[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[virt-tools-list] [virt-manager PATCH] support creation of x86_64 domains with alternate machine types (e.g. q35)



In an apparent attempt to simplify creation of x86_64 domains,
create.py has always cleared out the list of possible machine types,
thus forcing all new domains to use the default machine type "pc". Now
that the much more modern machinetypes based on the Intel Q35 chipset
are available in qemu, it is more important to allow the user to
select the machine type when creating a machine.

This patch makes the default machine type "pc", but adds "q35" as a
secondary "priority" selection (meaning that it will be placed at the
top of the list). I also noticed that all the more specific
machinetypes supported by qemu were duplicated (possibly due to
combining the list for x86_64 and i686?), so I made a modification to
remove duplicates in the list.

Since virt-manager now defaults to adding USB 2.0 controllers to new
machines, this small change allows virt-manager to create fully
functioning Q35 machines.
---
 virtManager/create.py | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/virtManager/create.py b/virtManager/create.py
index c2e0ee7..4fd8a8a 100644
--- a/virtManager/create.py
+++ b/virtManager/create.py
@@ -710,19 +710,21 @@ class vmmCreate(vmmGObjectUI):
         model.clear()
 
         machines = self.capsdomain.machines[:]
-        if self.capsguest.arch in ["i686", "x86_64"]:
-            machines = []
-        machines.sort()
-
-        defmachine = None
         prios = []
-        if self.capsguest.arch == "armv7l":
+        defmachine = None
+
+        if self.capsguest.arch in ["i686", "x86_64"]:
+            defmachine = "pc"
+            prios = [ "pc", "q35" ]
+        elif self.capsguest.arch == "armv7l":
             defmachine = "vexpress-a9"
             prios = ["vexpress-a9", "vexpress-a15", "highbank", "midway"]
         elif self.capsguest.arch == "ppc64":
             defmachine = "pseries"
             prios = ["pseries"]
 
+        machines = sorted(set(machines))
+
         for p in prios[:]:
             if p not in machines:
                 prios.remove(p)
-- 
1.9.0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]