mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
qemu_capabilities: Introduce virQEMUCapsGetDefaultMachine
Sometimes it may be useful to get a default machine for given qemu binary. Fortunately, the default machine is stored always on the first position in the supported machines array. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
69f92a87c2
commit
cb01d2b5b1
@ -3556,3 +3556,12 @@ virQEMUCapsIsMachineSupported(virQEMUCapsPtr qemuCaps,
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
const char *
|
||||
virQEMUCapsGetDefaultMachine(virQEMUCapsPtr qemuCaps)
|
||||
{
|
||||
if (!qemuCaps->nmachineTypes)
|
||||
return NULL;
|
||||
return qemuCaps->machineTypes[0];
|
||||
}
|
||||
|
@ -305,6 +305,8 @@ bool virQEMUCapsSupportsChardev(virDomainDefPtr def,
|
||||
bool virQEMUCapsIsMachineSupported(virQEMUCapsPtr qemuCaps,
|
||||
const char *canonical_machine);
|
||||
|
||||
const char * virQEMUCapsGetDefaultMachine(virQEMUCapsPtr qemuCaps);
|
||||
|
||||
int virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
|
||||
const char *binary,
|
||||
virQEMUCapsPtr qemubinCaps,
|
||||
|
Loading…
Reference in New Issue
Block a user