mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
Test that domain-specific qemu machine types are used correctly
* tests/testutilsqemu.c: add a machine types list for /usr/bin/kvm which doesn't have any aliases, while the guest has aliases * tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.*, tests/qemuxml2argvtest.c: add a test using /usr/bin/kvm and make sure that 'pc' machine type doesn't get canonicalized using the aliases in the guest machine type list
This commit is contained in:
parent
6ab16aaf63
commit
e52d608ddf
@ -0,0 +1 @@
|
|||||||
|
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/kvm -S -M pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb
|
22
tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.xml
Normal file
22
tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.xml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<domain type='qemu'>
|
||||||
|
<name>QEMUGuest1</name>
|
||||||
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
|
<memory>219200</memory>
|
||||||
|
<currentMemory>219200</currentMemory>
|
||||||
|
<vcpu>1</vcpu>
|
||||||
|
<os>
|
||||||
|
<type arch='x86_64' machine='pc'>hvm</type>
|
||||||
|
<boot dev='hd'/>
|
||||||
|
</os>
|
||||||
|
<clock offset='utc'/>
|
||||||
|
<on_poweroff>destroy</on_poweroff>
|
||||||
|
<on_reboot>restart</on_reboot>
|
||||||
|
<on_crash>destroy</on_crash>
|
||||||
|
<devices>
|
||||||
|
<emulator>/usr/bin/kvm</emulator>
|
||||||
|
<disk type='block' device='disk'>
|
||||||
|
<source dev='/dev/HostVG/QEMUGuest1'/>
|
||||||
|
<target dev='hda' bus='ide'/>
|
||||||
|
</disk>
|
||||||
|
</devices>
|
||||||
|
</domain>
|
@ -191,6 +191,7 @@ mymain(int argc, char **argv)
|
|||||||
|
|
||||||
DO_TEST("minimal", QEMUD_CMD_FLAG_NAME);
|
DO_TEST("minimal", QEMUD_CMD_FLAG_NAME);
|
||||||
DO_TEST("machine-aliases1", 0);
|
DO_TEST("machine-aliases1", 0);
|
||||||
|
DO_TEST("machine-aliases2", 0);
|
||||||
DO_TEST("boot-cdrom", 0);
|
DO_TEST("boot-cdrom", 0);
|
||||||
DO_TEST("boot-network", 0);
|
DO_TEST("boot-network", 0);
|
||||||
DO_TEST("boot-floppy", 0);
|
DO_TEST("boot-floppy", 0);
|
||||||
|
@ -101,13 +101,18 @@ virCapsPtr testQemuCapsInit(void) {
|
|||||||
0,
|
0,
|
||||||
NULL) == NULL)
|
NULL) == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
if ((machines = testQemuAllocMachines(&nmachines)) == NULL)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
"kvm",
|
"kvm",
|
||||||
"/usr/bin/kvm",
|
"/usr/bin/kvm",
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
nmachines,
|
||||||
NULL) == NULL)
|
machines) == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
machines = NULL;
|
||||||
|
|
||||||
nmachines = ARRAY_CARDINALITY(xen_machines);
|
nmachines = ARRAY_CARDINALITY(xen_machines);
|
||||||
if ((machines = virCapabilitiesAllocMachines(xen_machines, nmachines)) == NULL)
|
if ((machines = virCapabilitiesAllocMachines(xen_machines, nmachines)) == NULL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user