提交 cb01d2b5 编写于 作者: M Michal Privoznik

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: NMichal Privoznik <mprivozn@redhat.com>
上级 69f92a87
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册