]> git.proxmox.com Git - mirror_qemu.git/commit - qemu-img.c
qemu-img: Check create_opts before image amendment
authorMax Reitz <mreitz@redhat.com>
Tue, 2 Dec 2014 17:32:47 +0000 (18:32 +0100)
committerKevin Wolf <kwolf@redhat.com>
Wed, 10 Dec 2014 09:31:20 +0000 (10:31 +0100)
commitb2439d26f078c826e5e06b34d978a6f6d5c7c56f
treeecec50e0e8f301ed865f9c1e40d8a9fd030f532a
parentf75613cf2488a37fb8019bc32a06ddbcd477d0ce
qemu-img: Check create_opts before image amendment

The image options which can be amended are described by the .create_opts
field for every driver. This field must therefore be non-NULL so that
anything can be amended in the first place. Check that this holds true
before going into qemu_opts_create() (because if .create_opts is NULL,
the create_opts pointer in img_amend() will be NULL after
qemu_opts_append()).

Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-img.c