qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V2 2/3] Cocoa: avoid displaying window when comm


From: Alexandre Raymond
Subject: Re: [Qemu-devel] [PATCH V2 2/3] Cocoa: avoid displaying window when command-line contains '-h' or '-help'
Date: Sun, 29 May 2011 18:40:53 -0400

I agree that this is not the best way to handle all cases not requiring a GUI.

However, due to the current structure of the code, it was a simple way
to cover a very common case without having to refactor the whole cocoa
code.

Alexandre

On Sun, May 29, 2011 at 6:32 PM, Peter Maydell <address@hidden> wrote:
> On 29 May 2011 23:22, Alexandre Raymond <address@hidden> 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" ?
> (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 ?".)
>
> -- PMM
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]