Re: [libvirt] [PATCH v2] qemu: Don't crash when parsing command line lacking -M

2017-10-11 Thread Andrea Bolognani
On Tue, 2017-10-10 at 14:15 -0400, John Ferlan wrote: > [...] > > while scanning > > > +} else if (STREQ(arg, "-M") || > > + STREQ(arg, "-machine")) { > > +// This option has already been processed before entering this > > +// loop, so we

Re: [libvirt] [PATCH v2] qemu: Don't crash when parsing command line lacking -M

2017-10-10 Thread John Ferlan
[...] while scanning > +} else if (STREQ(arg, "-M") || > + STREQ(arg, "-machine")) { > +// This option has already been processed before entering this > +// loop, so we just need to skip its argument and move along I saw // instead of /* ...

Re: [libvirt] [PATCH v2] qemu: Don't crash when parsing command line lacking -M

2017-10-10 Thread Daniel P. Berrange
On Tue, Oct 10, 2017 at 06:01:17PM +0200, Andrea Bolognani wrote: > Parse the -M (or -machine) command line option before starting > processing in earnest and have a fallback ready in case it's not > present, so that while parsing other options we can rely on > def->os.machine being initialized. >

[libvirt] [PATCH v2] qemu: Don't crash when parsing command line lacking -M

2017-10-10 Thread Andrea Bolognani
Parse the -M (or -machine) command line option before starting processing in earnest and have a fallback ready in case it's not present, so that while parsing other options we can rely on def->os.machine being initialized. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1379218