From: Michal Privoznik Date: Mon, 27 Apr 2015 12:54:19 +0000 (+0200) Subject: qemu: Implement GIC X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=608c95c76cee49fe98b913d1b7beb1d728b7ca99;p=people%2Fliuw%2Flibxenctrl-split%2Flibvirt.git qemu: Implement GIC The only version that's supported in QEMU is version 2, currently. Fortunately, it is enabled by aarch64 automatically, so there's nothing for us that needs to be put onto command line. Signed-off-by: Michal Privoznik --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 952a10efc..c32d8c61d 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7202,6 +7202,19 @@ qemuBuildCpuArgStr(virQEMUDriverPtr driver, have_cpu = true; } + if (def->features[VIR_DOMAIN_FEATURE_GIC] == VIR_TRISTATE_SWITCH_ON) { + if (def->gic_version && def->gic_version != 2) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("gic version '%u' is not supported"), + def->gic_version); + goto cleanup; + } + + /* There's no command line argument currently to turn on/off GIC. It's + * done automatically by qemu-system-aarch64. But if this changes, lets + * put the code here. */ + } + if (virBufferCheckError(&buf) < 0) goto cleanup; diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic.args new file mode 100644 index 000000000..e61cd1e46 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic.args @@ -0,0 +1,6 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-aarch64 -S -M virt -no-kvm -cpu cortex-a53 -m 1024 -smp 1 \ +-nographic -nodefaults -monitor unix:/tmp/test-monitor,server,nowait -boot c \ +-kernel /aarch64.kernel -initrd /aarch64.initrd -append console=ttyAMA0 -usb \ +-net nic,macaddr=52:54:00:09:a4:37,vlan=0,model=virtio,name=net0 \ +-net user,vlan=0,name=hostnet0 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic.xml new file mode 100644 index 000000000..08d3d714b --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic.xml @@ -0,0 +1,26 @@ + + aarch64test + 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f + 1048576 + 1048576 + 1 + + + + + + cortex-a53 + + + hvm + /aarch64.kernel + /aarch64.initrd + console=ttyAMA0 + + + /usr/bin/qemu-system-aarch64 + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 4678261bc..97c7fba63 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1541,6 +1541,8 @@ mymain(void) DO_TEST("aarch64-cpu-model-host", QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DEVICE_VIRTIO_MMIO, QEMU_CAPS_CPU_HOST, QEMU_CAPS_KVM); + DO_TEST("aarch64-gic", QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE, + QEMU_CAPS_KVM); DO_TEST("kvm-pit-device", QEMU_CAPS_KVM_PIT_TICK_POLICY); DO_TEST("kvm-pit-delay", QEMU_CAPS_NO_KVM_PIT);