libvirt: Remove blockjob.end == 0 workaround resolved in libvirt v2.3.0

As documented in the comments this workaround was in place to catch when
blockjobs had not started and reported an end cursor position of 0.

This was resovled in libvirt v2.3.0 and can now be removed as
MIN_LIBVIRT is well past this at 4.0.0.

Change-Id: Ic22a0c6cfa32d03b7e117cc8dbc54ceb3bfc9fe2
This commit is contained in:
Lee Yarwood 2020-05-20 14:19:30 +01:00
parent ccecb507ff
commit ebdb852a83
1 changed files with 1 additions and 9 deletions

View File

@ -878,17 +878,9 @@ class BlockDevice(object):
"final cursor: %(end)s",
{'job_type': job_type, 'cur': status.cur, 'end': status.end})
# NOTE(slaweq): because of bug in libvirt, which is described in
# http://www.redhat.com/archives/libvir-list/2016-September/msg00017.html
# if status.end == 0 job is not started yet so it is not finished
# NOTE(mdbooth): The fix was committed upstream here:
# http://libvirt.org/git/?p=libvirt.git;a=commit;h=988218c
# The earliest tag which contains this commit is v2.3.0-rc1, so we
# should be able to remove this workaround when MIN_LIBVIRT_VERSION
# reaches 2.3.0, or we move to handling job events instead.
# NOTE(lyarwood): Use the mirror element to determine if we can pivot
# to the new disk once blockjobinfo reports progress as complete.
if status.end != 0 and status.cur == status.end:
if status.cur == status.end:
disk = self._guest.get_disk(self._disk)
if disk and disk.mirror:
return disk.mirror.ready == 'yes'