]> git.ipfire.org Git - thirdparty/qemu.git/commit
qemu-img: Check create_opts before image amendment
authorMax Reitz <mreitz@redhat.com>
Tue, 2 Dec 2014 17:32:47 +0000 (18:32 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 7 Jan 2015 21:08:35 +0000 (15:08 -0600)
commit07ede68671f8b14fd42b72a43bd95af7d45f3611
treee19cac265d08d5bc1a42c2c3d9992dc1bba2807b
parent2fbad1f9445534fe9f920950bed510714d58e8c8
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