From d070713ab3d4dcf6c3676fff034df83e70402756 Mon Sep 17 00:00:00 2001 From: nappoo Date: Fri, 22 Apr 2022 15:46:08 +0800 Subject: [PATCH] Patch: Fixes-ignore-device-already-in-the-process-of-unplug-errors Signed-off-by: nappoo --- ...eady-in-the-process-of-unplug-errors.patch | 38 +++++++++++++++++++ openstack-nova.spec | 6 ++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 Fixes-ignore-device-already-in-the-process-of-unplug-errors.patch diff --git a/Fixes-ignore-device-already-in-the-process-of-unplug-errors.patch b/Fixes-ignore-device-already-in-the-process-of-unplug-errors.patch new file mode 100644 index 0000000..62531e6 --- /dev/null +++ b/Fixes-ignore-device-already-in-the-process-of-unplug-errors.patch @@ -0,0 +1,38 @@ +diff --git a/nova/virt/libvirt/guest.py b/nova/virt/libvirt/guest.py +index a7fbc50..3d74f6a 100644 +--- a/nova/virt/libvirt/guest.py ++++ b/nova/virt/libvirt/guest.py +@@ -410,7 +410,6 @@ + LOG.debug('Successfully detached device %s from guest. ' + 'Persistent? %s. Live? %s', + device, persistent, live) +- + except libvirt.libvirtError as ex: + with excutils.save_and_reraise_exception(reraise=False) as ctx: + errcode = ex.get_error_code() +@@ -429,6 +428,17 @@ + # detach fails because the device is not found + raise exception.DeviceNotFound( + device=alternative_device_name) ++ # NOTE(lyarwood): https://bugzilla.redhat.com/1878659 ++ # Ignore this known QEMU bug for the time being ++ # allowing our retry logic to fire again and hopefully ++ # see that the device has been removed asynchronously ++ # by QEMU in the meantime when the next call to detach ++ # raises VIR_ERR_DEVICE_MISSING. ++ if 'already in the process of unplug' in errmsg: ++ LOG.debug('Ignoring QEMU rejecting our request to ' ++ 'detach as it is caused by a previous ' ++ 'request still being in progress.') ++ return + # TODO(lyarwood): Remove libvirt.VIR_ERR_INVALID_ARG once + # MIN_LIBVIRT_VERSION is >= 4.1.0 + elif errcode == libvirt.VIR_ERR_INVALID_ARG: +@@ -438,6 +448,7 @@ + # detach fails because the device is not found + raise exception.DeviceNotFound( + device=alternative_device_name) ++ + # Re-raise the original exception if we're not raising + # DeviceNotFound instead. This will avoid logging of a + # "Original exception being dropped" traceback. diff --git a/openstack-nova.spec b/openstack-nova.spec index 9f34b51..e6a3560 100644 --- a/openstack-nova.spec +++ b/openstack-nova.spec @@ -15,7 +15,7 @@ Name: openstack-nova # Liberty semver reset # https://review.openstack.org/#/q/I6a35fa0dda798fad93b804d00a46af80f08d475c,n,z Version: 20.6.1 -Release: 5 +Release: 6 Summary: OpenStack Compute (nova) License: ASL 2.0 @@ -49,6 +49,7 @@ Source40: nova_migration-rootwrap.conf Source41: nova_migration-rootwrap_cold_migration Patch1: Fixes-aarch64-incorrect-cpu-model.patch +Patch2: Fixes-ignore-device-already-in-the-process-of-unplug-errors.patch BuildArch: noarch BuildRequires: openstack-macros @@ -731,6 +732,9 @@ exit 0 %endif %changelog +* Fri Apr 22 2022 yangjunjie - 23.0.1-6 +- Ignore device already in the process of unplug errors. + * Tue Jan 25 2022 wangxiyuan - 20.6.1-5 - Add osprofiler requires -- Gitee