Accepting request 936082 from Virtualization

A couple features and a fix for virt-manager

OBS-URL: https://build.opensuse.org/request/show/936082
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/virt-manager?expand=0&rev=227
This commit is contained in:
Dominique Leuenberger 2021-12-08 21:08:44 +00:00 committed by Git OBS Bridge
commit 23befd14d8
8 changed files with 275 additions and 16 deletions

View File

@ -1,3 +1,28 @@
-------------------------------------------------------------------
Tue Nov 23 10:11:44 MST 2021 - carnold@suse.com
- jsc#SLE-17735 - Support Oracle Linux as a guest VM. See also
bsc#1192238 [Build58.2][KVM] The latest supported OracleLinux as
guest versions are not included anywhere
virtinst-add-oracle-linux-support.patch
-------------------------------------------------------------------
Thu Oct 28 16:09:36 MDT 2021 - carnold@suse.com
- bsc#1188223 - L3: Sles12sp3 DomU won't boot after adding phys
hard drive
virtinst-xenbus-disk-index-fix.patch
-------------------------------------------------------------------
Tue Oct 26 07:20:07 MDT 2021 - carnold@suse.com
- jsc#SLE-21540 Dev: Prefer UEFI when creating new virtual machines.
Add a preferences option to allow users to default to UEFI when
creating a new VM. Libvirt decides which firmware file to use.
virtman-add-firmware-preferences.patch
- Renamed patch virtinst-modify-gui-defaults.patch to
virtman-modify-gui-defaults.patch
-------------------------------------------------------------------
Fri Oct 22 10:09:51 MDT 2021 - carnold@suse.com

View File

@ -51,17 +51,18 @@ Patch76: virtinst-set-qemu-emulator.patch
# Features or Enhancements
Patch103: virtman-load-stored-uris.patch
Patch104: virtman-add-tooltip-to-firmware.patch
Patch105: virtman-modify-gui-defaults.patch
Patch106: virtman-add-firmware-preferences.patch
Patch120: virtinst-default-xen-to-qcow2-format.patch
Patch121: virtinst-detect-oes-distros.patch
Patch122: virtinst-modify-gui-defaults.patch
Patch123: virtinst-vol-default-nocow.patch
Patch124: virtinst-set-cache-mode-unsafe-for-install.patch
Patch125: virtinst-s390x-disable-graphics.patch
Patch126: virtinst-add-caasp-support.patch
Patch127: virtinst-add-sle15-detection-support.patch
Patch128: virtinst-add-pvh-support.patch
Patch129: virtinst-media-detection.patch
Patch130: virtinst-graphics-add-check-for-qemu-modules-in-spice-graphic.patch
Patch122: virtinst-vol-default-nocow.patch
Patch123: virtinst-set-cache-mode-unsafe-for-install.patch
Patch124: virtinst-s390x-disable-graphics.patch
Patch125: virtinst-add-caasp-support.patch
Patch126: virtinst-add-sle15-detection-support.patch
Patch127: virtinst-add-pvh-support.patch
Patch128: virtinst-media-detection.patch
Patch129: virtinst-graphics-add-check-for-qemu-modules-in-spice-graphic.patch
# Bug Fixes
Patch151: virtman-increase-setKeepAlive-count.patch
Patch152: virtman-allow-destroy-from-shutdown-menu-of-crashed-vm.patch
@ -88,6 +89,7 @@ Patch179: virtinst-smbios-unsupported-for-xenpv.patch
Patch180: virtinst-keep-iso-for-xenpv.patch
Patch181: virtinst-add-slem-detection-support.patch
Patch182: virtinst-add-sle-hpc-support.patch
Patch183: virtinst-add-oracle-linux-support.patch
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -185,6 +187,8 @@ machine).
# Enhancements
%patch103 -p1
%patch104 -p1
%patch105 -p1
%patch106 -p1
%patch120 -p1
%patch121 -p1
%patch122 -p1
@ -195,7 +199,6 @@ machine).
%patch127 -p1
%patch128 -p1
%patch129 -p1
%patch130 -p1
# Bug Fixes
%patch151 -p1
%patch152 -p1
@ -222,6 +225,7 @@ machine).
%patch180 -p1
%patch181 -p1
%patch182 -p1
%patch183 -p1
%build
%if %{default_hvs}

View File

@ -0,0 +1,37 @@
References: bsc#1192238, jsc#SLE-17764
--- virt-manager-3.2.0/virtinst/install/urldetect.py.orig 2021-11-23 15:06:47.451081946 -0700
+++ virt-manager-3.2.0/virtinst/install/urldetect.py 2021-11-23 15:07:43.539083283 -0700
@@ -723,6 +723,24 @@ class _OESDistro(_SuseDistro):
famregex = ".*Open Enterprise Server.*"
+class _OLDistro(_DistroTree):
+ PRETTY_NAME = "Oracle Linux"
+ matching_distros = ["ol"]
+ _variant_prefix = "ol"
+
+ @classmethod
+ def is_valid(cls, cache):
+ famregex = ".*Oracle Linux.*"
+ if cache.treeinfo_family_regex(famregex):
+ return True
+
+ def _detect_version(self):
+ if self.cache.treeinfo_version: # pragma: no cover
+ olname = self._variant_prefix + self.cache.treeinfo_version
+ if OSDB.lookup_os(olname):
+ return olname
+
+
class _DebianDistro(_DistroTree):
# ex. http://ftp.egr.msu.edu/debian/dists/sarge/main/installer-i386/
# daily builds: https://d-i.debian.org/daily-images/amd64/
@@ -949,6 +967,7 @@ def _build_distro_list(osobj):
_FedoraDistro,
_RHELDistro,
_CentOSDistro,
+ _OLDistro,
_SLEDistro,
_SLESDistro,
_SLEHPCDistro,

View File

@ -5,7 +5,7 @@ Index: virt-manager-3.2.0/virtManager/createvm.py
===================================================================
--- virt-manager-3.2.0.orig/virtManager/createvm.py
+++ virt-manager-3.2.0/virtManager/createvm.py
@@ -836,6 +836,9 @@ class vmmCreateVM(vmmGObjectUI):
@@ -839,6 +839,9 @@ class vmmCreateVM(vmmGObjectUI):
break
if label is None:
continue

View File

@ -28,7 +28,7 @@ Index: virt-manager-3.2.0/virtinst/devices/disk.py
skip_targets = [t for t in skip_targets if t and t.startswith(prefix)]
skip_targets.sort()
@@ -903,7 +914,12 @@ class DeviceDisk(Device):
@@ -903,11 +914,18 @@ class DeviceDisk(Device):
first_found = None
for i in range(maxnode):
@ -42,3 +42,9 @@ Index: virt-manager-3.2.0/virtinst/devices/disk.py
if gen_t in skip_targets:
skip_targets.remove(gen_t)
continue
if not skip_targets:
+ if first_found:
+ return first_found
return gen_t
elif not first_found:
first_found = gen_t

View File

@ -0,0 +1,187 @@
From d30b50139e60afc6e5da1e38f130b27859d31a83 Mon Sep 17 00:00:00 2001
From: Charles Arnold <carnold@suse.com>
Date: Mon, 25 Oct 2021 16:16:06 -0600
Subject: [PATCH 1/1] virt-manager: Add firmware preferences for creating a new
VM
See https://bugzilla.redhat.com/show_bug.cgi?id=1997882
---
.../org.virt-manager.virt-manager.gschema.xml | 6 +++++
ui/preferences.ui | 26 +++++++++++++++++++
virtManager/config.py | 11 ++++++++
virtManager/createvm.py | 4 +++
virtManager/preferences.py | 20 ++++++++++++++
5 files changed, 67 insertions(+)
Index: virt-manager-3.2.0/data/org.virt-manager.virt-manager.gschema.xml
===================================================================
--- virt-manager-3.2.0.orig/data/org.virt-manager.virt-manager.gschema.xml
+++ virt-manager-3.2.0/data/org.virt-manager.virt-manager.gschema.xml
@@ -265,6 +265,12 @@
<description>CPU setting to use for new VMs. Limited to VMs matching the host architecture. Possible values: default (virt-manager default), hv-default (qemu's default), host-model-only (just the model, not the additional features), host-model (libvirt's host-model setting), host-passthrough (libvirt's host-passthrough setting).</description>
</key>
+ <key name="firmware" type="s">
+ <default>'default'</default>
+ <summary>Use selected firmware for new VM booting</summary>
+ <description>Firmware used for new VMs. Possible values are BIOS (default) and UEFI. The firmware used is determined by libvirt unless a specific firmware is selected from the Customize dialog.</description>
+ </key>
+
</schema>
<schema id="org.virt-manager.virt-manager.paths"
Index: virt-manager-3.2.0/ui/preferences.ui
===================================================================
--- virt-manager-3.2.0.orig/ui/preferences.ui
+++ virt-manager-3.2.0/ui/preferences.ui
@@ -494,6 +494,32 @@ identical CPUs in order to migrate the V
<property name="top_attach">2</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="label127">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes">Default Firmware for new VMs. Boot using either BIOS or UEFI.</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">_Firmware default:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">prefs-firmware-default</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="prefs-firmware-default">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <signal name="changed" handler="on_prefs_firmware_default_changed" swapped="no"/>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
</object>
</child>
</object>
Index: virt-manager-3.2.0/virtManager/config.py
===================================================================
--- virt-manager-3.2.0.orig/virtManager/config.py
+++ virt-manager-3.2.0/virtManager/config.py
@@ -221,6 +221,7 @@ class vmmConfig(object):
self.default_storage_format_from_config = "qcow2"
self.default_console_resizeguest = 0
+ self.default_firmware_from_config = "bios"
self._objects = []
self.color_insensitive = None
@@ -532,6 +533,16 @@ class vmmConfig(object):
def set_default_cpu_setting(self, val):
self.conf.set("/new-vm/cpu-default", val.lower())
+ def get_default_firmware_setting(self, raw=False):
+ ret = self.conf.get("/new-vm/firmware")
+ if ret not in ["default", "bios", "uefi"]:
+ ret = "default" # pragma: no cover
+ if ret == "default" and not raw:
+ return self.default_firmware_from_config
+ return ret
+ def set_firmware_setting(self, val):
+ self.conf.set("/new-vm/firmware", val.lower())
+
# URL/Media path history
def _url_add_helper(self, gsettings_path, url):
Index: virt-manager-3.2.0/virtManager/createvm.py
===================================================================
--- virt-manager-3.2.0.orig/virtManager/createvm.py
+++ virt-manager-3.2.0/virtManager/createvm.py
@@ -105,6 +105,7 @@ class _GuestData:
self.os_variant = None
self.uefi_path = None
self.name = None
+ self.firmware = None
self.vcpus = None
self.memory = None
@@ -159,6 +160,8 @@ class _GuestData:
guest.currentMemory = self.currentMemory
if self.memory:
guest.memory = self.memory
+ if self.firmware == "uefi":
+ guest.os.firmware = "efi"
return guest
@@ -1507,6 +1510,7 @@ class vmmCreateVM(vmmGObjectUI):
gdata.default_graphics_type = self.config.get_graphics_type()
gdata.x86_cpu_default = self.config.get_default_cpu_setting()
+ gdata.firmware = self.config.get_default_firmware_setting()
return gdata
Index: virt-manager-3.2.0/virtManager/preferences.py
===================================================================
--- virt-manager-3.2.0.orig/virtManager/preferences.py
+++ virt-manager-3.2.0/virtManager/preferences.py
@@ -46,6 +46,7 @@ class vmmPreferences(vmmGObjectUI):
self.refresh_graphics_type()
self.refresh_storage_format()
self.refresh_cpu_default()
+ self.refresh_firmware_default()
self.refresh_cpu_poll()
self.refresh_disk_poll()
self.refresh_net_poll()
@@ -73,6 +74,7 @@ class vmmPreferences(vmmGObjectUI):
"on_prefs_graphics_type_changed": self.change_graphics_type,
"on_prefs_storage_format_changed": self.change_storage_format,
"on_prefs_cpu_default_changed": self.change_cpu_default,
+ "on_prefs_firmware_default_changed": self.change_firmware_default,
"on_prefs_stats_enable_cpu_toggled": self.change_cpu_poll,
"on_prefs_stats_enable_disk_toggled": self.change_disk_poll,
"on_prefs_stats_enable_net_toggled": self.change_net_poll,
@@ -175,6 +177,17 @@ class vmmPreferences(vmmGObjectUI):
combo.set_model(model)
uiutil.init_combo_text_column(combo, 1)
+ combo = self.widget("prefs-firmware-default")
+ # [gsettings value, string]
+ model = Gtk.ListStore(str, str)
+ for row in [["default", _("System default (%s)") %
+ self.config.default_firmware_from_config],
+ ["bios", "BIOS"],
+ ["uefi", "UEFI"]]:
+ model.append(row)
+ combo.set_model(model)
+ uiutil.init_combo_text_column(combo, 1)
+
if not vmmInspection.libguestfs_installed(): # pragma: no cover
self.widget("prefs-libguestfs").set_sensitive(False)
self.widget("prefs-libguestfs").set_tooltip_text(
@@ -234,6 +247,10 @@ class vmmPreferences(vmmGObjectUI):
combo = self.widget("prefs-cpu-default")
val = self.config.get_default_cpu_setting()
uiutil.set_list_selection(combo, val)
+ def refresh_firmware_default(self):
+ combo = self.widget("prefs-firmware-default")
+ val = self.config.get_default_firmware_setting(raw=True)
+ uiutil.set_list_selection(combo, val)
def refresh_cpu_poll(self):
self.widget("prefs-stats-enable-cpu").set_active(
@@ -374,6 +391,9 @@ class vmmPreferences(vmmGObjectUI):
def change_cpu_default(self, src):
typ = uiutil.get_list_selection(src) or "default"
self.config.set_default_cpu_setting(typ.lower())
+ def change_firmware_default(self, src):
+ typ = uiutil.get_list_selection(src) or "default"
+ self.config.set_firmware_setting(typ.lower())
def change_cpu_poll(self, src):
self.config.set_stats_enable_cpu_poll(src.get_active())

View File

@ -1,11 +1,11 @@
References: bsc#919692
Because openSUSE repos combine 32 and 64 bit sources we need to
continue showing the 'Architecture' pop-up.
Index: virt-manager-3.1.0/virtManager/createvm.py
Index: virt-manager-3.2.0/virtManager/createvm.py
===================================================================
--- virt-manager-3.1.0.orig/virtManager/createvm.py
+++ virt-manager-3.1.0/virtManager/createvm.py
@@ -861,11 +861,6 @@ class vmmCreateVM(vmmGObjectUI):
--- virt-manager-3.2.0.orig/virtManager/createvm.py
+++ virt-manager-3.2.0/virtManager/createvm.py
@@ -864,11 +864,6 @@ class vmmCreateVM(vmmGObjectUI):
for guest in self.conn.caps.guests:
if guest.os_type == self._capsinfo.os_type:
archs.append(guest.arch)