virt-manager-5.0.0-1.el9

- Rebased to virt-manager-5.0.0 (RHEL-34607)
- The rebase also fixes the following bugs:
    RHEL-7124, RHEL-741, RHEL-10468, RHEL-17436, RHEL-1126
    RHEL-62959, RHEL-65264

Resolves: RHEL-10468, RHEL-1126, RHEL-17436, RHEL-34607, RHEL-62959
Resolves: RHEL-65264, RHEL-7124, RHEL-741
This commit is contained in:
Pavel Hrdina 2024-12-02 17:21:19 +01:00
parent efc4a526b8
commit 1eb87a8f6d
14 changed files with 101 additions and 1344 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/virt-manager-*.tar.gz
/virt-manager-5.0.0.tar.xz

View File

@ -1 +1 @@
SHA512 (virt-manager-4.1.0.tar.gz) = 725cb5bcbaebaafae417f95deffb4243ccdad769668cba6e1235f4607e2b29dbd099d2a9a3885981158f53ea854dd71cc29ed9d7557b2791161c13d34f2ef883
SHA512 (virt-manager-5.0.0.tar.xz) = d0cb7eb844fc98ad29413717e5fa5834bc6f9f6cb6b9339b59c2721bb37a58f71280e3d2a04a64a6021614626329d76c92474f826bb1d9b7a9040b479f20d4e8

View File

@ -0,0 +1,43 @@
From 866a53d3e8ef1d536bc7b3f41560ba71f7e81c79 Mon Sep 17 00:00:00 2001
Message-ID: <866a53d3e8ef1d536bc7b3f41560ba71f7e81c79.1733156402.git.phrdina@redhat.com>
From: Pavel Hrdina <phrdina@redhat.com>
Date: Mon, 2 Dec 2024 16:55:04 +0100
Subject: [PATCH] Disable spice
- Disable spice options in virt-manager.
Resolves: #1946939
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
---
virt-manager.spec.in | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/virt-manager.spec.in b/virt-manager.spec.in
index c22ed32b5..fba140388 100644
--- a/virt-manager.spec.in
+++ b/virt-manager.spec.in
@@ -23,7 +23,6 @@ Requires: python3-gobject >= 3.31.3
Requires: gtk3 >= 3.22.0
Requires: libvirt-glib >= 0.0.9
Requires: gtk-vnc2
-Requires: spice-gtk3
# virt-manager is one of those apps that people will often install onto
# a headless machine for use over SSH. This means the virt-manager dep
@@ -104,8 +103,13 @@ machine).
%build
+%if 0%{?rhel}
+%global _default_graphics -Ddefault-graphics=vnc
+%endif
+
%meson \
-Ddefault-hvs=%{default_hvs} \
+ %{?_default_graphics} \
-Dupdate-icon-cache=false \
-Dcompile-schemas=false \
-Dtests=disabled
--
2.47.0

View File

@ -1,98 +0,0 @@
From deb27a8c7e1539e687d589edd7ea517018266f77 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Sun, 21 Aug 2022 16:21:10 -0400
Subject: [PATCH] cloner: Sync <uuid> and <sysinfo> system uuid
Otherwise libvirt errors like:
ERROR UUID mismatch between <uuid> and <sysinfo>
https://bugzilla.redhat.com/show_bug.cgi?id=2038040
Signed-off-by: Cole Robinson <crobinso@redhat.com>
(cherry picked from commit b0d0516736320315a70f74aff3759fb35dd35d9d)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2038040
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
---
tests/data/cli/compare/virt-clone-auto-unmanaged.xml | 5 +++++
tests/data/cli/compare/virt-clone-unmanaged-preserve.xml | 5 +++++
tests/data/cli/virtclone/clone-disk.xml | 5 +++++
virtinst/cloner.py | 6 ++++--
4 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/tests/data/cli/compare/virt-clone-auto-unmanaged.xml b/tests/data/cli/compare/virt-clone-auto-unmanaged.xml
index 21a9a6398..f2043be25 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 3bdbbbe36..c003ed3ee 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 da1eb0a63..2f6e916d7 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 34a702f91..9334513c5 100644
--- a/virtinst/cloner.py
+++ b/virtinst/cloner.py
@@ -352,8 +352,7 @@ class Cloner(object):
"""
self._new_guest.id = None
self._new_guest.title = None
- self._new_guest.uuid = None
- self._new_guest.uuid = Guest.generate_uuid(self.conn)
+ self.set_clone_uuid(Guest.generate_uuid(self.conn))
for dev in self._new_guest.devices.graphics:
if dev.port and dev.port != -1:
@@ -408,6 +407,9 @@ class Cloner(object):
Override the new VMs generated UUId
"""
self._new_guest.uuid = uuid
+ for sysinfo in self._new_guest.sysinfo:
+ if sysinfo.system_uuid:
+ sysinfo.system_uuid = uuid
def set_replace(self, val):
"""
--
2.38.1

View File

@ -1,150 +0,0 @@
From 7867228f70cd716afe35e9d60a5fc9793c7e7f96 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Tue, 12 Sep 2023 12:01:09 -0400
Subject: [PATCH 2/2] installer: drop default TPM for --cloud-init install
phase
When shim in the guest sees unpopulated EFI NVRAM, like when
we create a new UEFI VM, it invokes fallback.efi to populate
initial NVRAM boot entries. When the guest also has a TPM device,
shim will do a one time VM reset. This reset throws off the
reboot detection that is central to virt-install's install
process.
The main install case that this will usually be relevant is
the combo of UEFI and --cloud-init. The latter usually implies
use of a distro cloud image, which will be using shim, and the
--cloud-init process requires a multi stage install compared
to just a plain import install.
For that case, we disable the default TPM device for the first
boot.
https://bugzilla.redhat.com/show_bug.cgi?id=2133525
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Resolves: https://issues.redhat.com/browse/RHEL-1705
(cherry picked from commit ec434948a8384541c56bfa04e4985f4fc709bc76)
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
---
.../virt-install-aarch64-cloud-init.xml | 3 --
.../virt-install-cloud-init-options1.xml | 3 --
virtinst/guest.py | 2 ++
virtinst/install/installer.py | 31 +++++++++++++++++--
4 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/tests/data/cli/compare/virt-install-aarch64-cloud-init.xml b/tests/data/cli/compare/virt-install-aarch64-cloud-init.xml
index e4a50cf4c..18c417662 100644
--- a/tests/data/cli/compare/virt-install-aarch64-cloud-init.xml
+++ b/tests/data/cli/compare/virt-install-aarch64-cloud-init.xml
@@ -49,9 +49,6 @@
<source mode="bind"/>
<target type="virtio" name="org.qemu.guest_agent.0"/>
</channel>
- <tpm>
- <backend type="emulator"/>
- </tpm>
<memballoon model="virtio"/>
<rng model="virtio">
<backend model="random">/dev/urandom</backend>
diff --git a/tests/data/cli/compare/virt-install-cloud-init-options1.xml b/tests/data/cli/compare/virt-install-cloud-init-options1.xml
index cd5426049..110730dd3 100644
--- a/tests/data/cli/compare/virt-install-cloud-init-options1.xml
+++ b/tests/data/cli/compare/virt-install-cloud-init-options1.xml
@@ -71,9 +71,6 @@ chpasswd:
<source mode="bind"/>
<target type="virtio" name="org.qemu.guest_agent.0"/>
</channel>
- <tpm model="tpm-crb">
- <backend type="emulator"/>
- </tpm>
<memballoon model="virtio"/>
<rng model="virtio">
<backend model="random">/dev/urandom</backend>
diff --git a/virtinst/guest.py b/virtinst/guest.py
index e66360223..0f5a93d08 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -211,6 +211,7 @@ class Guest(XMLBuilder):
self.skip_default_graphics = False
self.skip_default_rng = False
self.skip_default_tpm = False
+ self.have_default_tpm = False
self.x86_cpu_default = self.cpu.SPECIAL_MODE_APP_DEFAULT
# qemu 6.1, fairly new when we added this option, has an unfortunate
@@ -1060,6 +1061,7 @@ class Guest(XMLBuilder):
dev = DeviceTpm(self.conn)
dev.type = DeviceTpm.TYPE_EMULATOR
self.add_device(dev)
+ self.have_default_tpm = True
def _add_default_memballoon(self):
if self.devices.memballoon:
diff --git a/virtinst/install/installer.py b/virtinst/install/installer.py
index df74eaffa..c005e77bd 100644
--- a/virtinst/install/installer.py
+++ b/virtinst/install/installer.py
@@ -564,13 +564,38 @@ class Installer(object):
# guest install handling #
##########################
- def _build_postboot_xml(self, final_xml, meter):
+ def _build_postboot_xml(self, guest_ro, final_xml, meter):
initial_guest = Guest(self.conn, parsexml=final_xml)
self._alter_bootconfig(initial_guest)
self._alter_install_resources(initial_guest, meter)
if self.has_cloudinit():
initial_guest.set_smbios_serial_cloudinit()
+ # When shim in the guest sees unpopulated EFI NVRAM, like when
+ # we create a new UEFI VM, it invokes fallback.efi to populate
+ # initial NVRAM boot entries. When the guest also has a TPM device,
+ # shim will do a one time VM reset. This reset throws off the
+ # reboot detection that is central to virt-install's install
+ # process.
+ #
+ # The main install case that this will usually be relevant is
+ # the combo of UEFI and --cloud-init. The latter usually implies
+ # use of a distro cloud image, which will be using shim, and the
+ # --cloud-init process requires a multi stage install compared
+ # to just a plain import install.
+ #
+ # For that case, we disable the default TPM device for the first
+ # boot.
+ if (guest_ro.have_default_tpm and
+ guest_ro.is_uefi() and
+ len(initial_guest.devices.tpm)):
+ log.debug(
+ "combo of default TPM, UEFI, and cloudinit is "
+ "used. assuming this VM is using a linux distro "
+ "cloud image with shim in the boot path. disabling "
+ "TPM for the first boot")
+ initial_guest.remove_device(initial_guest.devices.tpm[0])
+
final_guest = Guest(self.conn, parsexml=final_xml)
self._remove_install_cdrom_media(final_guest)
self._remove_unattended_install_cdrom_device(final_guest)
@@ -581,7 +606,8 @@ class Installer(object):
initial_xml = None
final_xml = guest.get_xml()
if self._requires_postboot_xml_changes():
- initial_xml, final_xml = self._build_postboot_xml(final_xml, meter)
+ initial_xml, final_xml = self._build_postboot_xml(
+ guest, final_xml, meter)
final_xml = self._pre_reinstall_xml or final_xml
log.debug("Generated initial_xml: %s",
@@ -680,6 +706,7 @@ class Installer(object):
# All installer XML alterations are made on this guest instance,
# so the user_guest instance is left intact
guest = Guest(self.conn, parsexml=user_guest.get_xml())
+ guest.have_default_tpm = user_guest.have_default_tpm
try:
self._prepare(guest, meter)
--
2.41.0

View File

@ -1,126 +0,0 @@
From 3702eed072ae7b2d52398a3c9b1c1feb04ffdce3 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Wed, 14 Dec 2022 12:57:10 -0500
Subject: [PATCH] progress: Fix showing correct final total
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>
(cherry picked from commit 4114fa1aa827b836d3a1d11c2ac2d367c9bb0463)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2156247
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
---
tests/data/meter/meter1.txt | 2 +-
tests/data/meter/meter2.txt | 2 +-
tests/data/meter/meter3.txt | 2 +-
tests/data/meter/meter5.txt | 2 +-
tests/data/meter/meter6.txt | 2 +-
tests/test_misc.py | 4 +++-
virtinst/_progresspriv.py | 4 ++--
7 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/tests/data/meter/meter1.txt b/tests/data/meter/meter1.txt
index a3f7c7d2f..7e154c972 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 93e93dc31..7ccc31636 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 474e40f74..6f66608fe 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 1d232a5de..7142a9718 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 07d99bfd8..dd5d3d47b 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 aa610f4df..20f5a626b 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 5a31a18cc..a035c9c43 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)
--
2.39.0

View File

@ -0,0 +1,28 @@
From 3b5840b5b91667638f26749d102ad69788566aa1 Mon Sep 17 00:00:00 2001
Message-ID: <3b5840b5b91667638f26749d102ad69788566aa1.1733156402.git.phrdina@redhat.com>
From: Pavel Hrdina <phrdina@redhat.com>
Date: Fri, 29 Nov 2024 20:59:27 +0100
Subject: [PATCH] spec: update link to virt-manager sources
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
(cherry picked from commit b74730ebb6556dcbcc3b4e4993c79304c309cab4)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
---
virt-manager.spec.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/virt-manager.spec.in b/virt-manager.spec.in
index fba140388..2805d3d88 100644
--- a/virt-manager.spec.in
+++ b/virt-manager.spec.in
@@ -15,7 +15,7 @@ Summary: Desktop tool for managing virtual machines via libvirt
License: GPL-2.0-or-later
BuildArch: noarch
URL: https://virt-manager.org/
-Source0: https://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar.xz
+Source0: https://releases.pagure.org/%{name}/%{name}-%{version}.tar.xz
Requires: virt-manager-common = %{verrel}
--
2.47.0

View File

@ -1,653 +0,0 @@
From c8d1097fdaf7640c9dc78095076e584d38fbf6e5 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Tue, 12 Sep 2023 11:57:27 -0400
Subject: [PATCH 1/2] tests: Add more cloud-init and TPM test cases
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Resolves: https://issues.redhat.com/browse/RHEL-1705
(cherry picked from commit fca6de3950d41ccc1c4895c42073c840c45f01ab)
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
---
.../data/capabilities/kvm-aarch64-domcaps.xml | 14 ++
.../virt-install-aarch64-cloud-init.xml | 136 ++++++++++++++++++
...t-install-aarch64-firmware-no-override.xml | 6 +
.../compare/virt-install-aarch64-kvm-gic.xml | 3 +
.../virt-install-aarch64-kvm-import.xml | 3 +
.../virt-install-cloud-init-default.xml | 127 +++++++++++-----
.../virt-install-cloud-init-options1.xml | 131 +++++++++++------
tests/test_cli.py | 6 +-
8 files changed, 346 insertions(+), 80 deletions(-)
create mode 100644 tests/data/cli/compare/virt-install-aarch64-cloud-init.xml
diff --git a/tests/data/capabilities/kvm-aarch64-domcaps.xml b/tests/data/capabilities/kvm-aarch64-domcaps.xml
index 432bdb537..9c244bbdd 100644
--- a/tests/data/capabilities/kvm-aarch64-domcaps.xml
+++ b/tests/data/capabilities/kvm-aarch64-domcaps.xml
@@ -62,6 +62,20 @@
<enum name='capsType'/>
<enum name='pciBackend'/>
</hostdev>
+ <tpm supported='yes'>
+ <enum name='model'>
+ <value>tpm-tis</value>
+ </enum>
+ <enum name='backendModel'>
+ <value>passthrough</value>
+ <value>emulator</value>
+ <value>external</value>
+ </enum>
+ <enum name='backendVersion'>
+ <value>1.2</value>
+ <value>2.0</value>
+ </enum>
+ </tpm>
</devices>
<features>
<gic supported='yes'>
diff --git a/tests/data/cli/compare/virt-install-aarch64-cloud-init.xml b/tests/data/cli/compare/virt-install-aarch64-cloud-init.xml
new file mode 100644
index 000000000..e4a50cf4c
--- /dev/null
+++ b/tests/data/cli/compare/virt-install-aarch64-cloud-init.xml
@@ -0,0 +1,136 @@
+<domain type="kvm">
+ <name>fedora28</name>
+ <uuid>00000000-1111-2222-3333-444444444444</uuid>
+ <metadata>
+ <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
+ <libosinfo:os id="http://fedoraproject.org/fedora/28"/>
+ </libosinfo:libosinfo>
+ </metadata>
+ <memory>65536</memory>
+ <currentMemory>65536</currentMemory>
+ <vcpu>2</vcpu>
+ <os>
+ <type arch="aarch64" machine="virt">hvm</type>
+ <loader readonly="yes" type="pflash">/usr/share/AAVMF/AAVMF_CODE.fd</loader>
+ <smbios mode="sysinfo"/>
+ </os>
+ <cpu mode="host-passthrough"/>
+ <clock offset="utc"/>
+ <devices>
+ <emulator>/usr/bin/qemu-system-aarch64</emulator>
+ <disk type="file" device="disk">
+ <driver name="qemu" type="qcow2"/>
+ <source file="/pool-dir/testvol1.img"/>
+ <target dev="vda" bus="virtio"/>
+ </disk>
+ <controller type="usb" model="qemu-xhci" ports="15"/>
+ <controller type="pci" model="pcie-root"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <interface type="bridge">
+ <source bridge="testsuitebr0"/>
+ <mac address="00:11:22:33:44:55"/>
+ <model type="virtio"/>
+ </interface>
+ <console type="pty"/>
+ <channel type="unix">
+ <source mode="bind"/>
+ <target type="virtio" name="org.qemu.guest_agent.0"/>
+ </channel>
+ <tpm>
+ <backend type="emulator"/>
+ </tpm>
+ <memballoon model="virtio"/>
+ <rng model="virtio">
+ <backend model="random">/dev/urandom</backend>
+ </rng>
+ <disk type="file" device="cdrom">
+ <driver name="qemu" type="raw"/>
+ <source file="/VIRTINST-TESTSUITE/cloudinit.iso"/>
+ <target dev="sda" bus="scsi"/>
+ <readonly/>
+ </disk>
+ </devices>
+ <sysinfo type="smbios">
+ <system>
+ <entry name="serial">ds=nocloud</entry>
+ </system>
+ </sysinfo>
+ <on_reboot>destroy</on_reboot>
+</domain>
+<domain type="kvm">
+ <name>fedora28</name>
+ <uuid>00000000-1111-2222-3333-444444444444</uuid>
+ <metadata>
+ <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
+ <libosinfo:os id="http://fedoraproject.org/fedora/28"/>
+ </libosinfo:libosinfo>
+ </metadata>
+ <memory>65536</memory>
+ <currentMemory>65536</currentMemory>
+ <vcpu>2</vcpu>
+ <os>
+ <type arch="aarch64" machine="virt">hvm</type>
+ <loader readonly="yes" type="pflash">/usr/share/AAVMF/AAVMF_CODE.fd</loader>
+ <boot dev="hd"/>
+ </os>
+ <cpu mode="host-passthrough"/>
+ <clock offset="utc"/>
+ <devices>
+ <emulator>/usr/bin/qemu-system-aarch64</emulator>
+ <disk type="file" device="disk">
+ <driver name="qemu" type="qcow2"/>
+ <source file="/pool-dir/testvol1.img"/>
+ <target dev="vda" bus="virtio"/>
+ </disk>
+ <controller type="usb" model="qemu-xhci" ports="15"/>
+ <controller type="pci" model="pcie-root"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <interface type="bridge">
+ <source bridge="testsuitebr0"/>
+ <mac address="00:11:22:33:44:55"/>
+ <model type="virtio"/>
+ </interface>
+ <console type="pty"/>
+ <channel type="unix">
+ <source mode="bind"/>
+ <target type="virtio" name="org.qemu.guest_agent.0"/>
+ </channel>
+ <tpm>
+ <backend type="emulator"/>
+ </tpm>
+ <memballoon model="virtio"/>
+ <rng model="virtio">
+ <backend model="random">/dev/urandom</backend>
+ </rng>
+ <disk type="file" device="cdrom">
+ <target dev="sda" bus="scsi"/>
+ <readonly/>
+ </disk>
+ </devices>
+</domain>
diff --git a/tests/data/cli/compare/virt-install-aarch64-firmware-no-override.xml b/tests/data/cli/compare/virt-install-aarch64-firmware-no-override.xml
index b6fe84e67..cef9e6cde 100644
--- a/tests/data/cli/compare/virt-install-aarch64-firmware-no-override.xml
+++ b/tests/data/cli/compare/virt-install-aarch64-firmware-no-override.xml
@@ -43,6 +43,9 @@
<source mode="bind"/>
<target type="virtio" name="org.qemu.guest_agent.0"/>
</channel>
+ <tpm>
+ <backend type="emulator"/>
+ </tpm>
<memballoon model="virtio"/>
<rng model="virtio">
<backend model="random">/dev/urandom</backend>
@@ -95,6 +98,9 @@
<source mode="bind"/>
<target type="virtio" name="org.qemu.guest_agent.0"/>
</channel>
+ <tpm>
+ <backend type="emulator"/>
+ </tpm>
<memballoon model="virtio"/>
<rng model="virtio">
<backend model="random">/dev/urandom</backend>
diff --git a/tests/data/cli/compare/virt-install-aarch64-kvm-gic.xml b/tests/data/cli/compare/virt-install-aarch64-kvm-gic.xml
index 92e17eda6..aa31ed9c1 100644
--- a/tests/data/cli/compare/virt-install-aarch64-kvm-gic.xml
+++ b/tests/data/cli/compare/virt-install-aarch64-kvm-gic.xml
@@ -56,6 +56,9 @@
<source mode="bind"/>
<target type="virtio" name="org.qemu.guest_agent.0"/>
</channel>
+ <tpm>
+ <backend type="emulator"/>
+ </tpm>
<memballoon model="virtio"/>
<rng model="virtio">
<backend model="random">/dev/urandom</backend>
diff --git a/tests/data/cli/compare/virt-install-aarch64-kvm-import.xml b/tests/data/cli/compare/virt-install-aarch64-kvm-import.xml
index 5203cb807..1e4b26e51 100644
--- a/tests/data/cli/compare/virt-install-aarch64-kvm-import.xml
+++ b/tests/data/cli/compare/virt-install-aarch64-kvm-import.xml
@@ -51,6 +51,9 @@
</channel>
<input type="tablet" bus="usb"/>
<input type="keyboard" bus="usb"/>
+ <tpm>
+ <backend type="emulator"/>
+ </tpm>
<graphics type="vnc" port="-1"/>
<video>
<model type="virtio"/>
diff --git a/tests/data/cli/compare/virt-install-cloud-init-default.xml b/tests/data/cli/compare/virt-install-cloud-init-default.xml
index 0ddc52762..46cff8c09 100644
--- a/tests/data/cli/compare/virt-install-cloud-init-default.xml
+++ b/tests/data/cli/compare/virt-install-cloud-init-default.xml
@@ -1,4 +1,4 @@
-<domain type="test">
+<domain type="kvm">
<name>fedora28</name>
<uuid>00000000-1111-2222-3333-444444444444</uuid>
<metadata>
@@ -10,41 +10,67 @@
<currentMemory>65536</currentMemory>
<vcpu>2</vcpu>
<os>
- <type arch="i686">hvm</type>
+ <type arch="x86_64" machine="q35">hvm</type>
<smbios mode="sysinfo"/>
</os>
<features>
- <pae/>
+ <acpi/>
+ <apic/>
</features>
- <clock offset="utc"/>
+ <cpu mode="host-passthrough"/>
+ <clock offset="utc">
+ <timer name="rtc" tickpolicy="catchup"/>
+ <timer name="pit" tickpolicy="delay"/>
+ <timer name="hpet" present="no"/>
+ </clock>
<pm>
<suspend-to-mem enabled="no"/>
<suspend-to-disk enabled="no"/>
</pm>
<devices>
- <emulator>/usr/bin/test-hv</emulator>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type="file" device="disk">
+ <driver name="qemu" type="qcow2"/>
<source file="/pool-dir/testvol1.img"/>
- <target dev="hda" bus="ide"/>
+ <target dev="vda" bus="virtio"/>
</disk>
- <controller type="usb" model="ich9-ehci1"/>
- <controller type="usb" model="ich9-uhci1">
- <master startport="0"/>
- </controller>
- <controller type="usb" model="ich9-uhci2">
- <master startport="2"/>
- </controller>
- <controller type="usb" model="ich9-uhci3">
- <master startport="4"/>
- </controller>
- <interface type="user">
+ <controller type="usb" model="qemu-xhci" ports="15"/>
+ <controller type="pci" model="pcie-root"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <interface type="bridge">
+ <source bridge="testsuitebr0"/>
<mac address="00:11:22:33:44:55"/>
- <model type="e1000"/>
+ <model type="virtio"/>
</interface>
<console type="pty"/>
+ <channel type="unix">
+ <source mode="bind"/>
+ <target type="virtio" name="org.qemu.guest_agent.0"/>
+ </channel>
+ <tpm model="tpm-crb">
+ <backend type="emulator"/>
+ </tpm>
+ <memballoon model="virtio"/>
+ <rng model="virtio">
+ <backend model="random">/dev/urandom</backend>
+ </rng>
<disk type="file" device="cdrom">
+ <driver name="qemu" type="raw"/>
<source file="/VIRTINST-TESTSUITE/cloudinit.iso"/>
- <target dev="hdb" bus="ide"/>
+ <target dev="sda" bus="sata"/>
<readonly/>
</disk>
</devices>
@@ -55,7 +81,7 @@
</sysinfo>
<on_reboot>destroy</on_reboot>
</domain>
-<domain type="test">
+<domain type="kvm">
<name>fedora28</name>
<uuid>00000000-1111-2222-3333-444444444444</uuid>
<metadata>
@@ -67,40 +93,65 @@
<currentMemory>65536</currentMemory>
<vcpu>2</vcpu>
<os>
- <type arch="i686">hvm</type>
+ <type arch="x86_64" machine="q35">hvm</type>
<boot dev="hd"/>
</os>
<features>
- <pae/>
+ <acpi/>
+ <apic/>
</features>
- <clock offset="utc"/>
+ <cpu mode="host-passthrough"/>
+ <clock offset="utc">
+ <timer name="rtc" tickpolicy="catchup"/>
+ <timer name="pit" tickpolicy="delay"/>
+ <timer name="hpet" present="no"/>
+ </clock>
<pm>
<suspend-to-mem enabled="no"/>
<suspend-to-disk enabled="no"/>
</pm>
<devices>
- <emulator>/usr/bin/test-hv</emulator>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type="file" device="disk">
+ <driver name="qemu" type="qcow2"/>
<source file="/pool-dir/testvol1.img"/>
- <target dev="hda" bus="ide"/>
+ <target dev="vda" bus="virtio"/>
</disk>
- <controller type="usb" model="ich9-ehci1"/>
- <controller type="usb" model="ich9-uhci1">
- <master startport="0"/>
- </controller>
- <controller type="usb" model="ich9-uhci2">
- <master startport="2"/>
- </controller>
- <controller type="usb" model="ich9-uhci3">
- <master startport="4"/>
- </controller>
- <interface type="user">
+ <controller type="usb" model="qemu-xhci" ports="15"/>
+ <controller type="pci" model="pcie-root"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <interface type="bridge">
+ <source bridge="testsuitebr0"/>
<mac address="00:11:22:33:44:55"/>
- <model type="e1000"/>
+ <model type="virtio"/>
</interface>
<console type="pty"/>
+ <channel type="unix">
+ <source mode="bind"/>
+ <target type="virtio" name="org.qemu.guest_agent.0"/>
+ </channel>
+ <tpm model="tpm-crb">
+ <backend type="emulator"/>
+ </tpm>
+ <memballoon model="virtio"/>
+ <rng model="virtio">
+ <backend model="random">/dev/urandom</backend>
+ </rng>
<disk type="file" device="cdrom">
- <target dev="hdb" bus="ide"/>
+ <target dev="sda" bus="sata"/>
<readonly/>
</disk>
</devices>
diff --git a/tests/data/cli/compare/virt-install-cloud-init-options1.xml b/tests/data/cli/compare/virt-install-cloud-init-options1.xml
index 1df73714d..cd5426049 100644
--- a/tests/data/cli/compare/virt-install-cloud-init-options1.xml
+++ b/tests/data/cli/compare/virt-install-cloud-init-options1.xml
@@ -4,7 +4,7 @@ chpasswd:
root:[SCRUBBLED]
expire: True
-<domain type="test">
+<domain type="kvm">
<name>fedora28</name>
<uuid>00000000-1111-2222-3333-444444444444</uuid>
<metadata>
@@ -20,48 +20,74 @@ chpasswd:
<entry name="serial">foobar</entry>
</system>
</sysinfo>
- <os>
- <type arch="i686">hvm</type>
+ <os firmware="efi">
+ <type arch="x86_64" machine="q35">hvm</type>
<smbios mode="sysinfo"/>
</os>
<features>
- <pae/>
+ <acpi/>
+ <apic/>
</features>
- <clock offset="utc"/>
+ <cpu mode="host-passthrough"/>
+ <clock offset="utc">
+ <timer name="rtc" tickpolicy="catchup"/>
+ <timer name="pit" tickpolicy="delay"/>
+ <timer name="hpet" present="no"/>
+ </clock>
<pm>
<suspend-to-mem enabled="no"/>
<suspend-to-disk enabled="no"/>
</pm>
<devices>
- <emulator>/usr/bin/test-hv</emulator>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type="file" device="disk">
+ <driver name="qemu" type="qcow2"/>
<source file="/pool-dir/testvol1.img"/>
- <target dev="hda" bus="ide"/>
+ <target dev="vda" bus="virtio"/>
</disk>
- <controller type="usb" model="ich9-ehci1"/>
- <controller type="usb" model="ich9-uhci1">
- <master startport="0"/>
- </controller>
- <controller type="usb" model="ich9-uhci2">
- <master startport="2"/>
- </controller>
- <controller type="usb" model="ich9-uhci3">
- <master startport="4"/>
- </controller>
- <interface type="user">
+ <controller type="usb" model="qemu-xhci" ports="15"/>
+ <controller type="pci" model="pcie-root"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <interface type="bridge">
+ <source bridge="testsuitebr0"/>
<mac address="00:11:22:33:44:55"/>
- <model type="e1000"/>
+ <model type="virtio"/>
</interface>
<console type="pty"/>
+ <channel type="unix">
+ <source mode="bind"/>
+ <target type="virtio" name="org.qemu.guest_agent.0"/>
+ </channel>
+ <tpm model="tpm-crb">
+ <backend type="emulator"/>
+ </tpm>
+ <memballoon model="virtio"/>
+ <rng model="virtio">
+ <backend model="random">/dev/urandom</backend>
+ </rng>
<disk type="file" device="cdrom">
+ <driver name="qemu" type="raw"/>
<source file="/VIRTINST-TESTSUITE/cloudinit.iso"/>
- <target dev="hdb" bus="ide"/>
+ <target dev="sda" bus="sata"/>
<readonly/>
</disk>
</devices>
<on_reboot>destroy</on_reboot>
</domain>
-<domain type="test">
+<domain type="kvm">
<name>fedora28</name>
<uuid>00000000-1111-2222-3333-444444444444</uuid>
<metadata>
@@ -77,42 +103,67 @@ chpasswd:
<entry name="serial">foobar</entry>
</system>
</sysinfo>
- <os>
- <type arch="i686">hvm</type>
+ <os firmware="efi">
+ <type arch="x86_64" machine="q35">hvm</type>
<boot dev="hd"/>
<smbios mode="sysinfo"/>
</os>
<features>
- <pae/>
+ <acpi/>
+ <apic/>
</features>
- <clock offset="utc"/>
+ <cpu mode="host-passthrough"/>
+ <clock offset="utc">
+ <timer name="rtc" tickpolicy="catchup"/>
+ <timer name="pit" tickpolicy="delay"/>
+ <timer name="hpet" present="no"/>
+ </clock>
<pm>
<suspend-to-mem enabled="no"/>
<suspend-to-disk enabled="no"/>
</pm>
<devices>
- <emulator>/usr/bin/test-hv</emulator>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type="file" device="disk">
+ <driver name="qemu" type="qcow2"/>
<source file="/pool-dir/testvol1.img"/>
- <target dev="hda" bus="ide"/>
+ <target dev="vda" bus="virtio"/>
</disk>
- <controller type="usb" model="ich9-ehci1"/>
- <controller type="usb" model="ich9-uhci1">
- <master startport="0"/>
- </controller>
- <controller type="usb" model="ich9-uhci2">
- <master startport="2"/>
- </controller>
- <controller type="usb" model="ich9-uhci3">
- <master startport="4"/>
- </controller>
- <interface type="user">
+ <controller type="usb" model="qemu-xhci" ports="15"/>
+ <controller type="pci" model="pcie-root"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <controller type="pci" model="pcie-root-port"/>
+ <interface type="bridge">
+ <source bridge="testsuitebr0"/>
<mac address="00:11:22:33:44:55"/>
- <model type="e1000"/>
+ <model type="virtio"/>
</interface>
<console type="pty"/>
+ <channel type="unix">
+ <source mode="bind"/>
+ <target type="virtio" name="org.qemu.guest_agent.0"/>
+ </channel>
+ <tpm model="tpm-crb">
+ <backend type="emulator"/>
+ </tpm>
+ <memballoon model="virtio"/>
+ <rng model="virtio">
+ <backend model="random">/dev/urandom</backend>
+ </rng>
<disk type="file" device="cdrom">
- <target dev="hdb" bus="ide"/>
+ <target dev="sda" bus="sata"/>
<readonly/>
</disk>
</devices>
diff --git a/tests/test_cli.py b/tests/test_cli.py
index ca8d2340a..c3f7ab2ba 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -1017,8 +1017,9 @@ c = vinst.add_category("misc-install", "--nographics --noautoconsole")
c.add_compare("--connect %s --os-variant generic" % (utils.URIs.test_suite), "noargs-fail", use_default_args=False) # No arguments
c.add_compare("--connect %s --os-variant fedora26" % (utils.URIs.test_suite), "osvariant-noargs-fail", use_default_args=False) # No arguments
c.add_compare("--connect %s --os-variant fedora26 --pxe --print-xml" % (utils.URIs.test_suite), "osvariant-defaults-pxe", use_default_args=False) # No arguments
-c.add_compare("--disk %(EXISTIMG1)s --os-variant fedora28 --cloud-init", "cloud-init-default", env={"VIRTINST_TEST_SUITE_CLOUDINIT": "1"}) # default --cloud-init behavior is root-password-generate=yes,disable=yes
-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_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("--connect %(URI-KVM-X86)s --disk %(EXISTIMG1)s --os-variant fedora28 --cloud-init --tpm default", "cloud-init-default", env={"VIRTINST_TEST_SUITE_CLOUDINIT": "1"}) # default --cloud-init behavior is root-password-generate=yes,disable=yes, forcing tpm
+c.add_compare("--connect %(URI-KVM-X86)s --disk %(EXISTIMG1)s --os-variant fedora28 --cloud-init root-password-generate=yes,disable=no --sysinfo system.serial=foobar --boot uefi", "cloud-init-options1", env={"VIRTINST_TEST_SUITE_PRINT_CLOUDINIT": "1"}) # --cloud-init root-password-generate, with --sysinfo override, with uefi
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
c.add_compare("--disk %(EXISTIMG1)s --os-variant fedora28 --cloud-init user-data=%(XMLDIR)s/cloudinit/user-data.txt,meta-data=%(XMLDIR)s/cloudinit/meta-data.txt", "cloud-init-options4", env={"VIRTINST_TEST_SUITE_PRINT_CLOUDINIT": "1"}) # --cloud-init user-data=,meta-data=
@@ -1177,6 +1178,7 @@ c.add_compare("--arch aarch64 --cdrom %(ISO-F26-NETINST)s --boot loader=CODE.fd,
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
c.add_compare("--connect %(URI-KVM-AARCH64)s --disk size=1 --os-variant fedora22 --features gic_version=host --network network=default,address.type=pci --controller type=scsi,model=virtio-scsi,address.type=pci", "aarch64-kvm-gic")
c.add_compare("--connect %(URI-KVM-AARCH64)s --osinfo fedora30 --arch aarch64 --disk none --pxe --boot firmware=efi", "aarch64-firmware-no-override")
+c.add_compare("--connect %(URI-KVM-AARCH64)s --disk %(EXISTIMG1)s --os-variant fedora28 --cloud-init", "aarch64-cloud-init")
--
2.41.0

View File

@ -1,62 +0,0 @@
From f44c6ec970413843214f52d5523ee8cf277b0150 Mon Sep 17 00:00:00 2001
From: Andrea Bolognani <abologna@redhat.com>
Date: Mon, 12 Dec 2022 19:38:22 +0100
Subject: [PATCH] virt-install: Document Secure Boot setups
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>
(cherry picked from commit 33ff193ee9fcfdb74f95d946a1b93239a1a12a61)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2112154
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
---
man/virt-install.rst | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/man/virt-install.rst b/man/virt-install.rst
index 684f22655..a0df73280 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
--
2.39.1

View File

@ -1,42 +0,0 @@
From 19b683f075d11b920552990d16b9a7a82eed12e3 Mon Sep 17 00:00:00 2001
From: Andrea Bolognani <abologna@redhat.com>
Date: Mon, 12 Dec 2022 19:32:32 +0100
Subject: [PATCH] virt-install: Recommend '--boot uefi'
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>
(cherry picked from commit f2b5aaf458764ec7ecf105038e5f2f7cc26b6c17)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2112154
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
---
man/virt-install.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/man/virt-install.rst b/man/virt-install.rst
index 3a6e8dcd2..684f22655 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.
--
2.39.1

View File

@ -1,39 +0,0 @@
From f68b3667591ab5f9edb9a40f9a7c0c798c923bc4 Mon Sep 17 00:00:00 2001
From: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
Date: Wed, 9 Nov 2022 18:33:56 +0900
Subject: [PATCH] virtinstall: Fix the allocating disk size printed by the
progress bar
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>
(cherry picked from commit 39c7a443146433766e4e71e48ab59145c74924b3)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2156247
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
---
virtinst/storage.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/virtinst/storage.py b/virtinst/storage.py
index 509f5cb06..617b05e0d 100644
--- a/virtinst/storage.py
+++ b/virtinst/storage.py
@@ -697,6 +697,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
--
2.39.0

View File

@ -1,87 +0,0 @@
From 91cd135f66b517cf247d031966c2f33343c23aa3 Mon Sep 17 00:00:00 2001
From: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
Date: Wed, 9 Nov 2022 18:33:57 +0900
Subject: [PATCH] virtinstall: Hide total_size in the progress bar if it
doesn't need
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>
(cherry picked from commit 6ec00474a659158f20248d6af3771d1a12ddac7b)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2156247
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
---
tests/data/meter/meter-zero.txt | 4 ++++
tests/test_misc.py | 14 ++++++++++++++
virtinst/_progresspriv.py | 8 ++++++--
3 files changed, 24 insertions(+), 2 deletions(-)
create mode 100644 tests/data/meter/meter-zero.txt
diff --git a/tests/data/meter/meter-zero.txt b/tests/data/meter/meter-zero.txt
new file mode 100644
index 000000000..fc81f21fd
--- /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 20f5a626b..2cabc3382 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 a035c9c43..207c64796 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)
--
2.39.0

View File

@ -1,58 +0,0 @@
From afb42b86ad8bd72930859968c92c084134e6d114 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Sat, 20 Aug 2022 09:54:01 -0400
Subject: [PATCH] virtinstall: fix regression with --boot and no install method
Anything passed to --boot should imply --install no_install=yes
in the absence of other --install options. This is historically
what we've done but we regressed in 4.1.0
Resolves: https://github.com/virt-manager/virt-manager/issues/426
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2144885
(cherry picked from commit e94786c066696781a821f5a4bcef3c377e4bc5e5)
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
---
tests/test_cli.py | 1 +
virtinst/virtinstall.py | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 774db098f..ca8d2340a 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -966,6 +966,7 @@ c.add_valid("--os-variant generic --pxe --ram 16", grep="Requested memory 16 MiB
c.add_valid("--os-variant winxp --ram 32 --cdrom %(EXISTIMG1)s", grep="32 MiB is less than the recommended 64 MiB") # Windows. Catch memory warning
c.add_valid("--osinfo generic --pxe --autostart") # --autostart flag
c.add_valid("--cdrom %(EXISTIMG2)s --os-variant win2k3 --print-step 2") # HVM windows install, print 3rd stage XML
+c.add_valid("--memory 512 --osinfo generic --boot cdrom") # --boot XXX should imply --install no_install
c.add_compare("--location location=%(TREEDIR)s --initrd-inject virt-install --extra-args ks=file:/virt-install", "initrd-inject") # initrd-inject
c.add_compare("--cdrom http://example.com/path/to/some.iso --os-variant detect=yes,require=no", "cdrom-url")
c.add_compare("--pxe --print-step all --os-variant none", "simple-pxe") # Diskless PXE install
diff --git a/virtinst/virtinstall.py b/virtinst/virtinstall.py
index 6d7f56b8d..20b901813 100644
--- a/virtinst/virtinstall.py
+++ b/virtinst/virtinstall.py
@@ -431,7 +431,7 @@ def build_installer(options, guest, installdata):
pass
elif (options.import_install or
options.xmlonly or
- options.boot or
+ options.boot_was_set or
options.cloud_init or
options.unattended):
no_install = True
@@ -641,6 +641,7 @@ def _build_options_guest(conn, options):
def build_guest_instance(conn, options):
installdata = cli.parse_install(options.install)
osdata = cli.parse_os_variant(options.os_variant or installdata.os)
+ options.boot_was_set = bool(options.boot)
if options.reinstall:
dummy1, guest, dummy2 = cli.get_domain_and_guest(conn, options.reinstall)
--
2.38.1

View File

@ -7,26 +7,19 @@
# End local config
Name: virt-manager
Version: 4.1.0
Release: 5%{?dist}%{?extra_release}
Version: 5.0.0
Release: 1%{?dist}%{?extra_release}
%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
Source0: https://releases.pagure.org/%{name}/%{name}-%{version}.tar.xz
Source1: symlinks
Patch1: virt-manager-cloner-Sync-uuid-and-sysinfo-system-uuid.patch
Patch2: virt-manager-virtinstall-fix-regression-with-boot-and-no-install-method.patch
Patch3: virt-manager-progress-Fix-showing-correct-final-total.patch
Patch4: virt-manager-virtinstall-Fix-the-allocating-disk-size-printed-by-the-progress-bar.patch
Patch5: virt-manager-virtinstall-Hide-total_size-in-the-progress-bar-if-it-doesn-t-need.patch
Patch6: virt-manager-virt-install-Recommend-boot-uefi.patch
Patch7: virt-manager-virt-install-Document-Secure-Boot-setups.patch
Patch8: virt-manager-tests-Add-more-cloud-init-and-TPM-test-cases.patch
Patch9: virt-manager-installer-drop-default-TPM-for-cloud-init-install-ph.patch
Patch1: virt-manager-Disable-spice.patch
Patch2: virt-manager-spec-update-link-to-virt-manager-sources.patch
Requires: virt-manager-common = %{verrel}
@ -35,9 +28,6 @@ Requires: gtk3 >= 3.22.0
Requires: libvirt-glib >= 0.0.9
Requires: gtk-vnc2
# We can work with gtksourceview 3 or gtksourceview4, pick the latest one
Requires: gtksourceview4
# virt-manager is one of those apps that people will often install onto
# a headless machine for use over SSH. This means the virt-manager dep
# chain needs to provide everything we need to get a usable app experience.
@ -52,6 +42,10 @@ Requires: dconf
# no ambiguity.
Requires: vte291
# We can use GtkTextView, gtksourceview 3 or gtksourceview4, recommend
# the latest one but don't make it a hard requirement
Recommends: gtksourceview4
# Weak dependencies for the common virt-manager usecase
Recommends: (libvirt-daemon-kvm or libvirt-daemon-qemu)
Recommends: libvirt-daemon-config-network
@ -63,7 +57,7 @@ BuildRequires: git
BuildRequires: gettext
BuildRequires: python3-devel
BuildRequires: python3-docutils
BuildRequires: python3-setuptools
BuildRequires: meson
%description
@ -125,25 +119,25 @@ git add .
git commit -q -a --allow-empty --author 'rpm-build <rpm-build>' -m symlinks
git config gc.auto 0
%autopatch
%build
%if %{default_hvs}
%global _default_hvs --default-hvs %{default_hvs}
%if 0%{?rhel}
%global _default_graphics -Ddefault-graphics=vnc
%endif
./setup.py configure \
%{?_default_hvs} \
--default-graphics=vnc
%meson \
-Ddefault-hvs=%{default_hvs} \
%{?_default_graphics} \
-Dupdate-icon-cache=false \
-Dcompile-schemas=false \
-Dtests=disabled
%meson_build
%install
./setup.py \
--no-update-icon-cache --no-compile-schemas \
install -O1 --root=%{buildroot}
%meson_install
%find_lang %{name}
%if 0%{?py_byte_compile:1}
@ -192,6 +186,12 @@ git config gc.auto 0
%changelog
* Mon Dec 2 2024 Pavel Hrdina <phrdina@redhat.com> - 5.0.0-1
- Rebased to virt-manager-5.0.0 (RHEL-34607)
- The rebase also fixes the following bugs:
RHEL-7124, RHEL-741, RHEL-10468, RHEL-17436, RHEL-1126
RHEL-62959, RHEL-65264
* Mon Oct 02 2023 Jonathon Jongsma <jjongsma@redhat.com> - 4.1.0-5
- On aarch64 the vm will shut off immediately shut off when using virt-install --cloud-init (RHEL-1705)