mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
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:
parent
4e30af3853
commit
69f92a87c2
@ -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;
|
||||
}
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user