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

[libvirt] [PATCH] qemu: add default pci-root device to mips*/malta guests



The MIPS Malta board has a root PCI controller. It is not sent during
migration, so it needs to be added by default.

Signed-off-by: Aurelien Jarno <aurelien aurel32 net>
---
 src/qemu/qemu_domain.c | 15 ++++++++++++++-
 src/qemu/qemu_domain.h |  1 +
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 173f82c..75b0545 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1763,6 +1763,14 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def,
             addPCIeRoot = virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX);
         break;
 
+    case VIR_ARCH_MIPS:
+    case VIR_ARCH_MIPSEL:
+    case VIR_ARCH_MIPS64:
+    case VIR_ARCH_MIPS64EL:
+        if (qemuDomainMachineIsMalta(def))
+            addPCIRoot = true;
+        break;
+
     case VIR_ARCH_PPC64:
     case VIR_ARCH_PPC64LE:
         addPCIRoot = true;
@@ -4654,6 +4662,11 @@ qemuDomainMachineIsVirt(const virDomainDef *def)
            STRPREFIX(def->os.machine, "virt-");
 }
 
+bool
+qemuDomainMachineIsMalta(const virDomainDef *def)
+{
+    return STRPREFIX(def->os.machine, "malta");
+}
 
 static bool
 qemuCheckMemoryDimmConflict(const virDomainDef *def,
@@ -4830,7 +4843,7 @@ bool
 qemuDomainMachineHasBuiltinIDE(const virDomainDef *def)
 {
     return qemuDomainMachineIsI440FX(def) ||
-        STREQ(def->os.machine, "malta") ||
+        qemuDomainMachineIsMalta(def) ||
         STREQ(def->os.machine, "sun4u") ||
         STREQ(def->os.machine, "g3beige");
 }
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 95f821c..adba5fa 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -585,6 +585,7 @@ bool qemuDomainMachineIsI440FX(const virDomainDef *def);
 bool qemuDomainMachineNeedsFDC(const virDomainDef *def);
 bool qemuDomainMachineIsS390CCW(const virDomainDef *def);
 bool qemuDomainMachineIsVirt(const virDomainDef *def);
+bool qemuDomainMachineIsMalta(const virDomainDef *def);
 bool qemuDomainMachineHasBuiltinIDE(const virDomainDef *def);
 
 int qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver,
-- 
2.8.1


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