]> git.proxmox.com Git - mirror_qemu.git/commit - block/mirror.c
mirror: Go through ready -> complete process for 0 len image
authorFam Zheng <famz@redhat.com>
Tue, 24 Jun 2014 12:26:36 +0000 (20:26 +0800)
committerKevin Wolf <kwolf@redhat.com>
Thu, 26 Jun 2014 11:50:57 +0000 (13:50 +0200)
commit9e48b025400b2d284e17860862b0a4aa02c6032d
tree8d605e28a49b66e19ec51875fec0577ef555c54f
parentdc71ce45ded4e872e25c2de32d5e7a71842b0985
mirror: Go through ready -> complete process for 0 len image

When mirroring or active committing a zero length image, BLOCK_JOB_READY
is not reported now, instead the job completes because we short circuit
the mirror job loop.

This is inconsistent with non-zero length images, and only confuses
management software.

Let's do the same thing when seeing a 0-length image: report ready
immediately; wait for block-job-cancel or block-job-complete; clear the
cancel flag as existing non-zero image synced case (cancelled after
ready); then jump to the exit.

Reported-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/mirror.c