From 4f34c95ba5fb8bffd8c4bd183506972a7cbf2828 Mon Sep 17 00:00:00 2001 From: yanjianqing Date: Tue, 20 Aug 2024 18:50:55 +0800 Subject: [PATCH] virt-manager upgrade to version 4.1.0-8 - diskbackend: Drop support for sheepdog - cli: support --boot loader.stateless= - virt-install: Reuse cli.fail_conflicting - virt-install: --unattended and --cloud-init conflict - cloner: Sync and system uuid - virt-install: --help required options are wrong - cli: --cpu: Add maxphysaddr.{mode,bits} options - tests: Add a compat check for linux2020 in amd-sev test case - virtinstall: fix regression with --boot and no install method - virtinstall: split no_install conditional apart to track code coverage --- ...u-Add-maxphysaddr.-mode-bits-options.patch | 127 +++++++++++++ ...rt-cli-support-boot-loader.stateless.patch | 83 +++++++++ ...er-Sync-uuid-and-sysinfo-system-uuid.patch | 94 ++++++++++ ...iskbackend-Drop-support-for-sheepdog.patch | 171 ++++++++++++++++++ ...at-check-for-linux2020-in-amd-sev-te.patch | 28 +++ ...t-install-Reuse-cli.fail_conflicting.patch | 42 +++++ ...tall-help-required-options-are-wrong.patch | 32 ++++ ...l-unattended-and-cloud-init-conflict.patch | 45 +++++ ...regression-with-boot-and-no-install-.patch | 53 ++++++ ...t-no_install-conditional-apart-to-tr.patch | 57 ++++++ virt-manager.spec | 24 ++- 11 files changed, 755 insertions(+), 1 deletion(-) create mode 100644 backport-cli-cpu-Add-maxphysaddr.-mode-bits-options.patch create mode 100644 backport-cli-support-boot-loader.stateless.patch create mode 100644 backport-cloner-Sync-uuid-and-sysinfo-system-uuid.patch create mode 100644 backport-diskbackend-Drop-support-for-sheepdog.patch create mode 100644 backport-tests-Add-a-compat-check-for-linux2020-in-amd-sev-te.patch create mode 100644 backport-virt-install-Reuse-cli.fail_conflicting.patch create mode 100644 backport-virt-install-help-required-options-are-wrong.patch create mode 100644 backport-virt-install-unattended-and-cloud-init-conflict.patch create mode 100644 backport-virtinstall-fix-regression-with-boot-and-no-install-.patch create mode 100644 backport-virtinstall-split-no_install-conditional-apart-to-tr.patch diff --git a/backport-cli-cpu-Add-maxphysaddr.-mode-bits-options.patch b/backport-cli-cpu-Add-maxphysaddr.-mode-bits-options.patch new file mode 100644 index 0000000..00a1a15 --- /dev/null +++ b/backport-cli-cpu-Add-maxphysaddr.-mode-bits-options.patch @@ -0,0 +1,127 @@ +From fbdf05162606e4d70506b65d0dd647a59f229253 Mon Sep 17 00:00:00 2001 +From: Lin Ma +Date: Fri, 19 Aug 2022 18:18:50 +0800 +Subject: [PATCH] cli: --cpu: Add maxphysaddr.{mode,bits} options + +This commit added support for cpu physical address bits control, It's +useful for VMs with huge amount of ram. + +E.g. +--cpu Cascadelake-Server,maxphysaddr.mode=emulate,maxphysaddr.bits=46 + +Signed-off-by: Lin Ma +--- + .../cli/compare/virt-install-many-devices.xml | 1 + + .../compare/virt-install-testdriver-edgecases.xml | 4 +++- + tests/test_cli.py | 5 +++-- + virtinst/cli.py | 3 +++ + virtinst/domain/cpu.py | 15 ++++++++++++++- + 5 files changed, 24 insertions(+), 4 deletions(-) + +diff --git a/tests/data/cli/compare/virt-install-many-devices.xml b/tests/data/cli/compare/virt-install-many-devices.xml +index c27512d1..e4a7da8f 100644 +--- a/tests/data/cli/compare/virt-install-many-devices.xml ++++ b/tests/data/cli/compare/virt-install-many-devices.xml +@@ -194,6 +194,7 @@ + + + ++ + + + +diff --git a/tests/data/cli/compare/virt-install-testdriver-edgecases.xml b/tests/data/cli/compare/virt-install-testdriver-edgecases.xml +index f129d089..3cc385c0 100644 +--- a/tests/data/cli/compare/virt-install-testdriver-edgecases.xml ++++ b/tests/data/cli/compare/virt-install-testdriver-edgecases.xml +@@ -17,7 +17,9 @@ + + + +- ++ ++ ++ + + + +diff --git a/tests/test_cli.py b/tests/test_cli.py +index 9f6c3bc0..ef27276a 100644 +--- a/tests/test_cli.py ++++ b/tests/test_cli.py +@@ -511,7 +511,8 @@ numa.interconnects.latency0.initiator=0,numa.interconnects.latency0.target=0,num + numa.interconnects.latency1.initiator=0,numa.interconnects.latency1.target=2,numa.interconnects.latency1.cache=1,numa.interconnects.latency1.type=access,numa.interconnects.latency1.value=10,numa.interconnects.latency1.unit=ns,\ + numa.interconnects.bandwidth0.initiator=0,numa.interconnects.bandwidth0.target=0,numa.interconnects.bandwidth0.type=access,numa.interconnects.bandwidth0.value=204800,\ + numa.interconnects.bandwidth1.initiator=0,numa.interconnects.bandwidth1.target=2,numa.interconnects.bandwidth1.cache=1,numa.interconnects.bandwidth1.type=access,numa.interconnects.bandwidth1.value=409600,numa.interconnects.bandwidth1.unit=KiB,\ +-cache.mode=emulate,cache.level=3 ++cache.mode=emulate,cache.level=3,\ ++maxphysaddr.mode=emulate,maxphysaddr.bits=46 + + + --numatune 1,2,3,5-7,^6,mode=strict,\ +@@ -880,7 +881,7 @@ c.add_compare("--pxe " + + # Hitting test driver specific output + c.add_compare("--connect " + utils.URIs.test_suite + " " +-"--cpu host-passthrough,migratable=on " # migratable=on is only accepted with host-passthrough ++"--cpu host-passthrough,migratable=on,maxphysaddr.mode=passthrough " # migratable=on is only accepted with host-passthrough + "--seclabel label=foobar.label,a1,z2,b3,relabel=yes,type=dynamic " # fills in default model=testModel + "--tpm default " # --tpm default when domcaps missing + "", +diff --git a/virtinst/cli.py b/virtinst/cli.py +index 388c5263..5ac8266b 100644 +--- a/virtinst/cli.py ++++ b/virtinst/cli.py +@@ -2386,6 +2386,9 @@ class ParserCPU(VirtCLIParser): + cls.add_arg("cache.level", "cache.level") + cls.add_arg("cache.mode", "cache.mode") + ++ cls.add_arg("maxphysaddr.mode", "maxphysaddr.mode") ++ cls.add_arg("maxphysaddr.bits", "maxphysaddr.bits") ++ + # CPU features + # These are handled specially in _parse + cls.add_arg("force", None, lookup_cb=None, cb=cls.set_feature_cb) +diff --git a/virtinst/domain/cpu.py b/virtinst/domain/cpu.py +index 5de42b4e..c635932e 100644 +--- a/virtinst/domain/cpu.py ++++ b/virtinst/domain/cpu.py +@@ -102,6 +102,17 @@ class _CPUFeature(XMLBuilder): + policy = XMLProperty("./@policy") + + ++class _CPUMaxphysaddr(XMLBuilder): ++ """ ++ Class for generating XML for child node . ++ """ ++ XML_NAME = "maxphysaddr" ++ _XML_PROP_ORDER = ["mode", "bits"] ++ ++ mode = XMLProperty("./@mode") ++ bits = XMLProperty("./@bits", is_int=True) ++ ++ + ############## + # NUMA cells # + ############## +@@ -211,7 +222,7 @@ class DomainCpu(XMLBuilder): + _XML_PROP_ORDER = ["mode", "match", "check", "migratable", + "model", "model_fallback", "model_vendor_id", "vendor", + "topology", "cache", "features", +- "cells", "latencies", "bandwidths"] ++ "cells", "latencies", "bandwidths", "maxphysaddr"] + + + ################## +@@ -242,6 +253,8 @@ class DomainCpu(XMLBuilder): + latencies = XMLChildProperty(_NUMALatency, relative_xpath="./numa/interconnects") + bandwidths = XMLChildProperty(_NUMABandwidth, relative_xpath="./numa/interconnects") + ++ maxphysaddr = XMLChildProperty(_CPUMaxphysaddr, is_single=True) ++ + + ############################# + # Special CPU mode handling # +-- +2.37.2.windows.2 + diff --git a/backport-cli-support-boot-loader.stateless.patch b/backport-cli-support-boot-loader.stateless.patch new file mode 100644 index 0000000..8d5bf7f --- /dev/null +++ b/backport-cli-support-boot-loader.stateless.patch @@ -0,0 +1,83 @@ +From 15ddeae6cb405bad10bc62164b14117646e9127e Mon Sep 17 00:00:00 2001 +From: Cole Robinson +Date: Mon, 17 Oct 2022 11:54:37 -0400 +Subject: [PATCH] cli: support --boot loader.stateless= + +Signed-off-by: Cole Robinson +--- + tests/data/cli/compare/virt-install-singleton-config-2.xml | 4 ++-- + tests/test_cli.py | 2 +- + virtinst/cli.py | 1 + + virtinst/domain/os.py | 2 ++ + 4 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/tests/data/cli/compare/virt-install-singleton-config-2.xml b/tests/data/cli/compare/virt-install-singleton-config-2.xml +index d567d188..27c69c11 100644 +--- a/tests/data/cli/compare/virt-install-singleton-config-2.xml ++++ b/tests/data/cli/compare/virt-install-singleton-config-2.xml +@@ -11,7 +11,7 @@ + 2 + + hvm +- /tmp/foo ++ /tmp/foo + + + +@@ -112,7 +112,7 @@ + 2 + + hvm +- /tmp/foo ++ /tmp/foo + + + +diff --git a/tests/test_cli.py b/tests/test_cli.py +index 9d4e5ae3..3d299c12 100644 +--- a/tests/test_cli.py ++++ b/tests/test_cli.py +@@ -832,7 +832,7 @@ c.add_compare("--pxe " + "--cpuset 1,3-5 " # setting compat --cpuset when --vcpus is not present + # --boot loader settings here, or they will conflict with firmware=efi + # in other test cases +-"--boot loader_ro=yes,loader.type=rom,loader=/tmp/foo,loader_secure=no " ++"--boot loader_ro=yes,loader.type=rom,loader=/tmp/foo,loader_secure=no,loader.stateless=yes" + + # 'default' handling for solo devices + """ +diff --git a/virtinst/cli.py b/virtinst/cli.py +index 5ac8266b..8dbffeb6 100644 +--- a/virtinst/cli.py ++++ b/virtinst/cli.py +@@ -2861,6 +2861,7 @@ class ParserBoot(VirtCLIParser): + cls.add_arg("loader.readonly", "loader_ro", is_onoff=True) + cls.add_arg("loader.type", "loader_type") + cls.add_arg("loader.secure", "loader_secure", is_onoff=True) ++ cls.add_arg("loader.stateless", "loader_stateless", is_onoff=True) + + # Guest-Based bootloader options + cls.add_arg("firmware", "firmware") +diff --git a/virtinst/domain/os.py b/virtinst/domain/os.py +index e2cea755..4310e623 100644 +--- a/virtinst/domain/os.py ++++ b/virtinst/domain/os.py +@@ -86,6 +86,7 @@ class DomainOs(XMLBuilder): + _XML_PROP_ORDER = [ + "firmware", "os_type", "arch", "machine", "firmware_features", + "loader", "loader_ro", "loader_secure", "loader_type", ++ "loader_stateless", + "nvram", "nvram_template", + "init", "initargs", "initenvs", "initdir", "inituser", "initgroup", + "kernel", "initrd", "kernel_args", "dtb", "acpi_tb", "acpi_tb_type", +@@ -100,6 +101,7 @@ class DomainOs(XMLBuilder): + loader_ro = XMLProperty("./loader/@readonly", is_yesno=True) + loader_type = XMLProperty("./loader/@type") + loader_secure = XMLProperty("./loader/@secure", is_yesno=True) ++ loader_stateless = XMLProperty("./loader/@stateless", is_yesno=True) + + # BIOS bootloader options + def _get_bootorder(self): +-- +2.37.2.windows.2 + diff --git a/backport-cloner-Sync-uuid-and-sysinfo-system-uuid.patch b/backport-cloner-Sync-uuid-and-sysinfo-system-uuid.patch new file mode 100644 index 0000000..861db0d --- /dev/null +++ b/backport-cloner-Sync-uuid-and-sysinfo-system-uuid.patch @@ -0,0 +1,94 @@ +From b0d0516736320315a70f74aff3759fb35dd35d9d Mon Sep 17 00:00:00 2001 +From: Cole Robinson +Date: Sun, 21 Aug 2022 16:21:10 -0400 +Subject: [PATCH] cloner: Sync and system uuid + +Otherwise libvirt errors like: + +ERROR UUID mismatch between and + +https://bugzilla.redhat.com/show_bug.cgi?id=2038040 + +Signed-off-by: Cole Robinson +--- + tests/data/cli/compare/virt-clone-auto-unmanaged.xml | 5 +++++ + tests/data/cli/compare/virt-clone-unmanaged-preserve.xml | 5 +++++ + tests/data/cli/virtclone/clone-disk.xml | 5 +++++ + virtinst/cloner.py | 6 ++++-- + 4 files changed, 19 insertions(+), 2 deletions(-) + +diff --git a/tests/data/cli/compare/virt-clone-auto-unmanaged.xml b/tests/data/cli/compare/virt-clone-auto-unmanaged.xml +index 21a9a639..f2043be2 100644 +--- a/tests/data/cli/compare/virt-clone-auto-unmanaged.xml ++++ b/tests/data/cli/compare/virt-clone-auto-unmanaged.xml +@@ -1,6 +1,11 @@ + + origtest-clone + 00000000-1111-2222-3333-444444444444 ++ ++ ++ 00000000-1111-2222-3333-444444444444 ++ ++ + 8388608 + 2097152 + 2 +diff --git a/tests/data/cli/compare/virt-clone-unmanaged-preserve.xml b/tests/data/cli/compare/virt-clone-unmanaged-preserve.xml +index 3bdbbbe3..c003ed3e 100644 +--- a/tests/data/cli/compare/virt-clone-unmanaged-preserve.xml ++++ b/tests/data/cli/compare/virt-clone-unmanaged-preserve.xml +@@ -1,6 +1,11 @@ + + clonetest + 00000000-1111-2222-3333-444444444444 ++ ++ ++ 00000000-1111-2222-3333-444444444444 ++ ++ + 8388608 + 2097152 + 2 +diff --git a/tests/data/cli/virtclone/clone-disk.xml b/tests/data/cli/virtclone/clone-disk.xml +index da1eb0a6..2f6e916d 100644 +--- a/tests/data/cli/virtclone/clone-disk.xml ++++ b/tests/data/cli/virtclone/clone-disk.xml +@@ -1,6 +1,11 @@ + + origtest + db69fa1f-eef0-e567-3c20-3ef16f10376b ++ ++ ++ db69fa1f-eef0-e567-3c20-3ef16f10376b ++ ++ + 8388608 + 2097152 + 2 +diff --git a/virtinst/cloner.py b/virtinst/cloner.py +index 34a702f9..9334513c 100644 +--- a/virtinst/cloner.py ++++ b/virtinst/cloner.py +@@ -352,8 +352,7 @@ class Cloner(object): + """ + self._new_guest.id = None + self._new_guest.title = None +- self._new_guest.uuid = None +- self._new_guest.uuid = Guest.generate_uuid(self.conn) ++ self.set_clone_uuid(Guest.generate_uuid(self.conn)) + + for dev in self._new_guest.devices.graphics: + if dev.port and dev.port != -1: +@@ -408,6 +407,9 @@ class Cloner(object): + Override the new VMs generated UUId + """ + self._new_guest.uuid = uuid ++ for sysinfo in self._new_guest.sysinfo: ++ if sysinfo.system_uuid: ++ sysinfo.system_uuid = uuid + + def set_replace(self, val): + """ +-- +2.37.2.windows.2 + diff --git a/backport-diskbackend-Drop-support-for-sheepdog.patch b/backport-diskbackend-Drop-support-for-sheepdog.patch new file mode 100644 index 0000000..6c47790 --- /dev/null +++ b/backport-diskbackend-Drop-support-for-sheepdog.patch @@ -0,0 +1,171 @@ +From 4a2df064839f71ed94320771507b1271d041e397 Mon Sep 17 00:00:00 2001 +From: Lin Ma +Date: Wed, 2 Nov 2022 20:45:43 +0800 +Subject: [PATCH] diskbackend: Drop support for sheepdog + +The sheepdog project is no longer actively developed, Libvirt removed +the support for sheepdog storage backend since v8.8.0, Let's drop it. + +Signed-off-by: Lin Ma +--- + .../compare/virt-xml-build-disk-domain.xml | 2 +- + .../virt-xml-build-pool-logical-disk.xml | 2 +- + tests/data/testdriver/testdriver.xml | 40 +------------------ + virtManager/object/storagepool.py | 2 - + virtinst/storage.py | 8 ++-- + 5 files changed, 7 insertions(+), 47 deletions(-) + +diff --git a/tests/data/cli/compare/virt-xml-build-disk-domain.xml b/tests/data/cli/compare/virt-xml-build-disk-domain.xml +index 1a08b20e..6d9f7160 100644 +--- a/tests/data/cli/compare/virt-xml-build-disk-domain.xml ++++ b/tests/data/cli/compare/virt-xml-build-disk-domain.xml +@@ -1,5 +1,5 @@ + + + +- ++ + +diff --git a/tests/data/cli/compare/virt-xml-build-pool-logical-disk.xml b/tests/data/cli/compare/virt-xml-build-pool-logical-disk.xml +index 055a8f04..49c9bd4a 100644 +--- a/tests/data/cli/compare/virt-xml-build-pool-logical-disk.xml ++++ b/tests/data/cli/compare/virt-xml-build-pool-logical-disk.xml +@@ -1,5 +1,5 @@ + + + +- ++ + +diff --git a/tests/data/testdriver/testdriver.xml b/tests/data/testdriver/testdriver.xml +index 7c94e698..04476b22 100644 +--- a/tests/data/testdriver/testdriver.xml ++++ b/tests/data/testdriver/testdriver.xml +@@ -294,26 +294,19 @@ Foo bar baz & yeah boii < > yeahfoo + + + +- +- +- +- +- +- +- + + + + + +- ++ + + + + + + +- ++ + + + +@@ -2171,35 +2164,6 @@ ba + + + +- +- pool-sheepdog +- 581381f8-a13f-4f7c-89b5-9c9b71c64834 +- 107374182400 +- 53687091200 +- 53687091200 +- +- +- mysheeppool +- +- +- +- vol_sheepdog +- sheep/vol_sheepdog +- 1024 +- 0 +- +- sheepdog:vol_sheepdog +- +- +- 0600 +- -1 +- -1 +- +- +- +- +- +- + + pool-gluster + 7b83ef6d-28da-44f1-841f-2011320f13b0 +diff --git a/virtManager/object/storagepool.py b/virtManager/object/storagepool.py +index 563526bb..1b4da515 100644 +--- a/virtManager/object/storagepool.py ++++ b/virtManager/object/storagepool.py +@@ -32,7 +32,6 @@ POOL_TYPE_DESCS = { + StoragePool.TYPE_MPATH: _("Multipath Device Enumerator"), + StoragePool.TYPE_GLUSTER: _("Gluster Filesystem"), + StoragePool.TYPE_RBD: _("RADOS Block Device/Ceph"), +- StoragePool.TYPE_SHEEPDOG: _("Sheepdog Filesystem"), + StoragePool.TYPE_ZFS: _("ZFS Pool"), + } + +@@ -128,7 +127,6 @@ class vmmStoragePool(vmmLibvirtObject): + ] + if not clone: + supported.extend([ +- StoragePool.TYPE_SHEEPDOG, + StoragePool.TYPE_ZFS, + ]) + return pool_type in supported +diff --git a/virtinst/storage.py b/virtinst/storage.py +index 509f5cb0..3c5d39bb 100644 +--- a/virtinst/storage.py ++++ b/virtinst/storage.py +@@ -82,7 +82,6 @@ class StoragePool(_StorageObject): + TYPE_MPATH = "mpath" + TYPE_GLUSTER = "gluster" + TYPE_RBD = "rbd" +- TYPE_SHEEPDOG = "sheepdog" + TYPE_ZFS = "zfs" + + @staticmethod +@@ -311,7 +310,7 @@ class StoragePool(_StorageObject): + + def supports_source_name(self): + return self.type in [self.TYPE_LOGICAL, self.TYPE_GLUSTER, +- self.TYPE_RBD, self.TYPE_SHEEPDOG, self.TYPE_ZFS] ++ self.TYPE_RBD, self.TYPE_ZFS] + + + def supports_source_path(self): +@@ -323,7 +322,7 @@ class StoragePool(_StorageObject): + def supports_hosts(self): + return self.type in [ + self.TYPE_NETFS, self.TYPE_ISCSI, self.TYPE_GLUSTER, +- self.TYPE_RBD, self.TYPE_SHEEPDOG] ++ self.TYPE_RBD] + + def supports_format(self): + return self.type in [self.TYPE_FS, self.TYPE_NETFS, self.TYPE_DISK] +@@ -340,8 +339,7 @@ class StoragePool(_StorageObject): + return StorageVolume.TYPE_BLOCK + if (self.type == StoragePool.TYPE_GLUSTER or + self.type == StoragePool.TYPE_RBD or +- self.type == StoragePool.TYPE_ISCSI or +- self.type == StoragePool.TYPE_SHEEPDOG): ++ self.type == StoragePool.TYPE_ISCSI): + return StorageVolume.TYPE_NETWORK + return StorageVolume.TYPE_FILE + +-- +2.37.2.windows.2 + diff --git a/backport-tests-Add-a-compat-check-for-linux2020-in-amd-sev-te.patch b/backport-tests-Add-a-compat-check-for-linux2020-in-amd-sev-te.patch new file mode 100644 index 0000000..a0f4905 --- /dev/null +++ b/backport-tests-Add-a-compat-check-for-linux2020-in-amd-sev-te.patch @@ -0,0 +1,28 @@ +From c22a876e9a63cb7114e2b008f2e24682c8bbef3e Mon Sep 17 00:00:00 2001 +From: Lin Ma +Date: Fri, 19 Aug 2022 18:18:09 +0800 +Subject: [PATCH] tests: Add a compat check for linux2020 in amd-sev test case + +It avoids amd-sev test failure if using older osinfo-db. + +Signed-off-by: Lin Ma +--- + tests/test_cli.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test_cli.py b/tests/test_cli.py +index cc1d3da2..9f6c3bc0 100644 +--- a/tests/test_cli.py ++++ b/tests/test_cli.py +@@ -1108,7 +1108,7 @@ c.add_compare("--connect " + utils.URIs.kvm_x86_remote + " --import --disk %(EXI + c.add_compare("--connect %(URI-KVM-X86)s --os-variant fedora26 --graphics spice --controller usb,model=none", "graphics-usb-disable") + c.add_compare("--osinfo generic --boot uefi --disk size=1", "boot-uefi") + c.add_compare("--osinfo generic --boot uefi --disk size=1 --tpm none --connect " + utils.URIs.kvm_x86_oldfirmware, "boot-uefi-oldcaps") +-c.add_compare("--osinfo linux2020 --boot uefi --launchSecurity sev --connect " + utils.URIs.kvm_amd_sev, "amd-sev") ++c.add_compare("--osinfo linux2020 --boot uefi --launchSecurity sev --connect " + utils.URIs.kvm_amd_sev, "amd-sev", prerun_check=no_osinfo_linux2020_virtio) + + c.add_invalid("--disk none --location nfs:example.com/fake --nonetworks", grep="NFS URL installs are no longer supported") + c.add_invalid("--disk none --boot network --machine foobar", grep="domain type None with machine 'foobar'") +-- +2.37.2.windows.2 + diff --git a/backport-virt-install-Reuse-cli.fail_conflicting.patch b/backport-virt-install-Reuse-cli.fail_conflicting.patch new file mode 100644 index 0000000..28c2ce0 --- /dev/null +++ b/backport-virt-install-Reuse-cli.fail_conflicting.patch @@ -0,0 +1,42 @@ +From 1d64a678d31829051444e1bf29d86f800e13de39 Mon Sep 17 00:00:00 2001 +From: Cole Robinson +Date: Mon, 22 Aug 2022 10:15:46 -0400 +Subject: [PATCH] virt-install: Reuse cli.fail_conflicting + +For the --unattended + --cloud-init conflict + +Signed-off-by: Cole Robinson +--- + tests/test_cli.py | 2 +- + virtinst/virtinstall.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/test_cli.py b/tests/test_cli.py +index cbeebd46..9d4e5ae3 100644 +--- a/tests/test_cli.py ++++ b/tests/test_cli.py +@@ -1116,7 +1116,7 @@ c.add_invalid("--disk none --boot network --machine foobar", grep="domain type N + c.add_invalid("--nodisks --boot network --arch mips --virt-type kvm", grep="any virtualization options for architecture 'mips'") + c.add_invalid("--nodisks --boot network --paravirt --arch mips", grep=" 'xen' for architecture 'mips'") + c.add_invalid("--osinfo generic --launchSecurity sev --connect " + utils.URIs.kvm_amd_sev, grep="SEV launch security requires a Q35 UEFI machine") +-c.add_invalid("--disk none --cloud-init --unattended --install fedora30", grep="--unattended and --cloud-init can not") ++c.add_invalid("--disk none --cloud-init --unattended --install fedora30", grep="Cannot use --unattended and --cloud-init at the same time") + + + +diff --git a/virtinst/virtinstall.py b/virtinst/virtinstall.py +index 8260628d..8fcc8ce1 100644 +--- a/virtinst/virtinstall.py ++++ b/virtinst/virtinstall.py +@@ -412,7 +412,7 @@ def build_installer(options, guest, installdata): + extra_args = [installdata.kernel_args] + + if options.unattended and options.cloud_init: +- fail("--unattended and --cloud-init can not be specified together.") ++ cli.fail_conflicting("--unattended", "--cloud-init") + + if options.unattended: + unattended_data = cli.parse_unattended(options.unattended) +-- +2.37.2.windows.2 + diff --git a/backport-virt-install-help-required-options-are-wrong.patch b/backport-virt-install-help-required-options-are-wrong.patch new file mode 100644 index 0000000..947dfff --- /dev/null +++ b/backport-virt-install-help-required-options-are-wrong.patch @@ -0,0 +1,32 @@ +From a254ece0f0497d062a0e4c94dc45619649ea4922 Mon Sep 17 00:00:00 2001 +From: Cole Robinson +Date: Sun, 21 Aug 2022 16:08:37 -0400 +Subject: [PATCH] virt-install: --help required options are wrong + +Nowadays it could be as simple as `virt-install --install fedora36`. + +Trying to represent the interdepencies here is not worth it, but +let's keep a simple string around to avoid the default parser +usage string, which is huge + +Signed-off-by: Cole Robinson +--- + virtinst/virtinstall.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/virtinst/virtinstall.py b/virtinst/virtinstall.py +index baebe5b5..37eef1fc 100644 +--- a/virtinst/virtinstall.py ++++ b/virtinst/virtinstall.py +@@ -1019,7 +1019,7 @@ def xml_to_print(guest, installer, xmlonly, dry): + + def parse_args(): + parser = cli.setupParser( +- "%(prog)s --name NAME --memory MB STORAGE INSTALL [options]", ++ "%(prog)s OPTIONS", + _("Create a new virtual machine from specified install media."), + introspection_epilog=True) + cli.add_connect_option(parser) +-- +2.37.2.windows.2 + diff --git a/backport-virt-install-unattended-and-cloud-init-conflict.patch b/backport-virt-install-unattended-and-cloud-init-conflict.patch new file mode 100644 index 0000000..ce0521f --- /dev/null +++ b/backport-virt-install-unattended-and-cloud-init-conflict.patch @@ -0,0 +1,45 @@ +From 999ccb85e3e4189386786256cdf70cf5238cf785 Mon Sep 17 00:00:00 2001 +From: Cole Robinson +Date: Sun, 21 Aug 2022 16:47:26 -0400 +Subject: [PATCH] virt-install: --unattended and --cloud-init conflict + +Make it an explicit error, otherwise unattended is preferred and +cloud-init is ignored + +https://bugzilla.redhat.com/show_bug.cgi?id=2117157 + +Signed-off-by: Cole Robinson +--- + tests/test_cli.py | 1 + + virtinst/virtinstall.py | 3 +++ + 2 files changed, 4 insertions(+) + +diff --git a/tests/test_cli.py b/tests/test_cli.py +index ef27276a..cbeebd46 100644 +--- a/tests/test_cli.py ++++ b/tests/test_cli.py +@@ -1116,6 +1116,7 @@ c.add_invalid("--disk none --boot network --machine foobar", grep="domain type N + c.add_invalid("--nodisks --boot network --arch mips --virt-type kvm", grep="any virtualization options for architecture 'mips'") + c.add_invalid("--nodisks --boot network --paravirt --arch mips", grep=" 'xen' for architecture 'mips'") + c.add_invalid("--osinfo generic --launchSecurity sev --connect " + utils.URIs.kvm_amd_sev, grep="SEV launch security requires a Q35 UEFI machine") ++c.add_invalid("--disk none --cloud-init --unattended --install fedora30", grep="--unattended and --cloud-init can not") + + + +diff --git a/virtinst/virtinstall.py b/virtinst/virtinstall.py +index 37eef1fc..8260628d 100644 +--- a/virtinst/virtinstall.py ++++ b/virtinst/virtinstall.py +@@ -411,6 +411,9 @@ def build_installer(options, guest, installdata): + else: + extra_args = [installdata.kernel_args] + ++ if options.unattended and options.cloud_init: ++ fail("--unattended and --cloud-init can not be specified together.") ++ + if options.unattended: + unattended_data = cli.parse_unattended(options.unattended) + +-- +2.37.2.windows.2 + diff --git a/backport-virtinstall-fix-regression-with-boot-and-no-install-.patch b/backport-virtinstall-fix-regression-with-boot-and-no-install-.patch new file mode 100644 index 0000000..1843522 --- /dev/null +++ b/backport-virtinstall-fix-regression-with-boot-and-no-install-.patch @@ -0,0 +1,53 @@ +From e94786c066696781a821f5a4bcef3c377e4bc5e5 Mon Sep 17 00:00:00 2001 +From: Cole Robinson +Date: Sat, 20 Aug 2022 09:54:01 -0400 +Subject: [PATCH] virtinstall: fix regression with --boot and no install method + +Anything passed to --boot should imply --install no_install=yes +in the absence of other --install options. This is historically +what we've done but we regressed in 4.1.0 + +Resolves: https://github.com/virt-manager/virt-manager/issues/426 + +Signed-off-by: Cole Robinson +--- + tests/test_cli.py | 1 + + virtinst/virtinstall.py | 3 ++- + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/tests/test_cli.py b/tests/test_cli.py +index 72b78df3..cc1d3da2 100644 +--- a/tests/test_cli.py ++++ b/tests/test_cli.py +@@ -967,6 +967,7 @@ c.add_valid("--os-variant generic --pxe --ram 16", grep="Requested memory 16 MiB + c.add_valid("--os-variant winxp --ram 32 --cdrom %(EXISTIMG1)s", grep="32 MiB is less than the recommended 64 MiB") # Windows. Catch memory warning + c.add_valid("--osinfo generic --pxe --autostart") # --autostart flag + c.add_valid("--cdrom %(EXISTIMG2)s --os-variant win2k3 --print-step 2") # HVM windows install, print 3rd stage XML ++c.add_valid("--memory 512 --osinfo generic --boot cdrom") # --boot XXX should imply --install no_install + c.add_compare("--location location=%(TREEDIR)s --initrd-inject virt-install --extra-args ks=file:/virt-install", "initrd-inject") # initrd-inject + c.add_compare("--cdrom http://example.com/path/to/some.iso --os-variant detect=yes,require=no", "cdrom-url") + c.add_compare("--pxe --print-step all --os-variant none", "simple-pxe") # Diskless PXE install +diff --git a/virtinst/virtinstall.py b/virtinst/virtinstall.py +index 32434119..baebe5b5 100644 +--- a/virtinst/virtinstall.py ++++ b/virtinst/virtinstall.py +@@ -433,7 +433,7 @@ def build_installer(options, guest, installdata): + no_install = True + elif options.import_install: + no_install = True +- elif options.boot: ++ elif options.boot_was_set: + no_install = True + elif options.cloud_init: + no_install = True +@@ -645,6 +645,7 @@ def _build_options_guest(conn, options): + def build_guest_instance(conn, options): + installdata = cli.parse_install(options.install) + osdata = cli.parse_os_variant(options.os_variant or installdata.os) ++ options.boot_was_set = bool(options.boot) + + if options.reinstall: + dummy1, guest, dummy2 = cli.get_domain_and_guest(conn, options.reinstall) +-- +2.37.2.windows.2 + diff --git a/backport-virtinstall-split-no_install-conditional-apart-to-tr.patch b/backport-virtinstall-split-no_install-conditional-apart-to-tr.patch new file mode 100644 index 0000000..23575ca --- /dev/null +++ b/backport-virtinstall-split-no_install-conditional-apart-to-tr.patch @@ -0,0 +1,57 @@ +From 1cb0be4002445e5755ead2423b5a4e9e06f0a3cb Mon Sep 17 00:00:00 2001 +From: Cole Robinson +Date: Sat, 20 Aug 2022 09:42:47 -0400 +Subject: [PATCH] virtinstall: split no_install conditional apart to track code + coverage + +Each bit here is part of the CLI API, we need to be sure we are +covering each one. Extend the test suite to hit one case we are missing + +Signed-off-by: Cole Robinson +--- + tests/test_cli.py | 2 ++ + virtinst/virtinstall.py | 14 +++++++++----- + 2 files changed, 11 insertions(+), 5 deletions(-) + +diff --git a/tests/test_cli.py b/tests/test_cli.py +index 259ac78c..72b78df3 100644 +--- a/tests/test_cli.py ++++ b/tests/test_cli.py +@@ -1017,7 +1017,9 @@ c = vinst.add_category("misc-install", "--nographics --noautoconsole") + c.add_compare("--connect %s --os-variant generic" % (utils.URIs.test_suite), "noargs-fail", use_default_args=False) # No arguments + c.add_compare("--connect %s --os-variant fedora26" % (utils.URIs.test_suite), "osvariant-noargs-fail", use_default_args=False) # No arguments + c.add_compare("--connect %s --os-variant fedora26 --pxe --print-xml" % (utils.URIs.test_suite), "osvariant-defaults-pxe", use_default_args=False) # No arguments ++c.add_compare("--disk %(EXISTIMG1)s --os-variant fedora28 --cloud-init root-password-generate=yes,disable=no --sysinfo system.serial=foobar", "cloud-init-options1", env={"VIRTINST_TEST_SUITE_PRINT_CLOUDINIT": "1"}) # --cloud-init root-password-generate, with --sysinfo override + c.add_compare("--disk %(EXISTIMG1)s --os-variant fedora28 --cloud-init", "cloud-init-default", env={"VIRTINST_TEST_SUITE_CLOUDINIT": "1"}) # default --cloud-init behavior is root-password-generate=yes,disable=yes ++c.add_valid("--disk %(EXISTIMG1)s --os-variant fedora28 --cloud-init", env={"VIRTINST_TEST_SUITE_CLOUDINIT": "1"}) # default --cloud-init, but without implied --print-xml, to hit some specific code paths + c.add_compare("--disk %(EXISTIMG1)s --os-variant fedora28 --cloud-init root-password-generate=yes,disable=no --sysinfo system.serial=foobar", "cloud-init-options1", env={"VIRTINST_TEST_SUITE_PRINT_CLOUDINIT": "1"}) # --cloud-init root-password-generate, with --sysinfo override + c.add_compare("--disk %(EXISTIMG1)s --os-variant fedora28 --cloud-init root-password-file=%(ADMIN-PASSWORD-FILE)s,root-ssh-key=%(XMLDIR)s/cloudinit/ssh-key.txt,clouduser-ssh-key=%(XMLDIR)s/cloudinit/ssh-key2.txt --boot smbios.mode=none", "cloud-init-options2", env={"VIRTINST_TEST_SUITE_PRINT_CLOUDINIT": "1"}) # --cloud-init root-password-file with smbios.mode override + c.add_compare("--disk %(EXISTIMG1)s --os-variant fedora28 --cloud-init ssh-key=%(XMLDIR)s/cloudinit/ssh-key.txt", "cloud-init-options3", env={"VIRTINST_TEST_SUITE_PRINT_CLOUDINIT": "1"}) # --cloud-init ssh-key +diff --git a/virtinst/virtinstall.py b/virtinst/virtinstall.py +index 6d7f56b8..32434119 100644 +--- a/virtinst/virtinstall.py ++++ b/virtinst/virtinstall.py +@@ -429,11 +429,15 @@ def build_installer(options, guest, installdata): + install_bootdev = "network" + elif installdata.is_set: + pass +- elif (options.import_install or +- options.xmlonly or +- options.boot or +- options.cloud_init or +- options.unattended): ++ elif options.xmlonly: ++ no_install = True ++ elif options.import_install: ++ no_install = True ++ elif options.boot: ++ no_install = True ++ elif options.cloud_init: ++ no_install = True ++ elif options.unattended: + no_install = True + + installer = virtinst.Installer(guest.conn, +-- +2.37.2.windows.2 + diff --git a/virt-manager.spec b/virt-manager.spec index fd871b0..6a2167e 100644 --- a/virt-manager.spec +++ b/virt-manager.spec @@ -2,7 +2,7 @@ Name: virt-manager Version: 4.1.0 -Release: 7 +Release: 8 Summary: The manage virtual machines tool which via libvirt. License: GPLv2+ BuildArch: noarch @@ -19,6 +19,16 @@ Patch7: backport-tests-cli-Fix-test-output-after-previous-commit.pa Patch8: backport-fsdetails-Fix-an-error-with-source.socket-of-virtiof.patch Patch9: backport-cli-Drop-unnecessary-disk-prop-aliases.patch Patch10: backport-tests-testdriver-Add-filesystem-socket-example.patch +Patch11: backport-virtinstall-split-no_install-conditional-apart-to-tr.patch +Patch12: backport-virtinstall-fix-regression-with-boot-and-no-install-.patch +Patch13: backport-tests-Add-a-compat-check-for-linux2020-in-amd-sev-te.patch +Patch14: backport-cli-cpu-Add-maxphysaddr.-mode-bits-options.patch +Patch15: backport-virt-install-help-required-options-are-wrong.patch +Patch16: backport-cloner-Sync-uuid-and-sysinfo-system-uuid.patch +Patch17: backport-virt-install-unattended-and-cloud-init-conflict.patch +Patch18: backport-virt-install-Reuse-cli.fail_conflicting.patch +Patch19: backport-cli-support-boot-loader.stateless.patch +Patch20: backport-diskbackend-Drop-support-for-sheepdog.patch Requires: virt-manager-common = %{version}-%{release} python3-gobject gtk3 libvirt-glib >= 0.0.9 Requires: gtk-vnc2 dconf vte291 gtksourceview4 @@ -96,6 +106,18 @@ done %{_mandir}/man1/{virt-install.1*,virt-clone.1*,virt-xml.1*} %changelog +* Wed Aug 21 2024 yanjianqing - 4.1.0-8 +- diskbackend: Drop support for sheepdog +- cli: support --boot loader.stateless= +- virt-install: Reuse cli.fail_conflicting +- virt-install: --unattended and --cloud-init conflict +- cloner: Sync and system uuid +- virt-install: --help required options are wrong +- cli: --cpu: Add maxphysaddr.{mode,bits} options +- tests: Add a compat check for linux2020 in amd-sev test case +- virtinstall: fix regression with --boot and no install method +- virtinstall: split no_install conditional apart to track code coverage + * Fri Jul 26 2024 yanjianqing - 4.1.0-7 - tests: testdriver: Add filesystem socket example - cli: Drop unnecessary --disk prop aliases -- Gitee