downgrade the version requirement of qemu from 4.2.0 to 4.1.0

This commit is contained in:
FFrog 2021-09-07 17:19:57 +08:00
parent 623306971e
commit c8b98121bf
2 changed files with 57 additions and 2 deletions

View File

@ -0,0 +1,50 @@
From f399e11607bbd74cc39760ead9c29122f22c2b6a Mon Sep 17 00:00:00 2001
From: FFrog <ljw1101.vip@gmail.com>
Date: Tue, 7 Sep 2021 15:44:00 +0800
Subject: [PATCH] downgrade the version of qemu from 4.2.0 to 4.1.0
---
nova/virt/libvirt/driver.py | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py
index 8ee8757..865ecb7 100644
--- a/nova/virt/libvirt/driver.py
+++ b/nova/virt/libvirt/driver.py
@@ -213,7 +213,7 @@ patch_tpool_proxy()
#
# DO NOT FORGET to update this document when touching any versions below!
MIN_LIBVIRT_VERSION = (6, 0, 0)
-MIN_QEMU_VERSION = (4, 2, 0)
+MIN_QEMU_VERSION = (4, 1, 0)
NEXT_MIN_LIBVIRT_VERSION = (7, 0, 0)
NEXT_MIN_QEMU_VERSION = (5, 2, 0)
@@ -2092,7 +2092,23 @@ class LibvirtDriver(driver.ComputeDriver):
guest.delete_configuration(support_uefi)
try:
- dev.copy(conf.to_xml(), reuse_ext=True)
+ # NOTE(lyarwood): Use virDomainBlockCopy from libvirt >= 6.0.0
+ # and QEMU >= 4.2.0 with -blockdev domains allowing QEMU to
+ # copy to remote disks.
+ if self._host.has_min_version(lv_ver=MIN_LIBVIRT_BLOCKDEV,
+ hv_ver=MIN_QEMU_BLOCKDEV):
+ dev.copy(conf.to_xml(), reuse_ext=True)
+ else:
+ # TODO(lyarwood): Remove the following use of
+ # virDomainBlockRebase once MIN_LIBVIRT_VERSION hits >=
+ # 6.0.0 and MIN_QEMU_VERSION hits >= 4.2.0.
+ # Start copy with VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT flag to
+ # allow writing to existing external volume file. Use
+ # VIR_DOMAIN_BLOCK_REBASE_COPY_DEV if it's a block device
+ # to make sure XML is generated correctly (bug 1691195)
+ copy_dev = conf.source_type == 'block'
+ dev.rebase(conf.source_path, copy=True, reuse_ext=True,
+ copy_dev=copy_dev)
while not dev.is_job_complete():
time.sleep(0.5)
--
2.27.0

View File

@ -17,13 +17,15 @@ Name: openstack-nova
# Liberty semver reset
# https://review.openstack.org/#/q/I6a35fa0dda798fad93b804d00a46af80f08d475c,n,z
Version: 23.0.1
Release: 3
Release: 4
Summary: OpenStack Compute (nova)
License: ASL 2.0
URL: http://openstack.org/projects/compute/
Source0: https://tarballs.openstack.org/nova/nova-%{upstream_version}.tar.gz
Patch0: 0001-downgrade-the-version-of-qemu-from-4.2.0-to-4.1.0.patch
Source1: nova-dist.conf
Source6: nova.logrotate
@ -395,7 +397,7 @@ This package contains documentation files for nova.
%endif
%prep
%autosetup -n nova-%{upstream_version}
%autosetup -n nova-%{upstream_version} -p1
find . \( -name .gitignore -o -name .placeholder \) -delete
@ -727,6 +729,9 @@ exit 0
%endif
%changelog
* Tue Sep 07 2021 ffrog <ljw1101.vip@gmail.com> - 23.0.1-4
- Downgrade the version requirement of qemu from 4.2.0 to 4.1.0
* Tue Aug 24 2021 huangtianhua <huangtianhua@huawei.com> - 23.0.1-3
- Fix requires errors