]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Don't double-free disk->mirror if block commit initialization fails
authorPeter Krempa <pkrempa@redhat.com>
Thu, 24 Jan 2019 09:35:48 +0000 (10:35 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 29 Jan 2019 12:41:16 +0000 (13:41 +0100)
commitf04bdf5368e00bc4ff11f71a0455feda1166ea61
tree96ae5163eb4a14450d655f69ce1db4c325a0fe79
parent06fa3366c6c13ab10ccb748653173786f0c105a9
qemu: Don't double-free disk->mirror if block commit initialization fails

disk->mirror would not be cleared while the local pointer was freed in
qemuDomainBlockCommit if qemuDomainObjExitMonitor or qemuBlockJobDiskNew
would return a failure.

Since block job handling is executed in the separate handler which needs
a qemu job, we don't need to pre-set the mirror state prior to starting
the job. Similarly the block copy job does not do that.

Move the setting of the data after starting the job so that we avoid
this problem.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_driver.c