[libvirt] [PATCH] qemu: fix block{commit,copy} abort handling

Jiri Denemark jdenemar at redhat.com
Thu Nov 27 12:48:08 UTC 2014


On Thu, Nov 27, 2014 at 13:29:42 +0100, Erik Skultety wrote:
> When a block{commit,copy} job was aborted on a domain, block job handler
> did not process it correctly, leaving a phantom job in the background.
> Any further calls to any blockjob causes "block <jobtype> still active"
> error. This patch fixes the blockjob handler so that it checks not only
> for VIR_DOMAIN_BLOCK_JOB_FAILED status, but VIR_DOMAIN_BLOCK_JOB_CANCELED
> status as well, followed by our existing cleanup routine.
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1135169
> ---
>  src/qemu/qemu_process.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index c3ee40b..7e53515 100644
> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c
> @@ -1108,7 +1108,8 @@ qemuProcessHandleBlockJob(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
>              if (status == VIR_DOMAIN_BLOCK_JOB_READY) {
>                  disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_READY;
>                  save = true;
> -            } else if (status == VIR_DOMAIN_BLOCK_JOB_FAILED) {
> +            } else if (status == VIR_DOMAIN_BLOCK_JOB_FAILED ||
> +                       status == VIR_DOMAIN_BLOCK_JOB_CANCELED) {
>                  virStorageSourceFree(disk->mirror);
>                  disk->mirror = NULL;
>                  disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_NONE;

ACK

Jirka




More information about the libvir-list mailing list