]> git.proxmox.com Git - mirror_qemu.git/blobdiff - qemu-img.c
qemu-img: Check create_opts before image amendment
[mirror_qemu.git] / qemu-img.c
index 8c4edf37a94a0bd132f9e7fe7c1e057a3cf05880..7876258fa92a254e9b64df239122e2df283b3707 100644 (file)
@@ -2986,6 +2986,13 @@ static int img_amend(int argc, char **argv)
         goto out;
     }
 
+    if (!bs->drv->create_opts) {
+        error_report("Format driver '%s' does not support any options to amend",
+                     fmt);
+        ret = -1;
+        goto out;
+    }
+
     create_opts = qemu_opts_append(create_opts, bs->drv->create_opts);
     opts = qemu_opts_create(create_opts, NULL, 0, &error_abort);
     if (options && qemu_opts_do_parse(opts, options, NULL)) {