]> xenbits.xensource.com Git - libvirt.git/commit
qemu: blockjob: Refuse to register blockjob if disk already has one
authorPeter Krempa <pkrempa@redhat.com>
Sat, 14 Sep 2019 07:40:29 +0000 (09:40 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 16 Sep 2019 09:50:28 +0000 (11:50 +0200)
commit87c8e7dbf539ae170f1f425c955218339c5b72c3
tree2117e4db16767073f1bd4baf631da912b8af7f3c
parent8b2798e395c78747fcb50c44cb91a8e5df777e60
qemu: blockjob: Refuse to register blockjob if disk already has one

Most code paths prevent starting a blockjob if we already have one but
the job registering function does not do this check. While this isn't a
problem for regular cases we had a bad test case where we registered two
jobs for a single disk which leaked one of the jobs. Prevent this in the
registering function until we allow having multiple jobs per disk.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
ACKed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_blockjob.c