Received: from [140.186.70.92] (port=35603 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q0FEq-0007b8-B7 for qemu-devel@nongnu.org; Thu, 17 Mar 2011 11:35:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q0FEl-0008Gd-7s for qemu-devel@nongnu.org; Thu, 17 Mar 2011 11:35:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36384) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q0FEk-0008GM-Tt for qemu-devel@nongnu.org; Thu, 17 Mar 2011 11:35:43 -0400 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH +STABLE-0.14] exit if -drive specified is invalid instead of ignoring the "wrong" -drive References: <4D81BF12.4020500@msgid.tls.msk.ru> <4D821A7F.9000204@msgid.tls.msk.ru> Date: Thu, 17 Mar 2011 16:35:40 +0100 In-Reply-To: <4D821A7F.9000204@msgid.tls.msk.ru> (Michael Tokarev's message of "Thu, 17 Mar 2011 17:28:15 +0300") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev Cc: qemu-devel@nongnu.org Michael Tokarev writes: > 17.03.2011 16:51, Markus Armbruster wrote: >> Michael Tokarev 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.