All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Färber" <andreas.faerber@web.de>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Alexandre Raymond <cerbere@gmail.com>,
	Alexander Graf <alex@csgraf.de>,
	Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH V2 2/3] Cocoa: avoid displaying window when command-line contains '-h' or '-help'
Date: Thu, 2 Jun 2011 01:05:39 +0200	[thread overview]
Message-ID: <375F5CD2-90DC-4E42-BB03-803AF1346AA6@web.de> (raw)
In-Reply-To: <BANLkTi=jFFTObX0RWO6irm4PMXAxBDCrgg@mail.gmail.com>

Am 30.05.2011 um 00:32 schrieb Peter Maydell:

> On 29 May 2011 23:22, Alexandre Raymond <cerbere@gmail.com> wrote:
>> diff --git a/ui/cocoa.m b/ui/cocoa.m
>> index 1ff1ac6..e1312d3 100644
>> --- a/ui/cocoa.m
>> +++ b/ui/cocoa.m
>> @@ -872,7 +872,8 @@ int main (int argc, const char * argv[]) {
>>             if (opt[1] == '-') {
>>                 opt++;
>>             }
>> -            if (!strcmp(opt, "-vnc") ||
>> +            if (!strcmp(opt, "-h") || !strcmp(opt, "-help") ||
>> +                !strcmp(opt, "-vnc") ||
>>                 !strcmp(opt, "-nographic") ||
>>                 !strcmp(opt, "-version") ||
>>                 !strcmp(opt, "-curses")) {
>
> (1) presumably this doesn't work if you disable the display
> with "-display none" ?

I don't see how that would not work. It's just not handled specially  
here, so it will likely display a window - the former behavior of all  
these switches.

> (2) it's pretty ugly and not very maintainable -- is there
> some restructuring possible to avoid having to hardcode
> information about qemu options into the ui code here?
>
> (It also doesn't catch other cases where qemu prints some
> information and exits immediately, like "-cpu ?".)

My saying! It's a general problem though: On my GNOME desktop I have  
some launchers for frequently used QEMU machines; it did occur that  
something changed in QEMU and nothing at all happened when double- 
clicking and I had to repeat the same in a terminal to find out why.  
Similar back when using a bundled Q.app on Mac OS X (i.e., a process  
that does not display a Terminal window).

What I have asked for in the past is an override mechanism for error  
messages, so that at runtime we can detect properly whether we're  
running in console or window mode and choose to display a MessageBox  
on Windows, a modal sheet on Mac OS X, a BAlert or whatever a frontend  
author sees fit. Sequential fprintf(stderr, ...) is not really helpful  
for that use case.

The added difficulty for Cocoa is that it needs to go through  
Objective-C (e.g., ui/cocoa.m).

Since that is a larger task and a long-time open issue, I see no  
reason not to accept this patch as an interim solution.

Andreas


P.S. I haven't found any VNC viewer component either, to resort to a  
specialized virt-manager-like graphical interface process with child  
QEMU processes. So going down the VNC route as once under discussion  
would mean forking and maintaining a VNC client for a particular less- 
common platform, which I am not comfortable with, given the occasional  
protocol extensions contributed to QEMU.

  parent reply	other threads:[~2011-06-01 23:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-29 22:22 [Qemu-devel] [PATCH V2 0/3] Fix compilation issues under darwin Alexandre Raymond
2011-05-29 22:22 ` [Qemu-devel] [PATCH V2 1/3] Darwin: Fix incorrect check for fdatasync() in configure Alexandre Raymond
2011-05-29 23:36   ` Andreas Färber
2011-05-30  0:09     ` Alexandre Raymond
2011-05-30  2:32       ` Alexandre Raymond
2011-06-01 22:26         ` Andreas Färber
2011-05-29 22:22 ` [Qemu-devel] [PATCH V2 2/3] Cocoa: avoid displaying window when command-line contains '-h' or '-help' Alexandre Raymond
2011-05-29 22:32   ` Peter Maydell
2011-05-29 22:40     ` Alexandre Raymond
2011-06-01 23:05     ` Andreas Färber [this message]
2011-06-02  6:10       ` Peter Maydell
2011-06-01 22:16   ` Andreas Färber
2011-05-29 22:22 ` [Qemu-devel] [PATCH V2 3/3] Remove warning in printf due to type mismatch Alexandre Raymond
2011-06-01 21:13   ` Andreas Färber
2011-06-02  7:18   ` Stefan Weil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=375F5CD2-90DC-4E42-BB03-803AF1346AA6@web.de \
    --to=andreas.faerber@web.de \
    --cc=alex@csgraf.de \
    --cc=aliguori@us.ibm.com \
    --cc=cerbere@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.