From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN2Fe-0000DN-OC for qemu-devel@nongnu.org; Fri, 20 Sep 2013 11:04:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VN2FY-0006KU-1L for qemu-devel@nongnu.org; Fri, 20 Sep 2013 11:04:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7288) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN2FX-0006KM-QA for qemu-devel@nongnu.org; Fri, 20 Sep 2013 11:04:03 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8KF43Oa008814 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 20 Sep 2013 11:04:03 -0400 Date: Fri, 20 Sep 2013 17:04:08 +0200 From: Kevin Wolf Message-ID: <20130920150408.GJ2800@dhcp-200-207.str.redhat.com> References: <1379678070-14346-1-git-send-email-kwolf@redhat.com> <1379678070-14346-9-git-send-email-kwolf@redhat.com> <523C600A.5000805@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <523C600A.5000805@redhat.com> Subject: Re: [Qemu-devel] [PATCH 08/17] blockdev: Move parsing of 'if' option to drive_init List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: qemu-devel@nongnu.org, stefanha@redhat.com, armbru@redhat.com Am 20.09.2013 um 16:47 hat Max Reitz geschrieben: > On 2013-09-20 13:54, Kevin Wolf wrote: > >It's always IF_NONE for blockdev-add. > > > >Signed-off-by: Kevin Wolf > >@@ -839,8 +832,23 @@ DriveInfo *drive_init(QemuOpts *all_opts, BlockInterfaceType block_default_type) > > } > > } > >+ /* Controller type */ > >+ value = qemu_opt_get(legacy_opts, "if"); > >+ if (value) { > >+ for (type = 0; > >+ type < IF_COUNT && strcmp(value, if_name[type]); > >+ type++) { > >+ } > >+ if (type == IF_COUNT) { > >+ error_report("unsupported bus type '%s'", value); > >+ return NULL; > I'd suggest "goto fail;" instead. Yup, otherwise we leak legacy_opts. More instances of the same bug follow throughout the series, I'll fix them all. Thanks. Kevin