Test all kinds of scenarios, including guests asking for GIC but failing to specify a version, guests specifying an invalid version and guests trying to use GIC with non-virt or even non-ARM machines. --- .../qemuxml2argv-aarch64-gic-default.args | 1 + .../qemuxml2argv-aarch64-gic-default.xml | 22 ++++++++++++++++++ .../qemuxml2argv-aarch64-gic-host.args | 20 ++++++++++++++++ .../qemuxml2argv-aarch64-gic-host.xml | 22 ++++++++++++++++++ .../qemuxml2argv-aarch64-gic-invalid.xml | 22 ++++++++++++++++++ .../qemuxml2argv-aarch64-gic-none.args | 1 + .../qemuxml2argv-aarch64-gic-none.xml | 19 +++++++++++++++ .../qemuxml2argv-aarch64-gic-not-arm.xml | 22 ++++++++++++++++++ .../qemuxml2argv-aarch64-gic-not-virt.xml | 22 ++++++++++++++++++ tests/qemuxml2argvtest.c | 27 ++++++++++++++++++++++ .../qemuxml2xmlout-aarch64-gic-default.xml | 1 + .../qemuxml2xmlout-aarch64-gic-none.xml | 1 + tests/qemuxml2xmltest.c | 3 +++ 13 files changed, 183 insertions(+) create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-default.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-default.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-invalid.xml create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-not-arm.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-not-virt.xml create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-default.xml create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none.xml diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-default.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-default.args new file mode 120000 index 0000000..3234039 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-default.args @@ -0,0 +1 @@ +qemuxml2argv-aarch64-gic-v2.args \ No newline at end of file diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-default.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-default.xml new file mode 100644 index 0000000..b219972 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-default.xml @@ -0,0 +1,22 @@ +<domain type='kvm'> + <name>aarch64test</name> + <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='aarch64' machine='virt'>hvm</type> + <boot dev='hd'/> + </os> + <features> + <gic/> + </features> + <cpu mode='host-passthrough'/> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-aarch64</emulator> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.args new file mode 100644 index 0000000..56adc72 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.args @@ -0,0 +1,20 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-aarch64 \ +-name aarch64test \ +-S \ +-machine virt,accel=kvm,gic-version=host \ +-cpu host \ +-m 1024 \ +-smp 1 \ +-uuid 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/test-monitor,server,nowait \ +-no-acpi \ +-boot c \ +-usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.xml new file mode 100644 index 0000000..445b358 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.xml @@ -0,0 +1,22 @@ +<domain type='kvm'> + <name>aarch64test</name> + <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='aarch64' machine='virt'>hvm</type> + <boot dev='hd'/> + </os> + <features> + <gic version='host'/> + </features> + <cpu mode='host-passthrough'/> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-aarch64</emulator> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-invalid.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-invalid.xml new file mode 100644 index 0000000..1cf9ea8 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-invalid.xml @@ -0,0 +1,22 @@ +<domain type='kvm'> + <name>aarch64test</name> + <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='aarch64' machine='virt'>hvm</type> + <boot dev='hd'/> + </os> + <features> + <gic version='none'/> + </features> + <cpu mode='host-passthrough'/> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-aarch64</emulator> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none.args new file mode 120000 index 0000000..3234039 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none.args @@ -0,0 +1 @@ +qemuxml2argv-aarch64-gic-v2.args \ No newline at end of file diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none.xml new file mode 100644 index 0000000..272d0c8 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none.xml @@ -0,0 +1,19 @@ +<domain type='kvm'> + <name>aarch64test</name> + <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='aarch64' machine='virt'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='host-passthrough'/> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-aarch64</emulator> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-not-arm.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-not-arm.xml new file mode 100644 index 0000000..3b907bc --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-not-arm.xml @@ -0,0 +1,22 @@ +<domain type='kvm'> + <name>aarch64test</name> + <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='ppc64' machine='pseries'>hvm</type> + <boot dev='hd'/> + </os> + <features> + <gic/> + </features> + <cpu mode='host-passthrough'/> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-ppc64</emulator> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-not-virt.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-not-virt.xml new file mode 100644 index 0000000..256664e --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-not-virt.xml @@ -0,0 +1,22 @@ +<domain type='kvm'> + <name>aarch64test</name> + <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='aarch64' machine='not-virt'>hvm</type> + <boot dev='hd'/> + </os> + <features> + <gic/> + </features> + <cpu mode='host-passthrough'/> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-aarch64</emulator> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 2ad5f5d..3a402b1 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1673,14 +1673,41 @@ mymain(void) DO_TEST("aarch64-cpu-passthrough", QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DEVICE_VIRTIO_MMIO, QEMU_CAPS_CPU_HOST, QEMU_CAPS_KVM); + + DO_TEST("aarch64-gic-none", QEMU_CAPS_DEVICE, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST("aarch64-gic-none", QEMU_CAPS_DEVICE, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST); + DO_TEST("aarch64-gic-default", QEMU_CAPS_DEVICE, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST("aarch64-gic-default", QEMU_CAPS_DEVICE, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST); DO_TEST("aarch64-gic-v2", QEMU_CAPS_DEVICE, QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST, QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST("aarch64-gic-v2", QEMU_CAPS_DEVICE, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST); DO_TEST("aarch64-gic-v3", QEMU_CAPS_DEVICE, QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST, QEMU_CAPS_MACH_VIRT_GIC_VERSION); DO_TEST_FAILURE("aarch64-gic-v3", QEMU_CAPS_DEVICE, QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST); + DO_TEST("aarch64-gic-host", QEMU_CAPS_DEVICE, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST_FAILURE("aarch64-gic-host", QEMU_CAPS_DEVICE, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST); + DO_TEST_PARSE_ERROR("aarch64-gic-invalid", QEMU_CAPS_DEVICE, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST_FAILURE("aarch64-gic-not-virt", QEMU_CAPS_DEVICE, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST_FAILURE("aarch64-gic-not-arm", QEMU_CAPS_DEVICE, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); driver.caps->host.cpu->arch = VIR_ARCH_AARCH64; DO_TEST("aarch64-kvm-32-on-64", QEMU_CAPS_DEVICE, diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-default.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-default.xml new file mode 120000 index 0000000..80a01c2 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-default.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/qemuxml2argv-aarch64-gic-v2.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none.xml new file mode 120000 index 0000000..80a01c2 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/qemuxml2argv-aarch64-gic-v2.xml \ No newline at end of file diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index bdf96a6..25002ef 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -604,8 +604,11 @@ mymain(void) DO_TEST("smbios-multiple-type2"); DO_TEST("aarch64-aavmf-virtio-mmio"); + DO_TEST_DIFFERENT("aarch64-gic-none"); + DO_TEST_DIFFERENT("aarch64-gic-default"); DO_TEST("aarch64-gic-v2"); DO_TEST("aarch64-gic-v3"); + DO_TEST("aarch64-gic-host"); DO_TEST("memory-hotplug"); DO_TEST("memory-hotplug-nonuma"); -- 2.5.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list