Compare commits
10 Commits
01b3f3dd83
...
b34bd331aa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b34bd331aa | ||
|
|
c47407c470 | ||
|
|
2f03b29cfb | ||
|
|
f55db71ee3 | ||
|
|
5295d3c4eb | ||
|
|
718e9d5d0a | ||
|
|
70ab6febf4 | ||
|
|
6a977cb284 | ||
|
|
a82ac4877b | ||
|
|
131a1bf992 |
46
0001-fix-bug-that-virt-manager-can-not-support-dies.patch
Normal file
46
0001-fix-bug-that-virt-manager-can-not-support-dies.patch
Normal file
@ -0,0 +1,46 @@
|
||||
From 908e14f48382d839fa9c5bed98b41f34c11f3489 Mon Sep 17 00:00:00 2001
|
||||
From: lijunwei <lijunwei@kylinos.cn>
|
||||
Date: Wed, 28 Feb 2024 16:18:19 +0800
|
||||
Subject: [PATCH] fix bug that virt-manager can not support dies
|
||||
|
||||
---
|
||||
virtManager/domain.py | 1 +
|
||||
virtinst/domain/cpu.py | 3 ++-
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/virtManager/domain.py b/virtManager/domain.py
|
||||
index ad1c76d..cfe9f15 100644
|
||||
--- a/virtManager/domain.py
|
||||
+++ b/virtManager/domain.py
|
||||
@@ -509,6 +509,7 @@ class vmmDomain(vmmLibvirtObject):
|
||||
guest.cpu.sockets = sockets
|
||||
guest.cpu.cores = cores
|
||||
guest.cpu.threads = threads
|
||||
+ guest.cpu.dies = None
|
||||
|
||||
if model != _SENTINEL:
|
||||
if model in guest.cpu.SPECIAL_MODES:
|
||||
diff --git a/virtinst/domain/cpu.py b/virtinst/domain/cpu.py
|
||||
index 3548acd..7747082 100644
|
||||
--- a/virtinst/domain/cpu.py
|
||||
+++ b/virtinst/domain/cpu.py
|
||||
@@ -62,7 +62,7 @@ class DomainCpu(XMLBuilder):
|
||||
"""
|
||||
XML_NAME = "cpu"
|
||||
_XML_PROP_ORDER = ["mode", "match", "_model", "vendor",
|
||||
- "sockets", "cores", "threads", "features"]
|
||||
+ "sockets", "cores", "threads", "dies", "features"]
|
||||
|
||||
special_mode_was_set = False
|
||||
# These values are exposed on the command line, so are stable API
|
||||
@@ -220,6 +220,7 @@ class DomainCpu(XMLBuilder):
|
||||
sockets = XMLProperty("./topology/@sockets", is_int=True)
|
||||
cores = XMLProperty("./topology/@cores", is_int=True)
|
||||
threads = XMLProperty("./topology/@threads", is_int=True)
|
||||
+ dies = XMLProperty("./topology/@dies", is_int=True)
|
||||
|
||||
|
||||
##################
|
||||
--
|
||||
2.20.1
|
||||
|
||||
39
0003-virt-manager-Add-sw64-architecture.patch
Normal file
39
0003-virt-manager-Add-sw64-architecture.patch
Normal file
@ -0,0 +1,39 @@
|
||||
From 04751a30760ae367d6b615ade7bbd658025d2f1d Mon Sep 17 00:00:00 2001
|
||||
From: wzx <wuzx1226@qq.com>
|
||||
Date: Wed, 26 Oct 2022 10:12:57 +0800
|
||||
Subject: [PATCH] Add sw64 architecture
|
||||
|
||||
Signed-off-by: wzx <wuzx1226@qq.com>
|
||||
---
|
||||
virtManager/create.py | 1 +
|
||||
virtinst/domain/os.py | 2 ++
|
||||
2 files changed, 3 insertions(+)
|
||||
|
||||
diff --git a/virtManager/create.py b/virtManager/create.py
|
||||
index ff3373d..e7ddd0c 100644
|
||||
--- a/virtManager/create.py
|
||||
+++ b/virtManager/create.py
|
||||
@@ -427,6 +427,7 @@ class vmmCreate(vmmGObjectUI):
|
||||
|
||||
installable_arch = bool(guest.os.is_x86() or
|
||||
guest.os.is_ppc64() or
|
||||
+ guest.os.is_sw_64() or
|
||||
guest.os.is_s390x())
|
||||
|
||||
if guest.prefers_uefi():
|
||||
diff --git a/virtinst/domain/os.py b/virtinst/domain/os.py
|
||||
index 32343ab..fdcaa19 100644
|
||||
--- a/virtinst/domain/os.py
|
||||
+++ b/virtinst/domain/os.py
|
||||
@@ -46,6 +46,8 @@ class DomainOs(XMLBuilder):
|
||||
return self.arch == "armv7l"
|
||||
def is_arm64(self):
|
||||
return self.arch == "aarch64"
|
||||
+ def is_sw_64(self):
|
||||
+ return self.arch == "sw_64"
|
||||
def is_arm(self):
|
||||
return self.is_arm32() or self.is_arm64()
|
||||
def is_arm_vexpress(self):
|
||||
--
|
||||
2.33.0
|
||||
|
||||
199
Add-loongarch-support.patch
Normal file
199
Add-loongarch-support.patch
Normal file
@ -0,0 +1,199 @@
|
||||
From 870dc69df0bee7309430a5f0cc3219e5ebdc4a47 Mon Sep 17 00:00:00 2001
|
||||
From: yangchenguang <yangchenguang@kylinsec.com.cn>
|
||||
Date: Tue, 6 Jun 2023 19:53:32 +0800
|
||||
Subject: [PATCH] Add loongarch64 support
|
||||
|
||||
Signed-off-by: yangchenguang <yangchenguang@kylinsec.com.cn>
|
||||
---
|
||||
virtManager/create.py | 4 ++++
|
||||
virtinst/devices/disk.py | 2 ++
|
||||
virtinst/devices/graphics.py | 2 +-
|
||||
virtinst/devices/video.py | 2 ++
|
||||
virtinst/domain/cpu.py | 5 +++++
|
||||
virtinst/domain/os.py | 2 ++
|
||||
virtinst/domcapabilities.py | 4 ++++
|
||||
virtinst/guest.py | 14 ++++++++++----
|
||||
8 files changed, 30 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/virtManager/create.py b/virtManager/create.py
|
||||
index e7ddd0c..2afd400 100644
|
||||
--- a/virtManager/create.py
|
||||
+++ b/virtManager/create.py
|
||||
@@ -428,6 +428,7 @@ class vmmCreate(vmmGObjectUI):
|
||||
installable_arch = bool(guest.os.is_x86() or
|
||||
guest.os.is_ppc64() or
|
||||
guest.os.is_sw_64() or
|
||||
+ guest.os.is_loongarch() or
|
||||
guest.os.is_s390x())
|
||||
|
||||
if guest.prefers_uefi():
|
||||
@@ -823,6 +824,9 @@ class vmmCreate(vmmGObjectUI):
|
||||
machines.sort()
|
||||
|
||||
defmachine = None
|
||||
+
|
||||
+ if self._capsinfo.arch in ["loongarch64"]:
|
||||
+ defmachine = "loongson7a"
|
||||
prios = []
|
||||
recommended_machine = virtinst.Guest.get_recommended_machine(
|
||||
self._capsinfo)
|
||||
diff --git a/virtinst/devices/disk.py b/virtinst/devices/disk.py
|
||||
index 533631e..ac20f08 100644
|
||||
--- a/virtinst/devices/disk.py
|
||||
+++ b/virtinst/devices/disk.py
|
||||
@@ -963,6 +963,8 @@ class DeviceDisk(Device):
|
||||
return "sata"
|
||||
if self.is_cdrom() and guest.os.is_s390x():
|
||||
return "scsi"
|
||||
+ if self.is_cdrom() and guest.os.is_loongarch():
|
||||
+ return "scsi"
|
||||
return "ide"
|
||||
|
||||
def set_defaults(self, guest):
|
||||
diff --git a/virtinst/devices/graphics.py b/virtinst/devices/graphics.py
|
||||
index dafae06..fa0b9e1 100644
|
||||
--- a/virtinst/devices/graphics.py
|
||||
+++ b/virtinst/devices/graphics.py
|
||||
@@ -203,7 +203,7 @@ class DeviceGraphics(Device):
|
||||
if not self.conn.is_qemu() and not self.conn.is_test():
|
||||
return False
|
||||
# Spice has issues on some host arches, like ppc, so whitelist it
|
||||
- if self.conn.caps.host.cpu.arch not in ["i686", "x86_64"]:
|
||||
+ if self.conn.caps.host.cpu.arch not in ["i686", "x86_64", "loongarch64"]:
|
||||
return False
|
||||
return True
|
||||
|
||||
diff --git a/virtinst/devices/video.py b/virtinst/devices/video.py
|
||||
index 785d412..5e459bb 100644
|
||||
--- a/virtinst/devices/video.py
|
||||
+++ b/virtinst/devices/video.py
|
||||
@@ -47,6 +47,8 @@ class DeviceVideo(Device):
|
||||
return "virtio"
|
||||
if guest.conn.is_qemu() and guest.os.is_s390x():
|
||||
return "virtio"
|
||||
+ if guest.os.is_loongarch():
|
||||
+ return "virtio"
|
||||
if guest.has_spice() and guest.os.is_x86():
|
||||
if guest.has_gl():
|
||||
return "virtio"
|
||||
diff --git a/virtinst/domain/cpu.py b/virtinst/domain/cpu.py
|
||||
index 3548acd..7d35a11 100644
|
||||
--- a/virtinst/domain/cpu.py
|
||||
+++ b/virtinst/domain/cpu.py
|
||||
@@ -274,6 +274,11 @@ class DomainCpu(XMLBuilder):
|
||||
# -M virt defaults to a 32bit CPU, even if using aarch64
|
||||
self.model = "cortex-a57"
|
||||
|
||||
+ elif guest.os.is_loongarch() and guest.type == "kvm":
|
||||
+ if guest.os.arch != self.conn.caps.host.cpu.arch:
|
||||
+ return
|
||||
+ self.set_special_mode(guest, guest.loongarch_cpu_default)
|
||||
+
|
||||
elif guest.os.is_x86() and guest.type == "kvm":
|
||||
self._set_cpu_x86_kvm_default(guest)
|
||||
|
||||
diff --git a/virtinst/domain/os.py b/virtinst/domain/os.py
|
||||
index fdcaa19..fe46dd2 100644
|
||||
--- a/virtinst/domain/os.py
|
||||
+++ b/virtinst/domain/os.py
|
||||
@@ -48,6 +48,8 @@ class DomainOs(XMLBuilder):
|
||||
return self.arch == "aarch64"
|
||||
def is_sw_64(self):
|
||||
return self.arch == "sw_64"
|
||||
+ def is_loongarch(self):
|
||||
+ return self.arch == "loongarch64"
|
||||
def is_arm(self):
|
||||
return self.is_arm32() or self.is_arm64()
|
||||
def is_arm_vexpress(self):
|
||||
diff --git a/virtinst/domcapabilities.py b/virtinst/domcapabilities.py
|
||||
index 4cbb7f2..1fbb3d0 100644
|
||||
--- a/virtinst/domcapabilities.py
|
||||
+++ b/virtinst/domcapabilities.py
|
||||
@@ -177,6 +177,10 @@ class DomainCapabilities(XMLBuilder):
|
||||
"armv7l": [
|
||||
r".*arm/QEMU_EFI.*", # fedora, gerd's firmware repo
|
||||
],
|
||||
+ "loongarch64": [
|
||||
+ ".*loongarch_bios.bin", # loongarch
|
||||
+ ".*loongarch_bios.bin", # gerd's firmware repo
|
||||
+ ],
|
||||
}
|
||||
|
||||
def find_uefi_path_for_arch(self):
|
||||
diff --git a/virtinst/guest.py b/virtinst/guest.py
|
||||
index c0471cd..c539276 100644
|
||||
--- a/virtinst/guest.py
|
||||
+++ b/virtinst/guest.py
|
||||
@@ -162,6 +162,7 @@ class Guest(XMLBuilder):
|
||||
self.skip_default_graphics = False
|
||||
self.skip_default_rng = False
|
||||
self.x86_cpu_default = self.cpu.SPECIAL_MODE_APP_DEFAULT
|
||||
+ self.loongarch_cpu_default = self.cpu.SPECIAL_MODE_HOST_MODEL_ONLY
|
||||
|
||||
self.__osinfo = None
|
||||
self._capsinfo = None
|
||||
@@ -283,6 +284,7 @@ class Guest(XMLBuilder):
|
||||
# These _only_ support virtio so don't check the OS
|
||||
if (self.os.is_arm_machvirt() or
|
||||
self.os.is_s390x() or
|
||||
+ self.os.is_loongarch() or
|
||||
self.os.is_pseries()):
|
||||
return True
|
||||
|
||||
@@ -318,7 +320,7 @@ class Guest(XMLBuilder):
|
||||
arm+machvirt prefers UEFI since it's required for traditional
|
||||
install methods
|
||||
"""
|
||||
- return self.os.is_arm_machvirt()
|
||||
+ return (self.os.is_arm_machvirt() or self.os.is_loongarch())
|
||||
|
||||
def get_uefi_path(self):
|
||||
"""
|
||||
@@ -350,6 +352,8 @@ class Guest(XMLBuilder):
|
||||
"""
|
||||
self.os.loader_ro = True
|
||||
self.os.loader_type = "pflash"
|
||||
+ if self.os.is_loongarch():
|
||||
+ self.os.loader_type = "rom"
|
||||
self.os.loader = path
|
||||
|
||||
# If the firmware name contains "secboot" it is probably build
|
||||
@@ -573,7 +577,7 @@ class Guest(XMLBuilder):
|
||||
usb_keyboard = False
|
||||
if self.os.is_x86() and not self.os.is_xenpv():
|
||||
usb_tablet = self.osinfo.supports_usbtablet()
|
||||
- if self.os.is_arm_machvirt():
|
||||
+ if (self.os.is_arm_machvirt() or self.os.is_loongarch()):
|
||||
usb_tablet = True
|
||||
usb_keyboard = True
|
||||
|
||||
@@ -665,7 +669,7 @@ class Guest(XMLBuilder):
|
||||
return
|
||||
if self.os.is_container() and not self.conn.is_vz():
|
||||
return
|
||||
- if self.os.arch not in ["x86_64", "i686", "ppc64", "ppc64le"]:
|
||||
+ if self.os.arch not in ["x86_64", "i686", "ppc64", "ppc64le", "loongarch64"]:
|
||||
return
|
||||
self.add_device(DeviceGraphics(self.conn))
|
||||
|
||||
@@ -711,7 +715,7 @@ class Guest(XMLBuilder):
|
||||
break
|
||||
|
||||
# Add virtio-scsi controller if needed
|
||||
- if ((self.os.is_arm_machvirt() or self.os.is_pseries()) and
|
||||
+ if ((self.os.is_arm_machvirt() or self.os.is_pseries() or self.os.is_loongarch()) and
|
||||
not has_any_scsi and
|
||||
not has_virtio_scsi):
|
||||
for dev in self.devices.disk:
|
||||
@@ -753,6 +757,8 @@ class Guest(XMLBuilder):
|
||||
self.add_device(dev)
|
||||
|
||||
def _add_spice_usbredir(self):
|
||||
+ if self.os.is_loongarch():
|
||||
+ return
|
||||
if self.skip_default_usbredir:
|
||||
return
|
||||
if self.devices.redirdev:
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
%global __python %{__python3}
|
||||
Name: virt-manager
|
||||
Version: 2.1.0
|
||||
Release: 5
|
||||
Release: 10
|
||||
Summary: The manage virtual machines tool which via libvirt.
|
||||
License: GPLv2+
|
||||
BuildArch: noarch
|
||||
@ -9,6 +9,9 @@ URL: https://virt-manager.org/
|
||||
Source0: https://virt-manager.org/download/sources/virt-manager/virt-manager-%{version}.tar.gz
|
||||
Patch0001: 0001-initrdinject-Use-full-option-versions-for-cpio.patch
|
||||
Patch0002: 0002-initrdinject-Force-added-files-to-be-owned-as-root-b.patch
|
||||
Patch0003: 0003-virt-manager-Add-sw64-architecture.patch
|
||||
Patch0004: Add-loongarch-support.patch
|
||||
Patch0005: 0001-fix-bug-that-virt-manager-can-not-support-dies.patch
|
||||
Requires: virt-manager-common = %{version}-%{release} python3-gobject gtk3 libvirt-glib >= 0.0.9
|
||||
Requires: gtk-vnc2 spice-gtk3 dconf vte291
|
||||
Recommends: (libvirt-daemon-kvm or libvirt-daemon-qemu) libvirt-daemon-config-network
|
||||
@ -81,6 +84,21 @@ done
|
||||
%{_mandir}/man1/{virt-install.1*,virt-clone.1*,virt-convert.1*,virt-xml.1*}
|
||||
|
||||
%changelog
|
||||
* Wed Feb 28 2024 lijunwei <lijunwei@kylinos.cn> - 2.1.0-10
|
||||
* fix bug that virt-manager can not support features dies
|
||||
|
||||
* Thu Aug 10 2023 yeqinglong <yeqinglong@kylinsec.com.cn> - 2.1.0-9
|
||||
- update loongarch64 support
|
||||
|
||||
* Thu Apr 13 2023 yangchenguang <yangchenguang@kylinsec.com.cn> - 2.1.0-8
|
||||
- Modify patch file incorrect
|
||||
|
||||
* Thu Apr 13 2023 yangchenguang <yangchenguang@kylinsec.com.cn> - 2.1.0-7
|
||||
- Add loongarch64 architecture
|
||||
|
||||
* Wed Oct 26 2022 wuzx<wuzx1226@qq.com> - 2.1.0-6
|
||||
- Add sw64 architecture
|
||||
|
||||
* Fri Jul 30 2021 chenyanpanHW <chenyanpan@huawei.com> - 2.1.0-5
|
||||
- DESC: delete -S git from %autosetup, and delete BuildRequires git
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user