Compare commits

3 Commits
1.1 ... main

133 changed files with 3413 additions and 7871 deletions

View File

@@ -0,0 +1,99 @@
Subject: cli: Support --cpu maximum
From: Andrea Bolognani abologna@redhat.com Fri Dec 6 22:10:31 2024 +0100
Date: Tue Dec 10 14:01:32 2024 +0100:
Git: fca41cfaa970ba5a4e695f482fd599f53572b6c7
This mode has been introduced in libvirt 7.1.0 (March 2021) and
can be already used today with
--cpu mode=maximum
This is however slightly inconvenient to type and is not
consistent with the special treatment that the other modes
(host-passthrough, host-model) get.
Introduce a proper special mode for it.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
diff --git a/man/virt-install.rst b/man/virt-install.rst
index 86152d214..775d7ce70 100644
--- a/man/virt-install.rst
+++ b/man/virt-install.rst
@@ -438,6 +438,11 @@ Some examples:
``--cpu host-passthrough,cache.mode=passthrough``
Example of passing through the host cpu's cache information.
+``--cpu maximum``
+ Expose the most feature-rich CPU possible. Useful when running a foreign
+ architecture guest, for example a riscv64 guest on an x86_64 host. Not
+ recommended when using KVM to run a same-architecture guest.
+
Use --cpu=? to see a list of all available sub options.
Complete details at https://libvirt.org/formatdomain.html#cpu-model-and-topology
diff --git a/tests/data/cli/compare/virt-install-linux2020.xml b/tests/data/cli/compare/virt-install-linux2020.xml
index 5a7d7adf3..b37b87758 100644
--- a/tests/data/cli/compare/virt-install-linux2020.xml
+++ b/tests/data/cli/compare/virt-install-linux2020.xml
@@ -19,7 +19,7 @@
<apic/>
<vmport state="off"/>
</features>
- <cpu mode="host-passthrough"/>
+ <cpu mode="maximum"/>
<clock offset="utc">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
@@ -102,7 +102,7 @@
<apic/>
<vmport state="off"/>
</features>
- <cpu mode="host-passthrough"/>
+ <cpu mode="maximum"/>
<clock offset="utc">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 23ad1cadb..03c3316e1 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -1153,7 +1153,7 @@ c.add_compare("--os-variant http://fedoraproject.org/fedora/20 --disk %(EXISTIMG
c.add_compare("--cdrom %(EXISTIMG2)s --file %(EXISTIMG1)s --os-variant win2k3 --sound --controller usb", "kvm-win2k3-cdrom") # HVM windows install with disk
c.add_compare("--os-variant name=ubuntusaucy --nodisks --boot cdrom --virt-type qemu --cpu Penryn --input tablet --boot uefi --graphics vnc", "qemu-plain") # plain qemu
c.add_compare("--os-variant fedora20 --nodisks --boot network --graphics default --arch i686 --rng none", "qemu-32-on-64", prerun_check=has_old_osinfo) # 32 on 64
-c.add_compare("--osinfo linux2020 --pxe", "linux2020", prerun_check=no_osinfo_linux2020_virtio)
+c.add_compare("--osinfo linux2020 --pxe --cpu maximum", "linux2020", prerun_check=no_osinfo_linux2020_virtio) # also --cpu maximum
c.add_compare("--check disk_size=off --osinfo win11 --cdrom %(EXISTIMG1)s", "win11", prerun_check=no_osinfo_win11)
c.add_compare("--check disk_size=off --osinfo win11 --cdrom %(EXISTIMG1)s --boot uefi=off", "win11-no-uefi")
c.add_compare("--osinfo generic --disk none --location %(ISO-NO-OS)s,kernel=frib.img,initrd=/frob.img", "location-manual-kernel", prerun_check=missing_xorriso) # --location with an unknown ISO but manually specified kernel paths
diff --git a/virtinst/domain/cpu.py b/virtinst/domain/cpu.py
index df0ca2250..91a9481cf 100644
--- a/virtinst/domain/cpu.py
+++ b/virtinst/domain/cpu.py
@@ -267,12 +267,13 @@ class DomainCpu(XMLBuilder):
SPECIAL_MODE_HOST_COPY = "host-copy"
SPECIAL_MODE_HOST_MODEL = "host-model"
SPECIAL_MODE_HOST_PASSTHROUGH = "host-passthrough"
+ SPECIAL_MODE_MAXIMUM = "maximum"
SPECIAL_MODE_CLEAR = "clear"
SPECIAL_MODE_APP_DEFAULT = "default"
SPECIAL_MODES = [SPECIAL_MODE_HOST_MODEL_ONLY, SPECIAL_MODE_HV_DEFAULT,
SPECIAL_MODE_HOST_COPY, SPECIAL_MODE_HOST_MODEL,
- SPECIAL_MODE_HOST_PASSTHROUGH, SPECIAL_MODE_CLEAR,
- SPECIAL_MODE_APP_DEFAULT]
+ SPECIAL_MODE_HOST_PASSTHROUGH, SPECIAL_MODE_MAXIMUM,
+ SPECIAL_MODE_CLEAR, SPECIAL_MODE_APP_DEFAULT]
def _get_app_default_mode(self, guest):
# Depending on if libvirt+qemu is new enough, we prefer
@@ -295,7 +296,8 @@ class DomainCpu(XMLBuilder):
log.debug("Using default cpu mode=%s", val)
if (val == self.SPECIAL_MODE_HOST_MODEL or
- val == self.SPECIAL_MODE_HOST_PASSTHROUGH):
+ val == self.SPECIAL_MODE_HOST_PASSTHROUGH or
+ val == self.SPECIAL_MODE_MAXIMUM):
self.model = None
self.vendor = None
self.model_fallback = None

View File

@@ -1,95 +0,0 @@
Subject: cli: --disk: Add driver.metadata_cache options
From: Lin Ma lma@suse.com Tue Aug 16 12:59:57 2022 +0800
Date: Wed Aug 17 09:57:29 2022 -0400:
Git: 11a887ece5b5bab287ff77b09337dc44c4e6e976
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>
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")

View File

@@ -0,0 +1,47 @@
Subject: gui: Support maximum CPU mode
From: Andrea Bolognani abologna@redhat.com Fri Dec 6 22:28:09 2024 +0100
Date: Tue Dec 10 14:01:32 2024 +0100:
Git: 11b70218d3b38efae36db8ba4149702a6d51afc0
Allow the user to set it and recognize it correctly when the
domain is already using it.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
diff --git a/virtManager/details/details.py b/virtManager/details/details.py
index e53c52ef0..0dc9d2d64 100644
--- a/virtManager/details/details.py
+++ b/virtManager/details/details.py
@@ -775,6 +775,8 @@ class vmmDetails(vmmGObjectUI):
virtinst.DomainCpu.SPECIAL_MODE_HOST_MODEL, False])
model.append(["host-passthrough", "05",
virtinst.DomainCpu.SPECIAL_MODE_HOST_PASSTHROUGH, False])
+ model.append(["maximum", "06",
+ virtinst.DomainCpu.SPECIAL_MODE_MAXIMUM, False])
model.append([None, None, None, True])
for name in domcaps.get_cpu_models():
model.append([name, name, name, False])
@@ -1915,7 +1917,8 @@ class vmmDetails(vmmGObjectUI):
# CPU model config
model = cpu.model or None
is_host = (cpu.mode in ["host-model", "host-passthrough"])
- if not model and is_host:
+ is_special_mode = (cpu.mode in virtinst.DomainCpu.SPECIAL_MODES)
+ if not model and is_special_mode:
model = cpu.mode
if model:
diff --git a/virtManager/preferences.py b/virtManager/preferences.py
index 5022f7ed3..df599d044 100644
--- a/virtManager/preferences.py
+++ b/virtManager/preferences.py
@@ -172,7 +172,8 @@ class vmmPreferences(vmmGObjectUI):
[DomainCpu.SPECIAL_MODE_HOST_MODEL_ONLY,
_("Nearest host CPU model")],
[DomainCpu.SPECIAL_MODE_HOST_MODEL, "host-model"],
- [DomainCpu.SPECIAL_MODE_HOST_PASSTHROUGH, "host-passthrough"]]:
+ [DomainCpu.SPECIAL_MODE_HOST_PASSTHROUGH, "host-passthrough"],
+ [DomainCpu.SPECIAL_MODE_MAXIMUM, "maximum"]]:
model.append(row)
combo.set_model(model)
uiutil.init_combo_text_column(combo, 1)

View File

@@ -1,20 +0,0 @@
Subject: tests: cli: Fix test output after previous commit
From: Cole Robinson crobinso@redhat.com Wed Aug 17 10:21:31 2022 -0400
Date: Wed Aug 17 10:21:31 2022 -0400:
Git: 7295ebfb02e1a6ebcc1fc94c4aecfe8e21a0e567
Signed-off-by: Cole Robinson <crobinso@redhat.com>
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>

View File

@@ -0,0 +1,240 @@
Subject: cpu: Prefer maximum mode for many emulated guests
From: Andrea Bolognani abologna@redhat.com Fri Dec 6 23:02:29 2024 +0100
Date: Tue Dec 10 14:01:32 2024 +0100:
Git: 8af438dd58cafe90d591eef25e7510c313cf3036
The actual default CPU at the QEMU level is often a relatively
poor choice, which is stuck with just baseline functionality
and can sometimes not run modern guests at all.
Whenever possible, prefer maximum mode for a much nicer out of
the box experience.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
diff --git a/tests/data/cli/compare/virt-install-aarch64-machdefault.xml b/tests/data/cli/compare/virt-install-aarch64-machdefault.xml
index f88a0fc17..d17c82573 100644
--- a/tests/data/cli/compare/virt-install-aarch64-machdefault.xml
+++ b/tests/data/cli/compare/virt-install-aarch64-machdefault.xml
@@ -18,9 +18,7 @@
<features>
<acpi/>
</features>
- <cpu mode="custom" match="exact">
- <model>cortex-a57</model>
- </cpu>
+ <cpu mode="maximum"/>
<clock offset="utc"/>
<devices>
<emulator>/usr/bin/qemu-system-aarch64</emulator>
diff --git a/tests/data/cli/compare/virt-install-aarch64-machvirt.xml b/tests/data/cli/compare/virt-install-aarch64-machvirt.xml
index f88a0fc17..d17c82573 100644
--- a/tests/data/cli/compare/virt-install-aarch64-machvirt.xml
+++ b/tests/data/cli/compare/virt-install-aarch64-machvirt.xml
@@ -18,9 +18,7 @@
<features>
<acpi/>
</features>
- <cpu mode="custom" match="exact">
- <model>cortex-a57</model>
- </cpu>
+ <cpu mode="maximum"/>
<clock offset="utc"/>
<devices>
<emulator>/usr/bin/qemu-system-aarch64</emulator>
diff --git a/tests/data/cli/compare/virt-install-arm-defaultmach-f20.xml b/tests/data/cli/compare/virt-install-arm-defaultmach-f20.xml
index b56d07880..bc8006252 100644
--- a/tests/data/cli/compare/virt-install-arm-defaultmach-f20.xml
+++ b/tests/data/cli/compare/virt-install-arm-defaultmach-f20.xml
@@ -15,6 +15,7 @@
<initrd>/f19-arm.initrd</initrd>
<cmdline>foo</cmdline>
</os>
+ <cpu mode="maximum"/>
<clock offset="utc"/>
<devices>
<emulator>/usr/bin/qemu-system-arm</emulator>
diff --git a/tests/data/cli/compare/virt-install-arm-virt-f20.xml b/tests/data/cli/compare/virt-install-arm-virt-f20.xml
index 9d2001697..dc74281b7 100644
--- a/tests/data/cli/compare/virt-install-arm-virt-f20.xml
+++ b/tests/data/cli/compare/virt-install-arm-virt-f20.xml
@@ -15,6 +15,7 @@
<initrd>/f19-arm.initrd</initrd>
<cmdline>console=ttyAMA0,1234 rw root=/dev/vda3</cmdline>
</os>
+ <cpu mode="maximum"/>
<clock offset="utc"/>
<devices>
<emulator>/usr/bin/qemu-system-arm</emulator>
diff --git a/tests/data/cli/compare/virt-install-riscv64-cdrom.xml b/tests/data/cli/compare/virt-install-riscv64-cdrom.xml
index 35cd1e712..1d6bd923c 100644
--- a/tests/data/cli/compare/virt-install-riscv64-cdrom.xml
+++ b/tests/data/cli/compare/virt-install-riscv64-cdrom.xml
@@ -14,6 +14,7 @@
<boot dev="cdrom"/>
<boot dev="hd"/>
</os>
+ <cpu mode="maximum"/>
<clock offset="utc"/>
<devices>
<emulator>/usr/bin/qemu-system-riscv64</emulator>
@@ -92,6 +93,7 @@
<type arch="riscv64" machine="virt">hvm</type>
<boot dev="hd"/>
</os>
+ <cpu mode="maximum"/>
<clock offset="utc"/>
<devices>
<emulator>/usr/bin/qemu-system-riscv64</emulator>
diff --git a/tests/data/cli/compare/virt-install-riscv64-cloud-init.xml b/tests/data/cli/compare/virt-install-riscv64-cloud-init.xml
index b83937ca5..815f93ea0 100644
--- a/tests/data/cli/compare/virt-install-riscv64-cloud-init.xml
+++ b/tests/data/cli/compare/virt-install-riscv64-cloud-init.xml
@@ -12,6 +12,7 @@
<os firmware="efi">
<type arch="riscv64" machine="virt">hvm</type>
</os>
+ <cpu mode="maximum"/>
<clock offset="utc"/>
<devices>
<emulator>/usr/bin/qemu-system-riscv64</emulator>
@@ -87,6 +88,7 @@
<type arch="riscv64" machine="virt">hvm</type>
<boot dev="hd"/>
</os>
+ <cpu mode="maximum"/>
<clock offset="utc"/>
<devices>
<emulator>/usr/bin/qemu-system-riscv64</emulator>
diff --git a/tests/data/cli/compare/virt-install-riscv64-graphics.xml b/tests/data/cli/compare/virt-install-riscv64-graphics.xml
index 659dae74f..04ab41933 100644
--- a/tests/data/cli/compare/virt-install-riscv64-graphics.xml
+++ b/tests/data/cli/compare/virt-install-riscv64-graphics.xml
@@ -13,6 +13,7 @@
<type arch="riscv64" machine="virt">hvm</type>
<boot dev="hd"/>
</os>
+ <cpu mode="maximum"/>
<clock offset="utc"/>
<devices>
<emulator>/usr/bin/qemu-system-riscv64</emulator>
diff --git a/tests/data/cli/compare/virt-install-riscv64-headless.xml b/tests/data/cli/compare/virt-install-riscv64-headless.xml
index 939e71b2a..27328a123 100644
--- a/tests/data/cli/compare/virt-install-riscv64-headless.xml
+++ b/tests/data/cli/compare/virt-install-riscv64-headless.xml
@@ -13,6 +13,7 @@
<type arch="riscv64" machine="virt">hvm</type>
<boot dev="hd"/>
</os>
+ <cpu mode="maximum"/>
<clock offset="utc"/>
<devices>
<emulator>/usr/bin/qemu-system-riscv64</emulator>
diff --git a/tests/data/cli/compare/virt-install-riscv64-kernel-boot.xml b/tests/data/cli/compare/virt-install-riscv64-kernel-boot.xml
index 640e5ee0d..c3714594a 100644
--- a/tests/data/cli/compare/virt-install-riscv64-kernel-boot.xml
+++ b/tests/data/cli/compare/virt-install-riscv64-kernel-boot.xml
@@ -15,6 +15,7 @@
<initrd>/initrd.img</initrd>
<cmdline>root=/dev/vda2</cmdline>
</os>
+ <cpu mode="maximum"/>
<clock offset="utc"/>
<devices>
<emulator>/usr/bin/qemu-system-riscv64</emulator>
diff --git a/tests/data/cli/compare/virt-install-riscv64-unattended.xml b/tests/data/cli/compare/virt-install-riscv64-unattended.xml
index 0a9f88b4e..7fdb32d04 100644
--- a/tests/data/cli/compare/virt-install-riscv64-unattended.xml
+++ b/tests/data/cli/compare/virt-install-riscv64-unattended.xml
@@ -12,6 +12,7 @@
<os firmware="efi">
<type arch="riscv64" machine="virt">hvm</type>
</os>
+ <cpu mode="maximum"/>
<clock offset="utc"/>
<devices>
<emulator>/usr/bin/qemu-system-riscv64</emulator>
@@ -90,6 +91,7 @@
<type arch="riscv64" machine="virt">hvm</type>
<boot dev="hd"/>
</os>
+ <cpu mode="maximum"/>
<clock offset="utc"/>
<devices>
<emulator>/usr/bin/qemu-system-riscv64</emulator>
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 03c3316e1..dc9c156da 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -1247,7 +1247,7 @@ c.add_compare("--connect %(URI-KVM-ARMV7L)s --disk %(EXISTIMG1)s --import --os-v
c.add_valid("--arch aarch64 --osinfo fedora19 --nodisks --pxe --connect " + utils.URIs.kvm_x86_nodomcaps, grep="Libvirt version does not support UEFI") # attempt to default to aarch64 UEFI, but it fails, but should only print warnings
c.add_invalid("--arch aarch64 --nodisks --pxe --connect " + utils.URIs.kvm_x86, grep="OS name is required") # catch missing osinfo for non-x86
-c.add_compare("--arch aarch64 --osinfo fedora19 --machine virt --boot kernel=/f19-arm.kernel,initrd=/f19-arm.initrd,kernel_args=\"console=ttyAMA0,1234 rw root=/dev/vda3\" --disk %(EXISTIMG1)s", "aarch64-machvirt")
+c.add_compare("--arch aarch64 --osinfo fedora19 --machine virt --cpu default --boot kernel=/f19-arm.kernel,initrd=/f19-arm.initrd,kernel_args=\"console=ttyAMA0,1234 rw root=/dev/vda3\" --disk %(EXISTIMG1)s", "aarch64-machvirt")
c.add_compare("--arch aarch64 --osinfo fedora19 --boot kernel=/f19-arm.kernel,initrd=/f19-arm.initrd,kernel_args=\"console=ttyAMA0,1234 rw root=/dev/vda3\" --disk %(EXISTIMG1)s", "aarch64-machdefault")
c.add_compare("--arch aarch64 --cdrom %(ISO-F26-NETINST)s --boot loader=CODE.fd,nvram.template=VARS.fd --disk %(EXISTIMG1)s --cpu none --events on_crash=preserve,on_reboot=destroy,on_poweroff=restart", "aarch64-cdrom") # cdrom test, but also --cpu none override, --events override, and headless
c.add_compare("--connect %(URI-KVM-AARCH64)s --disk %(EXISTIMG1)s --import --os-variant fedora21 --panic default --graphics vnc", "aarch64-kvm-import") # --import test, but also test --panic no-op, and --graphics
diff --git a/virtinst/domain/cpu.py b/virtinst/domain/cpu.py
index 91a9481cf..cc4053f88 100644
--- a/virtinst/domain/cpu.py
+++ b/virtinst/domain/cpu.py
@@ -275,11 +275,26 @@ class DomainCpu(XMLBuilder):
SPECIAL_MODE_HOST_PASSTHROUGH, SPECIAL_MODE_MAXIMUM,
SPECIAL_MODE_CLEAR, SPECIAL_MODE_APP_DEFAULT]
+ def _should_use_maximum_cpu_mode(self, guest, domcaps):
+ if (domcaps.supports_maximum_cpu_mode() and
+ guest.type == "qemu" and
+ (guest.os.is_x86() or
+ guest.os.is_arm_machvirt() or
+ guest.os.is_riscv_virt() or
+ guest.os.is_loongarch64())):
+ return True
+
+ return False
+
def _get_app_default_mode(self, guest):
# Depending on if libvirt+qemu is new enough, we prefer
# host-passthrough, then host-model, and finally host-model-only
+ # Emulated guests use maximum mode if available
domcaps = guest.lookup_domcaps()
+ if (self._should_use_maximum_cpu_mode(guest, domcaps)):
+ return self.SPECIAL_MODE_MAXIMUM
+
if domcaps.supports_safe_host_passthrough():
return self.SPECIAL_MODE_HOST_PASSTHROUGH
@@ -460,9 +475,12 @@ class DomainCpu(XMLBuilder):
if guest.os.is_arm_machvirt() and guest.type == "kvm":
self.mode = self.SPECIAL_MODE_HOST_PASSTHROUGH
- elif guest.os.is_arm64() and guest.os.is_arm_machvirt():
- # -M virt defaults to a 32bit CPU, even if using aarch64
- self.set_model(guest, "cortex-a57")
-
elif guest.os.is_x86() and guest.type == "kvm":
self._set_cpu_x86_kvm_default(guest)
+
+ else:
+ domcaps = guest.lookup_domcaps()
+
+ # Prefer to emulate a feature-rich CPU instead of a basic one
+ if (self._should_use_maximum_cpu_mode(guest, domcaps)):
+ self.set_special_mode(guest, self.SPECIAL_MODE_MAXIMUM)
diff --git a/virtinst/domcapabilities.py b/virtinst/domcapabilities.py
index 3a19591d9..5d82a351e 100644
--- a/virtinst/domcapabilities.py
+++ b/virtinst/domcapabilities.py
@@ -382,6 +382,10 @@ class DomainCapabilities(XMLBuilder):
return (m and m.supported and
"on" in m.get_enum("hostPassthroughMigratable").get_values())
+ def supports_maximum_cpu_mode(self):
+ m = self.cpu.get_mode("maximum")
+ return (m and m.supported)
+
def get_cpu_models(self):
models = []

View File

@@ -1,41 +0,0 @@
Subject: fsdetails: Fix an error with source.socket of virtiofs
From: Lin Ma lma@suse.com Tue Aug 16 12:59:36 2022 +0800
Date: Wed Aug 17 10:24:10 2022 -0400:
Git: 58f5e36da76277bfc7fb4d87293be60ef6e0cbc1
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>
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 "")

View File

@@ -1,20 +0,0 @@
Subject: cli: Drop unnecessary --disk prop aliases
From: Cole Robinson crobinso@redhat.com Wed Aug 17 10:27:36 2022 -0400
Date: Wed Aug 17 10:27:36 2022 -0400:
Git: 4b150735720d8a54c153e10a1bc760d252594004
Signed-off-by: Cole Robinson <crobinso@redhat.com>
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):

View File

@@ -0,0 +1,32 @@
Subject: domcaps: get list of supported panic device models
From: Lin Ma lma@suse.de Tue Dec 3 13:32:15 2024 +0800
Date: Tue Dec 10 14:05:20 2024 +0100:
Git: c859c7acec38a68a46b3ee98b1ff494fa88d508e
libvirt commit a52cd504 added support for advertisting panic device models.
Let's use it in domcapabilities.
Signed-off-by: Lin Ma <lma@suse.de>
diff --git a/virtinst/domcapabilities.py b/virtinst/domcapabilities.py
index 5d82a351e..9e1b11932 100644
--- a/virtinst/domcapabilities.py
+++ b/virtinst/domcapabilities.py
@@ -115,6 +115,7 @@ class _Devices(_CapsBlock):
filesystem = XMLChildProperty(_make_capsblock("filesystem"), is_single=True)
redirdev = XMLChildProperty(_make_capsblock("redirdev"), is_single=True)
channel = XMLChildProperty(_make_capsblock("channel"), is_single=True)
+ panic = XMLChildProperty(_make_capsblock("panic"), is_single=True)
class _Features(_CapsBlock):
@@ -508,3 +509,9 @@ class DomainCapabilities(XMLBuilder):
return []
return self.features.hyperv.get_enum("features").get_values()
+
+ def supported_panic_models(self):
+ """
+ Return list of supported panic device models.
+ """
+ return self.devices.panic.get_enum("model").get_values()

View File

@@ -0,0 +1,131 @@
Subject: tests: Update capabilities for advertisting panic device models
From: Lin Ma lma@suse.de Tue Dec 3 18:45:52 2024 +0800
Date: Tue Dec 10 14:05:20 2024 +0100:
Git: f9ceec2b14cb4012cb40226f3c0c05ff1ac8f708
Signed-off-by: Lin Ma <lma@suse.de>
diff --git a/tests/data/capabilities/kvm-aarch64-domcaps.xml b/tests/data/capabilities/kvm-aarch64-domcaps.xml
index eeef1a17a..af8354b08 100644
--- a/tests/data/capabilities/kvm-aarch64-domcaps.xml
+++ b/tests/data/capabilities/kvm-aarch64-domcaps.xml
@@ -215,6 +215,11 @@
<value>lkcf</value>
</enum>
</crypto>
+ <panic supported='yes'>
+ <enum name='model'>
+ <value>pvpanic</value>
+ </enum>
+ </panic>
</devices>
<features>
<gic supported='yes'>
diff --git a/tests/data/capabilities/kvm-loongarch64-domcaps.xml b/tests/data/capabilities/kvm-loongarch64-domcaps.xml
index e9836fec4..d2b348f4c 100644
--- a/tests/data/capabilities/kvm-loongarch64-domcaps.xml
+++ b/tests/data/capabilities/kvm-loongarch64-domcaps.xml
@@ -152,6 +152,11 @@
<value>lkcf</value>
</enum>
</crypto>
+ <panic supported='yes'>
+ <enum name='model'>
+ <value>pvpanic</value>
+ </enum>
+ </panic>
</devices>
<features>
<gic supported='no'/>
diff --git a/tests/data/capabilities/kvm-ppc64le-domcaps.xml b/tests/data/capabilities/kvm-ppc64le-domcaps.xml
index 7d40b12ff..46234fd19 100644
--- a/tests/data/capabilities/kvm-ppc64le-domcaps.xml
+++ b/tests/data/capabilities/kvm-ppc64le-domcaps.xml
@@ -160,6 +160,12 @@
<value>lkcf</value>
</enum>
</crypto>
+ <panic supported='yes'>
+ <enum name='model'>
+ <value>pseries</value>
+ <value>pvpanic</value>
+ </enum>
+ </panic>
</devices>
<features>
<gic supported='no'/>
diff --git a/tests/data/capabilities/kvm-x86_64-domcaps-latest.xml b/tests/data/capabilities/kvm-x86_64-domcaps-latest.xml
index 91fabc5fa..b5e06eda6 100644
--- a/tests/data/capabilities/kvm-x86_64-domcaps-latest.xml
+++ b/tests/data/capabilities/kvm-x86_64-domcaps-latest.xml
@@ -259,6 +259,13 @@
<value>lkcf</value>
</enum>
</crypto>
+ <panic supported='yes'>
+ <enum name='model'>
+ <value>isa</value>
+ <value>hyperv</value>
+ <value>pvpanic</value>
+ </enum>
+ </panic>
</devices>
<features>
<gic supported='no'/>
diff --git a/tests/data/capabilities/qemu-riscv64-domcaps.xml b/tests/data/capabilities/qemu-riscv64-domcaps.xml
index c8a9e5915..30eca7129 100644
--- a/tests/data/capabilities/qemu-riscv64-domcaps.xml
+++ b/tests/data/capabilities/qemu-riscv64-domcaps.xml
@@ -167,6 +167,11 @@
<value>lkcf</value>
</enum>
</crypto>
+ <panic supported='yes'>
+ <enum name='model'>
+ <value>pvpanic</value>
+ </enum>
+ </panic>
</devices>
<features>
<gic supported='no'/>
diff --git a/tests/test_capabilities.py b/tests/test_capabilities.py
index 1ebd564d4..5351c8352 100644
--- a/tests/test_capabilities.py
+++ b/tests/test_capabilities.py
@@ -101,6 +101,7 @@ def testDomainCapabilitiesx86():
assert caps.supports_memorybacking_memfd()
assert caps.supports_redirdev_usb()
assert caps.supports_channel_spicevmc()
+ assert caps.supported_panic_models() == ["isa", "hyperv", "pvpanic"]
xml = open(DATADIR + "/kvm-x86_64-domcaps-amd-sev.xml").read()
caps = DomainCapabilities(utils.URIs.open_testdriver_cached(), xml)
@@ -119,6 +120,7 @@ def testDomainCapabilitiesAArch64():
assert caps.supports_memorybacking_memfd()
assert caps.supports_redirdev_usb()
assert caps.supports_channel_spicevmc()
+ assert caps.supported_panic_models() == ["pvpanic"]
def testDomainCapabilitiesPPC64le():
@@ -137,6 +139,7 @@ def testDomainCapabilitiesPPC64le():
assert caps.supports_memorybacking_memfd()
assert caps.supports_redirdev_usb()
assert not caps.supports_channel_spicevmc()
+ assert caps.supported_panic_models() == ["pseries", "pvpanic"]
def testDomainCapabilitiesRISCV64():
@@ -167,6 +170,7 @@ def testDomainCapabilitiesRISCV64():
assert caps.supports_memorybacking_memfd()
assert caps.supports_redirdev_usb()
assert caps.supports_channel_spicevmc()
+ assert caps.supported_panic_models() == ["pvpanic"]
def testDomainCapabilitiesLoongArch64():
@@ -197,3 +201,4 @@ def testDomainCapabilitiesLoongArch64():
assert caps.supports_memorybacking_memfd()
assert caps.supports_redirdev_usb()
assert caps.supports_channel_spicevmc()
+ assert caps.supported_panic_models() == ["pvpanic"]

View File

@@ -1,25 +0,0 @@
Subject: tests: testdriver: Add filesystem socket example
From: Cole Robinson crobinso@redhat.com Wed Aug 17 10:29:31 2022 -0400
Date: Wed Aug 17 10:29:31 2022 -0400:
Git: 1b87e3e54c782da39cf30b100a22f70c37bfcddd
Signed-off-by: Cole Robinson <crobinso@redhat.com>
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'>

View File

@@ -0,0 +1,29 @@
Subject: addhardware: panic: Fill in model combo with advertised values by libvirt
From: Lin Ma lma@suse.de Tue Dec 3 18:46:28 2024 +0800
Date: Tue Dec 10 14:05:20 2024 +0100:
Git: f92c25749bcd88bb7412c74119b25802327916e6
The commit c5a46646 asks libvirt to fill in a default panic model for us.
Now libvirt domcaps can advertise panic models, Let's fill in the panic
model combo with the advertised values.
Signed-off-by: Lin Ma <lma@suse.de>
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index e6e4ec1d1..0faf30a53 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -860,8 +860,13 @@ class vmmAddHardware(vmmGObjectUI):
def _build_panic_model_combo(self):
+ guest = self.vm.get_xmlobj()
values = [[None, _("Hypervisor default")]]
+ for m in guest.lookup_domcaps().supported_panic_models():
+ values.append([m, m])
+
uiutil.build_simple_combo(self.widget("panic-model"), values)
+ uiutil.set_list_selection(self.widget("panic-model"), None)
def _build_controller_type_combo(self):

View File

@@ -1,45 +0,0 @@
Subject: virtinstall: split no_install conditional apart to track code coverage
From: Cole Robinson crobinso@redhat.com Sat Aug 20 09:42:47 2022 -0400
Date: Sat Aug 20 09:47:49 2022 -0400:
Git: 1cb0be4002445e5755ead2423b5a4e9e06f0a3cb
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>
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -1017,7 +1017,9 @@ c = vinst.add_category("misc-install", "
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
--- a/virtinst/virtinstall.py
+++ b/virtinst/virtinstall.py
@@ -429,11 +429,15 @@ def build_installer(options, guest, inst
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,

View File

@@ -0,0 +1,385 @@
Subject: cli, man: Always list --osinfo before --os-variant
From: Andrea Bolognani abologna@redhat.com Mon Dec 2 19:25:51 2024 +0100
Date: Tue Dec 10 14:06:12 2024 +0100:
Git: c3debb4eda6b251fdad87f1ba5326671bb558d2b
The former is the preferred spelling and it should always be
presented first to the user.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
diff --git a/man/virt-install.rst b/man/virt-install.rst
index 775d7ce70..dc0b6d9cc 100644
--- a/man/virt-install.rst
+++ b/man/virt-install.rst
@@ -1022,7 +1022,7 @@ GUEST OS OPTIONS
================
-``--os-variant``, ``--osinfo``
+``--osinfo``, ``--os-variant``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**Syntax:** ``--osinfo`` [OSNAME|OPT1=VAL1,...]
@@ -1031,7 +1031,7 @@ Optimize the guest configuration for a specific operating system.
For most cases, an OS must be specified or detected from the install
media so performance critical features like virtio can be enabled.
-The simplest usage is ``--os-variant OSNAME`` or ``--osinfo OSNAME``,
+The simplest usage is ``--osinfo OSNAME`` or ``--os-variant OSNAME``,
for example ``--osinfo fedora32``. The supported suboptions are:
``name=``, ``short-id=``
@@ -1076,7 +1076,7 @@ VIRTINSTALL_OSINFO_DISABLE_REQUIRE=1.
Use the command ``virt-install --osinfo list`` to get the list of the
accepted OS variants. See ``osinfo-query os`` for even more output.
-Note: ``--os-variant`` and ``--osinfo`` are aliases for one another.
+Note: ``--osinfo`` and ``--os-variant`` are aliases for one another.
``--osinfo`` is the preferred new style naming.
diff --git a/man/virt-xml.rst b/man/virt-xml.rst
index dfb6fd9fb..7bccffbf9 100644
--- a/man/virt-xml.rst
+++ b/man/virt-xml.rst
@@ -180,7 +180,7 @@ These options decide what action to take after altering the XML. In the common c
GUEST OS OPTIONS
================
-``--os-variant``, ``--osinfo`` OS_VARIANT
+``--osinfo``, ``--os-variant`` OS_VARIANT
Optimize the guest configuration for a specific operating system (ex.
'fedora29', 'rhel7', 'win10'). While not required, specifying this
options is HIGHLY RECOMMENDED, as it can greatly increase performance
@@ -194,7 +194,7 @@ GUEST OS OPTIONS
Use the command ``virt-xml --osinfo list`` to get the list of the
accepted OS variants. See ``osinfo-query os`` for even more output.
- See virt-install(1) documentation for more details about ``--os-variant/--osinfo``
+ See virt-install(1) documentation for more details about ``--osinfo/--os-variant``
CONVERSION OPTIONS
diff --git a/tests/test_cli.py b/tests/test_cli.py
index dc9c156da..51a1883c4 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -1039,8 +1039,8 @@ c.add_compare("--connect %(URI-KVM-X86)s --install fedora26", "osinfo-url") # g
c.add_valid("--location https://foobar.com --os-variant detect=yes,name=win7", nogrep="Please file a bug against virt-install") # os detection succeeds, the fallback warning shouldn't be printed
c.add_valid("--pxe --os-variant detect=yes,name=win7", grep="Please file a bug against virt-install") # os detection fails, so fallback warning should be printed
c.add_valid("--cdrom http://example.com/path/to/some.iso --os-variant detect=yes,require=no", grep="Please file a bug against virt-install") # detection fails with require=no, we should print the error about using fallback name=
-c.add_invalid("--pxe --os-variant detect=yes,require=yes", grep="--os-variant/--osinfo OS name is required") # No os-variant detected, but require=yes
-c.add_invalid("--pxe --osinfo detect=yes", grep="--os-variant/--osinfo OS name is required") # --osinfo detect=on failed, but with implied require=yes
+c.add_invalid("--pxe --os-variant detect=yes,require=yes", grep="--osinfo/--os-variant OS name is required") # No os-variant detected, but require=yes
+c.add_invalid("--pxe --osinfo detect=yes", grep="--osinfo/--os-variant OS name is required") # --osinfo detect=on failed, but with implied require=yes
c.add_invalid("--pxe --virt-type foobar", grep="Host does not support domain type")
c.add_invalid("--pxe --os-variant farrrrrrrge", grep="Unknown OS name")
c.add_invalid("--pxe --boot menu=foobar", grep="menu must be 'yes' or 'no'")
@@ -1409,9 +1409,9 @@ c.add_valid("test-for-virtxml --edit --cpu host-passthrough --no-define --start
c.add_valid("test-for-virtxml --edit --metadata name=test-for-virtxml", grep="requested changes will have no effect")
c.add_valid("--print-diff test-for-virtxml --remove-device --disk boot.order=5", grep="boot order=\"5")
c.add_invalid("test --edit 2 --events on_poweroff=destroy", grep="'--edit 2' doesn't make sense with --events")
-c.add_invalid("test --os-variant fedora26 --edit --cpu host-passthrough", grep="--os-variant/--osinfo is not supported")
-c.add_invalid("test-for-virtxml --os-variant fedora26 --remove-device --disk 1", grep="--os-variant/--osinfo is not supported")
-c.add_invalid("--build-xml --os-variant fedora26 --disk path=foo", grep="--os-variant/--osinfo is not supported")
+c.add_invalid("test --os-variant fedora26 --edit --cpu host-passthrough", grep="--osinfo/--os-variant is not supported")
+c.add_invalid("test-for-virtxml --os-variant fedora26 --remove-device --disk 1", grep="--osinfo/--os-variant is not supported")
+c.add_invalid("--build-xml --os-variant fedora26 --disk path=foo", grep="--osinfo/--os-variant is not supported")
c.add_invalid("domain-idontexist --edit --cpu host-passthrough --start", grep="Could not find domain")
c.add_invalid("test-state-shutoff --edit --update --boot menu=on --start", grep="Cannot use --update")
c.add_invalid("test --edit --update --events on_poweroff=destroy", grep="Don't know how to --update for --events")
diff --git a/virtManager/createvm.py b/virtManager/createvm.py
index d5f49fb70..e37921603 100644
--- a/virtManager/createvm.py
+++ b/virtManager/createvm.py
@@ -103,7 +103,7 @@ class _GuestData:
self.init = None
self.machine = None
- self.os_variant = None
+ self.osinfo = None
self.uefi_requested = None
self.name = None
@@ -138,8 +138,8 @@ class _GuestData:
# If no machine was explicitly selected, we don't overwrite
# it, because we want to
guest.os.machine = self.machine
- if self.os_variant:
- guest.set_os_name(self.os_variant)
+ if self.osinfo:
+ guest.set_os_name(self.osinfo)
if self.uefi_requested:
guest.uefi_requested = self.uefi_requested
@@ -1578,7 +1578,7 @@ class vmmCreateVM(vmmGObjectUI):
self._gdata.cdrom = cdrom
self._gdata.extra_args = extra
self._gdata.livecd = False
- self._gdata.os_variant = osobj and osobj.name or None
+ self._gdata.osinfo = osobj and osobj.name or None
guest = self._gdata.build_guest()
installer = self._gdata.build_installer()
except Exception as e:
diff --git a/virtinst/cli.py b/virtinst/cli.py
index b58717ab2..43d45a508 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -494,7 +494,7 @@ def fail_conflicting(option1, option2):
def _get_completer_parsers():
return VIRT_PARSERS + [ParserCheck, ParserLocation,
ParserUnattended, ParserInstall, ParserCloudInit,
- ParserOSVariant]
+ ParserOSInfo]
def _virtparser_completer(prefix, **kwargs):
@@ -930,7 +930,7 @@ def add_disk_option(stog, editexample=False):
"--disk=?") + editmsg)
-def add_os_variant_option(parser, virtinstall):
+def add_osinfo_option(parser, virtinstall):
osg = parser.add_argument_group(_("OS options"))
if virtinstall:
@@ -942,7 +942,7 @@ def add_os_variant_option(parser, virtinstall):
"Example values: fedora29, rhel7.0, win10, ...\n"
"Use '--osinfo list' to see a full list.")
- osg.add_argument("--os-variant", "--osinfo", help=msg)
+ osg.add_argument("--osinfo", "--os-variant", help=msg)
return osg
@@ -1880,11 +1880,11 @@ def parse_location(optstr):
return parsedata.location, parsedata.kernel, parsedata.initrd
-########################
-# --os-variant parsing #
-########################
+####################
+# --osinfo parsing #
+####################
-class OSVariantData(object):
+class OSInfoData(object):
_REQUIRE_ON = 1
_REQUIRE_AUTO = 3
@@ -1936,8 +1936,8 @@ class OSVariantData(object):
return self._name
-class ParserOSVariant(VirtCLIParser):
- cli_arg_name = "os_variant"
+class ParserOSInfo(VirtCLIParser):
+ cli_arg_name = "osinfo"
supports_clearxml = False
@classmethod
@@ -1956,9 +1956,9 @@ class ParserOSVariant(VirtCLIParser):
return super().parse(inst)
-def parse_os_variant(optstr):
- data = OSVariantData()
- parser = ParserOSVariant(optstr)
+def parse_osinfo(optstr):
+ data = OSInfoData()
+ parser = ParserOSInfo(optstr)
parser.parse(data)
data.validate()
return data
@@ -5051,7 +5051,7 @@ def check_option_introspection(options):
def check_osinfo_list(options):
- if options.os_variant != "list":
+ if options.osinfo != "list":
return False
for osobj in OSDB.list_os():
diff --git a/virtinst/install/installertreemedia.py b/virtinst/install/installertreemedia.py
index 8b208bf50..dc6519eef 100644
--- a/virtinst/install/installertreemedia.py
+++ b/virtinst/install/installertreemedia.py
@@ -29,15 +29,15 @@ def _is_url(url):
class _LocationData(object):
- def __init__(self, os_variant, kernel_pairs, os_media, os_tree):
- self.os_variant = os_variant
+ def __init__(self, osinfo, kernel_pairs, os_media, os_tree):
+ self.osinfo = osinfo
self.kernel_pairs = kernel_pairs
self.os_media = os_media
self.os_tree = os_tree
self.kernel_url_arg = None
- if self.os_variant:
- osobj = OSDB.lookup_os(self.os_variant)
+ if self.osinfo:
+ osobj = OSDB.lookup_os(self.osinfo)
self.kernel_url_arg = osobj.get_kernel_url_arg()
@@ -171,7 +171,7 @@ class InstallerTreeMedia(object):
return self._cached_data
store = None
- os_variant = None
+ osinfo = None
os_media = None
os_tree = None
kernel_paths = []
@@ -187,14 +187,14 @@ class InstallerTreeMedia(object):
if store:
kernel_paths = store.get_kernel_paths()
- os_variant = store.get_osdict_info()
+ osinfo = store.get_osdict_info()
os_media = store.get_os_media()
os_tree = store.get_os_tree()
if has_location_kernel:
kernel_paths = [
(self._location_kernel, self._location_initrd)]
- self._cached_data = _LocationData(os_variant, kernel_paths,
+ self._cached_data = _LocationData(osinfo, kernel_paths,
os_media, os_tree)
return self._cached_data
@@ -236,8 +236,8 @@ class InstallerTreeMedia(object):
self._initrd_injections.append((scriptpath, expected_filename))
def _prepare_kernel_url_arg(self, guest, cache):
- os_variant = cache.os_variant or guest.osinfo.name
- osobj = OSDB.lookup_os(os_variant)
+ osinfo = cache.osinfo or guest.osinfo.name
+ osobj = OSDB.lookup_os(osinfo)
return osobj.get_kernel_url_arg()
def _prepare_kernel_args(self, guest, cache, unattended_scripts):
@@ -304,7 +304,7 @@ class InstallerTreeMedia(object):
def detect_distro(self, guest):
fetcher = self._get_fetcher(guest, None)
cache = self._get_cached_data(guest, fetcher)
- return cache.os_variant
+ return cache.osinfo
def get_os_media(self, guest, meter):
fetcher = self._get_fetcher(guest, meter)
diff --git a/virtinst/virtinstall.py b/virtinst/virtinstall.py
index 15fd6ae9d..e56486055 100644
--- a/virtinst/virtinstall.py
+++ b/virtinst/virtinstall.py
@@ -571,7 +571,7 @@ def installer_detect_distro(guest, installer, osdata):
fail(_("Error validating install location: %s") % str(e))
msg = _(
- "--os-variant/--osinfo OS name is required, but no value was\n"
+ "--osinfo/--os-variant OS name is required, but no value was\n"
"set or detected.")
if os_set:
return
@@ -650,7 +650,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)
+ osdata = cli.parse_osinfo(options.osinfo or installdata.os)
options.boot_was_set = bool(options.boot)
if options.reinstall:
@@ -1076,7 +1076,7 @@ def parse_args():
cli.add_boot_options(insg)
insg.add_argument("--init", help=argparse.SUPPRESS)
- osg = cli.add_os_variant_option(parser, virtinstall=True)
+ osg = cli.add_osinfo_option(parser, virtinstall=True)
osg.add_argument("--os-type", dest="old_os_type", help=argparse.SUPPRESS)
devg = parser.add_argument_group(_("Device Options"))
@@ -1188,8 +1188,8 @@ def set_test_stub_options(options): # pragma: no cover
options.disk = "none"
if not options.graphics:
options.graphics = "none"
- if not options.os_variant:
- options.os_variant = "fedora27"
+ if not options.osinfo:
+ options.osinfo = "fedora27"
def main(conn=None):
diff --git a/virtinst/virtxml.py b/virtinst/virtxml.py
index 6a16532cd..bcd25eb48 100644
--- a/virtinst/virtxml.py
+++ b/virtinst/virtxml.py
@@ -44,11 +44,11 @@ def get_diff(origxml, newxml):
return diff
-def set_os_variant(guest, os_variant):
- if os_variant is None:
+def set_osinfo(guest, osinfo):
+ if osinfo is None:
return
- osdata = cli.parse_os_variant(os_variant)
+ osdata = cli.parse_osinfo(osinfo)
if osdata.get_name():
guest.set_os_name(osdata.get_name())
@@ -97,13 +97,13 @@ class Action:
def validate_action(action, conn, options):
- if options.os_variant is not None:
+ if options.osinfo is not None:
if action.is_edit:
- fail(_("--os-variant/--osinfo is not supported with --edit"))
+ fail(_("--osinfo/--os-variant is not supported with --edit"))
if action.is_remove_device:
- fail(_("--os-variant/--osinfo is not supported with --remove-device"))
+ fail(_("--osinfo/--os-variant is not supported with --remove-device"))
if action.is_build_xml:
- fail(_("--os-variant/--osinfo is not supported with --build-xml"))
+ fail(_("--osinfo/--os-variant is not supported with --build-xml"))
if not action.parserclass.guest_propname and action.is_build_xml:
fail(_("--build-xml not supported for {cli_flag}").format(
@@ -251,11 +251,11 @@ def action_edit(action, guest):
return devs
-def action_add_device(action, guest, os_variant, input_devs):
+def action_add_device(action, guest, osinfo, input_devs):
parserclass = action.parserclass
parservalue = action.parservalue
- set_os_variant(guest, os_variant)
+ set_osinfo(guest, osinfo)
if input_devs:
for dev in input_devs:
@@ -294,7 +294,7 @@ def action_build_xml(action, guest):
def perform_action(action, guest, options, input_devs):
if action.is_add_device:
- return action_add_device(action, guest, options.os_variant, input_devs)
+ return action_add_device(action, guest, options.osinfo, input_devs)
if action.is_remove_device:
return action_remove_device(action, guest)
if action.is_edit:
@@ -483,7 +483,7 @@ def parse_args():
outg.add_argument("--confirm", action="store_true",
help=_("Require confirmation before saving any results."))
- cli.add_os_variant_option(parser, virtinstall=False)
+ cli.add_osinfo_option(parser, virtinstall=False)
conv = parser.add_argument_group(_("Conversion options"))
cli.ParserConvertToQ35.register()

View File

@@ -1,42 +0,0 @@
Subject: virtinstall: fix regression with --boot and no install method
From: Cole Robinson crobinso@redhat.com Sat Aug 20 09:54:01 2022 -0400
Date: Sat Aug 20 09:54:01 2022 -0400:
Git: e94786c066696781a821f5a4bcef3c377e4bc5e5
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>
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -967,6 +967,7 @@ c.add_valid("--os-variant generic --pxe
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
--- a/virtinst/virtinstall.py
+++ b/virtinst/virtinstall.py
@@ -433,7 +433,7 @@ def build_installer(options, guest, inst
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)

View File

@@ -0,0 +1,71 @@
Subject: snapshots: default to same snapshot mode as currently used snapshot
From: Pavel Hrdina phrdina@redhat.com Tue Jan 21 11:09:00 2025 +0100
Date: Mon Jan 27 22:59:56 2025 +0100:
Git: 40d86086b6b903982b5d0f97bd6763fc54bfb115
Using internal and external snapshot mode for the same VM has some
limitations. When creating new snapshot default to the same mode as
already existing currently used snapshot. If there is no existing
snapshot default to external snapshot.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
diff --git a/virtManager/details/snapshots.py b/virtManager/details/snapshots.py
index a4f38de6d..00aa00708 100644
--- a/virtManager/details/snapshots.py
+++ b/virtManager/details/snapshots.py
@@ -138,7 +138,14 @@ class vmmSnapshotNew(vmmGObjectUI):
mode_external = self.widget("snapshot-new-mode-external")
mode_internal = self.widget("snapshot-new-mode-internal")
- if mode_external.is_sensitive():
+ use_external = mode_external.is_sensitive()
+
+ if use_external:
+ current_mode = self._get_current_mode()
+ if current_mode == "internal":
+ use_external = False
+
+ if use_external:
mode_external.set_active(True)
else:
mode_internal.set_active(True)
@@ -342,6 +349,17 @@ class vmmSnapshotNew(vmmGObjectUI):
self.topwin)
progWin.run()
+ def _get_current_mode(self):
+ current = self.vm.get_current_snapshot()
+
+ if current is None:
+ return None
+
+ if current.is_external():
+ return "external"
+
+ return "internal"
+
################
# UI listeners #
diff --git a/virtManager/object/domain.py b/virtManager/object/domain.py
index dbb932162..5aade01d8 100644
--- a/virtManager/object/domain.py
+++ b/virtManager/object/domain.py
@@ -1156,6 +1156,16 @@ class vmmDomain(vmmLibvirtObject):
self._snapshot_list = newlist
return self._snapshot_list[:]
+ def get_current_snapshot(self):
+
+ if self._backend.hasCurrentSnapshot(0):
+ rawsnap = self._backend.snapshotCurrent(0)
+ obj = vmmDomainSnapshot(self.conn, rawsnap)
+ obj.init_libvirt_state()
+ return obj
+
+ return None
+
@vmmLibvirtObject.lifecycle_action
def revert_to_snapshot(self, snap):
# no use trying to set the guest time if is going to be switched off

View File

@@ -1,22 +0,0 @@
Subject: tests: Add a compat check for linux2020 in amd-sev test case
From: Lin Ma lma@suse.com Fri Aug 19 18:18:09 2022 +0800
Date: Sat Aug 20 09:59:27 2022 -0400:
Git: c22a876e9a63cb7114e2b008f2e24682c8bbef3e
It avoids amd-sev test failure if using older osinfo-db.
Signed-off-by: Lin Ma <lma@suse.com>
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'")

View File

@@ -1,117 +0,0 @@
Subject: cli: --cpu: Add maxphysaddr.{mode,bits} options
From: Lin Ma lma@suse.com Fri Aug 19 18:18:50 2022 +0800
Date: Sat Aug 20 10:03:11 2022 -0400:
Git: fbdf05162606e4d70506b65d0dd647a59f229253
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>
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 #

View File

@@ -0,0 +1,28 @@
Subject: snapshots: warn users to not mix snapshot modes
From: Pavel Hrdina phrdina@redhat.com Tue Jan 21 12:11:10 2025 +0100
Date: Mon Jan 27 22:59:56 2025 +0100:
Git: 54dc858f79a973242394aa50c4db7c00385e9f5d
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
diff --git a/virtManager/details/snapshots.py b/virtManager/details/snapshots.py
index 00aa00708..3da7d5aca 100644
--- a/virtManager/details/snapshots.py
+++ b/virtManager/details/snapshots.py
@@ -370,6 +370,16 @@ class vmmSnapshotNew(vmmGObjectUI):
self._populate_memory_path()
def _ok_clicked_cb(self, src):
+ current_mode = self._get_current_mode()
+
+ if current_mode and current_mode != self._get_mode():
+ result = self.err.yes_no(_("Mixing external and internal snapshots for "
+ "the same VM is not recommended. Are you "
+ "sure you want to continue?"))
+
+ if not result:
+ return
+
return self._create_new_snapshot()
def _mode_toggled_cb(self, src):

View File

@@ -1,24 +0,0 @@
Subject: virt-install: --help required options are wrong
From: Cole Robinson crobinso@redhat.com Sun Aug 21 16:08:37 2022 -0400
Date: Sun Aug 21 16:10:55 2022 -0400:
Git: a254ece0f0497d062a0e4c94dc45619649ea4922
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>
--- a/virtinst/virtinstall.py
+++ b/virtinst/virtinstall.py
@@ -1019,7 +1019,7 @@ def xml_to_print(guest, installer, xmlon
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)

View File

@@ -0,0 +1,32 @@
Subject: virtManager: domain: fix indentation
From: Pavel Hrdina phrdina@redhat.com Wed Jan 29 10:50:03 2025 +0100
Date: Wed Jan 29 10:50:03 2025 +0100:
Git: 5ddd3456a0ca9836a98fc6ca4f0b2eaab268bf47
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
diff --git a/virtManager/object/domain.py b/virtManager/object/domain.py
index 5aade01d8..51aae4d8c 100644
--- a/virtManager/object/domain.py
+++ b/virtManager/object/domain.py
@@ -1157,14 +1157,13 @@ class vmmDomain(vmmLibvirtObject):
return self._snapshot_list[:]
def get_current_snapshot(self):
+ if self._backend.hasCurrentSnapshot(0):
+ rawsnap = self._backend.snapshotCurrent(0)
+ obj = vmmDomainSnapshot(self.conn, rawsnap)
+ obj.init_libvirt_state()
+ return obj
- if self._backend.hasCurrentSnapshot(0):
- rawsnap = self._backend.snapshotCurrent(0)
- obj = vmmDomainSnapshot(self.conn, rawsnap)
- obj.init_libvirt_state()
- return obj
-
- return None
+ return None
@vmmLibvirtObject.lifecycle_action
def revert_to_snapshot(self, snap):

View File

@@ -1,85 +0,0 @@
Subject: cloner: Sync <uuid> and <sysinfo> system uuid
From: Cole Robinson crobinso@redhat.com Sun Aug 21 16:21:10 2022 -0400
Date: Sun Aug 21 16:21:10 2022 -0400:
Git: b0d0516736320315a70f74aff3759fb35dd35d9d
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>
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):
"""

View File

@@ -1,34 +0,0 @@
Subject: virt-install: --unattended and --cloud-init conflict
From: Cole Robinson crobinso@redhat.com Sun Aug 21 16:47:26 2022 -0400
Date: Sun Aug 21 16:47:26 2022 -0400:
Git: 999ccb85e3e4189386786256cdf70cf5238cf785
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>
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -1116,6 +1116,7 @@ c.add_invalid("--disk none --boot networ
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")
--- a/virtinst/virtinstall.py
+++ b/virtinst/virtinstall.py
@@ -411,6 +411,9 @@ def build_installer(options, guest, inst
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)

View File

@@ -1,31 +0,0 @@
Subject: virt-install: Reuse cli.fail_conflicting
From: Cole Robinson crobinso@redhat.com Mon Aug 22 10:15:46 2022 -0400
Date: Mon Aug 22 10:16:19 2022 -0400:
Git: 1d64a678d31829051444e1bf29d86f800e13de39
For the --unattended + --cloud-init conflict
Signed-off-by: Cole Robinson <crobinso@redhat.com>
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -1116,7 +1116,7 @@ c.add_invalid("--disk none --boot networ
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")
--- a/virtinst/virtinstall.py
+++ b/virtinst/virtinstall.py
@@ -412,7 +412,7 @@ def build_installer(options, guest, inst
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)

View File

@@ -1,74 +0,0 @@
Subject: cli: support --boot loader.stateless=
From: Cole Robinson crobinso@redhat.com Mon Oct 17 11:54:37 2022 -0400
Date: Mon Oct 17 11:54:37 2022 -0400:
Git: 15ddeae6cb405bad10bc62164b14117646e9127e
Signed-off-by: Cole Robinson <crobinso@redhat.com>
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):

View File

@@ -1,161 +0,0 @@
Subject: diskbackend: Drop support for sheepdog
From: Lin Ma lma@suse.com Wed Nov 2 20:45:43 2022 +0800
Date: Mon Nov 7 10:10:00 2022 -0500:
Git: 4a2df064839f71ed94320771507b1271d041e397
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>
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

View File

@@ -1,249 +0,0 @@
Subject: Fix pylint/pycodestyle warnings with latest versions
From: Cole Robinson crobinso@redhat.com Tue Dec 13 10:51:14 2022 -0500
Date: Tue Dec 13 11:23:45 2022 -0500:
Git: bb1afaba29019605a240a57d6b3ca8eb36341d9b
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/setup.py b/setup.py
index b45d315a..4bf29f25 100755
--- a/setup.py
+++ b/setup.py
@@ -29,7 +29,7 @@ import setuptools.command.install_egg_info
#
# Newer setuptools will transparently support 'import distutils' though.
# That can be overridden with SETUPTOOLS_USE_DISTUTILS env variable
-import distutils.command.build # pylint: disable=wrong-import-order
+import distutils.command.build # pylint: disable=wrong-import-order,deprecated-module
SYSPREFIX = sysconfig.get_config_var("prefix")
diff --git a/tests/test_disk.py b/tests/test_disk.py
index ef065157..9127371b 100644
--- a/tests/test_disk.py
+++ b/tests/test_disk.py
@@ -82,6 +82,7 @@ def test_disk_dir_searchable(monkeypatch):
searchdata = virtinst.DeviceDisk.check_path_search(conn,
tmpdir + "/footest")
assert searchdata.uid == os.getuid()
+ # pylint: disable=use-implicit-booleaness-not-comparison
assert searchdata.fixlist == []
# Remove perms on the tmpdir, now it should report failures
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index 0a8e33d3..aec48dd2 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -371,8 +371,8 @@ class vmmAddHardware(vmmGObjectUI):
msg = _("These changes will take effect after "
"the next guest shutdown.")
- dtype = (hotplug_err and
- Gtk.MessageType.WARNING or Gtk.MessageType.INFO)
+ dtype = (Gtk.MessageType.WARNING if hotplug_err else
+ Gtk.MessageType.INFO)
hotplug_msg = ""
if hotplug_err:
hotplug_msg += (hotplug_err[0] + "\n\n" +
@@ -1560,7 +1560,7 @@ class vmmAddHardware(vmmGObjectUI):
controller_num = [x for x in controllers if
(x.type == controller_type)]
if len(controller_num) > 0:
- index_new = max([x.index for x in controller_num]) + 1
+ index_new = max(x.index for x in controller_num) + 1
dev.index = index_new
dev.type = controller_type
diff --git a/virtManager/details/sshtunnels.py b/virtManager/details/sshtunnels.py
index 9afc1e13..cb7ca7c0 100644
--- a/virtManager/details/sshtunnels.py
+++ b/virtManager/details/sshtunnels.py
@@ -22,7 +22,7 @@ class ConnectionInfo(object):
"""
def __init__(self, conn, gdev):
self.gtype = gdev.type
- self.gport = gdev.port and str(gdev.port) or None
+ self.gport = str(gdev.port) if gdev.port else None
self.gsocket = (gdev.listens and gdev.listens[0].socket) or gdev.socket
self.gaddr = gdev.listen or "127.0.0.1"
self.gtlsport = gdev.tlsPort or None
diff --git a/virtManager/lib/statsmanager.py b/virtManager/lib/statsmanager.py
index 28495495..ece130ab 100644
--- a/virtManager/lib/statsmanager.py
+++ b/virtManager/lib/statsmanager.py
@@ -66,7 +66,7 @@ class _VMStatsList(vmmGObject):
expected = self.config.get_stats_history_length()
current = len(self._stats)
if current > expected: # pragma: no cover
- del(self._stats[expected:current])
+ del self._stats[expected:current]
def _calculate_rate(record_name):
ret = 0.0
diff --git a/virtManager/object/domain.py b/virtManager/object/domain.py
index 2d6f5bca..1570b952 100644
--- a/virtManager/object/domain.py
+++ b/virtManager/object/domain.py
@@ -1306,10 +1306,10 @@ class vmmDomain(vmmLibvirtObject):
def get_arch(self):
return self.get_xmlobj().os.arch
def get_init(self):
- import pipes
+ import shlex
init = self.get_xmlobj().os.init
initargs = " ".join(
- [pipes.quote(i.val) for i in self.get_xmlobj().os.initargs])
+ [shlex.quote(i.val) for i in self.get_xmlobj().os.initargs])
return init, initargs
def get_emulator(self):
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 8dbffeb6..7615f743 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -85,7 +85,7 @@ class VirtHelpFormatter(argparse.RawDescriptionHelpFormatter):
'''
oldwrap = None
- # pylint: disable=arguments-differ
+ # pylint: disable=arguments-differ,protected-access
def _split_lines(self, *args, **kwargs):
def return_default():
return argparse.RawDescriptionHelpFormatter._split_lines(
@@ -1690,7 +1690,7 @@ def convert_old_force(options):
if options.force:
if not options.check:
options.check = "all=off"
- del(options.force)
+ del options.force
class ParserCheck(VirtCLIParser):
@@ -2281,7 +2281,7 @@ class ParserCPU(VirtCLIParser):
policy = "disable"
if policy:
- del(self.optdict[key])
+ del self.optdict[key]
converted[policy].append(key[1:])
self.optdict.update(converted)
@@ -2753,7 +2753,7 @@ class ParserBoot(VirtCLIParser):
if cliname not in inst.BOOT_DEVICES:
continue
- del(self.optdict[cliname])
+ del self.optdict[cliname]
if cliname not in boot_order:
boot_order.append(cliname)
diff --git a/virtinst/domcapabilities.py b/virtinst/domcapabilities.py
index d22ce6a2..1b5b6bf6 100644
--- a/virtinst/domcapabilities.py
+++ b/virtinst/domcapabilities.py
@@ -334,7 +334,7 @@ class DomainCapabilities(XMLBuilder):
"""
Return True if we know how to setup UEFI for the passed arch
"""
- return self.arch in list(self._uefi_arch_patterns.keys())
+ return self.arch in self._uefi_arch_patterns
def supports_uefi_loader(self):
"""
diff --git a/virtinst/pollhelpers.py b/virtinst/pollhelpers.py
index ef695914..f9fcc3fa 100644
--- a/virtinst/pollhelpers.py
+++ b/virtinst/pollhelpers.py
@@ -32,7 +32,7 @@ def _new_poll_helper(origmap, typename, list_cb, build_cb, support_cb):
else:
# Previously known object
current[name] = origmap[name]
- del(origmap[name])
+ del origmap[name]
return (list(origmap.values()), list(new.values()), list(current.values()))
diff --git a/virtinst/virtinstall.py b/virtinst/virtinstall.py
index 8fcc8ce1..130c8e28 100644
--- a/virtinst/virtinstall.py
+++ b/virtinst/virtinstall.py
@@ -67,7 +67,7 @@ def check_cdrom_option_error(options):
def convert_old_printxml(options):
if options.xmlstep:
options.xmlonly = options.xmlstep
- del(options.xmlstep)
+ del options.xmlstep
def convert_old_sound(options):
@@ -135,10 +135,10 @@ def convert_old_disks(options):
else:
_do_convert_old_disks(options)
- del(options.file_paths)
- del(options.disksize)
- del(options.sparse)
- del(options.nodisks)
+ del options.file_paths
+ del options.disksize
+ del options.sparse
+ del options.nodisks
log.debug("Distilled --disk options: %s", options.disk)
@@ -147,7 +147,7 @@ def convert_old_os_options(options):
return
log.warning(
_("--os-type is deprecated and does nothing. Please stop using it."))
- del(options.old_os_type)
+ del options.old_os_type
def convert_old_memory(options):
@@ -204,9 +204,9 @@ def convert_old_networks(options):
networks[idx] = networks[idx].replace(prefix + ":",
prefix + "=")
- del(options.mac)
- del(options.bridge)
- del(options.nonetworks)
+ del options.mac
+ del options.bridge
+ del options.nonetworks
options.network = networks
log.debug("Distilled --network options: %s", options.network)
@@ -224,7 +224,7 @@ def convert_old_graphics(options):
if graphics and (vnc or sdl or keymap or vncport or vnclisten):
fail(_("Cannot mix --graphics and old style graphical options"))
- optnum = sum([bool(g) for g in [vnc, nographics, sdl, graphics]])
+ optnum = sum(bool(g) for g in [vnc, nographics, sdl, graphics])
if optnum > 1:
raise ValueError(_("Can't specify more than one of VNC, SDL, "
"--graphics or --nographics"))
diff --git a/virtinst/xmlbuilder.py b/virtinst/xmlbuilder.py
index 07a9e319..dd78038e 100644
--- a/virtinst/xmlbuilder.py
+++ b/virtinst/xmlbuilder.py
@@ -262,9 +262,9 @@ class XMLProperty(_XMLPropertyBase):
self._is_onoff = is_onoff
self._do_abspath = do_abspath
- conflicts = sum([int(bool(i)) for i in
+ conflicts = sum(int(bool(i)) for i in
[self._is_bool, self._is_int,
- self._is_yesno, self._is_onoff]])
+ self._is_yesno, self._is_onoff])
if conflicts > 1:
raise xmlutil.DevError("Conflict property converter options.")
@@ -343,7 +343,7 @@ class XMLProperty(_XMLPropertyBase):
propstore = xmlbuilder._propstore
if self.propname in propstore:
- del(propstore[self.propname])
+ del propstore[self.propname]
propstore[self.propname] = val
def _nonxml_fget(self, xmlbuilder):

View File

@@ -1,19 +0,0 @@
Subject: tests: cpio: set owner to 0:0
From: Weijia Wang 9713184+wegank@users.noreply.github.com Sat Aug 6 19:00:07 2022 +0000
Date: Tue Dec 13 13:45:16 2022 -0500:
Git: 75a25e37660c5578587f4a7a75917cf98d77cf7e
diff --git a/virtinst/install/installerinject.py b/virtinst/install/installerinject.py
index 0b2a9bc5..98d88cf8 100644
--- a/virtinst/install/installerinject.py
+++ b/virtinst/install/installerinject.py
@@ -20,7 +20,7 @@ def _run_initrd_commands(initrd, tempdir):
stderr=subprocess.PIPE,
cwd=tempdir)
cpio_proc = subprocess.Popen(['cpio', '--create', '--null', '--quiet',
- '--format=newc', '--owner=root:root'],
+ '--format=newc', '--owner=0:0'],
stdin=find_proc.stdout,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,

View File

@@ -1,28 +0,0 @@
Subject: addhardware: Fix backtrace when controller.index is None
From: Cole Robinson crobinso@redhat.com Tue Dec 13 13:49:35 2022 -0500
Date: Tue Dec 13 13:49:35 2022 -0500:
Git: 67832d3097cd6451833c30452d6991896e05933c
When creating a new VM, in the customize wizard we can't depend on
index= value being set (virtinst doesn't do it for example).
For example, this causes a backtrace when adding two virtio-scsi
controllers via the Customize wizard, or adding an extra
virtio-scsi controller to an aarch64 CDROM install.
Reported-by: Charles Arnold <carnold@suse.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index aec48dd2..a1dd3261 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -1560,7 +1560,7 @@ class vmmAddHardware(vmmGObjectUI):
controller_num = [x for x in controllers if
(x.type == controller_type)]
if len(controller_num) > 0:
- index_new = max(x.index for x in controller_num) + 1
+ index_new = max(int(x.index or 0) for x in controller_num) + 1
dev.index = index_new
dev.type = controller_type

View File

@@ -1,492 +0,0 @@
Subject: Clean up FileChooser usage a bit
From: Cole Robinson crobinso@redhat.com Tue Dec 13 15:09:35 2022 -0500
Date: Wed Dec 14 12:31:17 2022 -0500:
Git: cbc5b897077671a675faf48603d9714527d84c83
* Move browse_reason handling entirely into storagebrowser.py
* Open code some of the browse_local logic at the few callers
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index a1dd3261..df902374 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -1590,8 +1590,8 @@ class vmmAddHardware(vmmGObjectUI):
textent.set_text(path)
reason = (isdir and
- self.config.CONFIG_DIR_FS or
- self.config.CONFIG_DIR_IMAGE)
+ vmmStorageBrowser.REASON_FS or
+ vmmStorageBrowser.REASON_IMAGE)
if self._storagebrowser is None:
self._storagebrowser = vmmStorageBrowser(self.conn)
diff --git a/virtManager/config.py b/virtManager/config.py
index 8379697c..2c81b061 100644
--- a/virtManager/config.py
+++ b/virtManager/config.py
@@ -133,51 +133,6 @@ class _SettingsWrapper(object):
class vmmConfig(object):
- # key names for saving last used paths
- CONFIG_DIR_IMAGE = "image"
- CONFIG_DIR_ISO_MEDIA = "isomedia"
- CONFIG_DIR_FLOPPY_MEDIA = "floppymedia"
- CONFIG_DIR_SCREENSHOT = "screenshot"
- CONFIG_DIR_FS = "fs"
-
- # Metadata mapping for browse types. Prob shouldn't go here, but works
- # for now.
- browse_reason_data = {
- CONFIG_DIR_IMAGE: {
- "enable_create": True,
- "storage_title": _("Locate or create storage volume"),
- "local_title": _("Locate existing storage"),
- "dialog_type": Gtk.FileChooserAction.SAVE,
- "choose_button": Gtk.STOCK_OPEN,
- "gsettings_key": "image",
- },
-
- CONFIG_DIR_SCREENSHOT: {
- "gsettings_key": "screenshot",
- },
-
- CONFIG_DIR_ISO_MEDIA: {
- "enable_create": False,
- "storage_title": _("Locate ISO media volume"),
- "local_title": _("Locate ISO media"),
- "gsettings_key": "media",
- },
-
- CONFIG_DIR_FLOPPY_MEDIA: {
- "enable_create": False,
- "storage_title": _("Locate floppy media volume"),
- "local_title": _("Locate floppy media"),
- "gsettings_key": "media",
- },
-
- CONFIG_DIR_FS: {
- "enable_create": False,
- "storage_title": _("Locate directory volume"),
- "local_title": _("Locate directory volume"),
- "dialog_type": Gtk.FileChooserAction.SELECT_FOLDER,
- },
- }
-
CONSOLE_SCALE_NEVER = 0
CONSOLE_SCALE_FULLSCREEN = 1
CONSOLE_SCALE_ALWAYS = 2
@@ -627,23 +582,15 @@ class vmmConfig(object):
# Default directory location dealings
- def get_default_directory(self, conn, _type):
- ignore = conn
- browsedata = self.browse_reason_data.get(_type, {})
- key = browsedata.get("gsettings_key", None)
- path = None
-
- if key:
- path = self.conf.get("/paths/%s-default" % key)
-
- log.debug("directory for type=%s returning=%s", _type, path)
+ def get_default_directory(self, gsettings_key):
+ path = self.conf.get("/paths/%s-default" % gsettings_key)
+ log.debug("directory for gsettings_key=%s returning=%s",
+ gsettings_key, path)
return path
- def set_default_directory(self, folder, _type):
- browsedata = self.browse_reason_data.get(_type, {})
- key = browsedata.get("gsettings_key", None)
- if not key:
+ def set_default_directory(self, gsettings_key, folder):
+ if not folder or folder.startswith("/dev"):
return # pragma: no cover
-
- log.debug("saving directory for type=%s to %s", key, folder)
- self.conf.set("/paths/%s-default" % key, folder)
+ log.debug("saving directory for gsettings_key=%s to %s",
+ gsettings_key, folder)
+ self.conf.set("/paths/%s-default" % gsettings_key, folder)
diff --git a/virtManager/createpool.py b/virtManager/createpool.py
index 66457b51..a3e9a99a 100644
--- a/virtManager/createpool.py
+++ b/virtManager/createpool.py
@@ -381,9 +381,8 @@ class vmmCreatePool(vmmGObjectUI):
self._show_options_by_pool()
def _browse_source_cb(self, src):
- source = self.err.browse_local(self.conn,
+ source = self.err.browse_local(
_("Choose source path"),
- dialog_type=Gtk.FileChooserAction.OPEN,
start_folder="/dev")
if source:
self.widget("pool-source-path").get_child().set_text(source)
@@ -394,7 +393,7 @@ class vmmCreatePool(vmmGObjectUI):
if current:
startfolder = os.path.dirname(current)
- target = self.err.browse_local(self.conn,
+ target = self.err.browse_local(
_("Choose target directory"),
dialog_type=Gtk.FileChooserAction.SELECT_FOLDER,
start_folder=startfolder)
diff --git a/virtManager/createvm.py b/virtManager/createvm.py
index 7e5ded68..95aff71b 100644
--- a/virtManager/createvm.py
+++ b/virtManager/createvm.py
@@ -1280,11 +1280,11 @@ class vmmCreateVM(vmmGObjectUI):
def _browse_file(self, cbwidget, cb=None, is_media=False, is_dir=False):
if is_media:
- reason = self.config.CONFIG_DIR_ISO_MEDIA
+ reason = vmmStorageBrowser.REASON_ISO_MEDIA
elif is_dir:
- reason = self.config.CONFIG_DIR_FS
+ reason = vmmStorageBrowser.REASON_FS
else:
- reason = self.config.CONFIG_DIR_IMAGE
+ reason = vmmStorageBrowser.REASON_IMAGE
if cb:
callback = cb
diff --git a/virtManager/createvol.py b/virtManager/createvol.py
index 58453038..ea82964a 100644
--- a/virtManager/createvol.py
+++ b/virtManager/createvol.py
@@ -208,7 +208,7 @@ class vmmCreateVolume(vmmGObjectUI):
self._storage_browser.set_finish_cb(cb)
self._storage_browser.topwin.set_modal(self.topwin.get_modal())
self._storage_browser.set_browse_reason(
- self.config.CONFIG_DIR_IMAGE)
+ vmmStorageBrowser.REASON_IMAGE)
self._storage_browser.show(self.topwin)
diff --git a/virtManager/details/details.py b/virtManager/details/details.py
index 757e18ad..1970d0aa 100644
--- a/virtManager/details/details.py
+++ b/virtManager/details/details.py
@@ -1089,7 +1089,7 @@ class vmmDetails(vmmGObjectUI):
def _browse_file(self, callback, reason=None):
if not reason:
- reason = self.config.CONFIG_DIR_IMAGE
+ reason = vmmStorageBrowser.REASON_IMAGE
if self.storage_browser is None:
self.storage_browser = vmmStorageBrowser(self.conn)
@@ -1235,9 +1235,9 @@ class vmmDetails(vmmGObjectUI):
def _disk_source_browse_clicked_cb(self, src):
disk = self._get_hw_row()[HW_LIST_COL_DEVICE]
if disk.is_floppy():
- reason = self.config.CONFIG_DIR_FLOPPY_MEDIA
+ reason = vmmStorageBrowser.REASON_FLOPPY_MEDIA
else:
- reason = self.config.CONFIG_DIR_ISO_MEDIA
+ reason = vmmStorageBrowser.REASON_ISO_MEDIA
def cb(ignore, path):
self._mediacombo.set_path(path)
diff --git a/virtManager/device/fsdetails.py b/virtManager/device/fsdetails.py
index b9956e1d..555c745a 100644
--- a/virtManager/device/fsdetails.py
+++ b/virtManager/device/fsdetails.py
@@ -268,8 +268,8 @@ class vmmFSDetails(vmmGObjectUI):
textent.set_text(path)
reason = (isdir and
- self.config.CONFIG_DIR_FS or
- self.config.CONFIG_DIR_IMAGE)
+ vmmStorageBrowser.REASON_FS or
+ vmmStorageBrowser.REASON_IMAGE)
if self._storage_browser is None:
self._storage_browser = vmmStorageBrowser(self.conn)
diff --git a/virtManager/error.py b/virtManager/error.py
index 8d78efae..593c89ca 100644
--- a/virtManager/error.py
+++ b/virtManager/error.py
@@ -3,6 +3,7 @@
# This work is licensed under the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.
+import os
import sys
import textwrap
import traceback
@@ -231,49 +232,38 @@ class vmmErrorDialog(vmmGObject):
return response
- def browse_local(self, conn, dialog_name, start_folder=None,
+ def browse_local(self, dialog_name, start_folder=None,
_type=None, dialog_type=None,
- browse_reason=None,
- choose_button=None, default_name=None):
+ choose_button=None, default_name=None,
+ confirm_overwrite=False):
"""
Helper function for launching a filechooser
@dialog_name: String to use in the title bar of the filechooser.
- @conn: vmmConnection used by calling class
@start_folder: Folder the filechooser is viewing at startup
@_type: File extension to filter by (e.g. "iso", "png")
@dialog_type: Maps to FileChooserDialog 'action'
- @browse_reason: The vmmConfig.CONFIG_DIR* reason we are browsing.
- If set, this will override the 'folder' parameter with the gsettings
- value, and store the user chosen path.
"""
- import os
-
- # Initial setup
- overwrite_confirm = False
- dialog_type = dialog_type or Gtk.FileChooserAction.OPEN
-
- if dialog_type == Gtk.FileChooserAction.SAVE:
- if choose_button is None:
- choose_button = Gtk.STOCK_SAVE
- overwrite_confirm = True
-
+ if dialog_type is None:
+ dialog_type = Gtk.FileChooserAction.OPEN
if choose_button is None:
choose_button = Gtk.STOCK_OPEN
+ buttons = (Gtk.STOCK_CANCEL,
+ Gtk.ResponseType.CANCEL,
+ choose_button,
+ Gtk.ResponseType.ACCEPT)
+
fcdialog = Gtk.FileChooserDialog(title=dialog_name,
parent=self.get_parent(),
action=dialog_type,
- buttons=(Gtk.STOCK_CANCEL,
- Gtk.ResponseType.CANCEL,
- choose_button,
- Gtk.ResponseType.ACCEPT))
+ buttons=buttons)
fcdialog.set_default_response(Gtk.ResponseType.ACCEPT)
if default_name:
fcdialog.set_current_name(default_name)
- fcdialog.set_do_overwrite_confirmation(overwrite_confirm)
+ fcdialog.set_do_overwrite_confirmation(confirm_overwrite)
# Set file match pattern (ex. *.png)
if _type is not None:
@@ -289,11 +279,6 @@ class vmmErrorDialog(vmmGObject):
f.set_name(name)
fcdialog.set_filter(f)
- # Set initial dialog folder
- if browse_reason:
- start_folder = self.config.get_default_directory(
- conn, browse_reason)
-
if start_folder is not None:
if os.access(start_folder, os.R_OK):
fcdialog.set_current_folder(start_folder)
@@ -304,10 +289,6 @@ class vmmErrorDialog(vmmGObject):
ret = fcdialog.get_filename()
fcdialog.destroy()
- # Store the chosen directory in gsettings if necessary
- if ret and browse_reason and not ret.startswith("/dev"):
- self.config.set_default_directory(
- os.path.dirname(ret), browse_reason)
return ret
diff --git a/virtManager/storagebrowse.py b/virtManager/storagebrowse.py
index b5fa9a2e..c5a26519 100644
--- a/virtManager/storagebrowse.py
+++ b/virtManager/storagebrowse.py
@@ -4,6 +4,10 @@
# This work is licensed under the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.
+import os
+
+from gi.repository import Gtk
+
from virtinst import log
from .lib import uiutil
@@ -11,15 +15,53 @@ from .baseclass import vmmGObjectUI
from .hoststorage import vmmHostStorage
+class _BrowseReasonMetadata:
+ def __init__(self, browse_reason):
+ self.enable_create = False
+ self.storage_title = None
+ self.local_title = None
+ self.gsettings_key = None
+ self.dialog_type = None
+
+ if browse_reason == vmmStorageBrowser.REASON_IMAGE:
+ self.enable_create = True
+ self.local_title = _("Locate existing storage")
+ self.storage_title = _("Locate or create storage volume")
+ self.dialog_type = Gtk.FileChooserAction.SAVE
+ self.gsettings_key = "image"
+
+ if browse_reason == vmmStorageBrowser.REASON_ISO_MEDIA:
+ self.local_title = _("Locate ISO media")
+ self.storage_title = _("Locate ISO media volume")
+ self.gsettings_key = "media"
+
+ if browse_reason == vmmStorageBrowser.REASON_FLOPPY_MEDIA:
+ self.local_title = _("Locate floppy media")
+ self.storage_title = _("Locate floppy media volume")
+ self.gsettings_key = "media"
+
+ if browse_reason == vmmStorageBrowser.REASON_FS:
+ self.local_title = _("Locate directory volume")
+ self.storage_title = _("Locate directory volume")
+ self.dialog_type = Gtk.FileChooserAction.SELECT_FOLDER
+
+ if browse_reason is None:
+ self.enable_create = True
+ self.storage_title = _("Choose Storage Volume")
+
+
class vmmStorageBrowser(vmmGObjectUI):
+ REASON_IMAGE = "image"
+ REASON_ISO_MEDIA = "isomedia"
+ REASON_FLOPPY_MEDIA = "floppymedia"
+ REASON_FS = "fs"
+
def __init__(self, conn):
vmmGObjectUI.__init__(self, "storagebrowse.ui", "vmm-storage-browse")
self.conn = conn
self._first_run = False
self._finish_cb = None
-
- # Passed to browse_local
self._browse_reason = None
self.storagelist = vmmHostStorage(self.conn, self.builder, self.topwin,
@@ -103,15 +145,10 @@ class vmmStorageBrowser(vmmGObjectUI):
def set_browse_reason(self, reason):
self._browse_reason = reason
- data = self.config.browse_reason_data.get(self._browse_reason, {})
- allow_create = True
- title = _("Choose Storage Volume")
- if data:
- allow_create = data["enable_create"]
- title = data["storage_title"]
+ data = _BrowseReasonMetadata(self._browse_reason)
- self.topwin.set_title(title)
- self.storagelist.widget("vol-add").set_sensitive(allow_create)
+ self.topwin.set_title(data.storage_title)
+ self.storagelist.widget("vol-add").set_sensitive(data.enable_create)
#############
@@ -128,7 +165,7 @@ class vmmStorageBrowser(vmmGObjectUI):
self._finish(volume.get_target_path())
def _vol_sensitive_cb(self, fmt):
- if ((self._browse_reason == self.config.CONFIG_DIR_FS) and
+ if ((self._browse_reason == vmmStorageBrowser.REASON_FS) and
fmt != 'dir'):
return False
return True
@@ -139,22 +176,27 @@ class vmmStorageBrowser(vmmGObjectUI):
####################
def _browse_local(self):
- dialog_type = None
- dialog_name = None
- choose_button = None
-
- data = self.config.browse_reason_data.get(self._browse_reason)
- if data:
- dialog_name = data["local_title"] or None
- dialog_type = data.get("dialog_type")
- choose_button = data.get("choose_button")
-
- filename = self.err.browse_local(self.conn,
- dialog_type=dialog_type, browse_reason=self._browse_reason,
- dialog_name=dialog_name, choose_button=choose_button)
- if filename:
- log.debug("Browse local chose path=%s", filename)
- self._finish(filename)
+ data = _BrowseReasonMetadata(self._browse_reason)
+ gsettings_key = data.gsettings_key
+
+ if gsettings_key:
+ start_folder = self.config.get_default_directory(gsettings_key)
+
+ filename = self.err.browse_local(
+ dialog_type=data.dialog_type,
+ dialog_name=data.local_title,
+ start_folder=start_folder)
+
+ if not filename:
+ return
+
+ log.debug("Browse local chose path=%s", filename)
+
+ if gsettings_key:
+ self.config.set_default_directory(
+ gsettings_key, os.path.dirname(filename))
+
+ self._finish(filename)
def _finish(self, path):
if self._finish_cb:
diff --git a/virtManager/vmwindow.py b/virtManager/vmwindow.py
index 3ac4a6a4..d5549454 100644
--- a/virtManager/vmwindow.py
+++ b/virtManager/vmwindow.py
@@ -548,24 +548,31 @@ class vmmVMWindow(vmmGObjectUI):
ret = ret.buffer # pragma: no cover
import datetime
+ import os
now = str(datetime.datetime.now()).split(".")[0].replace(" ", "_")
default = "Screenshot_%s_%s.png" % (self.vm.get_name(), now)
- path = self.err.browse_local(
- self.vm.conn, _("Save Virtual Machine Screenshot"),
+ start_folder = self.config.get_default_directory("screenshot")
+
+ filename = self.err.browse_local(
+ _("Save Virtual Machine Screenshot"),
_type=("png", _("PNG files")),
dialog_type=Gtk.FileChooserAction.SAVE,
- browse_reason=self.config.CONFIG_DIR_SCREENSHOT,
- default_name=default)
- if not path: # pragma: no cover
+ choose_button=Gtk.STOCK_SAVE,
+ start_folder=start_folder,
+ default_name=default,
+ confirm_overwrite=True)
+ if not filename: # pragma: no cover
log.debug("No screenshot path given, skipping save.")
return
- filename = path
if not filename.endswith(".png"):
filename += ".png" # pragma: no cover
open(filename, "wb").write(ret)
+ self.config.set_default_directory(
+ "screenshot", os.path.dirname(filename))
+
########################
# Details page refresh #

View File

@@ -1,51 +0,0 @@
Subject: guest: Query availability of usb redirdevs in domcaps
From: Lin Ma lma@suse.com Thu Nov 10 15:57:08 2022 +0800
Date: Wed Dec 14 12:44:54 2022 -0500:
Git: 8cc6ee8da36d518ec928c072822bbee6ebe2e362
Signed-off-by: Lin Ma <lma@suse.com>
diff --git a/virtinst/domcapabilities.py b/virtinst/domcapabilities.py
index 1b5b6bf6..91f51f9f 100644
--- a/virtinst/domcapabilities.py
+++ b/virtinst/domcapabilities.py
@@ -113,6 +113,7 @@ class _Devices(_CapsBlock):
graphics = XMLChildProperty(_make_capsblock("graphics"), is_single=True)
tpm = XMLChildProperty(_make_capsblock("tpm"), is_single=True)
filesystem = XMLChildProperty(_make_capsblock("filesystem"), is_single=True)
+ redirdev = XMLChildProperty(_make_capsblock("redirdev"), is_single=True)
class _Features(_CapsBlock):
@@ -448,6 +449,18 @@ class DomainCapabilities(XMLBuilder):
return self.devices.graphics.get_enum("type").has_value("spice")
+ def supports_redirdev_usb(self):
+ """
+ Return False if libvirt explicitly advertises no support for
+ USB redirect
+ """
+ if self.devices.redirdev.supported is None:
+ # Follow the original behavior in case of talking to older
+ # libvirt.
+ return True
+
+ return self.devices.redirdev.get_enum("bus").has_value("usb")
+
def supports_filesystem_virtiofs(self):
"""
Return True if libvirt advertises support for virtiofs
diff --git a/virtinst/guest.py b/virtinst/guest.py
index e6636022..1d1e2ee9 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -1155,6 +1155,8 @@ class Guest(XMLBuilder):
self.add_device(dev)
def _add_spice_usbredir(self):
+ if not self.lookup_domcaps().supports_redirdev_usb():
+ return
if self.skip_default_usbredir:
return
if self.devices.redirdev:

View File

@@ -0,0 +1,88 @@
Subject: cli: Add --memdev target.dynamicMemslots support for virtio-mem
From: Lin Ma lma@suse.de Sun Jan 5 17:46:04 2025 +0800
Date: Wed Jan 29 10:25:37 2025 +0100:
Git: 8564ace73a9a2b596c9206d16833904be993c6c2
Libvirt supports setting dynamicMemslots attribute for virtio-mem since
v10.1.0, Let's add it into virt-install. Eg:
virt-install \
......
--vcpu 2 \
--cpu cell0.cpus=0,cell0.memory=4194304,\
cell1.cpus=1,cell1.memory=4194304 \
--memory maxMemory=65536,maxMemory.slots=8 \
--memdev model=virtio-mem,\
target.node=0,\
target.block=2048,\
target.size=8192,\
target.dynamicMemslots=yes \
......
It results in the following domain XML snippet:
<memory model='virtio-mem'>
<target dynamicMemslots='yes'>
......
</memory>
Signed-off-by: Lin Ma <lma@suse.de>
diff --git a/tests/data/cli/compare/virt-install-memory-hotplug.xml b/tests/data/cli/compare/virt-install-memory-hotplug.xml
index 61e39ee02..37fa23328 100644
--- a/tests/data/cli/compare/virt-install-memory-hotplug.xml
+++ b/tests/data/cli/compare/virt-install-memory-hotplug.xml
@@ -123,7 +123,7 @@
</target>
</memory>
<memory model="virtio-mem">
- <target>
+ <target dynamicMemslots="yes">
<size>524288</size>
<node>0</node>
<block>2048</block>
@@ -267,7 +267,7 @@
</target>
</memory>
<memory model="virtio-mem">
- <target>
+ <target dynamicMemslots="yes">
<size>524288</size>
<node>0</node>
<block>2048</block>
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 51a1883c4..7f3ba0c3a 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -928,7 +928,7 @@ c.add_compare("--pxe "
"address.type=dimm,address.base=0x100000000,address.slot=1,"
"source.pmem=on,source.alignsize=2048,target.readonly=on "
-"--memdev virtio-mem,target_node=0,target.block=2048,"
+"--memdev virtio-mem,target_node=0,target.block=2048,target.dynamicMemslots=yes,"
"target_size=512,target.requested=524288,target.address_base=0x180000000 "
"--memdev virtio-pmem,source.path=/tmp/virtio_pmem,"
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 43d45a508..cecf33be1 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -4502,6 +4502,7 @@ class ParserMemdev(VirtCLIParser):
cls.add_arg("source.pmem", "source.pmem", is_onoff=True)
cls.add_arg("source.alignsize", "source.alignsize",
cb=cls.set_target_size)
+ cls.add_arg("target.dynamicMemslots", "target.dynamicMemslots")
########################
diff --git a/virtinst/devices/memory.py b/virtinst/devices/memory.py
index edc274e00..c74d7ab9d 100644
--- a/virtinst/devices/memory.py
+++ b/virtinst/devices/memory.py
@@ -20,6 +20,7 @@ class _DeviceMemoryTarget(XMLBuilder):
requested = XMLProperty("./requested", is_int=True)
current = XMLProperty("./current", is_int=True)
address_base = XMLProperty("./address/@base")
+ dynamicMemslots = XMLProperty("./@dynamicMemslots", is_yesno=True)
class _DeviceMemorySource(XMLBuilder):

View File

@@ -1,51 +0,0 @@
Subject: guest: Query availability of spicevmc channels in domcaps
From: Lin Ma lma@suse.com Thu Nov 10 15:57:24 2022 +0800
Date: Wed Dec 14 12:44:54 2022 -0500:
Git: 180154d752a33f6b26643184e6aa19dcb110e0eb
Signed-off-by: Lin Ma <lma@suse.com>
diff --git a/virtinst/domcapabilities.py b/virtinst/domcapabilities.py
index 91f51f9f..db08bf65 100644
--- a/virtinst/domcapabilities.py
+++ b/virtinst/domcapabilities.py
@@ -114,6 +114,7 @@ class _Devices(_CapsBlock):
tpm = XMLChildProperty(_make_capsblock("tpm"), is_single=True)
filesystem = XMLChildProperty(_make_capsblock("filesystem"), is_single=True)
redirdev = XMLChildProperty(_make_capsblock("redirdev"), is_single=True)
+ channel = XMLChildProperty(_make_capsblock("channel"), is_single=True)
class _Features(_CapsBlock):
@@ -449,6 +450,18 @@ class DomainCapabilities(XMLBuilder):
return self.devices.graphics.get_enum("type").has_value("spice")
+ def supports_channel_spicevmc(self):
+ """
+ Return False if libvirt explicitly advertises no support for
+ spice channel
+ """
+ if self.devices.channel.supported is None:
+ # Follow the original behavior in case of talking to older
+ # libvirt.
+ return True
+
+ return self.devices.channel.get_enum("type").has_value("spicevmc")
+
def supports_redirdev_usb(self):
"""
Return False if libvirt explicitly advertises no support for
diff --git a/virtinst/guest.py b/virtinst/guest.py
index 1d1e2ee9..c2244ae3 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -1127,6 +1127,8 @@ class Guest(XMLBuilder):
self.add_device(ctrl)
def _add_spice_channels(self):
+ if not self.lookup_domcaps().supports_channel_spicevmc():
+ return
if self.skip_default_channel:
return
for chn in self.devices.channel:

View File

@@ -0,0 +1,90 @@
Subject: cli: add target.memReserve for pci-bridge and pcie-root-port controllers
From: Lin Ma lma@suse.de Sun Jan 5 17:47:20 2025 +0800
Date: Wed Jan 29 10:25:37 2025 +0100:
Git: 79c333e3643cdef3a24672f4b6f0f34d5aa178fd
Libvirt(since v10.3.0) supports setting memReserve attribute to pci-bridge
and pcie-root-port, Let's add it into virt-install. Eg:
virt-install \
......
--controller pci,index=0,model=pcie-root \
--controller pci,index=1,model=pcie-root-port,target.memReserve=8196 \
--controller pci,index=2,model=dmi-to-pci-bridge \
--controller pci,index=3,model=pci-bridge,target.memReserve=8196 \
......
It results in the following domain XML snippet:
<controller type='pci' index='0' model='pcie-root'>
<alias name='pcie.0'/>
</controller>
<controller type='pci' index='1' model='pcie-root-port'>
<model name='pcie-root-port'/>
<target chassis='1' port='0x10' memReserve='8196'/>
<alias name='pci.1'/>
<address type='pci' ....../>
</controller>
<controller type='pci' index='2' model='dmi-to-pci-bridge'>
<model name='i82801b11-bridge'/>
<alias name='pci.2'/>
<address type='pci' ....../>
</controller>
<controller type='pci' index='3' model='pci-bridge'>
<model name='pci-bridge'/>
<target chassisNr='3' memReserve='8196'/>
<alias name='pci.3'/>
<address type='pci' ....../>
</controller>
Signed-off-by: Lin Ma <lma@suse.de>
diff --git a/tests/data/cli/compare/virt-install-many-devices.xml b/tests/data/cli/compare/virt-install-many-devices.xml
index 251dc1cb3..d91e4c849 100644
--- a/tests/data/cli/compare/virt-install-many-devices.xml
+++ b/tests/data/cli/compare/virt-install-many-devices.xml
@@ -483,7 +483,7 @@
<target index="1"/>
</controller>
<controller type="pci" index="2" model="pci-bridge">
- <target chassisNr="1"/>
+ <target chassisNr="1" memReserve="8196"/>
</controller>
<controller type="pci" index="3" model="pci-expander-bus">
<target busNr="252">
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 7f3ba0c3a..4a980dbac 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -685,7 +685,7 @@ source.reservations.managed=no,source.reservations.source.type=unix,source.reser
--controller xenbus,maxGrantFrames=64
--controller pci,index=0,model=pcie-root-port,target.chassis=1,target.port=1,target.hotplug=off
--controller pci,index=1,model=pci-root,target.index=1
---controller pci,index=2,model=pci-bridge,target.chassisNr=1
+--controller pci,index=2,model=pci-bridge,target.chassisNr=1,target.memReserve=8196
--controller pci,index=3,model=pci-expander-bus,target.busNr=252,target.node=1
--controller usb3
--controller scsi,model=virtio-scsi
diff --git a/virtinst/cli.py b/virtinst/cli.py
index cecf33be1..33235bf37 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -4199,6 +4199,7 @@ class ParserController(VirtCLIParser):
cls.add_arg("target.busNr", "target_busNr")
cls.add_arg("target.index", "target_index")
cls.add_arg("target.node", "target_node")
+ cls.add_arg("target.memReserve", "target_memReserve")
cls.add_arg("address", None, lookup_cb=None, cb=cls.set_address_cb)
cls.add_arg("num_pcie_root_ports", None, lookup_cb=None, cb=cls.noset_cb)
diff --git a/virtinst/devices/controller.py b/virtinst/devices/controller.py
index 57c94fe48..c45b8e08d 100644
--- a/virtinst/devices/controller.py
+++ b/virtinst/devices/controller.py
@@ -85,6 +85,7 @@ class DeviceController(Device):
target_busNr = XMLProperty("./target/@busNr", is_int=True)
target_index = XMLProperty("./target/@index", is_int=True)
target_node = XMLProperty("./target/node", is_int=True)
+ target_memReserve = XMLProperty("./target/@memReserve", is_int=True)
def _get_attached_disk_devices(self, guest):
ret = []

View File

@@ -1,20 +0,0 @@
Subject: tests: Add domcaps coverage for usb-redir/spicevmc channel checks
From: Lin Ma lma@suse.com Thu Nov 10 15:57:43 2022 +0800
Date: Wed Dec 14 12:44:54 2022 -0500:
Git: c313209455b2c5fd34560f469af4737a6c8e6fdb
Signed-off-by: Lin Ma <lma@suse.com>
diff --git a/tests/test_capabilities.py b/tests/test_capabilities.py
index d102e51b..70c9de6f 100644
--- a/tests/test_capabilities.py
+++ b/tests/test_capabilities.py
@@ -92,6 +92,8 @@ def testDomainCapabilitiesx86():
assert caps.supports_filesystem_virtiofs()
assert caps.supports_memorybacking_memfd()
+ assert caps.supports_redirdev_usb()
+ assert caps.supports_channel_spicevmc()
xml = open(DATADIR + "/kvm-x86_64-domcaps-amd-sev.xml").read()
caps = DomainCapabilities(utils.URIs.open_testdriver_cached(), xml)

View File

@@ -0,0 +1,73 @@
Subject: cli: Add --disk driver.queue_size support
From: Lin Ma lma@suse.de Sun Jan 5 17:49:34 2025 +0800
Date: Wed Jan 29 10:25:37 2025 +0100:
Git: 36d00e0e79f3d845522201c4a353d5a529af82a7
Eg:
virt-install \
......
--disk /tmp/disk0.qcow2,size=10,driver.type=qcow2,\
driver.queues=4,driver.queue_size=256 \
......
It results in the following domain XML snippet:
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' queues='4' queue_size='256'/>
<source file='/tmp/disk0.qcow2' index='2'/>
<backingStore/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
</disk>
Signed-off-by: Lin Ma <lma@suse.de>
diff --git a/tests/data/cli/compare/virt-install-many-devices.xml b/tests/data/cli/compare/virt-install-many-devices.xml
index d91e4c849..eb26d316b 100644
--- a/tests/data/cli/compare/virt-install-many-devices.xml
+++ b/tests/data/cli/compare/virt-install-many-devices.xml
@@ -231,7 +231,7 @@
<devices>
<emulator>/new/emu</emulator>
<disk type="block" device="disk">
- <driver name="qemu" type="raw" cache="writeback" discard="unmap" io="threads" iothread="3" queues="8"/>
+ <driver name="qemu" type="raw" cache="writeback" discard="unmap" io="threads" iothread="3" queues="8" queue_size="256"/>
<source dev="/pool-dir/UPPER"/>
<target dev="vda" bus="virtio"/>
<serial>WD-WMAP9A966149</serial>
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 4a980dbac..071a17bee 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -610,7 +610,7 @@ msrs.unknown=ignore
--sysinfo bios.vendor="Acme LLC",bios.version=1.2.3,bios.date=01/01/1970,bios.release=10.22,system.manufacturer="Acme Inc.",system.product=Computer,system.version=3.2.1,system.serial=123456789,system.uuid=00000000-1111-2222-3333-444444444444,system.sku=abc-123,system.family=Server,baseBoard.manufacturer="Acme Corp.",baseBoard.product=Motherboard,baseBoard.version=A01,baseBoard.serial=1234-5678,baseBoard.asset=Tag,baseBoard.location=Chassis
---disk type=block,source.dev=/pool-dir/UPPER,cache=writeback,io=threads,perms=sh,serial=WD-WMAP9A966149,wwn=123456789abcdefa,boot_order=2,driver.iothread=3,driver.queues=8
+--disk type=block,source.dev=/pool-dir/UPPER,cache=writeback,io=threads,perms=sh,serial=WD-WMAP9A966149,wwn=123456789abcdefa,boot_order=2,driver.iothread=3,driver.queues=8,driver.queue_size=256
--disk source.file=%(NEWIMG1)s,sparse=false,size=.001,perms=ro,error_policy=enospace,detect_zeroes=unmap,address.type=drive,address.controller=0,address.target=2,address.unit=0
--disk device=cdrom,bus=sata,read_bytes_sec=1,read_iops_sec=2,write_bytes_sec=5,write_iops_sec=6,driver.copy_on_read=on,geometry.cyls=16383,geometry.heads=16,geometry.secs=63,geometry.trans=lba,discard=ignore
--disk size=1
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 33235bf37..7df2e365f 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -3778,6 +3778,7 @@ class ParserDisk(VirtCLIParser):
cls.add_arg("driver.queues", "driver_queues")
cls.add_arg("driver.error_policy", "error_policy")
cls.add_arg("driver.discard_no_unref", "driver_discard_no_unref", is_onoff=True)
+ cls.add_arg("driver.queue_size", "driver_queue_size")
cls.add_arg("driver.metadata_cache.max_size",
"driver_metadata_cache_max_size")
diff --git a/virtinst/devices/disk.py b/virtinst/devices/disk.py
index 1f9358b84..9370fcd87 100644
--- a/virtinst/devices/disk.py
+++ b/virtinst/devices/disk.py
@@ -509,6 +509,7 @@ class DeviceDisk(Device):
driver_iothread = XMLProperty("./driver/@iothread", is_int=True)
driver_queues = XMLProperty("./driver/@queues", is_int=True)
driver_discard_no_unref = XMLProperty("./driver/@discard_no_unref", is_onoff=True)
+ driver_queue_size = XMLProperty("./driver/@queue_size", is_int=True)
driver_metadata_cache_max_size = XMLProperty(
"./driver/metadata_cache/max_size", is_int=True)

View File

@@ -1,264 +0,0 @@
Subject: tests: Update to latest kvm domcaps
From: Cole Robinson crobinso@redhat.com Wed Dec 14 12:44:13 2022 -0500
Date: Wed Dec 14 12:45:05 2022 -0500:
Git: b5d6dfaa0dab6c65b3ae4264e62302f2d93a69d4
And add some test coverage exclusions, needed for previous patches
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/tests/data/capabilities/kvm-x86_64-domcaps-latest.xml b/tests/data/capabilities/kvm-x86_64-domcaps-latest.xml
index ee586e1a..ebcc9ec4 100644
--- a/tests/data/capabilities/kvm-x86_64-domcaps-latest.xml
+++ b/tests/data/capabilities/kvm-x86_64-domcaps-latest.xml
@@ -1,7 +1,7 @@
<domainCapabilities>
<path>/usr/bin/qemu-system-x86_64</path>
<domain>kvm</domain>
- <machine>pc-q35-6.1</machine>
+ <machine>pc-q35-7.0</machine>
<arch>x86_64</arch>
<vcpu max='288'/>
<iothreads supported='yes'/>
@@ -12,6 +12,8 @@
<loader supported='yes'>
<value>/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd</value>
<value>/usr/share/edk2/ovmf/OVMF_CODE.fd</value>
+ <value>/usr/share/edk2/ovmf/OVMF.amdsev.fd</value>
+ <value>/usr/share/edk2/ovmf/OVMF.inteltdx.fd</value>
<enum name='type'>
<value>rom</value>
<value>pflash</value>
@@ -40,91 +42,91 @@
</enum>
</mode>
<mode name='host-model' supported='yes'>
- <model fallback='forbid'>Cooperlake</model>
+ <model fallback='forbid'>Skylake-Client-IBRS</model>
<vendor>Intel</vendor>
<feature policy='require' name='ss'/>
<feature policy='require' name='vmx'/>
<feature policy='require' name='pdcm'/>
<feature policy='require' name='hypervisor'/>
<feature policy='require' name='tsc_adjust'/>
- <feature policy='require' name='mpx'/>
+ <feature policy='require' name='clflushopt'/>
<feature policy='require' name='umip'/>
+ <feature policy='require' name='pku'/>
<feature policy='require' name='md-clear'/>
+ <feature policy='require' name='stibp'/>
+ <feature policy='require' name='arch-capabilities'/>
+ <feature policy='require' name='ssbd'/>
<feature policy='require' name='xsaves'/>
+ <feature policy='require' name='pdpe1gb'/>
<feature policy='require' name='invtsc'/>
<feature policy='require' name='ibpb'/>
<feature policy='require' name='ibrs'/>
<feature policy='require' name='amd-stibp'/>
<feature policy='require' name='amd-ssbd'/>
+ <feature policy='require' name='rdctl-no'/>
+ <feature policy='require' name='ibrs-all'/>
+ <feature policy='require' name='skip-l1dfl-vmentry'/>
+ <feature policy='require' name='mds-no'/>
+ <feature policy='require' name='pschange-mc-no'/>
<feature policy='disable' name='hle'/>
<feature policy='disable' name='rtm'/>
- <feature policy='disable' name='avx512f'/>
- <feature policy='disable' name='avx512dq'/>
- <feature policy='disable' name='clwb'/>
- <feature policy='disable' name='avx512cd'/>
- <feature policy='disable' name='avx512bw'/>
- <feature policy='disable' name='avx512vl'/>
- <feature policy='disable' name='avx512vnni'/>
- <feature policy='disable' name='avx-vnni'/>
- <feature policy='disable' name='avx512-bf16'/>
- <feature policy='disable' name='taa-no'/>
</mode>
<mode name='custom' supported='yes'>
- <model usable='yes'>qemu64</model>
- <model usable='yes'>qemu32</model>
- <model usable='no'>phenom</model>
- <model usable='yes'>pentium3</model>
- <model usable='yes'>pentium2</model>
- <model usable='yes'>pentium</model>
- <model usable='yes'>n270</model>
- <model usable='yes'>kvm64</model>
- <model usable='yes'>kvm32</model>
- <model usable='yes'>coreduo</model>
- <model usable='yes'>core2duo</model>
- <model usable='no'>athlon</model>
- <model usable='yes'>Westmere-IBRS</model>
- <model usable='yes'>Westmere</model>
- <model usable='no'>Snowridge</model>
- <model usable='no'>Skylake-Server-noTSX-IBRS</model>
- <model usable='no'>Skylake-Server-IBRS</model>
- <model usable='no'>Skylake-Server</model>
- <model usable='yes'>Skylake-Client-noTSX-IBRS</model>
- <model usable='no'>Skylake-Client-IBRS</model>
- <model usable='no'>Skylake-Client</model>
- <model usable='yes'>SandyBridge-IBRS</model>
- <model usable='yes'>SandyBridge</model>
- <model usable='yes'>Penryn</model>
- <model usable='no'>Opteron_G5</model>
- <model usable='no'>Opteron_G4</model>
- <model usable='no'>Opteron_G3</model>
- <model usable='yes'>Opteron_G2</model>
- <model usable='yes'>Opteron_G1</model>
- <model usable='yes'>Nehalem-IBRS</model>
- <model usable='yes'>Nehalem</model>
- <model usable='yes'>IvyBridge-IBRS</model>
- <model usable='yes'>IvyBridge</model>
- <model usable='no'>Icelake-Server-noTSX</model>
- <model usable='no'>Icelake-Server</model>
- <model usable='no' deprecated='yes'>Icelake-Client-noTSX</model>
- <model usable='no' deprecated='yes'>Icelake-Client</model>
- <model usable='yes'>Haswell-noTSX-IBRS</model>
- <model usable='yes'>Haswell-noTSX</model>
- <model usable='no'>Haswell-IBRS</model>
- <model usable='no'>Haswell</model>
- <model usable='no'>EPYC-Rome</model>
- <model usable='no'>EPYC-Milan</model>
- <model usable='no'>EPYC-IBPB</model>
- <model usable='no'>EPYC</model>
- <model usable='no'>Dhyana</model>
- <model usable='no'>Cooperlake</model>
- <model usable='yes'>Conroe</model>
- <model usable='no'>Cascadelake-Server-noTSX</model>
- <model usable='no'>Cascadelake-Server</model>
- <model usable='yes'>Broadwell-noTSX-IBRS</model>
- <model usable='yes'>Broadwell-noTSX</model>
- <model usable='no'>Broadwell-IBRS</model>
- <model usable='no'>Broadwell</model>
- <model usable='yes'>486</model>
+ <model usable='yes' vendor='unknown'>qemu64</model>
+ <model usable='yes' vendor='unknown'>qemu32</model>
+ <model usable='no' vendor='AMD'>phenom</model>
+ <model usable='yes' vendor='unknown'>pentium3</model>
+ <model usable='yes' vendor='unknown'>pentium2</model>
+ <model usable='yes' vendor='unknown'>pentium</model>
+ <model usable='yes' vendor='Intel'>n270</model>
+ <model usable='yes' vendor='unknown'>kvm64</model>
+ <model usable='yes' vendor='unknown'>kvm32</model>
+ <model usable='yes' vendor='Intel'>coreduo</model>
+ <model usable='yes' vendor='Intel'>core2duo</model>
+ <model usable='no' vendor='AMD'>athlon</model>
+ <model usable='yes' vendor='Intel'>Westmere-IBRS</model>
+ <model usable='yes' vendor='Intel'>Westmere</model>
+ <model usable='no' vendor='Intel'>Snowridge</model>
+ <model usable='no' vendor='Intel'>Skylake-Server-noTSX-IBRS</model>
+ <model usable='no' vendor='Intel'>Skylake-Server-IBRS</model>
+ <model usable='no' vendor='Intel'>Skylake-Server</model>
+ <model usable='yes' vendor='Intel'>Skylake-Client-noTSX-IBRS</model>
+ <model usable='no' vendor='Intel'>Skylake-Client-IBRS</model>
+ <model usable='no' vendor='Intel'>Skylake-Client</model>
+ <model usable='yes' vendor='Intel'>SandyBridge-IBRS</model>
+ <model usable='yes' vendor='Intel'>SandyBridge</model>
+ <model usable='yes' vendor='Intel'>Penryn</model>
+ <model usable='no' vendor='AMD'>Opteron_G5</model>
+ <model usable='no' vendor='AMD'>Opteron_G4</model>
+ <model usable='no' vendor='AMD'>Opteron_G3</model>
+ <model usable='yes' vendor='AMD'>Opteron_G2</model>
+ <model usable='yes' vendor='AMD'>Opteron_G1</model>
+ <model usable='yes' vendor='Intel'>Nehalem-IBRS</model>
+ <model usable='yes' vendor='Intel'>Nehalem</model>
+ <model usable='yes' vendor='Intel'>IvyBridge-IBRS</model>
+ <model usable='yes' vendor='Intel'>IvyBridge</model>
+ <model usable='no' vendor='Intel'>Icelake-Server-noTSX</model>
+ <model usable='no' vendor='Intel'>Icelake-Server</model>
+ <model usable='no' deprecated='yes' vendor='Intel'>Icelake-Client-noTSX</model>
+ <model usable='no' deprecated='yes' vendor='Intel'>Icelake-Client</model>
+ <model usable='yes' vendor='Intel'>Haswell-noTSX-IBRS</model>
+ <model usable='yes' vendor='Intel'>Haswell-noTSX</model>
+ <model usable='no' vendor='Intel'>Haswell-IBRS</model>
+ <model usable='no' vendor='Intel'>Haswell</model>
+ <model usable='no' vendor='AMD'>EPYC-Rome</model>
+ <model usable='no' vendor='AMD'>EPYC-Milan</model>
+ <model usable='no' vendor='AMD'>EPYC-IBPB</model>
+ <model usable='no' vendor='AMD'>EPYC</model>
+ <model usable='no' vendor='Hygon'>Dhyana</model>
+ <model usable='no' vendor='Intel'>Cooperlake</model>
+ <model usable='yes' vendor='Intel'>Conroe</model>
+ <model usable='no' vendor='Intel'>Cascadelake-Server-noTSX</model>
+ <model usable='no' vendor='Intel'>Cascadelake-Server</model>
+ <model usable='yes' vendor='Intel'>Broadwell-noTSX-IBRS</model>
+ <model usable='yes' vendor='Intel'>Broadwell-noTSX</model>
+ <model usable='no' vendor='Intel'>Broadwell-IBRS</model>
+ <model usable='no' vendor='Intel'>Broadwell</model>
+ <model usable='yes' vendor='unknown'>486</model>
</mode>
</cpu>
<memoryBacking supported='yes'>
@@ -161,6 +163,7 @@
<value>vnc</value>
<value>spice</value>
<value>egl-headless</value>
+ <value>dbus</value>
</enum>
</graphics>
<video supported='yes'>
@@ -191,10 +194,7 @@
<value>scsi</value>
</enum>
<enum name='capsType'/>
- <enum name='pciBackend'>
- <value>default</value>
- <value>vfio</value>
- </enum>
+ <enum name='pciBackend'/>
</hostdev>
<rng supported='yes'>
<enum name='model'>
@@ -224,7 +224,23 @@
<value>passthrough</value>
<value>emulator</value>
</enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ <value>2.0</value>
+ </enum>
</tpm>
+ <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>
</devices>
<features>
<gic supported='no'/>
@@ -233,6 +249,7 @@
<backingStoreInput supported='yes'/>
<backup supported='yes'/>
<sev supported='no'/>
+ <sgx supported='no'/>
</features>
</domainCapabilities>
diff --git a/virtinst/guest.py b/virtinst/guest.py
index c2244ae3..123abfb2 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -1128,7 +1128,7 @@ class Guest(XMLBuilder):
def _add_spice_channels(self):
if not self.lookup_domcaps().supports_channel_spicevmc():
- return
+ return # pragma: no cover
if self.skip_default_channel:
return
for chn in self.devices.channel:
@@ -1158,7 +1158,7 @@ class Guest(XMLBuilder):
def _add_spice_usbredir(self):
if not self.lookup_domcaps().supports_redirdev_usb():
- return
+ return # pragma: no cover
if self.skip_default_usbredir:
return
if self.devices.redirdev:

View File

@@ -0,0 +1,89 @@
Subject: cli: Add 'poll' settings for iothread
From: Lin Ma lma@suse.de Sun Jan 5 17:50:42 2025 +0800
Date: Wed Jan 29 10:25:37 2025 +0100:
Git: a7c455f4600c6a35820c435d34f05b8b4a513611
Since libvirt v9.4.0, It introduces 'poll' settings in domain XML to
override the hypervisor-default interval of polling for iothread.
Let's add it into virt-install.
Eg:
virt-install \
...... \
--iothreads iothreads=2,\
iothreadids.iothread0.id=1,\
iothreadids.iothread1.id=2,\
iothreadids.iothread1.poll.max=123,\
iothreadids.iothread1.poll.grow=456,\
iothreadids.iothread1.poll.shrink=789
It results in the following domain XML snippet:
<iothreads>2</iothreads>
<iothreadids>
<iothread id='1'/>
<iothread id='2'>
<poll max='123' grow='456' shrink='789'/>
</iothread>
</iothreadids>
Signed-off-by: Lin Ma <lma@suse.de>
diff --git a/tests/data/cli/compare/virt-install-many-devices.xml b/tests/data/cli/compare/virt-install-many-devices.xml
index eb26d316b..a841a380f 100644
--- a/tests/data/cli/compare/virt-install-many-devices.xml
+++ b/tests/data/cli/compare/virt-install-many-devices.xml
@@ -12,7 +12,9 @@
<iothreads>5</iothreads>
<iothreadids>
<iothread id="1"/>
- <iothread id="2" thread_pool_min="8" thread_pool_max="16"/>
+ <iothread id="2" thread_pool_min="8" thread_pool_max="16">
+ <poll max="123" grow="456" shrink="789"/>
+ </iothread>
</iothreadids>
<defaultiothread thread_pool_min="4" thread_pool_max="32"/>
<memory>65536</memory>
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 071a17bee..7f984cf1b 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -557,7 +557,7 @@ memorytune0.vcpus=0-3,memorytune0.node0.id=0,memorytune0.node0.bandwidth=60
--memorybacking size=1,unit='G',nodeset=0,1,nosharepages=yes,locked=yes,discard=yes,allocation.mode=immediate,access_mode=shared,source_type=file,hugepages.page.size=12,hugepages.page1.size=1234,hugepages.page1.unit=MB,hugepages.page1.nodeset=2,allocation.threads=8
---iothreads iothreads=5,iothreadids.iothread0.id=1,iothreadids.iothread1.id=2,iothreadids.iothread1.thread_pool_min=8,iothreadids.iothread1.thread_pool_max=16,defaultiothread.thread_pool_min=4,defaultiothread.thread_pool_max=32
+--iothreads iothreads=5,iothreadids.iothread0.id=1,iothreadids.iothread1.id=2,iothreadids.iothread1.thread_pool_min=8,iothreadids.iothread1.thread_pool_max=16,iothreadids.iothread1.poll.max=123,iothreadids.iothread1.poll.grow=456,iothreadids.iothread1.poll.shrink=789,defaultiothread.thread_pool_min=4,defaultiothread.thread_pool_max=32
--metadata title=my-title,description=my-description,uuid=00000000-1111-2222-3333-444444444444,genid=e9392370-2917-565e-692b-d057f46512d6,genid_enable=yes
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 7df2e365f..fa6145e8c 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -2693,6 +2693,12 @@ class ParserIOThreads(VirtCLIParser):
find_inst_cb=cls.defaultiothread_find_inst_cb)
cls.add_arg("defaultiothread.thread_pool_max", "thread_pool_max",
find_inst_cb=cls.defaultiothread_find_inst_cb)
+ cls.add_arg("iothreadids.iothread[0-9]*.poll.max",
+ "max", find_inst_cb=cls.iothreads_find_inst_cb)
+ cls.add_arg("iothreadids.iothread[0-9]*.poll.grow",
+ "grow", find_inst_cb=cls.iothreads_find_inst_cb)
+ cls.add_arg("iothreadids.iothread[0-9]*.poll.shrink",
+ "shrink", find_inst_cb=cls.iothreads_find_inst_cb)
###################
diff --git a/virtinst/guest.py b/virtinst/guest.py
index 567359073..ae76a1287 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -72,6 +72,9 @@ class _IOThreadID(XMLBuilder):
id = XMLProperty("./@id", is_int=True)
thread_pool_min = XMLProperty("./@thread_pool_min", is_int=True)
thread_pool_max = XMLProperty("./@thread_pool_max", is_int=True)
+ max = XMLProperty("./poll/@max", is_int=True)
+ grow = XMLProperty("./poll/@grow", is_int=True)
+ shrink = XMLProperty("./poll/@shrink", is_int=True)
class _DefaultIOThread(XMLBuilder):

View File

@@ -1,109 +0,0 @@
Subject: progress: Fix showing correct final total
From: Cole Robinson crobinso@redhat.com Wed Dec 14 12:57:10 2022 -0500
Date: Wed Dec 14 13:01:48 2022 -0500:
Git: 4114fa1aa827b836d3a1d11c2ac2d367c9bb0463
Reproducer:
Reproducer:
./virt-install --connect test:///default \
--location tests/data/fakemedia/fake-f26-netinst.iso
Before:
Starting install...
Retrieving 'vmlinuz' | 0 B 00:00:00 ...
Retrieving 'initrd.img' | 0 B 00:00:00 ...
After:
Starting install...
Retrieving 'vmlinuz' | 9 B 00:00:00 ...
Retrieving 'initrd.img' | 9 B 00:00:00 ...
progress.end() currently only reports the total amount of bytes
that were last written to the UI. It should report the total amount
that's been passed to update().
Reported-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/tests/data/meter/meter1.txt b/tests/data/meter/meter1.txt
index a3f7c7d2..7e154c97 100644
--- a/tests/data/meter/meter1.txt
+++ b/tests/data/meter/meter1.txt
@@ -9,4 +9,4 @@ Meter text test 20% [=== ] 413 B/s | 2.0 kB 00:19 ETA
Meter text test 40% [======- ] 731 B/s | 3.9 kB 00:08 ETA
-Meter text test | 3.9 kB 00:04 ...
+Meter text test | 4.4 kB 00:04 ...
diff --git a/tests/data/meter/meter2.txt b/tests/data/meter/meter2.txt
index 93e93dc3..7ccc3163 100644
--- a/tests/data/meter/meter2.txt
+++ b/tests/data/meter/meter2.txt
@@ -9,4 +9,4 @@ Meter text test 20% [=======
Meter text test 40% [============== ] 731 B/s | 3.9 kB 00:00:08 ETA
-Meter text test | 3.9 kB 00:00:04 ...
+Meter text test | 4.4 kB 00:00:04 ...
diff --git a/tests/data/meter/meter3.txt b/tests/data/meter/meter3.txt
index 474e40f7..6f66608f 100644
--- a/tests/data/meter/meter3.txt
+++ b/tests/data/meter/meter3.txt
@@ -4,4 +4,4 @@ Meter text test 67 B/s | 200 B 00:02
Meter text test 413 B/s | 2.0 kB 00:03
Meter text test 731 B/s | 3.9 kB 00:04
-Meter text test | 3.9 kB 00:04
+Meter text test | 4.4 kB 00:04
diff --git a/tests/data/meter/meter5.txt b/tests/data/meter/meter5.txt
index 1d232a5d..7142a971 100644
--- a/tests/data/meter/meter5.txt
+++ b/tests/data/meter/meter5.txt
@@ -9,4 +9,4 @@ Meter text test 1000% [================] 413 B/s | 2.0 kB --:-- ETA
Meter text test 2000% [================] 731 B/s | 3.9 kB --:-- ETA
-Meter text test | 3.9 kB 00:04 !!!
+Meter text test | 4.4 kB 00:04 !!!
diff --git a/tests/data/meter/meter6.txt b/tests/data/meter/meter6.txt
index 07d99bfd..dd5d3d47 100644
--- a/tests/data/meter/meter6.txt
+++ b/tests/data/meter/meter6.txt
@@ -9,4 +9,4 @@ Meter text test 100% [================] 413 B/s | 2.0 kB --:-- ETA
Meter text test 100% [================] 731 B/s | 3.9 kB --:-- ETA
-Meter text test | 3.9 kB 00:04
+Meter text test | 4.4 kB 00:04
diff --git a/tests/test_misc.py b/tests/test_misc.py
index aa610f4d..20f5a626 100644
--- a/tests/test_misc.py
+++ b/tests/test_misc.py
@@ -178,7 +178,9 @@ def test_misc_meter():
m.update(2000)
with unittest.mock.patch("time.time", return_value=5.0):
m.update(4000)
- with unittest.mock.patch("time.time", return_value=6.0):
+ with unittest.mock.patch("time.time", return_value=5.1):
+ m.update(4500)
+ with unittest.mock.patch("time.time", return_value=5.5):
m.end()
# Basic output testing
diff --git a/virtinst/_progresspriv.py b/virtinst/_progresspriv.py
index 5a31a18c..a035c9c4 100644
--- a/virtinst/_progresspriv.py
+++ b/virtinst/_progresspriv.py
@@ -112,10 +112,10 @@ class BaseMeter:
assert type(amount_read) is int
now = time.time()
+ self.last_amount_read = amount_read
+ self.re.update(amount_read, now)
if (not self.last_update_time or
(now >= self.last_update_time + self.update_period)):
- self.re.update(amount_read, now)
- self.last_amount_read = amount_read
self.last_update_time = now
self._do_update(amount_read)

View File

@@ -0,0 +1,34 @@
Subject: test_cli: Fix a pycodestyle E261 issue
From: Lin Ma lma@suse.de Mon Dec 30 19:38:49 2024 +0800
Date: Wed Jan 29 10:48:57 2025 +0100:
Git: 006ce4157665fd183ddb4a933a2c94de217302d4
root@localhost:~ # meson test -C build
==================================== 1/3 =========================
test: pycodestyle
start time: 14:08:14
duration: 5.80s
result: exit status 1
command: MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:...... \
/usr/bin/pycodestyle \
--config setup.cfg --format pylint tests virtinst virtManager
----------------------------------- stdout -----------------------------------
tests/test_cli.py:1157: [E261] at least two spaces before inline comment
......
Signed-off-by: Lin Ma <lma@suse.de>
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 7f984cf1b..5fc0a1c2f 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -1153,7 +1153,7 @@ c.add_compare("--os-variant http://fedoraproject.org/fedora/20 --disk %(EXISTIMG
c.add_compare("--cdrom %(EXISTIMG2)s --file %(EXISTIMG1)s --os-variant win2k3 --sound --controller usb", "kvm-win2k3-cdrom") # HVM windows install with disk
c.add_compare("--os-variant name=ubuntusaucy --nodisks --boot cdrom --virt-type qemu --cpu Penryn --input tablet --boot uefi --graphics vnc", "qemu-plain") # plain qemu
c.add_compare("--os-variant fedora20 --nodisks --boot network --graphics default --arch i686 --rng none", "qemu-32-on-64", prerun_check=has_old_osinfo) # 32 on 64
-c.add_compare("--osinfo linux2020 --pxe --cpu maximum", "linux2020", prerun_check=no_osinfo_linux2020_virtio) # also --cpu maximum
+c.add_compare("--osinfo linux2020 --pxe --cpu maximum", "linux2020", prerun_check=no_osinfo_linux2020_virtio) # also --cpu maximum
c.add_compare("--check disk_size=off --osinfo win11 --cdrom %(EXISTIMG1)s", "win11", prerun_check=no_osinfo_win11)
c.add_compare("--check disk_size=off --osinfo win11 --cdrom %(EXISTIMG1)s --boot uefi=off", "win11-no-uefi")
c.add_compare("--osinfo generic --disk none --location %(ISO-NO-OS)s,kernel=frib.img,initrd=/frob.img", "location-manual-kernel", prerun_check=missing_xorriso) # --location with an unknown ISO but manually specified kernel paths

View File

@@ -1,27 +0,0 @@
Subject: virtinstall: Fix the allocating disk size printed by the progress bar
From: Toshiki Sonoda sonoda.toshiki@fujitsu.com Wed Nov 9 18:33:56 2022 +0900
Date: Wed Dec 14 13:07:26 2022 -0500:
Git: 39c7a443146433766e4e71e48ab59145c74924b3
When a sparse file is created during a disk allocation,
virt-install prints not the created disk size but a sparse file size.
Therefore, we fix to print the created disk size during disk allocation
instead of the size of the sparse file by updating the meter with the
self.capacity.
Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
Signed-off-by: Haruka Ohata <ohata.haruka@fujitsu.com>
diff --git a/virtinst/storage.py b/virtinst/storage.py
index 3c5d39bb..f9a9f7a7 100644
--- a/virtinst/storage.py
+++ b/virtinst/storage.py
@@ -695,6 +695,7 @@ class StorageVolume(_StorageObject):
log.debug("Using vol create flags=%s", createflags)
vol = self.pool.createXML(xml, createflags)
+ meter.update(self.capacity)
meter.end()
log.debug("Storage volume '%s' install complete.", self.name)
return vol

View File

@@ -0,0 +1,17 @@
Subject: .gitignore: Ignore coverage.xml
From: Lin Ma lma@suse.de Mon Dec 30 19:41:07 2024 +0800
Date: Wed Jan 29 10:48:57 2025 +0100:
Git: 926385994486fde63dc092814ab793c53ed3f275
Signed-off-by: Lin Ma <lma@suse.de>
diff --git a/.gitignore b/.gitignore
index 89ad8a166..d303c1afb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,5 @@
/.coverage
/data/gschemas.compiled
+
+/coverage.xml

View File

@@ -1,72 +0,0 @@
Subject: virtinstall: Hide total_size in the progress bar if it doesn't need
From: Toshiki Sonoda sonoda.toshiki@fujitsu.com Wed Nov 9 18:33:57 2022 +0900
Date: Wed Dec 14 13:18:36 2022 -0500:
Git: 6ec00474a659158f20248d6af3771d1a12ddac7b
virt-install prints the total_size value to the progress bar even if it
is meaningless.
This value can be confusing to user, so for execute prosess that doesn't
copy files (total_size = 0B), we hide the total_size value.
For example, 'Creating domain...' doesn't need to print the total_size
value.
Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
Signed-off-by: Haruka Ohata <ohata.haruka@fujitsu.com>
diff --git a/tests/data/meter/meter-zero.txt b/tests/data/meter/meter-zero.txt
new file mode 100644
index 00000000..fc81f21f
--- /dev/null
+++ b/tests/data/meter/meter-zero.txt
@@ -0,0 +1,4 @@
+
+Meter text test 100% [================] 0 B/s | 0 B --:-- ETA
+
+Meter text test | 00:02
diff --git a/tests/test_misc.py b/tests/test_misc.py
index 20f5a626..2cabc338 100644
--- a/tests/test_misc.py
+++ b/tests/test_misc.py
@@ -224,6 +224,20 @@ def test_misc_meter():
out = meter.output.getvalue().replace("\r", "\n")
utils.diff_compare(out, os.path.join(utils.DATADIR, "meter", "meter6.txt"))
+ def _test_meter_zero(m, startval=0, text="Meter text test"):
+ with unittest.mock.patch("time.time", return_value=1.0):
+ m.start(text, startval)
+ with unittest.mock.patch("time.time", return_value=3.0):
+ m.update(0)
+ with unittest.mock.patch("time.time", return_value=3.1):
+ m.end()
+
+ # meter with size 0 and startval size 0
+ meter = _progresspriv.TextMeter(output=io.StringIO())
+ _test_meter_zero(meter, 0)
+ out = meter.output.getvalue().replace("\r", "\n")
+ utils.diff_compare(out, os.path.join(utils.DATADIR, "meter", "meter-zero.txt"))
+
# BaseMeter coverage
meter = _progresspriv.BaseMeter()
_test_meter_values(meter)
diff --git a/virtinst/_progresspriv.py b/virtinst/_progresspriv.py
index a035c9c4..207c6479 100644
--- a/virtinst/_progresspriv.py
+++ b/virtinst/_progresspriv.py
@@ -247,11 +247,15 @@ class TextMeter(BaseMeter):
tl = TerminalLine(8)
# For big screens, make it more readable.
use_hours = bool(tl.llen > 80)
- ui_size = tl.add(' | %5sB' % total_size)
ui_time = tl.add(' %s' % format_time(self.re.elapsed_time(),
use_hours))
ui_end, not_done = _term_add_end(tl, self.size, amount_read)
- dummy = not_done
+ if not not_done and amount_read == 0:
+ # Doesn't need to print total_size
+ ui_size = tl.add(' | %5s ' % ' ')
+ else:
+ ui_size = tl.add(' | %5sB' % total_size)
+
out = '\r%-*.*s%s%s%s\n' % (tl.rest(), tl.rest(), self.text,
ui_size, ui_time, ui_end)
self.output.write(out)

View File

@@ -1,24 +0,0 @@
Subject: asyncjob: Fix backtrace when no cursor theme installed
From: Cole Robinson crobinso@redhat.com Thu Jan 19 11:13:56 2023 -0500
Date: Thu Jan 19 11:40:37 2023 -0500:
Git: cc4a39ea94f42bc92765eb3bb56e2b7f9198be67
Fixes: https://github.com/virt-manager/virt-manager/issues/479
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/virtManager/asyncjob.py b/virtManager/asyncjob.py
index 32d9c0a1..46692ace 100644
--- a/virtManager/asyncjob.py
+++ b/virtManager/asyncjob.py
@@ -265,9 +265,7 @@ class vmmAsyncJob(vmmGObjectUI):
self.topwin.present()
if not self.cancel_cb and self.show_progress:
- gdk_window = self.topwin.get_window()
- gdk_window.set_cursor(
- Gdk.Cursor.new_from_name(gdk_window.get_display(), "progress"))
+ self._set_cursor("progress")
self._bg_thread.start()

View File

@@ -0,0 +1,109 @@
Subject: cli: Add --tpm backend.profile.{source,removeDisabled} support
From: Lin Ma lma@suse.de Mon Dec 30 19:44:58 2024 +0800
Date: Wed Jan 29 10:48:57 2025 +0100:
Git: f278c89b49bc4d1e46c8149fb0f1674d801b51c5
Swtpm since v0.10 supports to configure a TPM2 with a profile from file.
eg:
root@localhost:~ # cat /etc/swtpm/profiles/mytest.json
{
"Name": "custom:test",
"Algorithms":"rsa,rsa-min-size=1024,......"
}
root@localhost:~ # swtpm_setup --tpm2 --print-profiles | jq
{
"local": [
{
"Name": "mytest",
"Algorithms": "rsa,rsa-min-size=1024,......"
}
],
"builtin": [
{
"Name": "default-v1",
"StateFormatLevel": 7,
"Commands": "......",
"Algorithms": "rsa,rsa-min-size=1024,......",
"Description": "......"
},
{
"Name": "null",
"StateFormatLevel": 1,
"Commands": "......",
"Algorithms": "rsa,rsa-min-size=1024,......",
"Description": "......"
},
{
"Name": "custom",
"StateFormatLevel": 2,
"Commands": "......",
"Algorithms": "rsa,rsa-min-size=1024,......",
"Description": "......"
}
]
}
Libvirt supports it since v10.10.0
Let's add this feature into virt-install, eg:
root@localhost:~ # virt-install \
......\
--tpm model=tpm-tis,backend.version=2.0,\
backend.profile.source=local:mytest,backend.profile.removeDisabled=check
Signed-off-by: Lin Ma <lma@suse.de>
diff --git a/tests/data/cli/compare/virt-install-many-devices.xml b/tests/data/cli/compare/virt-install-many-devices.xml
index a841a380f..e34b487c3 100644
--- a/tests/data/cli/compare/virt-install-many-devices.xml
+++ b/tests/data/cli/compare/virt-install-many-devices.xml
@@ -791,6 +791,7 @@
<tpm model="tpm-tis">
<backend type="emulator" version="2.0" debug="3">
<source type="dir" path="/some/dir"/>
+ <profile source="local:mytest" removeDisabled="check"/>
</backend>
</tpm>
<graphics type="sdl" display=":3.4" xauth="/tmp/.Xauthority">
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 5fc0a1c2f..4e0b2d8c0 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -800,7 +800,7 @@ source.reservations.managed=no,source.reservations.source.type=unix,source.reser
--tpm passthrough,model=tpm-crb,path=/dev/tpm0,backend.encryption.secret=11111111-2222-3333-4444-5555555555,backend.persistent_state=yes,backend.active_pcr_banks.sha1=on,backend.active_pcr_banks.sha256=yes,backend.active_pcr_banks.sha384=yes,backend.active_pcr_banks.sha512=yes,version=2.0
---tpm model=tpm-tis,backend.type=emulator,backend.version=2.0,backend.debug=3,backend.source.type=dir,backend.source.path=/some/dir
+--tpm model=tpm-tis,backend.type=emulator,backend.version=2.0,backend.debug=3,backend.source.type=dir,backend.source.path=/some/dir,backend.profile.source=local:mytest,backend.profile.removeDisabled=check
--watchdog ib700,action=pause
diff --git a/virtinst/cli.py b/virtinst/cli.py
index fa6145e8c..d8926cdad 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -4370,6 +4370,8 @@ class ParserTPM(VirtCLIParser):
cls.add_arg("backend.debug", "debug")
cls.add_arg("backend.source.type", "source_type")
cls.add_arg("backend.source.path", "source_path")
+ cls.add_arg("backend.profile.source", "profile_source")
+ cls.add_arg("backend.profile.removeDisabled", "profile_removeDisabled")
cls.add_arg("backend.active_pcr_banks.sha1",
"active_pcr_banks.sha1", is_onoff=True)
diff --git a/virtinst/devices/tpm.py b/virtinst/devices/tpm.py
index 8b4023502..79ae224e8 100644
--- a/virtinst/devices/tpm.py
+++ b/virtinst/devices/tpm.py
@@ -44,6 +44,8 @@ class DeviceTpm(Device):
debug = XMLProperty("./backend/@debug")
source_type = XMLProperty("./backend/source/@type")
source_path = XMLProperty("./backend/source/@path")
+ profile_source = XMLProperty("./backend/profile/@source")
+ profile_removeDisabled = XMLProperty("./backend/profile/@removeDisabled")
active_pcr_banks = XMLChildProperty(_ActivePCRBanks, is_single=True,
relative_xpath="./backend")

View File

@@ -0,0 +1,58 @@
Subject: cli: Add nvram.templateFormat to indicate template format
From: Lin Ma lma@suse.de Mon Dec 30 19:48:04 2024 +0800
Date: Wed Jan 29 10:48:57 2025 +0100:
Git: dc89a02c75ca7d178c5332fc495a1fceb3732d76
Signed-off-by: Lin Ma <lma@suse.de>
diff --git a/tests/data/cli/compare/virt-install-many-devices.xml b/tests/data/cli/compare/virt-install-many-devices.xml
index e34b487c3..76e044731 100644
--- a/tests/data/cli/compare/virt-install-many-devices.xml
+++ b/tests/data/cli/compare/virt-install-many-devices.xml
@@ -108,6 +108,8 @@
<feature enabled="yes" name="secure-boot"/>
<feature enabled="no" name="enrolled-keys"/>
</firmware>
+ <loader type="pflash">CODE.fd</loader>
+ <nvram template="VARS.fd" templateFormat="raw"/>
<initarg>foo=bar</initarg>
<initarg>baz=woo</initarg>
<initenv name="MYENV">some value</initenv>
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 4e0b2d8c0..8bfccea18 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -500,7 +500,8 @@ bios.useserial=no,bios.rebootTimeout=60,cmdline=root=/foo,\
bootmenu.enable=yes,bootmenu.timeout=5000,\
acpi.table=/path/to/slic.dat,acpi.table.type=slic,\
initenv0.name=MYENV,initenv0='some value',initenv1.name=FOO,initenv1=bar,\
-initdir=/my/custom/cwd,inituser=tester,initgroup=1000
+initdir=/my/custom/cwd,inituser=tester,initgroup=1000,\
+loader_type=pflash,loader=CODE.fd,nvram.template=VARS.fd,nvram.templateFormat=raw
--vcpus vcpus=9,vcpu.placement=static,\
diff --git a/virtinst/cli.py b/virtinst/cli.py
index d8926cdad..6f633b933 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -2950,6 +2950,7 @@ class ParserBoot(VirtCLIParser):
cls.add_arg("bios.useserial", "bios_useserial", is_onoff=True)
cls.add_arg("bios.rebootTimeout", "bios_rebootTimeout")
cls.add_arg("smbios.mode", "smbios_mode")
+ cls.add_arg("nvram.templateFormat", "nvram_templateFormat")
# Direct kernel boot options
cls.add_arg("kernel", "kernel")
diff --git a/virtinst/domain/os.py b/virtinst/domain/os.py
index 9afcbb910..45d913450 100644
--- a/virtinst/domain/os.py
+++ b/virtinst/domain/os.py
@@ -126,6 +126,7 @@ class DomainOs(XMLBuilder):
bios_useserial = XMLProperty("./bios/@useserial", is_yesno=True)
bios_rebootTimeout = XMLProperty("./bios/@rebootTimeout", is_int=True)
smbios_mode = XMLProperty("./smbios/@mode")
+ nvram_templateFormat = XMLProperty("./nvram/@templateFormat")
# Host bootloader options
# Since the elements for a host bootloader are actually directly under

View File

@@ -1,19 +0,0 @@
Subject: asyncjob: Remove unused import
From: Cole Robinson crobinso@redhat.com Thu Jan 19 11:59:20 2023 -0500
Date: Thu Jan 19 11:59:20 2023 -0500:
Git: fe86f4639f6e055f1e107fed9e0eb8be3fb2a66f
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/virtManager/asyncjob.py b/virtManager/asyncjob.py
index 46692ace..958320b2 100644
--- a/virtManager/asyncjob.py
+++ b/virtManager/asyncjob.py
@@ -7,7 +7,6 @@
import threading
import traceback
-from gi.repository import Gdk
from gi.repository import GLib
import libvirt

View File

@@ -0,0 +1,55 @@
Subject: cli: Add --features hyperv.xmm_input.state=on/off
From: Lin Ma lma@suse.de Mon Dec 30 19:49:47 2024 +0800
Date: Wed Jan 29 10:48:57 2025 +0100:
Git: 5617330513e951643d69afd4c0cfbd230f1d2983
Signed-off-by: Lin Ma <lma@suse.de>
diff --git a/tests/data/cli/compare/virt-install-many-devices.xml b/tests/data/cli/compare/virt-install-many-devices.xml
index 76e044731..eeb964620 100644
--- a/tests/data/cli/compare/virt-install-many-devices.xml
+++ b/tests/data/cli/compare/virt-install-many-devices.xml
@@ -154,6 +154,7 @@
<ipi state="on"/>
<evmcs state="on"/>
<avic state="on"/>
+ <xmm_input state="on"/>
</hyperv>
<vmport state="off"/>
<kvm>
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 8bfccea18..76768dfe0 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -581,6 +581,7 @@ hyperv.tlbflush.state=on,\
hyperv.ipi.state=on,\
hyperv.evmcs.state=on,\
hyperv.avic.state=on,\
+hyperv.xmm_input.state=on,\
kvm.pv-ipi.state=on,\
msrs.unknown=ignore
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 6f633b933..add19ac09 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -3094,6 +3094,7 @@ class ParserFeatures(VirtCLIParser):
cls.add_arg("hyperv.ipi.state", "hyperv_ipi", is_onoff=True)
cls.add_arg("hyperv.evmcs.state", "hyperv_evmcs", is_onoff=True)
cls.add_arg("hyperv.avic.state", "hyperv_avic", is_onoff=True)
+ cls.add_arg("hyperv.xmm_input.state", "hyperv_xmm_input", is_onoff=True)
cls.add_arg("vmport.state", "vmport", is_onoff=True)
cls.add_arg("kvm.hidden.state", "kvm_hidden", is_onoff=True)
diff --git a/virtinst/domain/features.py b/virtinst/domain/features.py
index 93a576360..ae3b23d98 100644
--- a/virtinst/domain/features.py
+++ b/virtinst/domain/features.py
@@ -43,6 +43,7 @@ class DomainFeatures(XMLBuilder):
hyperv_ipi = XMLProperty("./hyperv/ipi/@state", is_onoff=True)
hyperv_evmcs = XMLProperty("./hyperv/evmcs/@state", is_onoff=True)
hyperv_avic = XMLProperty("./hyperv/avic/@state", is_onoff=True)
+ hyperv_xmm_input = XMLProperty("./hyperv/xmm_input/@state", is_onoff=True)
vmport = XMLProperty("./vmport/@state", is_onoff=True)
kvm_hidden = XMLProperty("./kvm/hidden/@state", is_onoff=True)

View File

@@ -1,36 +0,0 @@
Subject: Packit: initial enablement
From: Lokesh Mandvekar lsm5@fedoraproject.org Mon Dec 5 17:14:30 2022 +0530
Date: Thu Jan 19 14:04:42 2023 -0500:
Git: a63b40aae3835a8b82b23755f1ed45e526af80f9
This commit enables Packit `copr_build` tasks which will run on every PR
and build RPMS using the spec file present upstream with Source0 as
the archive created from HEAD commit of the PR.
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
diff --git a/.packit.yaml b/.packit.yaml
new file mode 100644
index 00000000..15798fe9
--- /dev/null
+++ b/.packit.yaml
@@ -0,0 +1,19 @@
+# See the documentation for more information:
+# https://packit.dev/docs/configuration/
+
+upstream_package_name: virt-manager
+downstream_package_name: virt-manager
+
+specfile_path: virt-manager.spec
+
+jobs:
+ - job: copr_build
+ # Run on every PR
+ trigger: pull_request
+ # Defaults to x86_64 unless architecture is explicitly specified
+ targets:
+ - fedora-rawhide-aarch64
+ - fedora-rawhide-i386
+ - fedora-rawhide-ppc64le
+ - fedora-rawhide-s390x
+ - fedora-rawhide-x86_64

View File

@@ -0,0 +1,55 @@
Subject: cli: Add --features hyperv.emsr_bitmap.state=on/off
From: Lin Ma lma@suse.de Mon Dec 30 19:50:21 2024 +0800
Date: Wed Jan 29 10:48:57 2025 +0100:
Git: 1f43c0d1d9d7128d24f5b6628b5f01e920a9f1fa
Signed-off-by: Lin Ma <lma@suse.de>
diff --git a/tests/data/cli/compare/virt-install-many-devices.xml b/tests/data/cli/compare/virt-install-many-devices.xml
index eeb964620..cea5b3890 100644
--- a/tests/data/cli/compare/virt-install-many-devices.xml
+++ b/tests/data/cli/compare/virt-install-many-devices.xml
@@ -155,6 +155,7 @@
<evmcs state="on"/>
<avic state="on"/>
<xmm_input state="on"/>
+ <emsr_bitmap state="on"/>
</hyperv>
<vmport state="off"/>
<kvm>
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 76768dfe0..69f48df3a 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -582,6 +582,7 @@ hyperv.ipi.state=on,\
hyperv.evmcs.state=on,\
hyperv.avic.state=on,\
hyperv.xmm_input.state=on,\
+hyperv.emsr_bitmap.state=on,\
kvm.pv-ipi.state=on,\
msrs.unknown=ignore
diff --git a/virtinst/cli.py b/virtinst/cli.py
index add19ac09..dcd2b8c8b 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -3095,6 +3095,7 @@ class ParserFeatures(VirtCLIParser):
cls.add_arg("hyperv.evmcs.state", "hyperv_evmcs", is_onoff=True)
cls.add_arg("hyperv.avic.state", "hyperv_avic", is_onoff=True)
cls.add_arg("hyperv.xmm_input.state", "hyperv_xmm_input", is_onoff=True)
+ cls.add_arg("hyperv.emsr_bitmap.state", "hyperv_emsr_bitmap", is_onoff=True)
cls.add_arg("vmport.state", "vmport", is_onoff=True)
cls.add_arg("kvm.hidden.state", "kvm_hidden", is_onoff=True)
diff --git a/virtinst/domain/features.py b/virtinst/domain/features.py
index ae3b23d98..cba3b710d 100644
--- a/virtinst/domain/features.py
+++ b/virtinst/domain/features.py
@@ -44,6 +44,7 @@ class DomainFeatures(XMLBuilder):
hyperv_evmcs = XMLProperty("./hyperv/evmcs/@state", is_onoff=True)
hyperv_avic = XMLProperty("./hyperv/avic/@state", is_onoff=True)
hyperv_xmm_input = XMLProperty("./hyperv/xmm_input/@state", is_onoff=True)
+ hyperv_emsr_bitmap = XMLProperty("./hyperv/emsr_bitmap/@state", is_onoff=True)
vmport = XMLProperty("./vmport/@state", is_onoff=True)
kvm_hidden = XMLProperty("./kvm/hidden/@state", is_onoff=True)

View File

@@ -0,0 +1,58 @@
Subject: cli: Add --features hyperv.tlbflush.direct.state=on/off
From: Lin Ma lma@suse.de Mon Dec 30 19:50:40 2024 +0800
Date: Wed Jan 29 10:48:57 2025 +0100:
Git: 5f2a2dbd0a2ccecd76710067854c07c1ebd5ea09
Signed-off-by: Lin Ma <lma@suse.de>
diff --git a/tests/data/cli/compare/virt-install-many-devices.xml b/tests/data/cli/compare/virt-install-many-devices.xml
index cea5b3890..996873a8a 100644
--- a/tests/data/cli/compare/virt-install-many-devices.xml
+++ b/tests/data/cli/compare/virt-install-many-devices.xml
@@ -150,7 +150,9 @@
<reset state="on"/>
<frequencies state="on"/>
<reenlightenment state="on"/>
- <tlbflush state="on"/>
+ <tlbflush state="on">
+ <direct state="on"/>
+ </tlbflush>
<ipi state="on"/>
<evmcs state="on"/>
<avic state="on"/>
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 69f48df3a..18a76612a 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -578,6 +578,7 @@ hyperv.reset.state=off,hyperv_reset=on,\
hyperv.frequencies.state=on,\
hyperv.reenlightenment.state=on,\
hyperv.tlbflush.state=on,\
+hyperv.tlbflush.direct.state=on,\
hyperv.ipi.state=on,\
hyperv.evmcs.state=on,\
hyperv.avic.state=on,\
diff --git a/virtinst/cli.py b/virtinst/cli.py
index dcd2b8c8b..5da607be4 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -3091,6 +3091,7 @@ class ParserFeatures(VirtCLIParser):
cls.add_arg("hyperv.frequencies.state", "hyperv_frequencies", is_onoff=True)
cls.add_arg("hyperv.reenlightenment.state", "hyperv_reenlightenment", is_onoff=True)
cls.add_arg("hyperv.tlbflush.state", "hyperv_tlbflush", is_onoff=True)
+ cls.add_arg("hyperv.tlbflush.direct.state", "hyperv_tlbflush_direct", is_onoff=True)
cls.add_arg("hyperv.ipi.state", "hyperv_ipi", is_onoff=True)
cls.add_arg("hyperv.evmcs.state", "hyperv_evmcs", is_onoff=True)
cls.add_arg("hyperv.avic.state", "hyperv_avic", is_onoff=True)
diff --git a/virtinst/domain/features.py b/virtinst/domain/features.py
index cba3b710d..d001ddfa1 100644
--- a/virtinst/domain/features.py
+++ b/virtinst/domain/features.py
@@ -40,6 +40,7 @@ class DomainFeatures(XMLBuilder):
hyperv_frequencies = XMLProperty("./hyperv/frequencies/@state", is_onoff=True)
hyperv_reenlightenment = XMLProperty("./hyperv/reenlightenment/@state", is_onoff=True)
hyperv_tlbflush = XMLProperty("./hyperv/tlbflush/@state", is_onoff=True)
+ hyperv_tlbflush_direct = XMLProperty("./hyperv/tlbflush/direct/@state", is_onoff=True)
hyperv_ipi = XMLProperty("./hyperv/ipi/@state", is_onoff=True)
hyperv_evmcs = XMLProperty("./hyperv/evmcs/@state", is_onoff=True)
hyperv_avic = XMLProperty("./hyperv/avic/@state", is_onoff=True)

View File

@@ -1,31 +0,0 @@
Subject: virt-install: Recommend '--boot uefi'
From: Andrea Bolognani abologna@redhat.com Mon Dec 12 19:32:32 2022 +0100
Date: Thu Feb 9 11:41:00 2023 -0500:
Git: f2b5aaf458764ec7ecf105038e5f2f7cc26b6c17
Firmware autoselection is the way to go in most cases, so
recommend that instead of telling users that they should provide
all information manually.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
diff --git a/man/virt-install.rst b/man/virt-install.rst
index 3a6e8dcd..684f2265 100644
--- a/man/virt-install.rst
+++ b/man/virt-install.rst
@@ -955,13 +955,13 @@ Some examples:
Configure the VM to boot from UEFI. In order for virt-install to know the
correct UEFI parameters, libvirt needs to be advertising known UEFI binaries
via domcapabilities XML, so this will likely only work if using properly
- configured distro packages.
+ configured distro packages. This is the recommended UEFI setup.
``--boot loader=/.../OVMF_CODE.fd,loader.readonly=yes,loader.type=pflash,nvram.template=/.../OVMF_VARS.fd,loader_secure=no``
Specify that the virtual machine use the custom OVMF binary as boot firmware,
mapped as a virtual flash chip. In addition, request that libvirt instantiate
the VM-specific UEFI varstore from the custom "/.../OVMF_VARS.fd" varstore
- template. This is the recommended UEFI setup, and should be used if
+ template. This setup is not recommended, and should only be used if
--boot uefi doesn't know about your UEFI binaries. If your UEFI firmware
supports Secure boot feature you can enable it via loader_secure.

View File

@@ -0,0 +1,55 @@
Subject: cli: Add --features hyperv.tlbflush.extended.state=on/off
From: Lin Ma lma@suse.de Mon Dec 30 19:50:50 2024 +0800
Date: Wed Jan 29 10:48:57 2025 +0100:
Git: 81c873ba36b58b8598f53b8c972dc9821ab6d423
Signed-off-by: Lin Ma <lma@suse.de>
diff --git a/tests/data/cli/compare/virt-install-many-devices.xml b/tests/data/cli/compare/virt-install-many-devices.xml
index 996873a8a..cbb186c92 100644
--- a/tests/data/cli/compare/virt-install-many-devices.xml
+++ b/tests/data/cli/compare/virt-install-many-devices.xml
@@ -152,6 +152,7 @@
<reenlightenment state="on"/>
<tlbflush state="on">
<direct state="on"/>
+ <extended state="on"/>
</tlbflush>
<ipi state="on"/>
<evmcs state="on"/>
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 18a76612a..a2eb1365e 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -579,6 +579,7 @@ hyperv.frequencies.state=on,\
hyperv.reenlightenment.state=on,\
hyperv.tlbflush.state=on,\
hyperv.tlbflush.direct.state=on,\
+hyperv.tlbflush.extended.state=on,\
hyperv.ipi.state=on,\
hyperv.evmcs.state=on,\
hyperv.avic.state=on,\
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 5da607be4..57d5608c6 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -3092,6 +3092,7 @@ class ParserFeatures(VirtCLIParser):
cls.add_arg("hyperv.reenlightenment.state", "hyperv_reenlightenment", is_onoff=True)
cls.add_arg("hyperv.tlbflush.state", "hyperv_tlbflush", is_onoff=True)
cls.add_arg("hyperv.tlbflush.direct.state", "hyperv_tlbflush_direct", is_onoff=True)
+ cls.add_arg("hyperv.tlbflush.extended.state", "hyperv_tlbflush_extended", is_onoff=True)
cls.add_arg("hyperv.ipi.state", "hyperv_ipi", is_onoff=True)
cls.add_arg("hyperv.evmcs.state", "hyperv_evmcs", is_onoff=True)
cls.add_arg("hyperv.avic.state", "hyperv_avic", is_onoff=True)
diff --git a/virtinst/domain/features.py b/virtinst/domain/features.py
index d001ddfa1..99ed43393 100644
--- a/virtinst/domain/features.py
+++ b/virtinst/domain/features.py
@@ -41,6 +41,7 @@ class DomainFeatures(XMLBuilder):
hyperv_reenlightenment = XMLProperty("./hyperv/reenlightenment/@state", is_onoff=True)
hyperv_tlbflush = XMLProperty("./hyperv/tlbflush/@state", is_onoff=True)
hyperv_tlbflush_direct = XMLProperty("./hyperv/tlbflush/direct/@state", is_onoff=True)
+ hyperv_tlbflush_extended = XMLProperty("./hyperv/tlbflush/extended/@state", is_onoff=True)
hyperv_ipi = XMLProperty("./hyperv/ipi/@state", is_onoff=True)
hyperv_evmcs = XMLProperty("./hyperv/evmcs/@state", is_onoff=True)
hyperv_avic = XMLProperty("./hyperv/avic/@state", is_onoff=True)

View File

@@ -1,51 +0,0 @@
Subject: virt-install: Document Secure Boot setups
From: Andrea Bolognani abologna@redhat.com Mon Dec 12 19:38:22 2022 +0100
Date: Thu Feb 9 11:41:00 2023 -0500:
Git: 33ff193ee9fcfdb74f95d946a1b93239a1a12a61
Provide ready to use recipes for explicitly enabling and
explicitly disabling Secure Boot, as well as a pointer to
the more extensive information found on the libvirt website.
Setting loader_secure=yes is only one part of a proper Secure
Boot setup, so stop documenting it in the section about manual
firmware selection to avoid confusion.
https://bugzilla.redhat.com/show_bug.cgi?id=2112154
https://bugzilla.redhat.com/show_bug.cgi?id=2149971
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
diff --git a/man/virt-install.rst b/man/virt-install.rst
index 684f2265..a0df7328 100644
--- a/man/virt-install.rst
+++ b/man/virt-install.rst
@@ -957,13 +957,26 @@ Some examples:
via domcapabilities XML, so this will likely only work if using properly
configured distro packages. This is the recommended UEFI setup.
+``--boot uefi,firmware.feature0.name=secure-boot,firmware.feature0.enabled=yes,firmware.feature1.name=enrolled-keys,firmware.feature1.enabled=yes``
+ Configure the VM to boot from UEFI with Secure Boot support enabled.
+ Only signed operating systems will be able to boot with this configuration.
+
+``--boot uefi,firmware.feature0.name=secure-boot,firmware.feature0.enabled=no``
+ Configure the VM to boot from UEFI with Secure Boot support disabled.
+ This configuration allows both signed and unsigned operating systems to
+ run.
+
+ Additional information about the ``secure-boot`` and
+ ``enrolled-keys`` firmware features and how they can be used to
+ influence firmware selection is available at
+ https://libvirt.org/kbase/secureboot.html
+
``--boot loader=/.../OVMF_CODE.fd,loader.readonly=yes,loader.type=pflash,nvram.template=/.../OVMF_VARS.fd,loader_secure=no``
Specify that the virtual machine use the custom OVMF binary as boot firmware,
mapped as a virtual flash chip. In addition, request that libvirt instantiate
the VM-specific UEFI varstore from the custom "/.../OVMF_VARS.fd" varstore
template. This setup is not recommended, and should only be used if
- --boot uefi doesn't know about your UEFI binaries. If your UEFI firmware
- supports Secure boot feature you can enable it via loader_secure.
+ --boot uefi doesn't know about your UEFI binaries.
Use --boot=? to see a list of all available sub options.
Complete details at https://libvirt.org/formatdomain.html#elementsOS

View File

@@ -1,97 +0,0 @@
Subject: cloner: clone serial files
From: Oleg Vasilev oleg.vasilev@virtuozzo.com Wed Nov 30 22:01:08 2022 +0600
Date: Wed Mar 22 17:44:06 2023 -0400:
Git: b2f6e953831aba9ab7cc4b8673c237c3bb434100
Before this, on clone the serial file would remain the same for the cloned
domain. This doesn't make much sense as the output would be an intermix of two
unrelated output sequences.
Here we apply the the same filename changing algorithm, as with disk files.
Signed-off-by: Oleg Vasilev <oleg.vasilev@virtuozzo.com>
diff --git a/virtinst/cloner.py b/virtinst/cloner.py
index 9334513c..556bfdbb 100644
--- a/virtinst/cloner.py
+++ b/virtinst/cloner.py
@@ -9,6 +9,7 @@
import re
import os
+from itertools import chain
import libvirt
@@ -20,6 +21,7 @@ from .devices import DeviceInterface
from .devices import DeviceDisk
from .logger import log
from .devices import DeviceChannel
+from .devices import DeviceSerial
def _replace_vm(conn, name):
@@ -70,9 +72,9 @@ def _generate_clone_name(conn, basename):
sep="", start_num=start_num, force_num=force_num)
-def _generate_clone_disk_path(conn, origname, newname, origpath):
+def _generate_clone_path(origname, newname, origpath, cb_exists):
"""
- Generate desired cloned disk path name, derived from the
+ Generate desired cloned path for auxiliary files, derived from the
original path, original VM name, and proposed new VM name
"""
if origpath is None:
@@ -99,9 +101,7 @@ def _generate_clone_disk_path(conn, origname, newname, origpath):
clonebase = newname
clonebase = os.path.join(dirname, clonebase)
- def cb(p):
- return DeviceDisk.path_definitely_exists(conn, p)
- return generatename.generate_name(clonebase, cb, suffix=suffix)
+ return generatename.generate_name(clonebase, cb_exists, suffix=suffix)
def _lookup_vm(conn, name):
@@ -287,7 +287,9 @@ class Cloner(object):
@staticmethod
def generate_clone_disk_path(conn, origname, newname, origpath):
- return _generate_clone_disk_path(conn, origname, newname, origpath)
+ def cb_exists(p):
+ return DeviceDisk.path_definitely_exists(conn, p)
+ return _generate_clone_path(origname, newname, origpath, cb_exists)
@staticmethod
def build_clone_disk(orig_disk, clonepath, allow_create, sparse):
@@ -455,6 +457,21 @@ class Cloner(object):
# Functional methods #
######################
+ def _prepare_serial_files(self):
+ for serial in chain(self._new_guest.devices.console,
+ self._new_guest.devices.serial):
+ if serial.type != DeviceSerial.TYPE_FILE:
+ continue
+
+ def cb_exists(path):
+ # Ignore the check for now
+ return False
+
+ serial.source.path = _generate_clone_path(self.src_name,
+ self.new_guest.name,
+ serial.source.path,
+ cb_exists=cb_exists)
+
def _prepare_nvram(self):
if not self._nvram_diskinfo:
return
@@ -534,6 +551,7 @@ class Cloner(object):
xmldisk.set_source_path(new_disk.get_source_path())
self._prepare_nvram()
+ self._prepare_serial_files()
# Save altered clone xml
diff = xmlutil.diff(self._src_guest.get_xml(),

View File

@@ -0,0 +1,25 @@
Subject: createvm: prioritize riscv64
From: Heinrich Schuchardt heinrich.schuchardt@canonical.com Tue Jan 21 22:52:40 2025 +0100
Date: Mon Mar 3 10:13:14 2025 -0500:
Git: 6c6c39be2fc26713b9756e668af7ab8106e7acae
As all major distros support the riscv64 architecture, add it to the
list of prioritized architectures. This will move it up in the
architecture drop-down menu and thereby easier to find when creating
a new VM.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
diff --git a/virtManager/createvm.py b/virtManager/createvm.py
index e37921603..1a8c6b4a1 100644
--- a/virtManager/createvm.py
+++ b/virtManager/createvm.py
@@ -792,7 +792,7 @@ class vmmCreateVM(vmmGObjectUI):
archs.sort()
prios = ["x86_64", "i686", "aarch64", "armv7l", "ppc64", "ppc64le",
- "s390x"]
+ "riscv64", "s390x"]
if self.conn.caps.host.cpu.arch not in prios:
prios = [] # pragma: no cover
for p in prios[:]:

View File

@@ -1,114 +0,0 @@
Subject: tests: cli: test serial file clone
From: Oleg Vasilev oleg.vasilev@virtuozzo.com Thu Dec 1 19:52:47 2022 +0600
Date: Wed Mar 22 17:44:06 2023 -0400:
Git: 77695484117b6a931041454865277e898c0fe5f6
Previous commit added serial file clone, now we test it.
Signed-off-by: Oleg Vasilev <oleg.vasilev@virtuozzo.com>
--- /dev/null
+++ b/tests/data/cli/compare/virt-clone-serial.xml
@@ -0,0 +1,31 @@
+<domain type="test">
+ <name>__virtinst_cli_test-clone1</name>
+ <uuid>00000000-1111-2222-3333-444444444444</uuid>
+ <memory>8388608</memory>
+ <currentMemory>2097152</currentMemory>
+ <vcpu>2</vcpu>
+ <os>
+ <type arch="i686">hvm</type>
+ <boot dev="hd"/>
+ </os>
+ <clock offset="utc"/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <serial type="file">
+ <source path="/tmp/__virtinst_cli_test-clone1.file">
+ <seclabel model="dac" relabel="no"/>
+ </source>
+ </serial>
+ <serial type="file">
+ <source path="/tmp/__virtinst_cli_other-serial-clone.file"/>
+ </serial>
+ <serial type="unix">
+ <source mode="connect" path="/tmp/__virtinst_cli_socket.sock"/>
+ </serial>
+ <console type="file">
+ <source path="/tmp/__virtinst_cli_serial-exists-clone.file"/>
+ </console>
+ </devices>
+</domain>
--- /dev/null
+++ b/tests/data/cli/virtclone/clone-serial.xml
@@ -0,0 +1,31 @@
+<domain type="test">
+ <name>__virtinst_cli_test-clone</name>
+ <uuid>00000000-1111-2222-3333-444444444444</uuid>
+ <memory>8388608</memory>
+ <currentMemory>2097152</currentMemory>
+ <vcpu>2</vcpu>
+ <os>
+ <type arch="i686">hvm</type>
+ <boot dev="hd"/>
+ </os>
+ <clock offset="utc"/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <serial type="file">
+ <source path="/tmp/__virtinst_cli_test-clone.file">
+ <seclabel model="dac" relabel="no"/>
+ </source>
+ </serial>
+ <serial type="file">
+ <source path="/tmp/__virtinst_cli_other-serial.file"/>
+ </serial>
+ <serial type="unix">
+ <source mode="connect" path="/tmp/__virtinst_cli_socket.sock"/>
+ </serial>
+ <console type="file">
+ <source path="/tmp/__virtinst_cli_serial-exists.file"/>
+ </console>
+ </devices>
+</domain>
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -52,12 +52,18 @@ NEW_FILES = [
TMP_IMAGE_DIR + "new3.img",
TMP_IMAGE_DIR + "exist1-clone.img",
TMP_IMAGE_DIR + "exist2-clone.img",
+
+ TMP_IMAGE_DIR + "test-clone1.file",
+ TMP_IMAGE_DIR + "other-serial-clone.file",
+ TMP_IMAGE_DIR + "serial-exists-clone-1.file",
]
# Images that are expected to exist before a command is run
EXIST_FILES = [
TMP_IMAGE_DIR + "exist1.img",
TMP_IMAGE_DIR + "exist2.img",
+
+ TMP_IMAGE_DIR + "serial-exists-clone.file",
]
@@ -1491,6 +1497,7 @@ _CLONE_NVRAM_MISSING = "--original-xml %
_CLONE_EMPTY = "--original-xml %s/clone-empty.xml" % _CLONEXMLDIR
_CLONE_NET_RBD = "--original-xml %s/clone-net-rbd.xml" % _CLONEXMLDIR
_CLONE_NET_HTTP = "--original-xml %s/clone-net-http.xml" % _CLONEXMLDIR
+_CLONE_SERIAL = "--original-xml %s/clone-serial.xml" % _CLONEXMLDIR
vclon = App("virt-clone")
@@ -1514,6 +1521,7 @@ c.add_compare(_CLONE_EMPTY + " --auto-cl
c.add_compare("--connect %(URI-KVM-X86)s -o test-clone-simple --auto -f /foo.img --print-xml", "pool-test-cross-pool") # cross pool cloning which fails with test driver but let's confirm the XML
c.add_compare(_CLONE_MANAGED + " --auto-clone", "auto-managed") # Auto flag w/ managed storage
c.add_compare(_CLONE_UNMANAGED + " --auto-clone", "auto-unmanaged") # Auto flag w/ local storage
+c.add_compare(_CLONE_SERIAL + " --auto-clone", "serial") # Auto flag w/ serial console
c.add_valid("--connect %(URI-TEST-FULL)s -o test-clone --auto-clone --nonsparse") # Auto flag, actual VM, skip state check
c.add_valid("--connect %(URI-TEST-FULL)s -o test-clone-simple -n newvm --preserve-data --file %(EXISTIMG1)s") # Preserve data shouldn't complain about existing volume
c.add_valid("-n clonetest " + _CLONE_UNMANAGED + " --file %(EXISTIMG3)s --file %(EXISTIMG4)s --check path_exists=off") # Skip existing file check

View File

@@ -0,0 +1,30 @@
Subject: tests: uitests: handle linux2020 going EOL
From: Cole Robinson crobinso@redhat.com Mon Mar 3 10:38:22 2025 -0500
Date: Mon Mar 3 10:39:12 2025 -0500:
Git: 6f188482b2e2e1c2d3ee1658b81fdd95bd497897
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/tests/uitests/test_createvm.py b/tests/uitests/test_createvm.py
index 1242a0473..053a94066 100644
--- a/tests/uitests/test_createvm.py
+++ b/tests/uitests/test_createvm.py
@@ -464,7 +464,8 @@ def testNewKVMQ35Tweaks(app):
newvm.find("import-entry").set_text("/pool-dir/testvol1.img")
newvm.find("oslist-entry").set_text("fribfrob")
popover = newvm.find("oslist-popover")
- popover.find_fuzzy("linux2020").click()
+ osname = "linux2022"
+ popover.find_fuzzy(osname).click()
_forward(newvm)
_forward(newvm)
@@ -472,7 +473,7 @@ def testNewKVMQ35Tweaks(app):
# hit some code paths elsewhere
newvm.find_fuzzy("Customize", "check").click()
newvm.find_fuzzy("Finish", "button").click()
- vmname = "linux2020"
+ vmname = osname
details = app.find_details_window(vmname)
appl = details.find("config-apply")

View File

@@ -1,32 +0,0 @@
Subject: man/virt-install: Add a note about different behavior of --boot on s390x
From: Thomas Huth thuth@redhat.com Tue Jan 31 12:35:49 2023 +0100
Date: Wed Mar 22 17:45:31 2023 -0400:
Git: 102fe52165535f9da9c9f370c6d1c399458ed4dc
It is common on x86 and other architectures to install a guest from
network by using "--boot hd,network" with virt-install - as long as
the hard disk is not bootable yet, the installation will be started
via network, and once it finished, the guest can boot from hd during
the next reboot.
However, this does not work on s390x since this architecture only
supports one single boot device to be passed to the guest. Thus add
a note to the documentation to avoid that people are running again
into this common pitfall.
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2032472
Signed-off-by: Thomas Huth <thuth@redhat.com>
diff --git a/man/virt-install.rst b/man/virt-install.rst
index a0df7328..8959df7c 100644
--- a/man/virt-install.rst
+++ b/man/virt-install.rst
@@ -929,6 +929,8 @@ Some examples:
``--boot cdrom,fd,hd,network``
Set the boot device priority as first cdrom, first floppy, first harddisk,
network PXE boot.
+ Note: s390x guests only support one boot device, so everything except
+ the first device type will be ignored.
``--boot kernel=KERNEL,initrd=INITRD,kernel_args="console=/dev/ttyS0"``
Have guest permanently boot off a local kernel/initrd pair, with the

View File

@@ -1,20 +0,0 @@
Subject: tests: uitests: Fix window reposition on f38
From: Cole Robinson crobinso@redhat.com Fri May 5 14:54:31 2023 -0400
Date: Fri May 5 14:54:31 2023 -0400:
Git: 909c8aa880396fecb3e1fa174bdf89ce5e8b36c8
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/tests/uitests/lib/app.py b/tests/uitests/lib/app.py
index 221808d0..83628a7f 100644
--- a/tests/uitests/lib/app.py
+++ b/tests/uitests/lib/app.py
@@ -222,7 +222,7 @@ class VMMDogtailApp(object):
# Give time for the child window to appear and possibly grab focus
self.sleep(1)
self.get_manager(check_active=False)
- dogtail.rawinput.drag(childwin.title_coordinates(), (1000, 1000))
+ dogtail.rawinput.dragWithTrajectory(childwin.title_coordinates(), (1000, 1000))
self.manager_conn_disconnect(conn_label)
utils.check(lambda: not childwin.showing)

View File

@@ -1,28 +0,0 @@
Subject: tests: livetests: work around qemu media change regression
From: Cole Robinson crobinso@redhat.com Fri May 5 15:47:25 2023 -0400
Date: Fri May 5 15:47:25 2023 -0400:
Git: 7f83d23f4fd0772acd5eab2145667686770dfd9d
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/tests/uitests/test_livetests.py b/tests/uitests/test_livetests.py
index 3ac0133b..72a96a10 100644
--- a/tests/uitests/test_livetests.py
+++ b/tests/uitests/test_livetests.py
@@ -471,9 +471,16 @@ def _testLiveHotplug(app, fname):
lib.utils.check(lambda: tab.showing)
entry.set_text(fname)
appl.click()
+ # F38 CDROM change is broken:
+ # https://gitlab.com/qemu-project/qemu/-/issues/933
+ # pylint: disable=unreachable
+ app.click_alert_button("changes will take effect", "OK")
+ return
+
lib.utils.check(lambda: not appl.sensitive)
lib.utils.check(lambda: entry.text == fname)
entry.click_secondary_icon()
+
appl.click()
lib.utils.check(lambda: not appl.sensitive)
lib.utils.check(lambda: not entry.text)

View File

@@ -1,33 +0,0 @@
Subject: tests: uitests: Fix manager window repositioning test
From: Cole Robinson crobinso@redhat.com Fri May 5 15:36:26 2023 -0400
Date: Fri May 5 15:48:24 2023 -0400:
Git: 6030049cd7e24f59581b818c5da53665d0a76d6c
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/tests/uitests/test_manager.py b/tests/uitests/test_manager.py
index 40329022..b01c3691 100644
--- a/tests/uitests/test_manager.py
+++ b/tests/uitests/test_manager.py
@@ -228,15 +228,17 @@ def testManagerWindowReposition(app):
fmenu.find("View Manager", "menu item").click()
lib.utils.check(lambda: manager.active)
- manager.window_maximize()
- newx = manager.position[0]
- newy = manager.position[1]
+ curxy = manager.title_coordinates()
+ newxy = curxy[0] + 200, curxy[1] + 200
+ import dogtail.rawinput
+ dogtail.rawinput.dragWithTrajectory(curxy, newxy)
+ checkxy = manager.position
manager.window_close()
host.click_title()
host.find("File", "menu").click()
host.find("View Manager", "menu item").click()
lib.utils.check(lambda: manager.showing)
- assert manager.position == (newx, newy)
+ assert manager.position == checkxy

View File

@@ -1,22 +0,0 @@
Subject: tests: Default --uitests to --verbosity=2
From: Cole Robinson crobinso@redhat.com Sat May 6 16:50:20 2023 -0400
Date: Sat May 6 16:50:20 2023 -0400:
Git: a9cf4945b1dcd45fb205c4adc6f555f2fc47ecfa
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/tests/conftest.py b/tests/conftest.py
index 3d1ca7d1..4a0fc1a0 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -40,6 +40,10 @@ def pytest_addoption(parser):
def pytest_ignore_collect(path, config):
uitests_requested = config.getoption("--uitests")
+ # Default --uitests to --verbosity=2
+ if uitests_requested:
+ config.option.verbose = max(2, config.option.verbose)
+
# Unless explicitly requested, ignore these tests
if "test_dist.py" in str(path):
return True

View File

@@ -1,31 +0,0 @@
Subject: uitests: Make hotplug test pass on both f37 and f38
From: Cole Robinson crobinso@redhat.com Sat May 6 13:13:22 2023 -0400
Date: Sat May 6 19:43:24 2023 -0400:
Git: 75422ec75efe254beb8dc85f75715d71fa3ec859
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/tests/uitests/test_livetests.py b/tests/uitests/test_livetests.py
index 72a96a10..55c9066b 100644
--- a/tests/uitests/test_livetests.py
+++ b/tests/uitests/test_livetests.py
@@ -471,11 +471,15 @@ def _testLiveHotplug(app, fname):
lib.utils.check(lambda: tab.showing)
entry.set_text(fname)
appl.click()
- # F38 CDROM change is broken:
- # https://gitlab.com/qemu-project/qemu/-/issues/933
# pylint: disable=unreachable
- app.click_alert_button("changes will take effect", "OK")
- return
+ import dogtail.tree
+ try:
+ # F38 CDROM change is broken:
+ # https://gitlab.com/qemu-project/qemu/-/issues/933
+ app.click_alert_button("changes will take effect", "OK")
+ return
+ except dogtail.tree.SearchError:
+ pass
lib.utils.check(lambda: not appl.sensitive)
lib.utils.check(lambda: entry.text == fname)

View File

@@ -0,0 +1,115 @@
Subject: virtinst: add --pstore backend=acpi-erst,path=XX,size=YY support
From: Lin Ma lma@suse.de Tue Feb 11 10:54:53 2025 +0800
Date: Mon Mar 3 12:01:09 2025 -0500:
Git: b5f6569bc0e24a4557ac43f7b9a7eeae0399c337
Libvirt since v10.6.0 introduces pstore pci device for storing oops/panic
logs in nvram storage.
Let's add it into virt-install, It has 3 suboptions:
* backend: The desired backend, by far only 'acpi-erst' is accepted.
* path: Represents a path in the host that backs the pstore device in
the guest. It is optional, If not specified the libvirt will
auto generates one.
* size: Configures the size of the persistent storage available to the
guest. It is mandatory, unit is kilobytes.
Eg:
virt-install --pstore backend=acpi-erst,path=/tmp/guest_acpi_esrt,size=8
Signed-off-by: Lin Ma <lma@suse.de>
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -826,6 +826,16 @@ def add_device_options(devg, sound_back_
devg.add_argument("--iommu", action="append",
help=_("Configure an IOMMU device. Ex:\n"
"--iommu model=intel,driver.aw_bits=48"))
+ ParserPstore.register()
+ devg.add_argument(
+ "--pstore",
+ action="append",
+ help=_(
+ "Configure a nvram storage device.\n"
+ "It's for guest kernel to record oops/panic logs. Ex:\n"
+ "--pstore backend=acpi-erst,size=8"
+ ),
+ )
def add_guest_xml_options(geng):
@@ -4859,6 +4869,19 @@ class ParserAudio(VirtCLIParser):
cls.add_arg("id", "id")
+class ParserPstore(VirtCLIParser):
+ cli_arg_name = "pstore"
+ guest_propname = "devices.pstore"
+
+ @classmethod
+ def _virtcli_class_init(cls):
+ VirtCLIParser._virtcli_class_init_common(cls)
+
+ cls.add_arg("backend", "backend")
+ cls.add_arg("path", "path")
+ cls.add_arg("size", "size")
+
+
#####################
# --hostdev parsing #
#####################
--- a/virtinst/devices/__init__.py
+++ b/virtinst/devices/__init__.py
@@ -27,6 +27,7 @@ from .tpm import DeviceTpm
from .video import DeviceVideo
from .vsock import DeviceVsock
from .watchdog import DeviceWatchdog
+from .pstore import DevicePstore
__all__ = [l for l in locals() if l.startswith("Device")]
--- a/virtinst/devices/meson.build
+++ b/virtinst/devices/meson.build
@@ -23,6 +23,7 @@ virtinst_devices_sources = files(
'video.py',
'vsock.py',
'watchdog.py',
+ 'pstore.py',
)
install_data(
--- /dev/null
+++ b/virtinst/devices/pstore.py
@@ -0,0 +1,13 @@
+# This work is licensed under the GNU GPLv2 or later.
+# See the COPYING file in the top-level directory.
+
+from .device import Device
+from ..xmlbuilder import XMLProperty
+
+
+class DevicePstore(Device):
+ XML_NAME = "pstore"
+
+ backend = XMLProperty("./@backend")
+ path = XMLProperty("./path")
+ size = XMLProperty("./size", is_int=True)
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -27,7 +27,7 @@ class _DomainDevices(XMLBuilder):
'smartcard', 'serial', 'parallel', 'console', 'channel',
'input', 'tpm', 'graphics', 'sound', 'audio', 'video', 'hostdev',
'redirdev', 'watchdog', 'memballoon', 'rng', 'panic',
- 'shmem', 'memory', 'vsock', 'iommu']
+ 'shmem', 'memory', 'vsock', 'iommu', 'pstore']
disk = XMLChildProperty(DeviceDisk)
@@ -55,6 +55,7 @@ class _DomainDevices(XMLBuilder):
memory = XMLChildProperty(DeviceMemory)
vsock = XMLChildProperty(DeviceVsock)
iommu = XMLChildProperty(DeviceIommu)
+ pstore = XMLChildProperty(DevicePstore)
def get_all(self):
retlist = []

View File

@@ -0,0 +1,32 @@
Subject: tests: add pstore test
From: Lin Ma lma@suse.de Tue Feb 11 10:56:12 2025 +0800
Date: Mon Mar 3 12:01:09 2025 -0500:
Git: 6c43ab38630a710e4de66cb59cbadd5e11569b68
Signed-off-by: Lin Ma <lma@suse.de>
--- a/tests/data/cli/compare/virt-install-many-devices.xml
+++ b/tests/data/cli/compare/virt-install-many-devices.xml
@@ -1025,6 +1025,10 @@
<iommu model="intel">
<driver aw_bits="48" intremap="off" caching_mode="on" eim="off" iotlb="off"/>
</iommu>
+ <pstore backend="acpi-erst">
+ <path>/tmp/guest_acpi_esrt</path>
+ <size>8</size>
+ </pstore>
</devices>
<launchSecurity type="sev" kernelHashes="yes">
<cbitpos>47</cbitpos>
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -803,6 +803,9 @@ source.reservations.managed=no,source.re
--vsock cid=17
+--pstore backend=acpi-erst,path=/tmp/guest_acpi_esrt,size=8
+
+
--tpm passthrough,model=tpm-crb,path=/dev/tpm0,backend.encryption.secret=11111111-2222-3333-4444-5555555555,backend.persistent_state=yes,backend.active_pcr_banks.sha1=on,backend.active_pcr_banks.sha256=yes,backend.active_pcr_banks.sha384=yes,backend.active_pcr_banks.sha512=yes,version=2.0
--tpm model=tpm-tis,backend.type=emulator,backend.version=2.0,backend.debug=3,backend.source.type=dir,backend.source.path=/some/dir,backend.profile.source=local:mytest,backend.profile.removeDisabled=check

View File

@@ -1,38 +0,0 @@
Subject: uitests: More attempts at making manager reposition test reliable
From: Cole Robinson crobinso@redhat.com Sat May 6 13:34:13 2023 -0400
Date: Sat May 6 19:43:24 2023 -0400:
Git: 509c95ddb9b3f30ea88a61b065cd920055faa5f4
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/tests/uitests/test_manager.py b/tests/uitests/test_manager.py
index b01c3691..10709f09 100644
--- a/tests/uitests/test_manager.py
+++ b/tests/uitests/test_manager.py
@@ -228,17 +228,21 @@ def testManagerWindowReposition(app):
fmenu.find("View Manager", "menu item").click()
lib.utils.check(lambda: manager.active)
+ # Use alt+f7 combo to move window
curxy = manager.title_coordinates()
- newxy = curxy[0] + 200, curxy[1] + 200
- import dogtail.rawinput
- dogtail.rawinput.dragWithTrajectory(curxy, newxy)
- checkxy = manager.position
+ newxy = (curxy[0] + 400, curxy[1] + 400)
+ manager.keyCombo("<alt>F7")
+ app.rawinput.click(*newxy)
+ checkxy = manager.position[0], manager.position[1]
manager.window_close()
host.click_title()
host.find("File", "menu").click()
host.find("View Manager", "menu item").click()
lib.utils.check(lambda: manager.showing)
- assert manager.position == checkxy
+
+ # Results can be off by one or two, but it's not a virt-manager bug
+ assert abs(manager.position[0] - checkxy[0]) in range(3)
+ assert abs(manager.position[1] - checkxy[1]) in range(3)

View File

@@ -0,0 +1,30 @@
Subject: man/virt-install: Document pstore device
From: Lin Ma lma@suse.de Tue Feb 11 10:56:43 2025 +0800
Date: Mon Mar 3 12:01:09 2025 -0500:
Git: a0e390b1b63ea3c6b53cf49e8f70a7d214452610
Signed-off-by: Lin Ma <lma@suse.de>
diff --git a/man/virt-install.rst b/man/virt-install.rst
index dc0b6d9cc..b6c48c3fe 100644
--- a/man/virt-install.rst
+++ b/man/virt-install.rst
@@ -2052,6 +2052,18 @@ Complete details at https://libvirt.org/formatdomain.html#iommu-devices
+``--pstore``
+^^^^^^^^^^^^
+
+**Syntax:** ``--pstore`` OPT=VAL,[...]
+
+Add a pstore device to a guest for storing oops/panic logs before it crashes.
+
+Use --pstore=? to see a list of all available options.
+Complete details at https://libvirt.org/formatdomain.html#pstore
+
+
+
MISCELLANEOUS OPTIONS
=====================

View File

@@ -1,47 +0,0 @@
Subject: tests: uitests: make menu operations more robust
From: Cole Robinson crobinso@redhat.com Sat May 6 17:01:44 2023 -0400
Date: Sat May 6 19:43:24 2023 -0400:
Git: 64bd6ba53e383c941df226bbb7f066b0a363d070
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/tests/uitests/lib/_node.py b/tests/uitests/lib/_node.py
index 1c6cf107..ad95ff02 100644
--- a/tests/uitests/lib/_node.py
+++ b/tests/uitests/lib/_node.py
@@ -221,24 +221,29 @@ class _VMMDogtailNode(dogtail.tree.Node):
clickX, clickY = self.title_coordinates()
dogtail.rawinput.click(clickX, clickY, button)
+ def is_menuitem(self):
+ submenu = (self.roleName == "menu" and
+ (not self.accessible_parent or
+ self.accessible_parent.roleName == "menu"))
+ return submenu or self.roleName == "menu item"
+
def click(self, *args, **kwargs):
"""
- click wrapper, give up to a second for widget to appear on
- screen, helps reduce some test flakiness
+ click wrapper, check some states first to reduce flakiness
"""
# pylint: disable=arguments-differ,signature-differs
self.check_onscreen()
self.check_sensitive()
+ if self.is_menuitem():
+ self.point()
super().click(*args, **kwargs)
def point(self, *args, **kwargs):
# pylint: disable=signature-differs
super().point(*args, **kwargs)
- if (self.roleName == "menu" and
- self.accessible_parent.roleName == "menu"):
- # Widget is a submenu, make sure the item is in selected
- # state before we return
+ if self.is_menuitem():
+ # Make sure item is selected before we return to caller
utils.check(lambda: self.state_selected)
def set_text(self, text):

View File

@@ -1,20 +0,0 @@
Subject: rpm: convert license to SPDX format
From: Daniel P. Berrangé berrange@redhat.com Wed Apr 26 17:49:37 2023 +0100
Date: Sun May 7 12:40:05 2023 -0400:
Git: 6258d536895b1a64a81f111445994c35c0928d4b
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
diff --git a/virt-manager.spec b/virt-manager.spec
index 55c24405..5b939b5d 100644
--- a/virt-manager.spec
+++ b/virt-manager.spec
@@ -12,7 +12,7 @@ Release: 1%{?dist}
%global verrel %{version}-%{release}
Summary: Desktop tool for managing virtual machines via libvirt
-License: GPLv2+
+License: GPL-2.0-or-later
BuildArch: noarch
URL: https://virt-manager.org/
Source0: https://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar.gz

View File

@@ -0,0 +1,48 @@
Subject: tests: Increase virtio-mem block size
From: Akihiko Odaki akihiko.odaki@daynix.com Sun Mar 2 15:47:29 2025 +0900
Date: Mon Mar 3 12:19:33 2025 -0500:
Git: fb54f37b6067f88b46acc0d1d7a11884a659279a
virtio-mem block size must be equal to or greater than the transparent
huge page size; otherwise, libvirt raises an error and a test will
fail. For example, on Asahi Linux, the transparent huge page size is 32
MiB, which is greater than 2 MiB, the specified virtio-mem block size.
On Linux 6.13, the configuration with the maximum transparent huge page
size is Arm64 with 64 KiB, and it has 512 MiB transparent huge pages.
Increase the block size to 512 MiB so that the test passes on every
Linux configuration.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
--- a/tests/data/cli/compare/virt-install-memory-hotplug.xml
+++ b/tests/data/cli/compare/virt-install-memory-hotplug.xml
@@ -126,7 +126,7 @@
<target dynamicMemslots="yes">
<size>524288</size>
<node>0</node>
- <block>2048</block>
+ <block>524288</block>
<requested>524288</requested>
<address base="0x180000000"/>
</target>
@@ -270,7 +270,7 @@
<target dynamicMemslots="yes">
<size>524288</size>
<node>0</node>
- <block>2048</block>
+ <block>524288</block>
<requested>524288</requested>
<address base="0x180000000"/>
</target>
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -936,7 +936,7 @@ c.add_compare("--pxe "
"address.type=dimm,address.base=0x100000000,address.slot=1,"
"source.pmem=on,source.alignsize=2048,target.readonly=on "
-"--memdev virtio-mem,target_node=0,target.block=2048,target.dynamicMemslots=yes,"
+"--memdev virtio-mem,target_node=0,target.block=524288,target.dynamicMemslots=yes,"
"target_size=512,target.requested=524288,target.address_base=0x180000000 "
"--memdev virtio-pmem,source.path=/tmp/virtio_pmem,"

View File

@@ -0,0 +1,18 @@
Subject: tests: test_urls: fix dead URL
From: Cole Robinson crobinso@redhat.com Mon Mar 3 12:40:21 2025 -0500
Date: Mon Mar 3 12:40:36 2025 -0500:
Git: ef41638f5eb0b390cbf74281c508fbfef42f73e5
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/tests/data/test_urls.ini b/tests/data/test_urls.ini
index df0d52fa5..29a794feb 100644
--- a/tests/data/test_urls.ini
+++ b/tests/data/test_urls.ini
@@ -197,5 +197,5 @@ distro = ubuntu20.04
# Devel tree
[mageiacauldron]
-url = http://distro.ibiblio.org/mageia/distrib/cauldron/x86_64/
+url = https://mageia.ip-connect.info/distrib/cauldron/x86_64/
distro = none

View File

@@ -1,27 +0,0 @@
Subject: uitests: Drop hotplug work around, f38 libvirt is fixed now
From: Cole Robinson crobinso@redhat.com Wed May 24 12:01:46 2023 -0400
Date: Wed May 24 12:49:02 2023 -0400:
Git: 7cd6151a212c4c477a947fe5a7f2b3363dd0dcbd
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/tests/uitests/test_livetests.py b/tests/uitests/test_livetests.py
index 55c9066b..64ff7ad9 100644
--- a/tests/uitests/test_livetests.py
+++ b/tests/uitests/test_livetests.py
@@ -471,15 +471,6 @@ def _testLiveHotplug(app, fname):
lib.utils.check(lambda: tab.showing)
entry.set_text(fname)
appl.click()
- # pylint: disable=unreachable
- import dogtail.tree
- try:
- # F38 CDROM change is broken:
- # https://gitlab.com/qemu-project/qemu/-/issues/933
- app.click_alert_button("changes will take effect", "OK")
- return
- except dogtail.tree.SearchError:
- pass
lib.utils.check(lambda: not appl.sensitive)
lib.utils.check(lambda: entry.text == fname)

View File

@@ -0,0 +1,20 @@
Subject: urlfetcher: add riscv64 architecture for Debian
From: Heinrich Schuchardt heinrich.schuchardt@canonical.com Mon Mar 3 11:52:58 2025 +0100
Date: Sat Mar 8 12:59:18 2025 +0100:
Git: ccfe4a0abc0dc37f6ecd367d2c3b3bb1f55649f7
Add riscv64 to the list of Debian architectures.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
--- a/virtinst/install/urldetect.py
+++ b/virtinst/install/urldetect.py
@@ -692,7 +692,7 @@ class _DebianDistro(_DistroTree):
# Check for standard arch strings which will be
# in the URI name for --location $ISO mounts
- for arch in ["i386", "amd64", "x86_64", "arm64"]:
+ for arch in ["i386", "amd64", "x86_64", "arm64", "riscv64"]:
if arch in self.uri:
log.debug("Found treearch=%s in uri", arch)
if arch == "x86_64":

View File

@@ -1,68 +0,0 @@
Subject: virtinst: delay "lookup_capsinfo" until we really need it
From: Laszlo Ersek lersek@redhat.com Sat Aug 26 13:00:16 2023 +0200
Date: Tue Aug 29 13:24:52 2023 +0200:
Git: 4ead4acb440e132c84f2e73365a1e419279d9fb9
When I try to open the details window for a domain that does not use the
system default emulator, I get the following exception:
> Traceback (most recent call last):
> File "virtManager/vmwindow.py", line 40, in get_instance
> cls._instances[key] = vmmVMWindow(vm)
> File "virtManager/vmwindow.py", line 83, in __init__
> self._details = vmmDetails(self.vm, self.builder, self.topwin,
> File "virtManager/details/details.py", line 389, in __init__
> self._init_details()
> File "virtManager/details/details.py", line 807, in _init_details
> vmmAddHardware.build_video_combo(self.vm, video_dev)
> File "virtManager/addhardware.py", line 816, in build_video_combo
> default = DeviceVideo.default_model(vm.xmlobj)
> File "virtinst/devices/video.py", line 47, in default_model
> if (guest.lookup_domcaps().supports_video_virtio() and
> File "virtinst/guest.py", line 656, in lookup_domcaps
> if not self._domcaps or not _compare(self._domcaps):
> File "virtinst/guest.py", line 646, in _compare
> if self.os.machine and not _compare_machine(domcaps):
> File "virtinst/guest.py", line 633, in _compare_machine
> capsinfo = self.lookup_capsinfo()
> File "virtinst/guest.py", line 674, in lookup_capsinfo
> self._capsinfo = self.conn.caps.guest_lookup(
> File "virtinst/capabilities.py", line 319, in guest_lookup
> raise ValueError(msg)
> ValueError: Host does not support domain type kvm with machine
> 'pc-q35-8.1' for virtualization type 'hvm' with architecture 'x86_64'
This is a regression; according to git-bisect, it was introduced in commit
05fcc7410eee ("virtinst: fix caching of domain capabilities", 2022-07-27).
"lookup_capsinfo" (and "guest_lookup" called by it) are unsuitable for
machine type alias checking (or for anything else) if the domain uses an
emulator that differs from the system default emulator. The information
returned by virConnectGetCapabilities() pertains to the system default
emulator. Thus, when using a non-default emulator, we should either not
call "lookup_capsinfo" for machine type alias checking, *or* we should
suppress the exception, and pretend that the alias check was a mismatch.
It turns out that we can avoid the "lookup_capsinfo" call (and thereby the
exception) in practice if we just delay the call until after the direct
(non-alias) comparison.
Fixes: #539
Fixes: 05fcc7410eee ("virtinst: fix caching of domain capabilities", 2022-07-27)
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
diff --git a/virtinst/guest.py b/virtinst/guest.py
index 123abfb2..9232405b 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -630,9 +630,9 @@ class Guest(XMLBuilder):
def lookup_domcaps(self):
def _compare_machine(domcaps):
- capsinfo = self.lookup_capsinfo()
if self.os.machine == domcaps.machine:
return True
+ capsinfo = self.lookup_capsinfo()
if capsinfo.is_machine_alias(self.os.machine, domcaps.machine):
return True
return False

View File

@@ -0,0 +1,24 @@
Subject: virt-manager: list virtual networks when creating new QEMU Session VM
From: Pavel Hrdina phrdina@redhat.com Mon Mar 10 19:26:44 2025 +0100
Date: Tue Mar 18 20:33:33 2025 +0100:
Git: 714d5f1afdd58d5e908d420c4fbd8183edf47aa7
Using qemu-bridge-helper QEMU Session VMs are now able to use host
bridge interfaces. Currently only interface named virbr0 is allowed by
default but it is possible to change it in `/etc/qemu/bridge.conf`.
We will still keep the usermode network as default.
Resolves: https://github.com/virt-manager/virt-manager/issues/863
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
--- a/virtManager/device/netlist.py
+++ b/virtManager/device/netlist.py
@@ -149,7 +149,6 @@ class vmmNetworkList(vmmGObjectUI):
add_usermode = False
if self.conn.is_qemu_unprivileged():
log.debug("Using unprivileged qemu, adding usermode net")
- vnets = []
default_bridge = None
add_usermode = True

View File

@@ -1,52 +0,0 @@
Subject: virtinst: suppress "lookup_capsinfo" exception in machine type alias check
From: Laszlo Ersek lersek@redhat.com Sat Aug 26 13:38:42 2023 +0200
Date: Tue Aug 29 13:24:52 2023 +0200:
Git: 7dbe973b3f3a4311094f772bca72bef58cfdf4d7
Just to be sure, this patch implements the second approach (described in
the previous patch) as well.
Note that there is precedent for suppressing "guest_lookup" exceptions:
refer to the "Error determining machine list" branch from commit
ae7ebc220b15 ("details: Properly limit machine type list by guests
arch/type", 2013-09-01).
(
In fact, that branch gets activated when opening the details window for a
domain that uses a non-default emulator; the "virt-manager --debug" log
contains:
> ERROR (details:613) Error determining machine list
> Traceback (most recent call last):
> File "virtManager/details/details.py", line 605, in _init_details
> capsinfo = caps.guest_lookup(
> File "virtinst/capabilities.py", line 319, in guest_lookup
> raise ValueError(msg)
> ValueError: Host does not support domain type kvm with machine
> 'pc-q35-8.1' for virtualization type 'hvm' with architecture 'x86_64'
)
Fixes: #539
Fixes: 05fcc7410eee ("virtinst: fix caching of domain capabilities", 2022-07-27)
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
diff --git a/virtinst/guest.py b/virtinst/guest.py
index 9232405b..c61c65e7 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -632,7 +632,12 @@ class Guest(XMLBuilder):
def _compare_machine(domcaps):
if self.os.machine == domcaps.machine:
return True
- capsinfo = self.lookup_capsinfo()
+ try:
+ capsinfo = self.lookup_capsinfo()
+ except Exception:
+ log.exception("Error fetching machine list for alias "
+ "resolution, assuming mismatch");
+ return False
if capsinfo.is_machine_alias(self.os.machine, domcaps.machine):
return True
return False

View File

@@ -1,63 +0,0 @@
Subject: tests/data: refresh Fedora tree URLs in virt-install-osinfo* expected XMLs
From: Laszlo Ersek lersek@redhat.com Sun Aug 27 09:19:09 2023 +0200
Date: Tue Aug 29 13:24:52 2023 +0200:
Git: 6e5c1db6b4a0af96afeb09a09fb2fc2b73308f01
Libosinfo seems to generate Fedora tree URLs using the "https", not
"http", scheme now; which breaks CI. Update the expected outputs
accordingly.
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
diff --git a/tests/data/cli/compare/virt-install-osinfo-unattended-treeapis.xml b/tests/data/cli/compare/virt-install-osinfo-unattended-treeapis.xml
index 1140bf0b..5f3c3474 100644
--- a/tests/data/cli/compare/virt-install-osinfo-unattended-treeapis.xml
+++ b/tests/data/cli/compare/virt-install-osinfo-unattended-treeapis.xml
@@ -13,7 +13,7 @@
<type arch="x86_64" machine="pc-i440fx-6.1">hvm</type>
<kernel>/VIRTINST-TESTSUITE/vmlinuz</kernel>
<initrd>/VIRTINST-TESTSUITE/initrd.img</initrd>
- <cmdline>ks=file:/fedora.ks method=http://archive.fedoraproject.org/pub/archive/fedora/linux/releases/17/Fedora/x86_64/os/</cmdline>
+ <cmdline>ks=file:/fedora.ks method=https://archive.fedoraproject.org/pub/archive/fedora/linux/releases/17/Fedora/x86_64/os/</cmdline>
</os>
<features>
<acpi/>
diff --git a/tests/data/cli/compare/virt-install-osinfo-url-unattended.xml b/tests/data/cli/compare/virt-install-osinfo-url-unattended.xml
index fe653b8b..2388120a 100644
--- a/tests/data/cli/compare/virt-install-osinfo-url-unattended.xml
+++ b/tests/data/cli/compare/virt-install-osinfo-url-unattended.xml
@@ -13,7 +13,7 @@
<type arch="x86_64" machine="q35">hvm</type>
<kernel>/VIRTINST-TESTSUITE/vmlinuz</kernel>
<initrd>/VIRTINST-TESTSUITE/initrd.img</initrd>
- <cmdline>ks=file:/fedora.ks inst.repo=http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/26/Server/x86_64/os/</cmdline>
+ <cmdline>ks=file:/fedora.ks inst.repo=https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/26/Server/x86_64/os/</cmdline>
</os>
<features>
<acpi/>
diff --git a/tests/data/cli/compare/virt-install-osinfo-url-with-disk.xml b/tests/data/cli/compare/virt-install-osinfo-url-with-disk.xml
index 99fb90fb..11fce0aa 100644
--- a/tests/data/cli/compare/virt-install-osinfo-url-with-disk.xml
+++ b/tests/data/cli/compare/virt-install-osinfo-url-with-disk.xml
@@ -13,7 +13,7 @@
<type arch="x86_64" machine="q35">hvm</type>
<kernel>/VIRTINST-TESTSUITE/vmlinuz</kernel>
<initrd>/VIRTINST-TESTSUITE/initrd.img</initrd>
- <cmdline>method=http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/26/Server/x86_64/os/</cmdline>
+ <cmdline>method=https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/26/Server/x86_64/os/</cmdline>
</os>
<features>
<acpi/>
diff --git a/tests/data/cli/compare/virt-install-osinfo-url.xml b/tests/data/cli/compare/virt-install-osinfo-url.xml
index 37fcc109..ea1937a3 100644
--- a/tests/data/cli/compare/virt-install-osinfo-url.xml
+++ b/tests/data/cli/compare/virt-install-osinfo-url.xml
@@ -13,7 +13,7 @@
<type arch="x86_64" machine="q35">hvm</type>
<kernel>/VIRTINST-TESTSUITE/vmlinuz</kernel>
<initrd>/VIRTINST-TESTSUITE/initrd.img</initrd>
- <cmdline>method=http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/26/Server/x86_64/os/</cmdline>
+ <cmdline>method=https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/26/Server/x86_64/os/</cmdline>
</os>
<features>
<acpi/>

View File

@@ -0,0 +1,59 @@
Subject: virt-install: add support for vDPA network device
From: Joren joren.regan@curtin.edu.au Tue Mar 18 17:09:29 2025 +0800
Date: Tue Mar 18 20:34:22 2025 +0100:
Git: e5142f28fe30f434bde2eb96afdc1de93a38f478
--- a/tests/data/cli/compare/virt-install-many-devices.xml
+++ b/tests/data/cli/compare/virt-install-many-devices.xml
@@ -618,6 +618,12 @@
<model type="virtio"/>
<address type="pci" domain="0" bus="0" slot="16" function="0"/>
</interface>
+ <interface type="vdpa">
+ <source dev="/dev/vhost-vdpa-0"/>
+ <mac address="12:34:56:78:9a:bc"/>
+ <model type="virtio"/>
+ <driver page_per_vq="on" queues="16"/>
+ </interface>
<interface type="user">
<mac address="00:11:22:33:44:55"/>
<model type="virtio"/>
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -655,6 +655,7 @@ source.reservations.managed=no,source.re
--network type=direct,source=eth5,source_mode=vepa,source.mode=vepa,target=mytap12,virtualport_type=802.1Qbg,virtualport_managerid=12,virtualport_typeid=1193046,virtualport_typeidversion=1,virtualport_instanceid=09b11c53-8b5c-4eeb-8f00-d84eaa0aaa3b,boot_order=1,trustGuestRxFilters=yes,mtu.size=1500,virtualport.parameters.managerid=12,virtualport.parameters.typeid=1193046,virtualport.parameters.typeidversion=1,virtualport.parameters.instanceid=09b11c53-8b5c-4eeb-8f00-d84eaa0aaa3b,boot_order=1,trustGuestRxFilters=yes,mtu.size=1500
--network user,model=virtio,address.type=spapr-vio,address.reg=0x500,link.state=no
--network vhostuser,source_type=unix,source_path=/tmp/vhost1.sock,source_mode=server,model=virtio,source.type=unix,source.path=/tmp/vhost1.sock,address.type=pci,address.bus=0x00,address.slot=0x10,address.function=0x0,address.domain=0x0000
+--network type=vdpa,source=/dev/vhost-vdpa-0,mac=12:34:56:78:9a:bc,driver.queues=16,driver.page_per_vq=on
--network user,address.type=ccw,address.cssid=0xfe,address.ssid=0,address.devno=01,boot.order=15,boot.loadparm=SYSTEM1
--network model=vmxnet3
--network backend.type=passt,backend.logFile=/tmp/foo.log,portForward0.proto=tcp,portForward0.address=192.168.10.10,portForward0.dev=eth0,portForward0.range0.start=4000,portForward0.range0.end=5000,portForward0.range0.to=10000,portForward0.range0.exclude=no,portForward0.range1.start=6000,portForward1.proto=tcp,portForward1.range0.start=2022,portForward1.range0.to=22
--- a/virtinst/devices/interface.py
+++ b/virtinst/devices/interface.py
@@ -181,6 +181,7 @@ class DeviceInterface(Device):
TYPE_VHOSTUSER = "vhostuser"
TYPE_ETHERNET = "ethernet"
TYPE_DIRECT = "direct"
+ TYPE_VDPA = "vdpa"
@staticmethod
def generate_mac(conn):
@@ -242,7 +243,7 @@ class DeviceInterface(Device):
return self.network
if self.type == self.TYPE_BRIDGE:
return self.bridge
- if self.type == self.TYPE_DIRECT:
+ if self.type == self.TYPE_DIRECT or self.type == self.TYPE_VDPA:
return self.source_dev
return None
def _set_source(self, newsource):
@@ -258,7 +259,7 @@ class DeviceInterface(Device):
self.network = newsource
elif self.type == self.TYPE_BRIDGE:
self.bridge = newsource
- elif self.type == self.TYPE_DIRECT:
+ elif self.type == self.TYPE_DIRECT or self.type == self.TYPE_VDPA:
self.source_dev = newsource
source = property(_get_source, _set_source)

View File

@@ -1,74 +0,0 @@
Subject: tests: Add unit test coverage for #539
From: Cole Robinson crobinso@redhat.com Tue Aug 29 12:27:40 2023 -0400
Date: Tue Aug 29 12:27:40 2023 -0400:
Git: 19b0f3f446ff8fc3b98c676726ee3a42b0b00b74
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/tests/data/xmlparse/emulator-custom.xml b/tests/data/xmlparse/emulator-custom.xml
new file mode 100644
index 00000000..d39ce024
--- /dev/null
+++ b/tests/data/xmlparse/emulator-custom.xml
@@ -0,0 +1,22 @@
+<domain type='kvm'>
+ <name>manual-emulator-test</name>
+ <metadata>
+ <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
+ <libosinfo:os id="http://fedoraproject.org/fedora/unknown"/>
+ </libosinfo:libosinfo>
+ </metadata>
+ <memory unit='KiB'>8388608</memory>
+ <currentMemory unit='KiB'>8388608</currentMemory>
+ <vcpu placement='static'>8</vcpu>
+ <os>
+ <type arch='mips' machine='some-unknown-machine'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/my/manual/emulator</emulator>
+ </devices>
+</domain>
+
diff --git a/tests/test_xmlparse.py b/tests/test_xmlparse.py
index 1bf0ebe5..781680cf 100644
--- a/tests/test_xmlparse.py
+++ b/tests/test_xmlparse.py
@@ -1170,3 +1170,34 @@ def testDiskSourceAbspath():
# ...unless it's a URL
disk.set_source_path("http://example.com/foobar3")
assert disk.get_source_path() == "http://example.com/foobar3"
+
+
+def testUnknownEmulatorDomcapsLookup(monkeypatch):
+ """
+ Libvirt can handle defining a VM with a custom emulator, one not detected
+ by `virsh capabilities`. An appropriate `virsh domcapabilities` call will
+ inspect the emulator and return relevant info.
+
+ This test ensures that for parsing XML the `virsh capabilities` failure
+ isn't fatal, and we attempt to return valid `virsh domcapabilities` data
+ """
+
+ seen = False
+ def fake_build_from_params(conn, emulator, arch, machine, hvtype):
+ nonlocal seen
+ seen = True
+ assert arch == "mips"
+ assert machine == "some-unknown-machine"
+ assert emulator == "/my/manual/emulator"
+ return virtinst.DomainCapabilities(conn)
+
+ monkeypatch.setattr(
+ "virtinst.DomainCapabilities.build_from_params",
+ fake_build_from_params)
+
+ conn = utils.URIs.open_kvm()
+ xml = open(DATADIR + "emulator-custom.xml").read()
+ guest = virtinst.Guest(conn, xml)
+ assert guest.lookup_domcaps()
+ assert guest.lookup_domcaps()
+ assert seen

View File

@@ -0,0 +1,43 @@
Subject: virt-manager: add support for vDPA network device
From: Pavel Hrdina phrdina@redhat.com Tue Mar 18 20:01:22 2025 +0100
Date: Tue Mar 18 20:34:22 2025 +0100:
Git: e39e0ad5f06fb080f0042090d97e47e11f11dcab
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
--- a/virtManager/device/netlist.py
+++ b/virtManager/device/netlist.py
@@ -142,6 +142,11 @@ class vmmNetworkList(vmmGObjectUI):
_nettype = virtinst.DeviceInterface.TYPE_DIRECT
model.append(_build_manual_row(_nettype, _label))
+ def _add_manual_vdpa_row():
+ _label = _("vDPA device...")
+ _nettype = virtinst.DeviceInterface.TYPE_VDPA
+ model.append(_build_manual_row(_nettype, _label))
+
vnets = self._find_virtual_networks()
default_bridge = virtinst.DeviceInterface.default_bridge(
self.conn.get_backend())
@@ -165,6 +170,7 @@ class vmmNetworkList(vmmGObjectUI):
bridgeidx = _add_manual_bridge_row()
_add_manual_macvtap_row()
+ _add_manual_vdpa_row()
# If there is a bridge device, default to that
if default_bridge:
@@ -248,8 +254,11 @@ class vmmNetworkList(vmmGObjectUI):
# If this is a bridge or macvtap device, show the
# manual source mode
- if nettype in [virtinst.DeviceInterface.TYPE_BRIDGE,
- virtinst.DeviceInterface.TYPE_DIRECT]:
+ if nettype in [
+ virtinst.DeviceInterface.TYPE_BRIDGE,
+ virtinst.DeviceInterface.TYPE_DIRECT,
+ virtinst.DeviceInterface.TYPE_VDPA,
+ ]:
rowiter = _find_row(nettype, None, True)
self.widget("net-manual-source").set_text(source or "")
if rowiter:

View File

@@ -1,80 +0,0 @@
Subject: fix indentation of multiline log.exception() invocations
From: Laszlo Ersek lersek@redhat.com Wed Aug 30 10:03:15 2023 +0200
Date: Wed Aug 30 10:48:54 2023 +0200:
Git: 2ebbdb2797c62b9a962bdc4362882115f9445a62
Commit f107e3998908 ("Switch to more traditional logging structure",
2019-06-17) replaced "logging.exception" with "log.exception", effectively
shifting the argument lists 4 characters to the left. The second and
further lines of multiline invocations were not accordingly unindented,
however, which ended up setting a suboptimal precedent as well. Unindent
those lines now.
Reported-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
diff --git a/virtManager/hoststorage.py b/virtManager/hoststorage.py
index 594c6587..0670572c 100644
--- a/virtManager/hoststorage.py
+++ b/virtManager/hoststorage.py
@@ -427,8 +427,7 @@ class vmmHostStorage(vmmGObjectUI):
if not namestr:
namestr = None
except Exception: # pragma: no cover
- log.exception("Failed to determine if storage volume in "
- "use.")
+ log.exception("Failed to determine if storage volume in use.")
sensitive = True
if self._vol_sensitive_cb:
diff --git a/virtManager/lib/inspection.py b/virtManager/lib/inspection.py
index 59f8b413..bc14dd2c 100644
--- a/virtManager/lib/inspection.py
+++ b/virtManager/lib/inspection.py
@@ -115,9 +115,8 @@ def _perform_inspection(conn, vm): # pragma: no cover
g.mount_ro(dev, mp)
filesystems_mounted = True
except Exception:
- log.exception("%s: exception mounting %s on %s "
- "(ignored)",
- prettyvm, dev, mp)
+ log.exception("%s: exception mounting %s on %s (ignored)",
+ prettyvm, dev, mp)
icon = None
apps = None
@@ -154,7 +153,7 @@ def _perform_inspection(conn, vm): # pragma: no cover
apps.append(app)
except Exception:
log.exception("%s: exception while listing apps (ignored)",
- prettyvm)
+ prettyvm)
# Force the libguestfs handle to close right now.
del g
diff --git a/virtManager/object/domain.py b/virtManager/object/domain.py
index 1570b952..e7dc5035 100644
--- a/virtManager/object/domain.py
+++ b/virtManager/object/domain.py
@@ -1429,7 +1429,7 @@ class vmmDomain(vmmLibvirtObject):
self._backend.undefineFlags(flags)
except libvirt.libvirtError:
log.exception("libvirt undefineFlags failed, "
- "falling back to old style")
+ "falling back to old style")
self._backend.undefine()
@vmmLibvirtObject.lifecycle_action
diff --git a/virtinst/guest.py b/virtinst/guest.py
index c61c65e7..0584484f 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -636,7 +636,7 @@ class Guest(XMLBuilder):
capsinfo = self.lookup_capsinfo()
except Exception:
log.exception("Error fetching machine list for alias "
- "resolution, assuming mismatch");
+ "resolution, assuming mismatch");
return False
if capsinfo.is_machine_alias(self.os.machine, domcaps.machine):
return True

View File

@@ -0,0 +1,46 @@
Subject: virt-install: detect wayland in order to start virt-viewer
From: Pavel Hrdina phrdina@redhat.com Mon Mar 24 12:11:23 2025 +0100
Date: Mon Mar 24 15:32:28 2025 +0100:
Git: 4f9618289f279f86994a5d2f1aada8a6524f5a6f
When running virt-install using waypipe the DISPLAY variable is not
defined and virt-install will complain that it cannot start virt-viewer.
Check for WAYLAND_DISPLAY as well, DISPLAY is defined only when xwayland
is used. In case of waypipe it configures only WAYLAND_DISPLAY.
Move the check before we check for virt-viewer as without display there
is no point to check if virt-viewer is installed or not.
Fixes: https://github.com/virt-manager/virt-manager/issues/884
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -1999,18 +1999,20 @@ def _determine_default_autoconsole_type(
log.debug("No viewer to launch for graphics type '%s'", gtype)
return None
+ if (
+ not os.environ.get("DISPLAY", "")
+ and not os.environ.get("DISPLAY_WAYLAND")
+ and not xmlutil.in_testsuite()
+ ): # pragma: no cover
+ log.warning(_("No display detected. Not running virt-viewer."))
+ return None
+
if not HAS_VIRTVIEWER and not xmlutil.in_testsuite(): # pragma: no cover
log.warning(_("Unable to connect to graphical console: "
"virt-viewer not installed. Please install "
"the 'virt-viewer' package."))
return None
- if (not os.environ.get("DISPLAY", "") and
- not xmlutil.in_testsuite()): # pragma: no cover
- log.warning(_("Graphics requested but DISPLAY is not set. "
- "Not running virt-viewer."))
- return None
-
return "graphical"

View File

@@ -0,0 +1,43 @@
Subject: Validation: allow spaces, disallow slashes
From: AbhinavTiruvee ranjaniabhinav@gmail.com Mon Apr 7 18:05:41 2025 -0500
Date: Tue Apr 22 12:11:00 2025 +0200:
Git: 237896029d668543465b4566d0ea880d468c7058
Libvirt permits spaces in object names but rejects the / character.
This change aligns our validator with libvirts behavior (and QEMUs),
preventing names with '/' while still allowing humanfriendly
names with spaces.
Fixes: #740
diff --git a/tests/test_xmlparse.py b/tests/test_xmlparse.py
index c4107f932..898fc55c3 100644
--- a/tests/test_xmlparse.py
+++ b/tests/test_xmlparse.py
@@ -1011,7 +1011,9 @@ def testXMLBuilderCoverage():
virtinst.DeviceDisk.validate_generic_name("objtype", None)
with pytest.raises(ValueError):
- virtinst.DeviceDisk.validate_generic_name("objtype", "foo bar")
+ virtinst.DeviceDisk.validate_generic_name("objtype", "foo/bar")
+
+ assert virtinst.DeviceDisk.validate_generic_name("objtype", "foo bar") is None
# Test property __repr__ for code coverage
assert "DeviceAddress" in str(virtinst.DeviceDisk.address)
diff --git a/virtinst/xmlbuilder.py b/virtinst/xmlbuilder.py
index 64ea25e1b..8ec18a7a7 100644
--- a/virtinst/xmlbuilder.py
+++ b/virtinst/xmlbuilder.py
@@ -511,9 +511,8 @@ class XMLBuilder(object):
@staticmethod
def validate_generic_name(name_label, val):
- # Rather than try and match libvirt's regex, just forbid things we
- # know don't work
- forbid = [" "]
+ # Only character that shouldn't work is '/', matching QEMU
+ forbid = ["/"]
if not val:
# translators: value is a generic object type name
raise ValueError(_("A name must be specified for the %s") %

View File

@@ -1,27 +0,0 @@
Subject: virt-clone: Copy disk permissions as well
From: Martin Kletzander mkletzan@redhat.com Fri Sep 1 21:39:37 2023 +0200
Date: Sun Sep 10 11:19:31 2023 -0400:
Git: 9f8da1f666177694dcffaac6728988b18e27274c
When cloning using libvirt APIs the function virStorageVolCreateXMLFrom
is used. However name and permissions are taken from the new XML [1].
By copying the permissions (only the mode is used) we can avoid some
unexpected issues.
[1] https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolCreateXMLFrom
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2115153
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
diff --git a/virtinst/storage.py b/virtinst/storage.py
index f9a9f7a7..fd8a7481 100644
--- a/virtinst/storage.py
+++ b/virtinst/storage.py
@@ -528,6 +528,7 @@ class StorageVolume(_StorageObject):
self.format = parsevol.format
self.capacity = parsevol.capacity
self.allocation = parsevol.allocation
+ self.permissions.mode = parsevol.permissions.mode
if not self._pool:
self.pool = self._input_vol.storagePoolLookupByVolume()

View File

@@ -1,19 +0,0 @@
Subject: data: appstream: add launchable tag
From: Pino Toscano ptoscano@redhat.com Sat Sep 9 07:26:20 2023 +0200
Date: Sun Sep 10 11:20:29 2023 -0400:
Git: ccd47575337cfa8e8b96197310b3ff4dabd2ab69
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
diff --git a/data/virt-manager.appdata.xml.in b/data/virt-manager.appdata.xml.in
index 0383852e..fd8f6e48 100644
--- a/data/virt-manager.appdata.xml.in
+++ b/data/virt-manager.appdata.xml.in
@@ -40,6 +40,7 @@
<keyword>kvm</keyword>
</keywords>
<content_rating type="oars-1.1"/>
+ <launchable type="desktop-id">virt-manager.desktop</launchable>
<releases>
<release version="4.1.0" date="2022-08-04"/>
<release version="4.0.0" date="2022-03-02"/>

View File

@@ -0,0 +1,18 @@
Subject: fix: default start_folder to None
From: Zahid Kizmaz tech@zahid.rocks Sun May 11 22:41:44 2025 +0200
Date: Tue Jun 10 09:22:10 2025 +0200:
Git: 62f976a61b0363b9e6a0eac1fd2e8553d24d5457
diff --git a/virtManager/storagebrowse.py b/virtManager/storagebrowse.py
index 8e8239b4d..d8c70c925 100644
--- a/virtManager/storagebrowse.py
+++ b/virtManager/storagebrowse.py
@@ -176,6 +176,7 @@ class vmmStorageBrowser(vmmGObjectUI):
data = _BrowseReasonMetadata(self._browse_reason)
gsettings_key = data.gsettings_key
+ start_folder = None
if gsettings_key:
start_folder = self.config.get_default_directory(gsettings_key)

View File

@@ -0,0 +1,21 @@
Subject: Add Ctrl+Alt+Shift+Esc key command for logind's SecureAttentionKey
From: n3rdopolis bluescreen_avenger@verizon.net Mon May 5 22:29:18 2025 -0400
Date: Wed Jun 11 09:32:34 2025 +0200:
Git: 4b89c39eea1cb89dda597d81831fc385db3f8cbc
logind now supports a new key binding https://github.com/systemd/systemd/pull/29542
Ctrl+Alt+Shift+Esc that emits SecureAttentionKey to allow login managers to start
or switch back to the greeter
diff --git a/virtManager/details/console.py b/virtManager/details/console.py
index 54b587772..e68bb9ac8 100644
--- a/virtManager/details/console.py
+++ b/virtManager/details/console.py
@@ -120,6 +120,7 @@ def build_keycombo_menu(on_send_key_fn):
make_item("<Control><Alt>BackSpace", ["Control_L", "Alt_L", "BackSpace"])
make_item("<Control><Alt>Delete", ["Control_L", "Alt_L", "Delete"])
+ make_item("<Control><Alt><Shift>Escape", ["Control_L", "Alt_L", "Shift_L", "Escape"])
menu.add(Gtk.SeparatorMenuItem())
for i in range(1, 13):

View File

@@ -1,71 +0,0 @@
Subject: Fix some pylint
From: Cole Robinson crobinso@redhat.com Tue Sep 12 11:54:04 2023 -0400
Date: Tue Sep 12 11:54:04 2023 -0400:
Git: 0f706cf87436af598b8694aecf4b42657bfa5b11
Signed-off-by: Cole Robinson <crobinso@redhat.com>
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -449,7 +449,7 @@ class App(object):
self._add(cat, args, None, check_success=True, **kwargs)
def add_invalid(self, cat, args, **kwargs):
if "grep" not in kwargs:
- raise Exception("grep= must be passed for add_invalid")
+ raise RuntimeError("grep= must be passed for add_invalid")
self._add(cat, args, None, check_success=False, **kwargs)
def add_compare(self, cat, args, compbase, **kwargs):
self._add(cat, args, compbase,
--- a/tests/test_xmlparse.py
+++ b/tests/test_xmlparse.py
@@ -1183,7 +1183,7 @@ def testUnknownEmulatorDomcapsLookup(mon
"""
seen = False
- def fake_build_from_params(conn, emulator, arch, machine, hvtype):
+ def fake_build_from_params(conn, emulator, arch, machine, _hvtype):
nonlocal seen
seen = True
assert arch == "mips"
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -1276,7 +1276,7 @@ class _InitClass(type):
but without giving us an explicit dep on python 3.6
"""
- def __new__(cls, *args, **kwargs):
+ def __new__(cls, *args, **kwargs): # pylint: disable=bad-mcs-classmethod-argument
if len(args) != 3:
return super().__new__(cls, *args) # pragma: no cover
dummy = kwargs
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -636,7 +636,7 @@ class Guest(XMLBuilder):
capsinfo = self.lookup_capsinfo()
except Exception:
log.exception("Error fetching machine list for alias "
- "resolution, assuming mismatch");
+ "resolution, assuming mismatch")
return False
if capsinfo.is_machine_alias(self.os.machine, domcaps.machine):
return True
@@ -743,7 +743,7 @@ class Guest(XMLBuilder):
if original_machine_type.startswith(prefix):
self.os.machine = machine_alias
return
- raise Exception("Don't know how to refresh machine type '%s'" %
+ raise RuntimeError("Don't know how to refresh machine type '%s'" %
original_machine_type)
def set_smbios_serial_cloudinit(self):
--- a/virtinst/xmlbuilder.py
+++ b/virtinst/xmlbuilder.py
@@ -54,7 +54,7 @@ class XMLManualAction(object):
val = self.xpath_value
else:
if "=" not in str(xpath):
- raise Exception(
+ raise ValueError(
"%s: Setting xpath must be in the form of XPATH=VALUE" %
xpath)
xpath, val = xpath.rsplit("=", 1)

View File

@@ -1,154 +0,0 @@
Subject: connectauth: Drop sanity checking for libvirtd
From: Cole Robinson crobinso@redhat.com Tue Sep 12 13:18:42 2023 -0400
Date: Sun Sep 24 16:31:58 2023 -0400:
Git: 775edfd5dc668c26ffbdf07f6404ca80d91c3a3a
Nowadays with libvirt split daemons, libvirtd isn't required to
be installed for a first run local connection to succeed, so we
are needlessly blocking the app from 'just working' in many cases.
Especially considering that many distros often have libvirt running
out of the box due to gnome-boxes pulling it in.
Drop the daemon checking entirely.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/tests/uitests/test_cli.py b/tests/uitests/test_cli.py
index 7e7ab6ea..b317bf28 100644
--- a/tests/uitests/test_cli.py
+++ b/tests/uitests/test_cli.py
@@ -139,15 +139,12 @@ def testCLIFirstRunURIBad(app):
app.click_alert_button("bad:///uri", "Close")
-def testCLIFirstRunNoLibvirtd(app):
+def testCLIFirstRunNoURI(app):
# Emulate first run with no libvirtd detected
- app.open(use_uri=False, firstrun_uri="bad:///uri",
- extra_opts=["--test-options=fake-no-libvirtd"])
+ app.open(use_uri=False, firstrun_uri="")
errlabel = app.topwin.find("error-label")
lib.utils.check(
lambda: "Checking for virtualization" in errlabel.text)
- lib.utils.check(
- lambda: "libvirtd service does not appear" in errlabel.text)
lib.utils.check(
lambda: "detect a default hypervisor" in errlabel.text)
diff --git a/virtManager/engine.py b/virtManager/engine.py
index 58fd8026..a90b5464 100644
--- a/virtManager/engine.py
+++ b/virtManager/engine.py
@@ -131,14 +131,14 @@ class vmmEngine(vmmGObject):
"""
from .lib import connectauth
- tryuri = vmmCreateConn.default_uri()
- log.debug("Probed default URI=%s", tryuri)
+ detected_uri = vmmCreateConn.default_uri()
+ log.debug("Probed default URI=%s", detected_uri)
if self.config.CLITestOptions.firstrun_uri is not None:
- tryuri = self.config.CLITestOptions.firstrun_uri or None
- log.debug("Using test-options firstrun_uri=%s", tryuri)
+ detected_uri = self.config.CLITestOptions.firstrun_uri or None
+ log.debug("Using test-options firstrun_uri=%s", detected_uri)
manager = self._get_manager()
- msg = connectauth.setup_first_uri(self.config, tryuri)
+ msg = connectauth.setup_first_uri(self.config, detected_uri)
if msg:
manager.set_startup_error(msg)
return
@@ -149,7 +149,7 @@ class vmmEngine(vmmGObject):
if ConnectError:
self._handle_conn_error(c, ConnectError)
- conn = vmmConnectionManager.get_instance().add_conn(tryuri)
+ conn = vmmConnectionManager.get_instance().add_conn(detected_uri)
conn.set_autoconnect(True)
conn.connect_once("open-completed", _open_completed)
conn.open()
diff --git a/virtManager/lib/connectauth.py b/virtManager/lib/connectauth.py
index 71e1b21f..9baec603 100644
--- a/virtManager/lib/connectauth.py
+++ b/virtManager/lib/connectauth.py
@@ -7,7 +7,6 @@
import collections
import os
import re
-import shutil
import time
from gi.repository import GLib
@@ -161,7 +160,7 @@ def connect_error(conn, errmsg, tb, warnconsole):
"or install an SSH askpass package locally.")
show_errmsg = False
else:
- hint += _("Verify that the 'libvirtd' daemon is running "
+ hint += _("Verify that an appropriate libvirt daemon is running "
"on the remote host.")
elif conn.is_xen(): # pragma: no cover
@@ -176,8 +175,8 @@ def connect_error(conn, errmsg, tb, warnconsole):
"may not be able to connect to libvirt as a "
"regular user. Try running as root.")
show_errmsg = False
- elif re.search(r"libvirt-sock", tb): # pragma: no cover
- hint += _("Verify that the 'libvirtd' daemon is running.")
+ elif re.search(r"virt[a-z]*-sock", tb): # pragma: no cover
+ hint += _("Verify that an appropriate libvirt daemon is running.")
show_errmsg = False
msg = _("Unable to connect to libvirt %s." % conn.get_uri())
@@ -203,27 +202,11 @@ def connect_error(conn, errmsg, tb, warnconsole):
# App first run connection setup #
##################################
-def setup_first_uri(config, tryuri):
- # Add /usr/sbin to the path in case non-root user launches virt-manager
- libvirtd_installed = bool(shutil.which("libvirtd", path=os.environ['PATH'] + os.pathsep + "/usr/sbin"))
- if config.CLITestOptions.fake_no_libvirtd:
- libvirtd_installed = False
-
- if tryuri and libvirtd_installed:
- return
-
- # Manager fail message
+def setup_first_uri(_config, detected_uri):
msg = ""
- if not libvirtd_installed: # pragma: no cover
- msg += _("The libvirtd service does not appear to be installed. "
- "Install and run the libvirtd service to manage "
- "virtualization on this host.")
-
- if not tryuri or "qemu" not in tryuri:
- if msg:
- msg += "\n\n" # pragma: no cover
+ if not detected_uri:
msg += _("Could not detect a default hypervisor. Make "
- "sure the appropriate QEMU/KVM virtualization "
+ "sure the appropriate QEMU/KVM virtualization and libvirt "
"packages are installed to manage virtualization "
"on this host.")
diff --git a/virtManager/lib/testmock.py b/virtManager/lib/testmock.py
index 1f3e91ac..d2ee6972 100644
--- a/virtManager/lib/testmock.py
+++ b/virtManager/lib/testmock.py
@@ -168,8 +168,6 @@ class CLITestOptionsClass:
* firstrun-uri: If set, use this as the initial connection URI
if we are doing firstrun testing
- * fake-no-libvirtd: If doing firstrun testing, fake that
- libvirtd is not installed
* fake-vnc-username: Fake VNC username auth request
* fake-console-resolution: Fake viewer console resolution response.
Spice doesn't return values here when we are just testing
@@ -223,7 +221,6 @@ class CLITestOptionsClass:
self.test_vm_run_fail = _get("test-vm-run-fail")
self.spice_agent = _get("spice-agent")
self.firstrun_uri = _get_value("firstrun-uri")
- self.fake_no_libvirtd = _get("fake-no-libvirtd")
self.fake_vnc_username = _get("fake-vnc-username")
self.fake_console_resolution = _get("fake-console-resolution")
self.fake_systray = _get("fake-systray")

View File

@@ -1,70 +0,0 @@
Subject: delete: Fix ambiguity that confused pylint
From: Cole Robinson crobinso@redhat.com Sun Sep 24 16:13:00 2023 -0400
Date: Sun Sep 24 16:31:58 2023 -0400:
Git: ab0a318a46b1ab5c7827fc805b8c4e21635d66ab
virtManager/delete.py:219:11: E0601: Using variable 'error' before assignment (used-before-assignment)
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/virtManager/delete.py b/virtManager/delete.py
index f050534b..2195a5d9 100644
--- a/virtManager/delete.py
+++ b/virtManager/delete.py
@@ -179,8 +179,9 @@ class _vmmDeleteBase(vmmGObjectUI):
self._set_vm(None)
def _async_delete(self, asyncjob, vm, paths):
- details = ""
+ errdata = None
storage_errors = []
+
try:
self._destroy_vm(vm)
@@ -191,33 +192,32 @@ class _vmmDeleteBase(vmmGObjectUI):
self._delete_vm(vm)
vm.conn.schedule_priority_tick(pollvm=True)
except Exception as e: # pragma: no cover
- error = _("Error deleting virtual machine '%(vm)s': %(error)s") % {
- "vm": vm.get_name(),
- "error": str(e),
- }
- details = "".join(traceback.format_exc())
+ errdata = (
+ (_("Error deleting virtual machine '%(vm)s': %(error)s") %
+ {"vm": vm.get_name(), "error": str(e)}),
+ "".join(traceback.format_exc()))
+
+ if not storage_errors and not errdata:
+ return
storage_errstr = ""
for errinfo in storage_errors:
storage_errstr += "%s\n%s\n" % (errinfo[0], errinfo[1])
- if not storage_errstr and not details:
- return
-
# We had extra storage errors. If there was another error message,
# errors to it. Otherwise, build the main error around them.
- if details: # pragma: no cover
+ if errdata: # pragma: no cover
+ error, details = errdata
details += "\n\n"
details += _("Additionally, there were errors removing"
- " certain storage devices: \n")
+ " certain storage devices: \n")
details += storage_errstr
else:
error = _("Errors encountered while removing certain "
- "storage devices.")
+ "storage devices.")
details = storage_errstr
- if error:
- asyncjob.set_error(error, details)
+ asyncjob.set_error(error, details)
def _async_delete_paths(self, paths, conn, meter):
storage_errors = []

View File

@@ -1,65 +0,0 @@
Subject: Fix filesystem socket.source
From: Jonathon Jongsma jjongsma@redhat.com Mon Oct 23 14:42:19 2023 -0500
Date: Tue Oct 24 10:30:37 2023 +0200:
Git: 40b73fec1b251da866485ac8534ba61aaca14fe7
When specifying the socket.source option for filesystem devices, like
this:
--filesystem type=mount,driver.type=virtiofs,source.socket=/xyz.sock,target.dir=tag1
virt-install is writing the xml as:
<filesystem type="mount">
<source>
<socket>/xyz.sock</socket>
</source>
<target dir="tag1"/>
<driver type="virtiofs"/>
</filesystem>
This produces an error such as:
ERROR missing source information for device mount_tag1
But the socket should be an attribute of source rather than a child
element. After this patch, the same command results in the following XML
and no error is produced:
<filesystem type="mount">
<source socket="/xyz.sock"/>
<target dir="tag1"/>
<driver type="virtiofs"/>
</filesystem>
Resolves: RHEL-1126
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
diff --git a/tests/data/cli/compare/virt-install-many-devices.xml b/tests/data/cli/compare/virt-install-many-devices.xml
index e4a7da8f..8eca4e5b 100644
--- a/tests/data/cli/compare/virt-install-many-devices.xml
+++ b/tests/data/cli/compare/virt-install-many-devices.xml
@@ -509,9 +509,7 @@
<readonly/>
<space_hard_limit>1234</space_hard_limit>
<space_soft_limit>500</space_soft_limit>
- <source pool="pool1" volume="vol">
- <socket>/tmp/foo.sock</socket>
- </source>
+ <source pool="pool1" volume="vol" socket="/tmp/foo.sock"/>
<target dir="/foo"/>
<binary path="/foo/virtiofsd" xattr="off">
<cache mode="always"/>
diff --git a/virtinst/devices/filesystem.py b/virtinst/devices/filesystem.py
index 975548f4..e38e35c3 100644
--- a/virtinst/devices/filesystem.py
+++ b/virtinst/devices/filesystem.py
@@ -53,7 +53,7 @@ class DeviceFilesystem(Device):
source_units = XMLProperty("./source/@units")
source_pool = XMLProperty("./source/@pool")
source_volume = XMLProperty("./source/@volume")
- source_socket = XMLProperty("./source/socket")
+ source_socket = XMLProperty("./source/@socket")
binary_path = XMLProperty("./binary/@path")
binary_xattr = XMLProperty("./binary/@xattr", is_onoff=True)

View File

@@ -1,65 +0,0 @@
Subject: uri: Mock domcaps returning NO_SUPPORT
From: Cole Robinson crobinso@redhat.com Mon Jan 22 17:07:31 2024 -0500
Date: Mon Jan 22 17:07:31 2024 -0500:
Git: 2e3db754d1d596f8fed6b327017ace922838eb49
With libvirt 9.8.0, the test driver now has a stub getDomainCapabilities
implementation. But we still have some code that needs to handle
a driver with missing domcaps.
Make our magicuri mock return NO_SUPPORT for domcaps, when the URI
doesn't have any domcaps XML passed in. This is enough for our test
purposes.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/virtinst/uri.py b/virtinst/uri.py
index c83aaa78..c4be1960 100644
--- a/virtinst/uri.py
+++ b/virtinst/uri.py
@@ -173,23 +173,39 @@ class MagicURI(object):
capsxml = open(self.capsfile).read()
conn.getCapabilities = lambda: capsxml
+ def _raise_nosupport_error(msg):
+ import libvirt
+ err = [libvirt.VIR_ERR_NO_SUPPORT, None, msg, None, None, None]
+ exc = libvirt.libvirtError(msg)
+ exc.err = err
+ raise exc
+
# Fake domcapabilities. This is insufficient since output should
# vary per type/arch/emulator combo, but it can be expanded later
# if needed
+ domcapsxml = None
if self.domcapsfile:
domcapsxml = open(self.domcapsfile).read()
- def fake_domcaps(emulator, arch, machine, virttype, flags=0):
- ignore = emulator
- ignore = flags
- ignore = machine
- ignore = virttype
+ def fake_domcaps(emulator, arch, machine, virttype, flags=0):
+ ignore = emulator
+ ignore = flags
+ ignore = machine
+ ignore = virttype
+
+ if domcapsxml:
ret = domcapsxml
if arch:
ret = re.sub("arch>.+</arch", "arch>%s</arch" % arch, ret)
return ret
- conn.getDomainCapabilities = fake_domcaps
+ # In libvirt 9.8.0 the test suite added a stub domcaps
+ # impl. Fall back to raising NO_SUPPORT for our magic URIs, so
+ # we can keep getting code coverage of the old code paths
+ _raise_nosupport_error(
+ "virtinst test driver fake domcaps nosupport")
+
+ conn.getDomainCapabilities = fake_domcaps
if self.fakeuri:
origcreate = conn.createXML

View File

@@ -1,23 +0,0 @@
Subject: tests: cli: Adjust hotplug test for latest libvirt
From: Cole Robinson crobinso@redhat.com Mon Jan 22 17:10:41 2024 -0500
Date: Mon Jan 22 17:10:41 2024 -0500:
Git: 83fcc5b2e8f2cede84564387756fe8971de72188
The libvirt test driver now has implementations for hotplug routines,
which broke string matching for one case.
Loosen it up to work for old and new libvirt versions.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -1334,7 +1334,7 @@ c.add_invalid("test --edit --cpu host-pa
c.add_invalid("test --edit", grep="No change specified.")
c.add_invalid("test --edit 2 --cpu host-passthrough", grep="'--edit 2' requested but there's only 1 --cpu object in the XML")
c.add_invalid("test-for-virtxml --edit 5 --tpm /dev/tpm", grep="'--edit 5' requested but there's only 1 --tpm object in the XML")
-c.add_invalid("test-for-virtxml --add-device --host-device 0x04b3:0x4485 --update --confirm", input_text="yes", grep="not supported by the connection driver: virDomainAttachDevice")
+c.add_invalid("test-for-virtxml --add-device --host-device 0x04b3:0x4485 --update --confirm", input_text="yes", grep="not supported")
c.add_invalid("test-for-virtxml --remove-device --host-device 1 --update --confirm", input_text="foo\nyes\n", grep="not supported by the connection driver: virDomainDetachDevice")
c.add_invalid("test-for-virtxml --edit --graphics password=foo,keymap= --update --confirm", input_text="yes", grep="not supported by the connection driver: virDomainUpdateDeviceFlags")
c.add_invalid("--build-xml --memory 10,maxmemory=20", grep="--build-xml not supported for --memory")

View File

@@ -1,35 +0,0 @@
Subject: Fix some pylint
From: Cole Robinson crobinso@redhat.com Mon Jan 22 17:15:11 2024 -0500
Date: Mon Jan 22 17:15:11 2024 -0500:
Git: c399353e00b37ae00c614c7e52a1369e6e816820
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/virtManager/details/viewers.py b/virtManager/details/viewers.py
index 68c97bdb..2a8a7857 100644
--- a/virtManager/details/viewers.py
+++ b/virtManager/details/viewers.py
@@ -618,8 +618,8 @@ class SpiceViewer(Viewer):
self._main_channel, "notify::agent-connected",
self._agent_connected_cb)
- elif (type(channel) == SpiceClientGLib.DisplayChannel and
- not self._display):
+ elif (isinstance(channel, SpiceClientGLib.DisplayChannel) and
+ not self._display):
channel_id = channel.get_property("channel-id")
if channel_id != 0: # pragma: no cover
diff --git a/virtinst/diskbackend.py b/virtinst/diskbackend.py
index 5f80c437..abfaab26 100644
--- a/virtinst/diskbackend.py
+++ b/virtinst/diskbackend.py
@@ -753,7 +753,7 @@ class StorageBackend(_StorageBase):
self._exists = True
elif self._path is None:
self._exists = True
- elif (not self.get_dev_type() == "network" and
+ elif (self.get_dev_type() != "network" and
not self._conn.is_remote() and
os.path.exists(self._path)):
self._exists = True

View File

@@ -1,24 +0,0 @@
Subject: tests: ui: make newvm test start less flakey
From: Cole Robinson crobinso@redhat.com Tue Jan 23 08:59:34 2024 -0500
Date: Tue Jan 23 09:07:29 2024 -0500:
Git: acf3cedbbf85de9dd50c483547e2ea258c529583
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/tests/uitests/test_createvm.py b/tests/uitests/test_createvm.py
index f430c14c..6fe894b4 100644
--- a/tests/uitests/test_createvm.py
+++ b/tests/uitests/test_createvm.py
@@ -12,7 +12,11 @@ from . import lib
###################
def _open_newvm(app):
- app.root.find("New", "push button").click()
+ button = app.root.find("New", "push button")
+ # Launching the dialog can be very flakey without this explicit
+ # point() call, not sure why
+ button.point()
+ button.click()
return app.find_window("New VM")

View File

@@ -1,22 +0,0 @@
Subject: tests: ui: make creatnet test start less flakey
From: Cole Robinson crobinso@redhat.com Tue Jan 23 11:18:49 2024 -0500
Date: Tue Jan 23 13:28:07 2024 -0500:
Git: 4e2bec5b1410649232165fa33091a6ed9b9b48d9
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/tests/uitests/lib/app.py b/tests/uitests/lib/app.py
index 83628a7f..672b5ced 100644
--- a/tests/uitests/lib/app.py
+++ b/tests/uitests/lib/app.py
@@ -215,7 +215,9 @@ class VMMDogtailApp(object):
self.root.find_fuzzy("Edit", "menu").click()
self.root.find_fuzzy("Connection Details", "menu item").click()
win = self.find_window("%s - Connection Details" % conn_label)
- win.find_fuzzy(tab, "page tab").click()
+ tab = win.find_fuzzy(tab, "page tab")
+ tab.point()
+ tab.click()
return win
def manager_test_conn_window_cleanup(self, conn_label, childwin):

View File

@@ -14,9 +14,11 @@ change now to get ahead of it.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
--- a/man/virt-install.rst
+++ b/man/virt-install.rst
@@ -1055,8 +1055,8 @@ all other settings off or unset.
Index: virt-manager-5.0.0/man/virt-install.rst
===================================================================
--- virt-manager-5.0.0.orig/man/virt-install.rst
+++ virt-manager-5.0.0/man/virt-install.rst
@@ -1067,8 +1067,8 @@ all other settings off or unset.
By default, virt-install will always attempt ``--osinfo detect=on``
for appropriate install media. If no OS is detected, we will fail
@@ -27,18 +29,22 @@ Signed-off-by: Cole Robinson <crobinso@redhat.com>
above, or disabling the ``require`` option. If you just need to get back
to the old non-fatal behavior ASAP, set the environment variable
VIRTINSTALL_OSINFO_DISABLE_REQUIRE=1.
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -1181,7 +1181,6 @@ c.add_compare("--connect %(URI-KVM-ARMV7
Index: virt-manager-5.0.0/tests/test_cli.py
===================================================================
--- virt-manager-5.0.0.orig/tests/test_cli.py
+++ virt-manager-5.0.0/tests/test_cli.py
@@ -1255,7 +1255,6 @@ c.add_compare("--connect %(URI-KVM-ARMV7
#################
c.add_valid("--arch aarch64 --osinfo fedora19 --nodisks --pxe --connect " + utils.URIs.kvm_x86_nodomcaps, grep="Libvirt version does not support UEFI") # attempt to default to aarch64 UEFI, but it fails, but should only print warnings
-c.add_invalid("--arch aarch64 --nodisks --pxe --connect " + utils.URIs.kvm_x86, grep="OS name is required") # catch missing osinfo for non-x86
c.add_compare("--arch aarch64 --osinfo fedora19 --machine virt --boot kernel=/f19-arm.kernel,initrd=/f19-arm.initrd,kernel_args=\"console=ttyAMA0,1234 rw root=/dev/vda3\" --disk %(EXISTIMG1)s", "aarch64-machvirt")
c.add_compare("--arch aarch64 --osinfo fedora19 --machine virt --cpu default --boot kernel=/f19-arm.kernel,initrd=/f19-arm.initrd,kernel_args=\"console=ttyAMA0,1234 rw root=/dev/vda3\" --disk %(EXISTIMG1)s", "aarch64-machvirt")
c.add_compare("--arch aarch64 --osinfo fedora19 --boot kernel=/f19-arm.kernel,initrd=/f19-arm.initrd,kernel_args=\"console=ttyAMA0,1234 rw root=/dev/vda3\" --disk %(EXISTIMG1)s", "aarch64-machdefault")
c.add_compare("--arch aarch64 --cdrom %(ISO-F26-NETINST)s --boot loader=CODE.fd,nvram.template=VARS.fd --disk %(EXISTIMG1)s --cpu none --events on_crash=preserve,on_reboot=destroy,on_poweroff=restart", "aarch64-cdrom") # cdrom test, but also --cpu none override, --events override, and headless
--- a/virtinst/virtinstall.py
+++ b/virtinst/virtinstall.py
Index: virt-manager-5.0.0/virtinst/virtinstall.py
===================================================================
--- virt-manager-5.0.0.orig/virtinst/virtinstall.py
+++ virt-manager-5.0.0/virtinst/virtinstall.py
@@ -355,13 +355,9 @@ def _show_memory_warnings(guest):

View File

@@ -2,7 +2,7 @@
X-SuSE-translate=true
X-SuSE-DocTeamID=ycc_xen
Type=Application
Categories=GTK;GNOME;System;Monitor;X-SuSE-YaST;X-SuSE-YaST-Virtualization;
Categories=System;X-SuSE-YaST;X-SuSE-YaST-Virtualization;
X-KDE-ModuleType=Library
X-KDE-RootOnly=true

Binary file not shown.

BIN
virt-manager-5.0.0.tar.xz LFS Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More