Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
acf4b5af37
!53 [sync] PR-51: virt-manager upgrade to version 4.1.0-8
From: @openeuler-sync-bot 
Reviewed-by: @jxy_git 
Signed-off-by: @jxy_git
2024-08-21 02:57:09 +00:00
yanjianqing
bf3e5345e9 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

(cherry picked from commit 4f34c95ba5fb8bffd8c4bd183506972a7cbf2828)
2024-08-21 10:14:24 +08:00
openeuler-ci-bot
00e68fe71b
!49 [sync] PR-48: virt-manager upgrade to version 4.1.0-7
From: @openeuler-sync-bot 
Reviewed-by: @jxy_git 
Signed-off-by: @jxy_git
2024-07-30 01:59:55 +00:00
yanjianqing
87986d5cd4 virt-manager upgrade to version 4.1.0-7
- tests: testdriver: Add filesystem socket example
- cli: Drop unnecessary --disk prop aliases
- fsdetails: Fix an error with source.socket of virtiofs
- tests: cli: Fix test output after previous commit
- cli: --disk: Add driver.metadata_cache options

(cherry picked from commit 58bb2a7d27e0b9cfde41ae8a026ccaa361d1aaea)
2024-07-29 16:55:04 +08:00
openeuler-ci-bot
0efcec998d
!46 [sync] PR-45: Update chinese translation file
From: @openeuler-sync-bot 
Reviewed-by: @jxy_git 
Signed-off-by: @jxy_git
2024-07-17 08:00:30 +00:00
yanjianqing
453ece67a8 update chinese translation file
(cherry picked from commit 3d2d190aff0dfe561fb9ee6d10e98446aff83ab6)
2024-07-17 15:27:31 +08:00
openeuler-ci-bot
357a66f95c
!42 virt-manager-4.1.0已经支持图形化界面手动设置拓扑后取消保存报错,PR27需要回退
From: @yanjianqing_kylin 
Reviewed-by: @jxy_git 
Signed-off-by: @jxy_git
2024-02-29 08:13:51 +00:00
yanjianqing@kylinos.cn
ddf95fa994 virt-manager-4.1.0 already support feature dies 2024-02-29 15:50:57 +08:00
openeuler-ci-bot
160d127513
!40 update loongarch code
From: @lixianglai 
Reviewed-by: @jxy_git 
Signed-off-by: @jxy_git
2024-02-29 01:48:15 +00:00
Xianglai Li
489c14ad23 Update loongarch code
virt-manager updated to 4.1,
loongarch code changed, update loongarch code.

Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
2024-02-28 20:16:34 -05:00
22 changed files with 1711 additions and 213 deletions

View File

@ -0,0 +1,83 @@
From 2e466df762326045c7d40f179bff6e54d2e0d015 Mon Sep 17 00:00:00 2001
From: Xianglai Li <lixianglai@loongson.cn>
Date: Wed, 28 Feb 2024 02:07:26 -0500
Subject: [PATCH 2/4] Add loongarch support in guest class
Add adaptations for loongarch with the following features in guest class:
virtio Support
input deveice support
default graphic Support
usb redir support
Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
---
virtinst/guest.py | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/virtinst/guest.py b/virtinst/guest.py
index e663602..86f6e14 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -352,7 +352,8 @@ class Guest(XMLBuilder):
if (self.os.is_arm_machvirt() or
self.os.is_riscv_virt() or
self.os.is_s390x() or
- self.os.is_pseries()):
+ self.os.is_pseries() or
+ self.os.is_loongarch64()):
return True
if not os_support:
@@ -541,7 +542,7 @@ class Guest(XMLBuilder):
# and doesn't break QEMU internal snapshots
prefer_efi = self.osinfo.requires_firmware_efi(self.os.arch)
else:
- prefer_efi = self.os.is_arm_machvirt() or self.conn.is_bhyve()
+ prefer_efi = self.os.is_arm_machvirt() or self.conn.is_bhyve() or self.os.is_loongarch64()
log.debug("Prefer EFI => %s", prefer_efi)
return prefer_efi
@@ -902,7 +903,8 @@ class Guest(XMLBuilder):
usb_tablet = True
if (self.os.is_arm_machvirt() or
self.os.is_riscv_virt() or
- self.os.is_pseries()):
+ self.os.is_pseries() or
+ self.os.is_loongarch64()):
usb_tablet = True
usb_keyboard = True
@@ -984,7 +986,11 @@ class Guest(XMLBuilder):
# For pseries, we always assume OS supports usb3
if qemu_usb3:
usb3 = True
-
+ elif self.os.is_loongarch64():
+ # For machvirt, we always assume OS supports usb3
+ if (qemu_usb3 and
+ self.conn.support.conn_machvirt_pci_default()):
+ usb3 = True
if usb2:
for dev in DeviceController.get_usb2_controllers(self.conn):
@@ -1016,7 +1022,7 @@ class Guest(XMLBuilder):
if self.os.is_container() and not self.conn.is_vz():
return
if (not self.os.is_x86() and
- not self.os.is_pseries()):
+ not self.os.is_pseries() and not self.os.is_loongarch64()):
return
self.add_device(DeviceGraphics(self.conn))
@@ -1155,6 +1161,8 @@ class Guest(XMLBuilder):
self.add_device(dev)
def _add_spice_usbredir(self):
+ if (self.os.is_loongarch64()):
+ return
if self.skip_default_usbredir:
return
if self.devices.redirdev:
--
2.27.0

View File

@ -1,21 +1,19 @@
From 49874e7491b10b7cf47f842e2967dc843fb862a0 Mon Sep 17 00:00:00 2001
From: zhaotianrui <zhaotianrui@loongson.cn>
Date: Mon, 12 Dec 2022 16:51:20 +0800
Subject: [PATCH] Add loongarch support
From d10f3f9bc65b7832db98ef00973bf22f38dd86a6 Mon Sep 17 00:00:00 2001
From: Xianglai Li <lixianglai@loongson.cn>
Date: Wed, 28 Feb 2024 02:03:21 -0500
Subject: [PATCH 1/4] Add loongarch support
Signed-off-by: zhaotianrui <zhaotianrui@loongson.cn>
Set loongarch installable,And Define the judgment function of
loongarch architecture.
Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
---
virtManager/createvm.py | 5 ++++-
virtinst/devices/disk.py | 2 ++
virtinst/devices/video.py | 2 ++
virtinst/domain/cpu.py | 5 +++++
virtinst/domain/os.py | 3 +++
virtinst/domcapabilities.py | 6 +++++-
virtinst/guest.py | 16 ++++++++++++----
7 files changed, 33 insertions(+), 6 deletions(-)
virtManager/createvm.py | 6 +++++-
virtinst/domain/os.py | 2 ++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/virtManager/createvm.py b/virtManager/createvm.py
index 7e5ded6..7930b37 100644
index 7e5ded6..f5d678d 100644
--- a/virtManager/createvm.py
+++ b/virtManager/createvm.py
@@ -476,7 +476,8 @@ class vmmCreateVM(vmmGObjectUI):
@ -24,167 +22,33 @@ index 7e5ded6..7930b37 100644
guest.os.is_ppc64() or
- guest.os.is_s390x())
+ guest.os.is_s390x() or
+ guest.os.is_loongarch())
+ guest.os.is_loongarch64())
default_efi = (
self.config.get_default_firmware_setting() == "uefi" and
@@ -857,6 +858,8 @@ class vmmCreateVM(vmmGObjectUI):
machines.sort()
@@ -864,6 +865,9 @@ class vmmCreateVM(vmmGObjectUI):
defmachine = recommended_machine
prios = [defmachine]
defmachine = None
+ if self._capsinfo.arch in ["loongarch64"]:
+ defmachine = "loongson7a"
prios = []
recommended_machine = virtinst.Guest.get_recommended_machine(
self._capsinfo)
diff --git a/virtinst/devices/disk.py b/virtinst/devices/disk.py
index dc59fd1..261b82b 100644
--- a/virtinst/devices/disk.py
+++ b/virtinst/devices/disk.py
@@ -974,6 +974,8 @@ class DeviceDisk(Device):
return "sd"
if guest.os.is_q35():
return "sata"
+ if self.is_cdrom() and guest.os.is_loongarch():
+ return "scsi"
if self.conn.is_bhyve():
# IDE bus is not supported by bhyve
return "sata"
diff --git a/virtinst/devices/video.py b/virtinst/devices/video.py
index 70067a7..d10fd7a 100644
--- a/virtinst/devices/video.py
+++ b/virtinst/devices/video.py
@@ -27,6 +27,8 @@ class DeviceVideo(Device):
@staticmethod
def default_model(guest):
+ if guest.os.is_loongarch():
+ return "virtio"
if not guest.os.is_hvm():
return None
if guest.os.is_pseries():
diff --git a/virtinst/domain/cpu.py b/virtinst/domain/cpu.py
index 5de42b4..82b68ac 100644
--- a/virtinst/domain/cpu.py
+++ b/virtinst/domain/cpu.py
@@ -449,5 +449,10 @@ class DomainCpu(XMLBuilder):
# -M virt defaults to a 32bit CPU, even if using aarch64
self.set_model(guest, "cortex-a57")
+ elif guest.os.is_loongarch() and guest.type == "kvm":
+ if guest.os.arch != self.conn.caps.host.cpu.arch:
+ return
+ self.set_special_mode(guest, guest.loongarch_cpu_default)
+ defmachine = "virt"
+
elif guest.os.is_x86() and guest.type == "kvm":
self._set_cpu_x86_kvm_default(guest)
for p in prios[:]:
if p not in machines:
prios.remove(p) # pragma: no cover
diff --git a/virtinst/domain/os.py b/virtinst/domain/os.py
index e2cea75..bd0deac 100644
index e2cea75..e783c85 100644
--- a/virtinst/domain/os.py
+++ b/virtinst/domain/os.py
@@ -70,6 +70,9 @@ class DomainOs(XMLBuilder):
def is_pseries(self):
return self.is_ppc64() and str(self.machine).startswith("pseries")
+ def is_loongarch(self):
@@ -77,6 +77,8 @@ class DomainOs(XMLBuilder):
return self.arch == "riscv64" or self.arch == "riscv32"
def is_riscv_virt(self):
return self.is_riscv() and str(self.machine).startswith("virt")
+ def is_loongarch64(self):
+ return self.arch == "loongarch64"
+
def is_s390x(self):
return self.arch == "s390x"
diff --git a/virtinst/domcapabilities.py b/virtinst/domcapabilities.py
index d22ce6a..50ce12c 100644
--- a/virtinst/domcapabilities.py
+++ b/virtinst/domcapabilities.py
@@ -289,6 +289,10 @@ class DomainCapabilities(XMLBuilder):
r".*arm/QEMU_EFI.*", # fedora, gerd's firmware repo
r".*edk2-arm-code\.fd" # upstream qemu
],
+ "loongarch64": [
+ ".*loongarch_bios.bin", # loongarch
+ ".*loongarch_vars.bin", # gerd's firmware repo
+ ],
}
def find_uefi_path_for_arch(self):
@@ -444,7 +448,7 @@ class DomainCapabilities(XMLBuilder):
# support. Use our pre-existing logic
if not self.conn.is_qemu() and not self.conn.is_test():
return False
- return self.conn.caps.host.cpu.arch in ["i686", "x86_64"]
+ return self.conn.caps.host.cpu.arch in ["i686", "x86_64", "loongarch64"]
return self.devices.graphics.get_enum("type").has_value("spice")
diff --git a/virtinst/guest.py b/virtinst/guest.py
index e663602..f0f2d67 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -212,6 +212,7 @@ class Guest(XMLBuilder):
self.skip_default_rng = False
self.skip_default_tpm = False
self.x86_cpu_default = self.cpu.SPECIAL_MODE_APP_DEFAULT
+ self.loongarch_cpu_default = self.cpu.SPECIAL_MODE_HOST_MODEL_ONLY
# qemu 6.1, fairly new when we added this option, has an unfortunate
# bug with >= 15 root ports, so we choose 14 instead of our original 16
@@ -352,7 +353,8 @@ class Guest(XMLBuilder):
if (self.os.is_arm_machvirt() or
self.os.is_riscv_virt() or
self.os.is_s390x() or
- self.os.is_pseries()):
+ self.os.is_pseries() or
+ self.os.is_loongarch()):
return True
if not os_support:
@@ -541,7 +543,7 @@ class Guest(XMLBuilder):
# and doesn't break QEMU internal snapshots
prefer_efi = self.osinfo.requires_firmware_efi(self.os.arch)
else:
- prefer_efi = self.os.is_arm_machvirt() or self.conn.is_bhyve()
+ prefer_efi = self.os.is_arm_machvirt() or self.conn.is_bhyve() or self.os.is_loongarch()
log.debug("Prefer EFI => %s", prefer_efi)
return prefer_efi
@@ -558,6 +560,8 @@ class Guest(XMLBuilder):
"""
self.os.loader_ro = True
self.os.loader_type = "pflash"
+ if (self.os.is_loongarch()):
+ self.os.loader_type = "rom"
self.os.loader = path
# If the firmware name contains "secboot" it is probably build
@@ -902,7 +906,8 @@ class Guest(XMLBuilder):
usb_tablet = True
if (self.os.is_arm_machvirt() or
self.os.is_riscv_virt() or
- self.os.is_pseries()):
+ self.os.is_pseries() or
+ self.os.is_loongarch()):
usb_tablet = True
usb_keyboard = True
@@ -1016,7 +1021,8 @@ class Guest(XMLBuilder):
if self.os.is_container() and not self.conn.is_vz():
return
if (not self.os.is_x86() and
- not self.os.is_pseries()):
+ not self.os.is_pseries() and
+ not self.os.is_loongarch()):
return
self.add_device(DeviceGraphics(self.conn))
@@ -1155,6 +1161,8 @@ class Guest(XMLBuilder):
self.add_device(dev)
def _add_spice_usbredir(self):
+ if (self.os.is_loongarch()):
+ return
if self.skip_default_usbredir:
return
if self.devices.redirdev:
##################
# XML properties #
--
2.33.0
2.27.0

View File

@ -0,0 +1,59 @@
From 568965c0c852d882028d0777c1fa311da62ef6cb Mon Sep 17 00:00:00 2001
From: Xianglai Li <lixianglai@loongson.cn>
Date: Wed, 28 Feb 2024 02:11:16 -0500
Subject: [PATCH 3/4] Add some default device support for loongarch
Add adaptations for loongarch with the following features:
scsi support
default video Support
cpu modeul support
Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
---
virtinst/devices/disk.py | 2 ++
virtinst/devices/video.py | 2 ++
virtinst/domain/cpu.py | 3 +++
3 files changed, 7 insertions(+)
diff --git a/virtinst/devices/disk.py b/virtinst/devices/disk.py
index dc59fd1..cfb1387 100644
--- a/virtinst/devices/disk.py
+++ b/virtinst/devices/disk.py
@@ -974,6 +974,8 @@ class DeviceDisk(Device):
return "sd"
if guest.os.is_q35():
return "sata"
+ if self.is_cdrom() and guest.os.is_loongarch64():
+ return "scsi"
if self.conn.is_bhyve():
# IDE bus is not supported by bhyve
return "sata"
diff --git a/virtinst/devices/video.py b/virtinst/devices/video.py
index 70067a7..97adf7d 100644
--- a/virtinst/devices/video.py
+++ b/virtinst/devices/video.py
@@ -31,6 +31,8 @@ class DeviceVideo(Device):
return None
if guest.os.is_pseries():
return "vga"
+ if guest.os.is_loongarch64():
+ return "virtio"
if guest.os.is_arm_machvirt():
# For all cases here the hv and guest are new enough for virtio
return "virtio"
diff --git a/virtinst/domain/cpu.py b/virtinst/domain/cpu.py
index 5de42b4..c93a43b 100644
--- a/virtinst/domain/cpu.py
+++ b/virtinst/domain/cpu.py
@@ -449,5 +449,8 @@ class DomainCpu(XMLBuilder):
# -M virt defaults to a 32bit CPU, even if using aarch64
self.set_model(guest, "cortex-a57")
+ elif guest.os.is_loongarch64():
+ self.set_model(guest, "la464")
+
elif guest.os.is_x86() and guest.type == "kvm":
self._set_cpu_x86_kvm_default(guest)
--
2.27.0

View File

@ -0,0 +1,365 @@
From 26d63f7864341a6ce254449209bd7b8069b4ee45 Mon Sep 17 00:00:00 2001
From: Xianglai Li <lixianglai@loongson.cn>
Date: Wed, 28 Feb 2024 02:16:23 -0500
Subject: [PATCH 4/4] Add test cases for loongarch
Add some basic test cases for loongarch.
Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
---
.../capabilities/kvm-loongarch64-domcaps.xml | 167 ++++++++++++++++++
tests/data/capabilities/kvm-loongarch64.xml | 28 +++
.../virt-install-kvm-loongarch64-basic.xml | 99 +++++++++++
tests/test_cli.py | 8 +
tests/utils.py | 1 +
5 files changed, 303 insertions(+)
create mode 100644 tests/data/capabilities/kvm-loongarch64-domcaps.xml
create mode 100644 tests/data/capabilities/kvm-loongarch64.xml
create mode 100644 tests/data/cli/compare/virt-install-kvm-loongarch64-basic.xml
diff --git a/tests/data/capabilities/kvm-loongarch64-domcaps.xml b/tests/data/capabilities/kvm-loongarch64-domcaps.xml
new file mode 100644
index 0000000..2013da3
--- /dev/null
+++ b/tests/data/capabilities/kvm-loongarch64-domcaps.xml
@@ -0,0 +1,167 @@
+<domainCapabilities>
+ <path>/usr/bin/qemu-system-loongarch64</path>
+ <domain>kvm</domain>
+ <machine>virt</machine>
+ <arch>loongarch64</arch>
+ <vcpu max='256'/>
+ <iothreads supported='yes'/>
+ <os supported='yes'>
+ <enum name='firmware'/>
+ <loader supported='yes'>
+ <value>/obviously/fake/firmware1.fd</value>
+ <value>/obviously/fake/firmware2.fd</value>
+ <enum name='type'>
+ <value>rom</value>
+ <value>pflash</value>
+ </enum>
+ <enum name='readonly'>
+ <value>yes</value>
+ <value>no</value>
+ </enum>
+ <enum name='secure'>
+ <value>no</value>
+ </enum>
+ </loader>
+ </os>
+ <cpu>
+ <mode name='host-passthrough' supported='yes'>
+ <enum name='hostPassthroughMigratable'>
+ <value>off</value>
+ </enum>
+ </mode>
+ <mode name='maximum' supported='yes'>
+ <enum name='maximumMigratable'>
+ <value>on</value>
+ <value>off</value>
+ </enum>
+ </mode>
+ <mode name='host-model' supported='no'/>
+ <mode name='custom' supported='yes'>
+ <model usable='unknown' vendor='unknown'>la132</model>
+ <model usable='unknown' vendor='unknown'>la464</model>
+ <model usable='unknown' vendor='unknown'>max</model>
+ </mode>
+ </cpu>
+ <memoryBacking supported='yes'>
+ <enum name='sourceType'>
+ <value>file</value>
+ <value>anonymous</value>
+ <value>memfd</value>
+ </enum>
+ </memoryBacking>
+ <devices>
+ <disk supported='yes'>
+ <enum name='diskDevice'>
+ <value>disk</value>
+ <value>cdrom</value>
+ <value>floppy</value>
+ <value>lun</value>
+ </enum>
+ <enum name='bus'>
+ <value>fdc</value>
+ <value>scsi</value>
+ <value>virtio</value>
+ <value>usb</value>
+ <value>sata</value>
+ </enum>
+ <enum name='model'>
+ <value>virtio</value>
+ <value>virtio-transitional</value>
+ <value>virtio-non-transitional</value>
+ </enum>
+ </disk>
+ <graphics supported='yes'>
+ <enum name='type'>
+ <value>sdl</value>
+ <value>vnc</value>
+ <value>spice</value>
+ <value>dbus</value>
+ </enum>
+ </graphics>
+ <video supported='yes'>
+ <enum name='modelType'>
+ <value>vga</value>
+ <value>cirrus</value>
+ <value>virtio</value>
+ <value>none</value>
+ <value>bochs</value>
+ <value>ramfb</value>
+ </enum>
+ </video>
+ <hostdev supported='yes'>
+ <enum name='mode'>
+ <value>subsystem</value>
+ </enum>
+ <enum name='startupPolicy'>
+ <value>default</value>
+ <value>mandatory</value>
+ <value>requisite</value>
+ <value>optional</value>
+ </enum>
+ <enum name='subsysType'>
+ <value>usb</value>
+ <value>pci</value>
+ <value>scsi</value>
+ </enum>
+ <enum name='capsType'/>
+ <enum name='pciBackend'>
+ <value>default</value>
+ <value>vfio</value>
+ </enum>
+ </hostdev>
+ <rng supported='yes'>
+ <enum name='model'>
+ <value>virtio</value>
+ <value>virtio-transitional</value>
+ <value>virtio-non-transitional</value>
+ </enum>
+ <enum name='backendModel'>
+ <value>random</value>
+ <value>egd</value>
+ <value>builtin</value>
+ </enum>
+ </rng>
+ <filesystem supported='yes'>
+ <enum name='driverType'>
+ <value>path</value>
+ <value>handle</value>
+ <value>virtiofs</value>
+ </enum>
+ </filesystem>
+ <tpm supported='no'/>
+ <redirdev supported='yes'>
+ <enum name='bus'>
+ <value>usb</value>
+ </enum>
+ </redirdev>
+ <channel supported='yes'>
+ <enum name='type'>
+ <value>pty</value>
+ <value>unix</value>
+ <value>spicevmc</value>
+ </enum>
+ </channel>
+ <crypto supported='yes'>
+ <enum name='model'>
+ <value>virtio</value>
+ </enum>
+ <enum name='type'>
+ <value>qemu</value>
+ </enum>
+ <enum name='backendModel'>
+ <value>builtin</value>
+ <value>lkcf</value>
+ </enum>
+ </crypto>
+ </devices>
+ <features>
+ <gic supported='no'/>
+ <vmcoreinfo supported='yes'/>
+ <genid supported='no'/>
+ <backingStoreInput supported='yes'/>
+ <backup supported='yes'/>
+ <async-teardown supported='yes'/>
+ <sev supported='no'/>
+ <sgx supported='no'/>
+ </features>
+</domainCapabilities>
diff --git a/tests/data/capabilities/kvm-loongarch64.xml b/tests/data/capabilities/kvm-loongarch64.xml
new file mode 100644
index 0000000..c15d4d9
--- /dev/null
+++ b/tests/data/capabilities/kvm-loongarch64.xml
@@ -0,0 +1,28 @@
+<capabilities>
+
+ <host>
+ <cpu>
+ <arch>loongarch64</arch>
+ </cpu>
+ <power_management/>
+ <iommu support='no'/>
+ </host>
+
+ <guest>
+ <os_type>hvm</os_type>
+ <arch name='loongarch64'>
+ <wordsize>64</wordsize>
+ <emulator>/usr/bin/qemu-system-loongarch64</emulator>
+ <domain type='qemu'/>
+ <domain type='kvm'/>
+ </arch>
+ <features>
+ <acpi default='on' toggle='yes'/>
+ <cpuselection/>
+ <deviceboot/>
+ <disksnapshot default='on' toggle='no'/>
+ <externalSnapshot/>
+ </features>
+ </guest>
+
+</capabilities>
diff --git a/tests/data/cli/compare/virt-install-kvm-loongarch64-basic.xml b/tests/data/cli/compare/virt-install-kvm-loongarch64-basic.xml
new file mode 100644
index 0000000..83444ba
--- /dev/null
+++ b/tests/data/cli/compare/virt-install-kvm-loongarch64-basic.xml
@@ -0,0 +1,99 @@
+<domain type="kvm">
+ <name>fedora19</name>
+ <uuid>00000000-1111-2222-3333-444444444444</uuid>
+ <metadata>
+ <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
+ <libosinfo:os id="http://fedoraproject.org/fedora/19"/>
+ </libosinfo:libosinfo>
+ </metadata>
+ <memory>65536</memory>
+ <currentMemory>65536</currentMemory>
+ <vcpu>2</vcpu>
+ <os>
+ <type arch="loongarch64">hvm</type>
+ <boot dev="network"/>
+ </os>
+ <features>
+ <acpi/>
+ </features>
+ <cpu mode="custom" match="exact">
+ <model>la464</model>
+ </cpu>
+ <clock offset="utc"/>
+ <devices>
+ <emulator>/usr/bin/qemu-system-loongarch64</emulator>
+ <controller type="usb" model="qemu-xhci" ports="15"/>
+ <interface type="bridge">
+ <source bridge="testsuitebr0"/>
+ <mac address="00:11:22:33:44:55"/>
+ <model type="virtio"/>
+ </interface>
+ <console type="pty"/>
+ <channel type="unix">
+ <source mode="bind"/>
+ <target type="virtio" name="org.qemu.guest_agent.0"/>
+ </channel>
+ <channel type="spicevmc">
+ <target type="virtio" name="com.redhat.spice.0"/>
+ </channel>
+ <input type="tablet" bus="usb"/>
+ <input type="keyboard" bus="usb"/>
+ <graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
+ <image compression="off"/>
+ </graphics>
+ <sound model="ich6"/>
+ <video>
+ <model type="virtio"/>
+ </video>
+ </devices>
+ <on_reboot>destroy</on_reboot>
+</domain>
+<domain type="kvm">
+ <name>fedora19</name>
+ <uuid>00000000-1111-2222-3333-444444444444</uuid>
+ <metadata>
+ <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
+ <libosinfo:os id="http://fedoraproject.org/fedora/19"/>
+ </libosinfo:libosinfo>
+ </metadata>
+ <memory>65536</memory>
+ <currentMemory>65536</currentMemory>
+ <vcpu>2</vcpu>
+ <os>
+ <type arch="loongarch64">hvm</type>
+ <boot dev="network"/>
+ </os>
+ <features>
+ <acpi/>
+ </features>
+ <cpu mode="custom" match="exact">
+ <model>la464</model>
+ </cpu>
+ <clock offset="utc"/>
+ <devices>
+ <emulator>/usr/bin/qemu-system-loongarch64</emulator>
+ <controller type="usb" model="qemu-xhci" ports="15"/>
+ <interface type="bridge">
+ <source bridge="testsuitebr0"/>
+ <mac address="00:11:22:33:44:55"/>
+ <model type="virtio"/>
+ </interface>
+ <console type="pty"/>
+ <channel type="unix">
+ <source mode="bind"/>
+ <target type="virtio" name="org.qemu.guest_agent.0"/>
+ </channel>
+ <channel type="spicevmc">
+ <target type="virtio" name="com.redhat.spice.0"/>
+ </channel>
+ <input type="tablet" bus="usb"/>
+ <input type="keyboard" bus="usb"/>
+ <graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
+ <image compression="off"/>
+ </graphics>
+ <sound model="ich6"/>
+ <video>
+ <model type="virtio"/>
+ </video>
+ </devices>
+</domain>
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 774db09..65123f5 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -1179,6 +1179,14 @@ c.add_compare("--connect %(URI-KVM-AARCH64)s --osinfo fedora30 --arch aarch64 --
+#####################
+# loongarch64 tests #
+#####################
+
+c.add_compare("--osinfo fedora19 --nodisks --pxe --connect " + utils.URIs.kvm_loongarch64, "kvm-loongarch64-basic")
+
+
+
#################
# AMD sev tests #
#################
diff --git a/tests/utils.py b/tests/utils.py
index 5c813f6..6d91a14 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -105,6 +105,7 @@ class _URIs(object):
self.kvm_ppc64le = _uri_qemu + _caps("kvm-ppc64le.xml") + _domcaps("kvm-ppc64le-domcaps.xml")
self.kvm_s390x = _uri_qemu + _caps("kvm-s390x.xml") + _domcaps("kvm-s390x-domcaps.xml")
self.qemu_riscv64 = _uri_qemu + _caps("qemu-riscv64.xml") + _domcaps("qemu-riscv64-domcaps.xml")
+ self.kvm_loongarch64 = _uri_qemu + _caps("kvm-loongarch64.xml") + _domcaps("kvm-loongarch64-domcaps.xml")
--
2.27.0

View File

@ -1,47 +0,0 @@
From 8b09ac9855c051fc4f52538e168f0ddd64bcb963 Mon Sep 17 00:00:00 2001
From: weishaokun <weishaokun@kylinos.cn>
Date: Thu, 1 Feb 2024 15:28:17 +0800
Subject: [PATCH] fix bug that virt-manager can not support dies
Change-Id: Id791f0d9e93613e8085167753a292deb5c7b4db7
---
virtManager/object/domain.py | 1 +
virtinst/domain/cpu.py | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/virtManager/object/domain.py b/virtManager/object/domain.py
index f61f0f5..9ebda3f 100644
--- a/virtManager/object/domain.py
+++ b/virtManager/object/domain.py
@@ -464,6 +464,7 @@ class vmmDomain(vmmLibvirtObject):
guest.cpu.sockets = sockets
guest.cpu.cores = cores
guest.cpu.threads = threads
+ guest.cpu.dies = None
if secure != _SENTINEL or model != _SENTINEL:
guest.cpu.secure = secure
diff --git a/virtinst/domain/cpu.py b/virtinst/domain/cpu.py
index 5fb3d22..b671f04 100644
--- a/virtinst/domain/cpu.py
+++ b/virtinst/domain/cpu.py
@@ -65,7 +65,7 @@ class DomainCpu(XMLBuilder):
"""
XML_NAME = "cpu"
_XML_PROP_ORDER = ["mode", "match", "model", "vendor",
- "sockets", "cores", "threads", "features"]
+ "sockets", "cores", "threads", "dies", "features"]
secure = True
@@ -264,6 +264,7 @@ class DomainCpu(XMLBuilder):
sockets = XMLProperty("./topology/@sockets", is_int=True)
cores = XMLProperty("./topology/@cores", is_int=True)
threads = XMLProperty("./topology/@threads", is_int=True)
+ dies = XMLProperty("./topology/@dies", is_int=True)
##################
--
2.20.1

View File

@ -0,0 +1,159 @@
From ceed98b72d347ca732c58c681dc7c99562facc77 Mon Sep 17 00:00:00 2001
From: yanjianqing <yanjianqing@kylinos.cn>
Date: Wed, 17 Jul 2024 11:42:53 +0800
Subject: [PATCH] Update chinese translation file
---
po/zh_CN.po | 43 ++++++++++++-------------------------------
1 file changed, 12 insertions(+), 31 deletions(-)
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 292c293..ec51bb5 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -186,7 +186,7 @@ msgstr "随机数生成器"
#: ui/addhardware.ui:1336 ui/details.ui:4770
msgid "panic"
-msgstr "恐慌Panic"
+msgstr "panic"
#: ui/addhardware.ui:1442 ui/asyncjob.ui:146 ui/clone.ui:26 ui/clone.ui:690
#: ui/connectauth.ui:22 ui/createconn.ui:25 ui/createnet.ui:798
@@ -194,7 +194,7 @@ msgstr "恐慌Panic"
#: ui/delete.ui:181 ui/details.ui:4866 ui/hoststorage.ui:154 ui/migrate.ui:638
#: ui/snapshotsnew.ui:253
msgid "_Cancel"
-msgstr ""
+msgstr "取消(_C)"
#: ui/addhardware.ui:1457 ui/createnet.ui:813 ui/createpool.ui:493
#: ui/createvm.ui:2446 ui/createvol.ui:477 ui/snapshotsnew.ui:268
@@ -794,16 +794,12 @@ msgid "Finish"
msgstr "完成"
#: ui/createvm.ui:2415
-#, fuzzy
-#| msgid "_Backend:"
msgid "_Back"
-msgstr "后端:"
+msgstr "后退(_B)"
#: ui/createvm.ui:2431
-#, fuzzy
-#| msgid "Forwarding:"
msgid "_Forward"
-msgstr "转发:"
+msgstr "下一步(_F)"
#: ui/createvol.ui:24
msgid "Add a Storage Volume"
@@ -1033,10 +1029,8 @@ msgid "MiB"
msgstr "MiB"
#: ui/details.ui:1913
-#, fuzzy
-#| msgid "External disk and memory"
msgid "Enable shared _memory"
-msgstr "外部磁盘和内存"
+msgstr "启用共享内存"
#: ui/details.ui:1943
msgid "<b>Memory</b>"
@@ -1275,15 +1269,13 @@ msgid "<b>Panic Notifier</b>"
msgstr "<b>Panic 通知器</b>"
#: ui/details.ui:4845
-#, fuzzy
-#| msgid "Removable"
msgid "_Remove"
msgstr "可移除"
#: ui/details.ui:4886 ui/hostnets.ui:652 ui/hoststorage.ui:186
#: ui/snapshots.ui:499
msgid "_Apply"
-msgstr ""
+msgstr "应用"
#: ui/fsdetails.ui:30
msgid "E_xport filesystem as readonly mount"
@@ -1455,10 +1447,8 @@ msgid "Cancel and close dialog"
msgstr "取消并关闭对话框"
#: ui/hoststorage.ui:170
-#, fuzzy
-#| msgid "Choose Volume"
msgid "Ch_oose Volume"
-msgstr "选择卷"
+msgstr "选择卷(_O)"
#: ui/hoststorage.ui:174
msgid "Choose the selected volume"
@@ -1499,11 +1489,11 @@ msgstr "新建虚拟机(_N)"
#: ui/manager.ui:59 ui/preferences.ui:979 ui/vmwindow.ui:49
msgid "_Close"
-msgstr ""
+msgstr "关闭(_C)"
#: ui/manager.ui:69 ui/vmwindow.ui:59
msgid "_Quit"
-msgstr ""
+msgstr "退出(_Q)"
#: ui/manager.ui:83
msgid "_Edit"
@@ -1518,10 +1508,8 @@ msgid "_Virtual Machine Details"
msgstr "虚拟机详情(_V)"
#: ui/manager.ui:125
-#, fuzzy
-#| msgid "Preferences"
msgid "_Preferences"
-msgstr "首选项"
+msgstr "首选项(_P)"
#: ui/manager.ui:138 ui/vmwindow.ui:112
msgid "_View"
@@ -1557,7 +1545,7 @@ msgstr "帮助(_H)"
#: ui/manager.ui:222
msgid "_About"
-msgstr ""
+msgstr "关于(_A)"
#: ui/manager.ui:253
msgid "Create a new virtual machine"
@@ -1727,11 +1715,6 @@ msgid "_Network source:"
msgstr "网络源(_N)"
#: ui/oslist.ui:56
-#, fuzzy
-#| msgid ""
-#| "Can't find the operating system you are looking for?\n"
-#| "Try selecting the next most recent version displayed,\n"
-#| "or use the \"Generic OS\" entry."
msgid ""
"Can't find the operating system you are looking for?\n"
"Try selecting a similar distro or version, or use one of the 'Generic' "
@@ -1997,8 +1980,6 @@ msgid "_Version:"
msgstr "版本(_V)"
#: ui/tpmdetails.ui:162
-#, fuzzy
-#| msgid "Advanced options"
msgid "Adva_nced options"
msgstr "高级选项"
@@ -3988,7 +3969,7 @@ msgstr "源路径(_S)"
#: virtManager/device/fsdetails.py:163
msgid "You may need to 'Enable shared memory' on the 'Memory' screen."
-msgstr ""
+msgstr "你可能需要在'内存'界面启用共享内存"
#: virtManager/device/gfxdetails.py:87
msgid "Spice server"
--
2.43.0

View File

@ -0,0 +1,26 @@
From 4b150735720d8a54c153e10a1bc760d252594004 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Wed, 17 Aug 2022 10:27:36 -0400
Subject: [PATCH] cli: Drop unnecessary --disk prop aliases
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
virtinst/cli.py | 2 --
1 file changed, 2 deletions(-)
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 042b500f..388c5263 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -3497,8 +3497,6 @@ class ParserDisk(VirtCLIParser):
"driver.io": "io",
"driver.name": "driver_name",
"driver.type": "driver_type",
- "driver.metadata_cache.max_size": "metadata_cache.max_size",
- "driver.metadata_cache.max_size.unit": "metadata_cache.max_size.unit",
}
def _add_advertised_aliases(self):
--
2.43.0

View File

@ -0,0 +1,127 @@
From fbdf05162606e4d70506b65d0dd647a59f229253 Mon Sep 17 00:00:00 2001
From: Lin Ma <lma@suse.com>
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 <lma@suse.com>
---
.../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 @@
<bandwidth initiator="0" target="2" cache="1" type="access" value="409600" unit="KiB"/>
</interconnects>
</numa>
+ <maxphysaddr mode="emulate" bits="46"/>
</cpu>
<clock offset="utc">
<timer name="pit" tickpolicy="catchup" present="yes"/>
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 @@
<pae/>
<vmport state="off"/>
</features>
- <cpu mode="host-passthrough" migratable="on"/>
+ <cpu mode="host-passthrough" migratable="on">
+ <maxphysaddr mode="passthrough"/>
+ </cpu>
<clock offset="utc"/>
<pm>
<suspend-to-mem enabled="no"/>
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 <cpu> child node <maxphysaddr>.
+ """
+ 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

View File

@ -0,0 +1,106 @@
From 11a887ece5b5bab287ff77b09337dc44c4e6e976 Mon Sep 17 00:00:00 2001
From: Lin Ma <lma@suse.com>
Date: Tue, 16 Aug 2022 12:59:57 +0800
Subject: [PATCH] cli: --disk: Add driver.metadata_cache options
Properly setting the metadata cache size can provide better performance
in case of using big qcow2 images.
This patch introduces two driver options:
* driver.metadata_cache.max_size
* driver.metadata_cache.max_size.unit
E.g. --disk ...,driver.type=qcow2,\
driver.metadata_cache.max_size=2,\
driver.metadata_cache.max_size.unit=MiB
BTW, Metadata cache size control is currently supported only for qcow2.
Regarding how to properly caluclate the cache size of qcow2, Please refer
to qemu's documentation.
Signed-off-by: Lin Ma <lma@suse.com>
---
tests/data/cli/compare/virt-install-many-devices.xml | 9 +++++++++
tests/test_cli.py | 1 +
virtinst/cli.py | 7 +++++++
virtinst/devices/disk.py | 5 +++++
4 files changed, 22 insertions(+)
diff --git a/tests/data/cli/compare/virt-install-many-devices.xml b/tests/data/cli/compare/virt-install-many-devices.xml
index a73343a9..a33dc16a 100644
--- a/tests/data/cli/compare/virt-install-many-devices.xml
+++ b/tests/data/cli/compare/virt-install-many-devices.xml
@@ -423,6 +423,15 @@
</source>
<target dev="vdu" bus="virtio"/>
</disk>
+ <disk type="file" device="disk">
+ <driver name="qemu" type="qcow2">
+ <metadata_cache>
+ <max_size unit="KiB">2048</max_size>
+ </metadata_cache>
+ </driver>
+ <source file="/tmp/disk1.qcow2"/>
+ <target dev="vdv" bus="virtio"/>
+ </disk>
<controller type="usb" index="0" model="ich9-ehci1">
<address type="pci" domain="0" bus="0" slot="4" function="7"/>
</controller>
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 774db098..259ac78c 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -605,6 +605,7 @@ source.reservations.managed=no,source.reservations.source.type=unix,source.reser
--disk path=/fooroot.img,size=.0001,transient=on
--disk source.dir=/
--disk type=nvme,source.type=pci,source.managed=no,source.namespace=2,source.address.domain=0x0001,source.address.bus=0x02,source.address.slot=0x00,source.address.function=0x0
+--disk /tmp/disk1.qcow2,size=16,driver.type=qcow2,driver.metadata_cache.max_size=2048,driver.metadata_cache.max_size.unit=KiB
--network user,mac=12:34:56:78:11:22,portgroup=foo,link_state=down,rom_bar=on,rom_file=/tmp/foo
diff --git a/virtinst/cli.py b/virtinst/cli.py
index c4dffd34..042b500f 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -3497,6 +3497,8 @@ class ParserDisk(VirtCLIParser):
"driver.io": "io",
"driver.name": "driver_name",
"driver.type": "driver_type",
+ "driver.metadata_cache.max_size": "metadata_cache.max_size",
+ "driver.metadata_cache.max_size.unit": "metadata_cache.max_size.unit",
}
def _add_advertised_aliases(self):
@@ -3696,6 +3698,11 @@ class ParserDisk(VirtCLIParser):
cls.add_arg("driver.queues", "driver_queues")
cls.add_arg("driver.error_policy", "error_policy")
+ cls.add_arg("driver.metadata_cache.max_size",
+ "driver_metadata_cache_max_size")
+ cls.add_arg("driver.metadata_cache.max_size.unit",
+ "driver_metadata_cache_max_size_unit")
+
cls.add_arg("iotune.read_bytes_sec", "iotune_rbs")
cls.add_arg("iotune.write_bytes_sec", "iotune_wbs")
cls.add_arg("iotune.total_bytes_sec", "iotune_tbs")
diff --git a/virtinst/devices/disk.py b/virtinst/devices/disk.py
index dc59fd13..9609ebac 100644
--- a/virtinst/devices/disk.py
+++ b/virtinst/devices/disk.py
@@ -481,6 +481,11 @@ class DeviceDisk(Device):
driver_iothread = XMLProperty("./driver/@iothread", is_int=True)
driver_queues = XMLProperty("./driver/@queues", is_int=True)
+ driver_metadata_cache_max_size = XMLProperty(
+ "./driver/metadata_cache/max_size", is_int=True)
+ driver_metadata_cache_max_size_unit = XMLProperty(
+ "./driver/metadata_cache/max_size/@unit")
+
error_policy = XMLProperty("./driver/@error_policy")
serial = XMLProperty("./serial")
wwn = XMLProperty("./wwn")
--
2.37.2.windows.2

View File

@ -0,0 +1,83 @@
From 15ddeae6cb405bad10bc62164b14117646e9127e Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Mon, 17 Oct 2022 11:54:37 -0400
Subject: [PATCH] cli: support --boot loader.stateless=
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
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 @@
<vcpu cpuset="1,3-5">2</vcpu>
<os>
<type arch="x86_64" machine="q35">hvm</type>
- <loader readonly="yes" secure="no" type="rom">/tmp/foo</loader>
+ <loader readonly="yes" secure="no" type="rom" stateless="yes">/tmp/foo</loader>
<smbios mode="emulate"/>
<boot dev="network"/>
<boot dev="hd"/>
@@ -112,7 +112,7 @@
<vcpu cpuset="1,3-5">2</vcpu>
<os>
<type arch="x86_64" machine="q35">hvm</type>
- <loader readonly="yes" secure="no" type="rom">/tmp/foo</loader>
+ <loader readonly="yes" secure="no" type="rom" stateless="yes">/tmp/foo</loader>
<boot dev="hd"/>
<smbios mode="emulate"/>
</os>
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

View File

@ -0,0 +1,94 @@
From b0d0516736320315a70f74aff3759fb35dd35d9d Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Sun, 21 Aug 2022 16:21:10 -0400
Subject: [PATCH] cloner: Sync <uuid> and <sysinfo> system uuid
Otherwise libvirt errors like:
ERROR UUID mismatch between <uuid> and <sysinfo>
https://bugzilla.redhat.com/show_bug.cgi?id=2038040
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
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 @@
<domain type="test">
<name>origtest-clone</name>
<uuid>00000000-1111-2222-3333-444444444444</uuid>
+ <sysinfo type="smbios">
+ <system>
+ <entry name="uuid">00000000-1111-2222-3333-444444444444</entry>
+ </system>
+ </sysinfo>
<memory>8388608</memory>
<currentMemory>2097152</currentMemory>
<vcpu>2</vcpu>
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 @@
<domain type="test">
<name>clonetest</name>
<uuid>00000000-1111-2222-3333-444444444444</uuid>
+ <sysinfo type="smbios">
+ <system>
+ <entry name="uuid">00000000-1111-2222-3333-444444444444</entry>
+ </system>
+ </sysinfo>
<memory>8388608</memory>
<currentMemory>2097152</currentMemory>
<vcpu>2</vcpu>
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 @@
<domain type='test' id='1'>
<name>origtest</name>
<uuid>db69fa1f-eef0-e567-3c20-3ef16f10376b</uuid>
+ <sysinfo type='smbios'>
+ <system>
+ <entry name='uuid'>db69fa1f-eef0-e567-3c20-3ef16f10376b</entry>
+ </system>
+ </sysinfo>
<memory>8388608</memory>
<currentMemory>2097152</currentMemory>
<vcpu>2</vcpu>
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

View File

@ -0,0 +1,171 @@
From 4a2df064839f71ed94320771507b1271d041e397 Mon Sep 17 00:00:00 2001
From: Lin Ma <lma@suse.com>
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 <lma@suse.com>
---
.../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 @@
<disk type="file" device="disk">
<driver name="qemu" type="qcow2"/>
<source file="/pool-dir/testvol1.img"/>
- <target dev="vdag" bus="virtio"/>
+ <target dev="vdaf" bus="virtio"/>
</disk>
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 @@
<disk type="volume" device="disk">
<driver name="qemu" type="raw"/>
<source volume="sdfg1" pool="pool-disk"/>
- <target dev="vdag" bus="virtio"/>
+ <target dev="vdaf" bus="virtio"/>
</disk>
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 &amp; yeah boii &lt; &gt; yeahfoo
</source>
<target dev='vdac' bus='virtio'/>
</disk>
- <disk type='network' device='disk'>
- <driver name='qemu' type='raw'/>
- <source protocol='sheepdog' name='image,with,commas'>
- <host name='example.org' port='6000'/>
- </source>
- <target dev='vdad' bus='virtio'/>
- </disk>
<disk type='network' device='disk'>
<driver name='qemu' type='raw'/>
<source protocol='gluster' name='test-volume/test-gluster2.raw'>
<host name='192.168.1.100'/>
</source>
- <target dev='vdae' bus='virtio'/>
+ <target dev='vdad' bus='virtio'/>
</disk>
<disk type='network' device='disk'>
<driver name='qemu' type='raw'/>
<source protocol='nbd'>
<host transport='unix' socket='relative.sock'/>
</source>
- <target dev='vdaf' bus='virtio'/>
+ <target dev='vdae' bus='virtio'/>
</disk>
<!-- bus usb -->
@@ -2171,35 +2164,6 @@ ba</description>
</pool>
-<pool type='sheepdog'>
- <name>pool-sheepdog</name>
- <uuid>581381f8-a13f-4f7c-89b5-9c9b71c64834</uuid>
- <capacity unit='bytes'>107374182400</capacity>
- <allocation unit='bytes'>53687091200</allocation>
- <available unit='bytes'>53687091200</available>
- <source>
- <host name='localhost' port='7000'/>
- <name>mysheeppool</name>
- </source>
-
- <volume type='network'>
- <name>vol_sheepdog</name>
- <key>sheep/vol_sheepdog</key>
- <capacity unit='bytes'>1024</capacity>
- <allocation unit='bytes'>0</allocation>
- <target>
- <path>sheepdog:vol_sheepdog</path>
- <format type='unknown'/>
- <permissions>
- <mode>0600</mode>
- <owner>-1</owner>
- <group>-1</group>
- </permissions>
- </target>
- </volume>
-</pool>
-
-
<pool type='gluster'>
<name>pool-gluster</name>
<uuid>7b83ef6d-28da-44f1-841f-2011320f13b0</uuid>
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

View File

@ -0,0 +1,47 @@
From 58f5e36da76277bfc7fb4d87293be60ef6e0cbc1 Mon Sep 17 00:00:00 2001
From: Lin Ma <lma@suse.com>
Date: Tue, 16 Aug 2022 12:59:36 +0800
Subject: [PATCH] fsdetails: Fix an error with source.socket of virtiofs
Using the source.socket of virtiofs needs a virtiofsd daemon launched
outside of libvirtd, So the filesystem UI doesn't support it yet. If
users need it they can set it manually in the XML editor.
But if we view the filesystem info of such a VM on the details page,
It fails with this error message:
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/details/details.py", line 1713, in _refresh_page
self._refresh_filesystem_page(dev)
File "/usr/share/virt-manager/virtManager/details/details.py", line 2241, in _refresh_filesystem_page
self.fsDetails.set_dev(dev)
File "/usr/share/virt-manager/virtManager/device/fsdetails.py", line 193, in set_dev
self.widget("fs-source").set_text(dev.source)
TypeError: Argument 1 does not allow None as a value
This patch fixes above issue by leaving the 'source path' info blank in
case of source.socket.
In this case, Considering that showing 'target path' info without source
info is kind of meaningless, So this patch leaves the 'target path' info
blank as well.
Signed-off-by: Lin Ma <lma@suse.com>
---
virtManager/device/fsdetails.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/virtManager/device/fsdetails.py b/virtManager/device/fsdetails.py
index 40868d1c..b9956e1d 100644
--- a/virtManager/device/fsdetails.py
+++ b/virtManager/device/fsdetails.py
@@ -190,7 +190,7 @@ class vmmFSDetails(vmmGObjectUI):
self.widget("fs-format-combo"), dev.driver_format)
if dev.type != DeviceFilesystem.TYPE_RAM:
- self.widget("fs-source").set_text(dev.source)
+ self.widget("fs-source").set_text(dev.source or "")
else:
self.widget("fs-ram-source-spin").set_value(int(dev.source) // 1024)
self.widget("fs-target").set_text(dev.target or "")
--
2.37.2.windows.2

View File

@ -0,0 +1,28 @@
From c22a876e9a63cb7114e2b008f2e24682c8bbef3e Mon Sep 17 00:00:00 2001
From: Lin Ma <lma@suse.com>
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 <lma@suse.com>
---
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

View File

@ -0,0 +1,26 @@
From 7295ebfb02e1a6ebcc1fc94c4aecfe8e21a0e567 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Wed, 17 Aug 2022 10:21:31 -0400
Subject: [PATCH] tests: cli: Fix test output after previous commit
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
tests/data/cli/compare/virt-install-many-devices.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/data/cli/compare/virt-install-many-devices.xml b/tests/data/cli/compare/virt-install-many-devices.xml
index a33dc16a..c27512d1 100644
--- a/tests/data/cli/compare/virt-install-many-devices.xml
+++ b/tests/data/cli/compare/virt-install-many-devices.xml
@@ -424,7 +424,7 @@
<target dev="vdu" bus="virtio"/>
</disk>
<disk type="file" device="disk">
- <driver name="qemu" type="qcow2">
+ <driver name="qemu" type="qcow2" discard="unmap">
<metadata_cache>
<max_size unit="KiB">2048</max_size>
</metadata_cache>
--
2.43.0

View File

@ -0,0 +1,31 @@
From 1b87e3e54c782da39cf30b100a22f70c37bfcddd Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Wed, 17 Aug 2022 10:29:31 -0400
Subject: [PATCH] tests: testdriver: Add filesystem socket example
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
tests/data/testdriver/testdriver.xml | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tests/data/testdriver/testdriver.xml b/tests/data/testdriver/testdriver.xml
index b213863d..7c94e698 100644
--- a/tests/data/testdriver/testdriver.xml
+++ b/tests/data/testdriver/testdriver.xml
@@ -599,6 +599,13 @@ Foo bar baz &amp; yeah boii &lt; &gt; yeahfoo
<source file='/root/container.vmdk'/>
<target dir='/home'/>
</filesystem>
+ <filesystem type='mount'>
+ <driver type='virtiofs' queue='1024'/>
+ <source socket='/tmp/sock'/>
+ <target dir='tag'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </filesystem>
+
<!-- tpm devices -->
<tpm model='tpm-tis'>
--
2.37.2.windows.2

View File

@ -0,0 +1,42 @@
From 1d64a678d31829051444e1bf29d86f800e13de39 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
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 <crobinso@redhat.com>
---
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

View File

@ -0,0 +1,32 @@
From a254ece0f0497d062a0e4c94dc45619649ea4922 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
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 <crobinso@redhat.com>
---
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

View File

@ -0,0 +1,45 @@
From 999ccb85e3e4189386786256cdf70cf5238cf785 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
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 <crobinso@redhat.com>
---
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

View File

@ -0,0 +1,53 @@
From e94786c066696781a821f5a4bcef3c377e4bc5e5 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
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 <crobinso@redhat.com>
---
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

View File

@ -0,0 +1,57 @@
From 1cb0be4002445e5755ead2423b5a4e9e06f0a3cb Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
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 <crobinso@redhat.com>
---
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

View File

@ -2,7 +2,7 @@
Name: virt-manager
Version: 4.1.0
Release: 3
Release: 8
Summary: The manage virtual machines tool which via libvirt.
License: GPLv2+
BuildArch: noarch
@ -10,6 +10,25 @@ URL: https://virt-manager.org/
Source0: https://virt-manager.org/download/sources/virt-manager/virt-manager-%{version}.tar.gz
Patch1: Add-loongarch-support.patch
Patch2: Add-loongarch-support-in-guest-class.patch
Patch3: Add-some-default-device-support-for-loongarch.patch
Patch4: Add-test-cases-for-loongarch.patch
Patch5: Update-chinese-translation-file.patch
Patch6: backport-cli-disk-Add-driver.metadata_cache-options.patch
Patch7: backport-tests-cli-Fix-test-output-after-previous-commit.patch
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
@ -87,6 +106,34 @@ done
%{_mandir}/man1/{virt-install.1*,virt-clone.1*,virt-xml.1*}
%changelog
* Wed Aug 21 2024 yanjianqing <yanjianqing@kylinos.cn> - 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 <yanjianqing@kylinos.cn> - 4.1.0-7
- tests: testdriver: Add filesystem socket example
- cli: Drop unnecessary --disk prop aliases
- fsdetails: Fix an error with source.socket of virtiofs
- tests: cli: Fix test output after previous commit
- cli: --disk: Add driver.metadata_cache options
* Wed Jul 17 2024 yanjianqing <yanjianqing@kylinos.cn> - 4.1.0-6
- Update chinese translation file
* Thu Feb 29 2024 yanjianqing <yanjianqing@kylinos.cn> - 4.1.0-5
- delete Fix-bug-that-virt-manager-can-not-support-dies.patch,virt-manager-4.1.0 support dies
* Thu Feb 29 2024 lixianglai <lixianglai@loongson.cn> - 4.1.0-4
- Update loongarch code
* Wed Feb 28 2024 lijunwei <lijunwei@kylinos.cn> - 4.1.0-3
* fix bug that virt-manager can not support features dies