mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
tests: Add fake PPC64 emulator for QEMU testing
Create a fake PPC64 QEMU so that we can run PPC64 QEMU tests when we don't have a real version of the emulator available. Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
This commit is contained in:
parent
d64955a91a
commit
bbae92f8b8
@ -60,6 +60,33 @@ static int testQemuDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED)
|
|||||||
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
|
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int testQemuAddPPC64Guest(virCapsPtr caps)
|
||||||
|
{
|
||||||
|
static const char *machine[] = { "pseries" };
|
||||||
|
virCapsGuestMachinePtr *machines = NULL;
|
||||||
|
virCapsGuestPtr guest;
|
||||||
|
|
||||||
|
machines = virCapabilitiesAllocMachines(machine, 1);
|
||||||
|
if (!machines)
|
||||||
|
goto error;
|
||||||
|
|
||||||
|
guest = virCapabilitiesAddGuest(caps, "hvm", "ppc64", 64,
|
||||||
|
"/usr/bin/qemu-system-ppc64", NULL,
|
||||||
|
1, machines);
|
||||||
|
if (!guest)
|
||||||
|
goto error;
|
||||||
|
|
||||||
|
if (!virCapabilitiesAddGuestDomain(guest, "qemu", NULL, NULL, 0, NULL))
|
||||||
|
goto error;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
error:
|
||||||
|
/* No way to free a guest? */
|
||||||
|
virCapabilitiesFreeMachines(machines, 1);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
virCapsPtr testQemuCapsInit(void) {
|
virCapsPtr testQemuCapsInit(void) {
|
||||||
virCapsPtr caps;
|
virCapsPtr caps;
|
||||||
virCapsGuestPtr guest;
|
virCapsGuestPtr guest;
|
||||||
@ -172,6 +199,9 @@ virCapsPtr testQemuCapsInit(void) {
|
|||||||
NULL) == NULL)
|
NULL) == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
if (testQemuAddPPC64Guest(caps))
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
if (virTestGetDebug()) {
|
if (virTestGetDebug()) {
|
||||||
char *caps_str;
|
char *caps_str;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user