[gnome-boxes/backports-gnome-3-36-1: 2/4] installer-media, libvirt-media: Set "prefers_q35" for existing VMs
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes/backports-gnome-3-36-1: 2/4] installer-media, libvirt-media: Set "prefers_q35" for existing VMs
- Date: Fri, 13 Mar 2020 13:00:05 +0000 (UTC)
commit 436b7f1068130e33ec067aed4e8006e631a42ff8
Author: Felipe Borges <felipeborges gnome org>
Date: Wed Feb 26 17:37:12 2020 +0100
installer-media, libvirt-media: Set "prefers_q35" for existing VMs
Libosinfo tells us whether an OS supports the q35 machine type
while installing an OS. When cloning, we don't inspect the media,
and therefore are not able to use libosinfo for that. Luckly the
GvirConfig.Domain contains the machine type.
src/installer-media.vala | 4 ++--
src/libvirt-media.vala | 6 ++++++
2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/installer-media.vala b/src/installer-media.vala
index ef73668d..ffae48ac 100644
--- a/src/installer-media.vala
+++ b/src/installer-media.vala
@@ -69,7 +69,7 @@
}
}
- public bool prefers_q35 {
+ public virtual bool prefers_q35 {
get {
if (os == null)
return false;
@@ -85,7 +85,7 @@
}
}
- public bool prefers_ich9 {
+ public virtual bool prefers_ich9 {
get {
if (!prefers_q35)
return false;
diff --git a/src/libvirt-media.vala b/src/libvirt-media.vala
index 93157ed6..f173a497 100644
--- a/src/libvirt-media.vala
+++ b/src/libvirt-media.vala
@@ -3,6 +3,12 @@
using GVirConfig;
private class Boxes.LibvirtMedia : Boxes.InstalledMedia {
+ public override bool prefers_q35 {
+ get {
+ return domain_config.get_os ().get_machine ().contains ("q35");
+ }
+ }
+
protected override string? architecture {
owned get {
return domain_config.get_os ().get_arch ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]