When mirroring an image of a size that is not a multiple of the
mirror job granularity, the last request would have the right nb_sectors
argument, but a qiov that is rounded up to the next multiple of the
granularity. Don't do this.
This fixes a segfault that is caused by raw-posix being confused by this
and allocating a buffer with request length, but operating on it with
qiov length.
[s/Driver/Drive/ in qemu-iotests 041 as suggested by Eric
--Stefan]
Reported-by: Eric Blake <email address hidden>
Signed-off-by: Kevin Wolf <email address hidden>
Tested-by: Eric Blake <email address hidden>
Reviewed-by: Eric Blake <email address hidden>
Signed-off-by: Stefan Hajnoczi <email address hidden>
(cherry picked from commit 5a0f6fd5c84573387056e0464a7fc0c6fb70b2dc)
Conflicts:
tests/qemu-iotests/041.out
*updated 041.out to reflect tests missing from 2.0
Signed-off-by: Michael Roth <email address hidden>
qemu-iotests: Test BLOCK_JOB_READY event for 0Kb image active commit
There should be a BLOCK_JOB_READY event with active commit, regardless
of image length. Let's test the 0 length image case, and make sure it
goes through the ready->complete process.
Signed-off-by: Fam Zheng <email address hidden>
Reviewed-by: Eric Blake <email address hidden>
Signed-off-by: Kevin Wolf <email address hidden>
(cherry picked from commit 8b9a30ca5bc10545637429486836f3c206c39fab)
Signed-off-by: Michael Roth <email address hidden>
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 <email address hidden>
Signed-off-by: Fam Zheng <email address hidden>
Reviewed-by: Eric Blake <email address hidden>
Signed-off-by: Kevin Wolf <email address hidden>
(cherry picked from commit 9e48b025400b2d284e17860862b0a4aa02c6032d)
*removed dependency on bcada37b
Signed-off-by: Michael Roth <email address hidden>