qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH +STABLE-0.14] exit if -drive specified is invali


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH +STABLE-0.14] exit if -drive specified is invalid instead of ignoring the "wrong" -drive
Date: Thu, 17 Mar 2011 16:35:40 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Michael Tokarev <address@hidden> writes:

> 17.03.2011 16:51, Markus Armbruster wrote:
>> Michael Tokarev <address@hidden> writes:
>> 
>>> Trivial patch.  I've sent it yesterday but somehow it didn't
>>> reach the list.
>>>
>>> This fixes the problem when qemu continues even if -drive specification
>>> is somehow invalid, resulting in a mess.  Applicable for both current
>>> master and for stable-0.14 (and 0.13 and 0.12 as well).
>> 
>> Note patch doesn't apply to 0.12 and 0.13.
>
> Yes it doesn't, since to 0.14 the code changed.
> What I mean is that the same problem exist in
> earlier versions too.  I'll apply a change of
> this effect to 0.12.5 as used in Debian now,
> something like the one below.
>
> []
>> What about all the other unchecked drive_add() calls in main()?
>
> These are much less worrisome - they fail only of the
> internal definitions of options are incorrect, which
> should never happen.  For example:
>
>             case QEMU_OPTION_hdd:
>                 drive_add(IF_DEFAULT, popt->index - QEMU_OPTION_hda, optarg,
>                           HD_OPTS);
>
> There, optarg is just a filename, and HD_OPTS is
> defined like this:
>
> #define HD_OPTS "media=disk"
>
> So it should not fail when parsing options, only
> when trying to interpret and actually open the
> filename, which happens much later in the game.

Fair enough.



reply via email to

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