qemu_capabilities: Introduce virQEMUCapsIsMachineSupported

This internal API is meant to answer the question 'Is this machine
type supported by given qemu?'.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2014-06-30 16:31:51 +02:00
parent 4e30af3853
commit 69f92a87c2
2 changed files with 17 additions and 0 deletions

View File

@ -3542,3 +3542,17 @@ virQEMUCapsSupportsChardev(virDomainDefPtr def,
(chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE &&
chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO));
}
bool
virQEMUCapsIsMachineSupported(virQEMUCapsPtr qemuCaps,
const char *canonical_machine)
{
size_t i;
for (i = 0; i < qemuCaps->nmachineTypes; i++) {
if (STREQ(canonical_machine, qemuCaps->machineTypes[i]))
return true;
}
return false;
}

View File

@ -302,6 +302,9 @@ bool virQEMUCapsSupportsChardev(virDomainDefPtr def,
virQEMUCapsPtr qemuCaps,
virDomainChrDefPtr chr);
bool virQEMUCapsIsMachineSupported(virQEMUCapsPtr qemuCaps,
const char *canonical_machine);
int virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
const char *binary,
virQEMUCapsPtr qemubinCaps,