!9 [sync] PR-7: add 0001-make-gnome-boxes-correctly-select-virtualization-cpu-mode.patch
From: @openeuler-sync-bot Reviewed-by: @dwl301 Signed-off-by: @dwl301
This commit is contained in:
commit
dbd7326a36
@ -0,0 +1,45 @@
|
||||
diff --git a/src/vm-configurator.vala b/src/vm-configurator.vala
|
||||
index ee8cf13..ede5e0e 100644
|
||||
--- a/src/vm-configurator.vala
|
||||
+++ b/src/vm-configurator.vala
|
||||
@@ -38,6 +38,13 @@ private class Boxes.VMConfigurator {
|
||||
private const string LIBOSINFO_XML = "<libosinfo>%s</libosinfo>";
|
||||
private const string LIBOSINFO_OS_ID_XML = "<os id=\"%s\"/>";
|
||||
|
||||
+ /* this var is used for passporting virt type information between function set_cpu_config and statement:
|
||||
+ "var virt_type = guest_kvm_enabled (best_caps) ? DomainVirtType.KVM : DomainVirtType.QEMU;"
|
||||
+ the concrete type of virt_type_p refers to /usr/share/vala/vapi/libvirt-gconfig-1.0.vapi:75: public GVirConfig.DomainVirtType get_virt_type ();
|
||||
+ the virt_type_p must be static then member function create_domain_config and set_cpu_config can access it.
|
||||
+ */
|
||||
+ private static GVirConfig.DomainVirtType virt_type_p = DomainVirtType.QEMU;
|
||||
+
|
||||
public static Domain create_domain_config (InstallerMedia install_media, string target_path, Capabilities caps, DomainCapabilities domain_caps)
|
||||
throws VMConfiguratorError {
|
||||
var domain = new Domain ();
|
||||
@@ -46,9 +53,13 @@ private class Boxes.VMConfigurator {
|
||||
|
||||
var best_caps = get_best_guest_caps (caps, install_media);
|
||||
domain.memory = install_media.resources.ram / KIBIBYTES;
|
||||
- set_cpu_config (domain, caps);
|
||||
+ //set_cpu_config (domain, caps); //move this statement before statement:"domain.set_virt_type (virt_type);"
|
||||
|
||||
var virt_type = guest_kvm_enabled (best_caps) ? DomainVirtType.KVM : DomainVirtType.QEMU;
|
||||
+ // passporting virt type information
|
||||
+ virt_type_p = virt_type;
|
||||
+ // new call position
|
||||
+ set_cpu_config (domain, caps);
|
||||
domain.set_virt_type (virt_type);
|
||||
|
||||
set_os_config (domain, install_media, best_caps, domain_caps);
|
||||
@@ -244,7 +255,10 @@ private class Boxes.VMConfigurator {
|
||||
domain.vcpu = topology.get_sockets () * topology.get_cores () * topology.get_threads ();
|
||||
|
||||
var cpu = new DomainCpu ();
|
||||
- cpu.set_mode (DomainCpuMode.HOST_PASSTHROUGH);
|
||||
+ if(virt_type_p == DomainVirtType.QEMU)
|
||||
+ cpu.set_mode (DomainCpuMode.HOST_MODEL);
|
||||
+ else /* if virt_type_p == DomainVirtType.KVM or other */
|
||||
+ cpu.set_mode (DomainCpuMode.HOST_PASSTHROUGH);
|
||||
cpu.set_topology (topology);
|
||||
|
||||
domain.set_cpu (cpu);
|
||||
@ -4,11 +4,12 @@
|
||||
|
||||
Name: gnome-boxes
|
||||
Version: 3.38.2
|
||||
Release: 2
|
||||
Release: 3
|
||||
Summary: An application of the GNOME Desktop Environment
|
||||
License: LGPLv2+
|
||||
URL: https://wiki.gnome.org/Apps/Boxes
|
||||
Source0: http://download.gnome.org/sources/%{name}/%{url_ver}/%{name}-%{version}.tar.xz
|
||||
Patch0: 0001-make-gnome-boxes-correctly-select-virtualization-cpu-mode.patch
|
||||
|
||||
BuildRequires: gettext >= 0.19.8 meson itstool vala >= 0.36.0 yelp-tools
|
||||
BuildRequires: pkgconfig(clutter-gtk-1.0) pkgconfig(freerdp2) pkgconfig(glib-2.0) >= 2.52
|
||||
@ -70,6 +71,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.gnome.Boxes.deskt
|
||||
%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf
|
||||
|
||||
%changelog
|
||||
* Mon Oct 11 2021 weijin deng <weijin.deng@turbolinux.com.cn> - 3.38.2-3
|
||||
- Add 0001-make-gnome-boxes-correctly-select-virtualization-cpu-mode.patch
|
||||
|
||||
* Fri Sep 10 2021 lingsheng <lingsheng@huawei.com> - 3.38.2-2
|
||||
- Delete rpath setting
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user