]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
qemu-img: don't shadow opts variable in img_dd()
authorStefan Hajnoczi <stefanha@redhat.com>
Mon, 19 Jun 2017 15:00:02 +0000 (16:00 +0100)
committerMax Reitz <mreitz@redhat.com>
Mon, 26 Jun 2017 12:54:46 +0000 (14:54 +0200)
It's confusing when two different variables have the same name in one
function.

Cc: Reda Sallahi <fullmanet@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20170619150002.3033-1-stefanha@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
qemu-img.c

index e70d5155e4c31e3a65417d288d865f01d3f6de0a..91ad6bebbf3686b5a9db97a98bc4fe189211f511 100644 (file)
@@ -4255,15 +4255,12 @@ static int img_dd(int argc, char **argv)
         case 'U':
             force_share = true;
             break;
-        case OPTION_OBJECT: {
-            QemuOpts *opts;
-            opts = qemu_opts_parse_noisily(&qemu_object_opts,
-                                           optarg, true);
-            if (!opts) {
+        case OPTION_OBJECT:
+            if (!qemu_opts_parse_noisily(&qemu_object_opts, optarg, true)) {
                 ret = -1;
                 goto out;
             }
-        }   break;
+            break;
         case OPTION_IMAGE_OPTS:
             image_opts = true;
             break;