From ebdb852a835cf14a2c91a91e815aae4a853f3702 Mon Sep 17 00:00:00 2001 From: Lee Yarwood Date: Wed, 20 May 2020 14:19:30 +0100 Subject: [PATCH] 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 --- nova/virt/libvirt/guest.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/nova/virt/libvirt/guest.py b/nova/virt/libvirt/guest.py index 943bd362913c..a939eb74afbc 100644 --- a/nova/virt/libvirt/guest.py +++ b/nova/virt/libvirt/guest.py @@ -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'