diff --git a/qemu-img.c b/qemu-img.c index 8c4edf37a94a0bd132f9e7fe7c1e057a3cf05880..7876258fa92a254e9b64df239122e2df283b3707 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -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)) {