qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 08/17] blockdev: Move parsing of 'if' option to


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH 08/17] blockdev: Move parsing of 'if' option to drive_init
Date: Fri, 20 Sep 2013 17:04:08 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

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 <address@hidden>

> >@@ -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



reply via email to

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