提交 0440d5e9 编写于 作者: A Andrea Bolognani

qemu: Move qemuDomainSupportsPCI() to qemu_domain

The function operates on a virDomainDef and is not tied to
device address assignment in any way, so it makes more sense
for it to live along with qemuDomainIs*() and the like.
Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
上级 68e26a9e
...@@ -10085,6 +10085,28 @@ qemuDomainNeedsFDC(const virDomainDef *def) ...@@ -10085,6 +10085,28 @@ qemuDomainNeedsFDC(const virDomainDef *def)
} }
bool
qemuDomainSupportsPCI(virDomainDefPtr def,
virQEMUCapsPtr qemuCaps)
{
if ((def->os.arch != VIR_ARCH_ARMV6L) &&
(def->os.arch != VIR_ARCH_ARMV7L) &&
(def->os.arch != VIR_ARCH_AARCH64) &&
!ARCH_IS_RISCV(def->os.arch))
return true;
if (STREQ(def->os.machine, "versatilepb"))
return true;
if ((qemuDomainIsARMVirt(def) ||
qemuDomainIsRISCVVirt(def)) &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX))
return true;
return false;
}
static bool static bool
qemuCheckMemoryDimmConflict(const virDomainDef *def, qemuCheckMemoryDimmConflict(const virDomainDef *def,
const virDomainMemoryDef *mem) const virDomainMemoryDef *mem)
......
...@@ -847,6 +847,8 @@ bool qemuDomainHasPCIRoot(const virDomainDef *def); ...@@ -847,6 +847,8 @@ bool qemuDomainHasPCIRoot(const virDomainDef *def);
bool qemuDomainHasPCIeRoot(const virDomainDef *def); bool qemuDomainHasPCIeRoot(const virDomainDef *def);
bool qemuDomainHasBuiltinIDE(const virDomainDef *def); bool qemuDomainHasBuiltinIDE(const virDomainDef *def);
bool qemuDomainNeedsFDC(const virDomainDef *def); bool qemuDomainNeedsFDC(const virDomainDef *def);
bool qemuDomainSupportsPCI(virDomainDefPtr def,
virQEMUCapsPtr qemuCaps);
void qemuDomainUpdateCurrentMemorySize(virDomainObjPtr vm); void qemuDomainUpdateCurrentMemorySize(virDomainObjPtr vm);
......
...@@ -2356,28 +2356,6 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, ...@@ -2356,28 +2356,6 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
} }
static bool
qemuDomainSupportsPCI(virDomainDefPtr def,
virQEMUCapsPtr qemuCaps)
{
if ((def->os.arch != VIR_ARCH_ARMV6L) &&
(def->os.arch != VIR_ARCH_ARMV7L) &&
(def->os.arch != VIR_ARCH_AARCH64) &&
!ARCH_IS_RISCV(def->os.arch))
return true;
if (STREQ(def->os.machine, "versatilepb"))
return true;
if ((qemuDomainIsARMVirt(def) ||
qemuDomainIsRISCVVirt(def)) &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX))
return true;
return false;
}
static void static void
qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDefPtr cont, qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDefPtr cont,
virDomainDefPtr def, virDomainDefPtr def,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册