diff options
author | Zuul <zuul@review.opendev.org> | 2020-09-02 16:02:34 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2020-09-02 16:02:34 +0000 |
commit | 611399744fc151d2145e003b81144e07cfb8f8be (patch) | |
tree | b147078b6716000f77fa1415f2849be092739845 /nova/virt/libvirt/driver.py | |
parent | 5a4395c2bcafa45357c8394460c366ac1a7df3d8 (diff) | |
parent | f0ec6378c42133f52178ae89fcde7084dc6b16eb (diff) | |
download | nova-611399744fc151d2145e003b81144e07cfb8f8be.tar.gz |
Merge "trivial: Use constants for libvirt version checks"
Diffstat (limited to 'nova/virt/libvirt/driver.py')
-rw-r--r-- | nova/virt/libvirt/driver.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 45eb46862c..b46f7d100e 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -244,6 +244,7 @@ QEMU_MAX_SERIAL_PORTS = 4 # Qemu supports 4 serial consoles, we remove 1 because of the PTY one defined ALLOWED_QEMU_SERIAL_PORTS = QEMU_MAX_SERIAL_PORTS - 1 +VGPU_RESOURCE_SEMAPHORE = 'vgpu_resources' LIBVIRT_PERF_EVENT_PREFIX = 'VIR_PERF_PARAM_' @@ -262,13 +263,6 @@ MIN_QEMU_NATIVE_TLS_VERSION = (2, 11, 0) # before the SIGKILL signal takes effect. MIN_LIBVIRT_BETTER_SIGKILL_HANDLING = (4, 7, 0) -VGPU_RESOURCE_SEMAPHORE = "vgpu_resources" - -# see https://libvirt.org/formatdomain.html#elementsVideo -MIN_LIBVIRT_VIDEO_MODEL_VERSIONS = { - fields.VideoModel.NONE: (4, 6, 0), -} - # Persistent Memory (PMEM/NVDIMM) Device Support MIN_LIBVIRT_PMEM_SUPPORT = (5, 0, 0) MIN_QEMU_PMEM_SUPPORT = (3, 1, 0) @@ -283,6 +277,13 @@ MIN_LIBVIRT_VIR_ERR_DEVICE_MISSING = (4, 1, 0) MIN_LIBVIRT_VTPM = (5, 6, 0) MIN_QEMU_VTPM = (2, 11, 0) +MIN_LIBVIRT_S390X_CPU_COMPARE = (5, 9, 0) + +# see https://libvirt.org/formatdomain.html#elementsVideo +MIN_LIBVIRT_VIDEO_MODEL_VERSIONS = { + fields.VideoModel.NONE: (4, 6, 0), +} + class LibvirtDriver(driver.ComputeDriver): def __init__(self, virtapi, read_only=False): @@ -8840,12 +8841,13 @@ class LibvirtDriver(driver.ComputeDriver): # s390x doesn't support cpu model in host info, so compare # cpu info will raise an error anyway, thus have to avoid check # see bug 1854126 for more info - min_libvirt_version = (5, 9, 0) - if (cpu.arch in (arch.S390X, arch.S390) and - not self._host.has_min_version(min_libvirt_version)): + if ( + cpu.arch in (arch.S390X, arch.S390) and + not self._host.has_min_version(MIN_LIBVIRT_S390X_CPU_COMPARE) + ): LOG.debug("on s390x platform, the min libvirt version " "support cpu model compare is %s", - min_libvirt_version) + MIN_LIBVIRT_S390X_CPU_COMPARE) return u = ("http://libvirt.org/html/libvirt-libvirt-host.html#" |