qemu-img: Check create_opts before image amendment
commitb15bfd0558934703cfa860117a38d7f0a71645ae
authorMax Reitz <mreitz@redhat.com>
Tue, 2 Dec 2014 17:32:47 +0000 (2 18:32 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Sun, 22 Feb 2015 18:03:58 +0000 (22 12:03 -0600)
tree95ce24570b190321021e71c3e4701bf5c1237e15
parent10be14ee7d1d82e439f0fab69e32c90427afa07c
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>
(cherry picked from commit b2439d26f078c826e5e06b34d978a6f6d5c7c56f)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qemu-img.c