nova/nova/virt/libvirt
Lee Yarwood 76428c1a6a libvirt: Handle VIR_ERR_DEVICE_MISSING when detaching devices
Introduced in libvirt v4.1.0 [1] this error code replaces the previously
raised VIR_ERR_INVALID_ARG, VIR_ERR_OPERATION_FAILED and
VIR_ERR_INVALID_ARG codes [2][3].

VIR_ERR_OPERATION_FAILED was introduced and tested as an
active/live/hot unplug config device detach error code in
I131aaf28d2f5d5d964d4045e3d7d62207079cfb0.

VIR_ERR_INTERNAL_ERROR was introduced and tested as an
active/live/hot unplug config device detach error code in
I3055cd7641de92ab188de73733ca9288a9ca730a.

VIR_ERR_INVALID_ARG was introduced and tested as an
inactive/persistent/cold unplug config device detach error code in
I09230fc47b0950aa5a3db839a070613c9c817576.

This change introduces support for the new VIR_ERR_DEVICE_MISSING error
code while also retaining coverage for these codes until
MIN_LIBVIRT_VERSION is bumped past v4.1.0.

The majority of this change is test code motion with the existing tests
being modified to run against either the active or inactive versions of
the above  error codes for the time being.

test_detach_device_with_retry_operation_internal and
test_detach_device_with_retry_invalid_argument_no_live have been removed
as they duplicate the logic within the now refactored
_test_detach_device_with_retry_second_detach_failure.

[1] https://libvirt.org/git/?p=libvirt.git;a=commit;h=bb189c8e8c93f115c13fa3bfffdf64498f3f0ce1
[2] https://libvirt.org/git/?p=libvirt.git;a=commit;h=126db34a81bc9f9f9710408f88cceaa1e34bbbd7
[3] https://libvirt.org/git/?p=libvirt.git;a=commit;h=2f54eab7c7c618811de23c60a51e910274cf30de

Closes-Bug: #1887946
Change-Id: I7eb86edc130d186a66c04b229d46347ec5c0b625
(cherry picked from commit 902f09af25)
(cherry picked from commit 93058ae1b8)
(cherry picked from commit 863d6ef760)
2020-08-28 13:39:53 +02:00
..
storage Fix python3 compatibility of rbd get_fsid 2019-06-18 12:33:08 +01:00
volume Fixes multi-registry config in Quobyte driver 2019-05-24 16:03:52 +02:00
__init__.py Remove vi modelines 2014-02-03 14:19:44 +00:00
blockinfo.py libvirt: Use SATA bus for cdrom devices when using Q35 machine type 2019-06-13 15:56:58 +00:00
compat.py Remove translation of log messages 2017-06-13 11:20:28 +07:00
config.py Parse <emulator> elements from virConnectGetCapabilities() 2019-03-05 10:07:21 +00:00
designer.py add mtu to libvirt xml for ethernet and bridge types 2018-06-06 09:39:40 -04:00
driver.py Merge "Reserve DISK_GB resource for the image cache" into stable/stein 2020-07-08 15:30:30 +00:00
firewall.py Add missing ws seperator between words 2018-11-26 23:42:18 +00:00
guest.py libvirt: Handle VIR_ERR_DEVICE_MISSING when detaching devices 2020-08-28 13:39:53 +02:00
host.py libvirt: check job status for VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED event 2019-12-30 09:34:49 -05:00
imagebackend.py Make RBD imagebackend flatten method idempotent 2020-04-23 15:53:10 +00:00
imagecache.py Guard against missing image cache directory 2020-07-10 07:39:22 +00:00
instancejobtracker.py Remove translation of log messages 2017-06-13 11:20:28 +07:00
migration.py libvirt: check job status for VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED event 2019-12-30 09:34:49 -05:00
utils.py libvirt: Provide the backing file format when creating qcow2 disks 2020-03-02 14:53:26 +00:00
vif.py libvirt: Mark e1000e VIF as supported 2020-07-22 10:43:19 +00:00