summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin Kletzander <mkletzan@redhat.com>2012-09-13 15:27:07 +0200
committerMartin Kletzander <mkletzan@redhat.com>2012-09-14 08:32:56 +0200
commitfbf9aa12c7e5ade035f208584b3a55401bc097a3 (patch)
tree146cab572a987b5a2b39ee44d0e9d54b3c72aaf5 /tests
parentAdd support for EOI with APIC (diff)
downloadlibvirt-fbf9aa12c7e5ade035f208584b3a55401bc097a3.tar.gz
libvirt-fbf9aa12c7e5ade035f208584b3a55401bc097a3.tar.bz2
libvirt-fbf9aa12c7e5ade035f208584b3a55401bc097a3.zip
qemu: Add support for EOI with APIC
This patch adds full support for EOI setting for domains. Because this is CPU feature (flag), the model needs to be added even when it's not specified. Fortunately this problem was already solved with kvmclock, so this patch simply abuses that. And due to the size of the patch (17 lines) I dared to include the tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.args4
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.xml28
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.args4
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.xml28
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.args4
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.xml25
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.args4
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.xml25
-rw-r--r--tests/qemuxml2argvtest.c5
-rw-r--r--tests/qemuxml2xmltest.c6
10 files changed, 133 insertions, 0 deletions
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.args
new file mode 100644
index 000000000..6d57f9101
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.args
@@ -0,0 +1,4 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc \
+-cpu qemu32,-kvm_pv_eoi -m 214 -smp 6 -nographic -monitor \
+unix:/tmp/test-monitor,server,nowait -boot n -net none -serial none \
+-parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.xml
new file mode 100644
index 000000000..467df3041
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.xml
@@ -0,0 +1,28 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>6</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='network'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic eoi='off'/>
+ <pae/>
+ </features>
+ <cpu mode='custom' match='exact'>
+ <model fallback='allow'>qemu32</model>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/./qemu.sh</emulator>
+ <controller type='usb' index='0'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.args
new file mode 100644
index 000000000..3dc43107c
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.args
@@ -0,0 +1,4 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc \
+-cpu qemu32,+kvm_pv_eoi -m 214 -smp 6 -nographic -monitor \
+unix:/tmp/test-monitor,server,nowait -boot n -net none -serial none \
+-parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.xml
new file mode 100644
index 000000000..1ed630a0c
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.xml
@@ -0,0 +1,28 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>6</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='network'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic eoi='on'/>
+ <pae/>
+ </features>
+ <cpu mode='custom' match='exact'>
+ <model fallback='allow'>qemu32</model>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/./qemu.sh</emulator>
+ <controller type='usb' index='0'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.args b/tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.args
new file mode 100644
index 000000000..93475bd0e
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.args
@@ -0,0 +1,4 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc \
+-cpu qemu32,-kvm_pv_eoi -m 214 -smp 6 -nographic -monitor \
+unix:/tmp/test-monitor,server,nowait -boot n -net none -serial \
+none -parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.xml b/tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.xml
new file mode 100644
index 000000000..f84570e70
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.xml
@@ -0,0 +1,25 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>6</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='network'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic eoi='off'/>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/./qemu.sh</emulator>
+ <controller type='usb' index='0'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.args b/tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.args
new file mode 100644
index 000000000..13f570be4
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.args
@@ -0,0 +1,4 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc \
+-cpu qemu32,+kvm_pv_eoi -m 214 -smp 6 -nographic -monitor \
+unix:/tmp/test-monitor,server,nowait -boot n -net none -serial \
+none -parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.xml b/tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.xml
new file mode 100644
index 000000000..03b6b52e7
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.xml
@@ -0,0 +1,25 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>6</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='network'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic eoi='on'/>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/./qemu.sh</emulator>
+ <controller type='usb' index='0'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 936b74901..468014c75 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -385,6 +385,11 @@ mymain(void)
DO_TEST("cpu-host-kvmclock", QEMU_CAPS_ENABLE_KVM, QEMU_CAPS_CPU_HOST);
DO_TEST("kvmclock", QEMU_CAPS_KVM);
+ DO_TEST("cpu-eoi-disabled", QEMU_CAPS_ENABLE_KVM);
+ DO_TEST("cpu-eoi-enabled", QEMU_CAPS_ENABLE_KVM);
+ DO_TEST("eoi-disabled", NONE);
+ DO_TEST("eoi-enabled", NONE);
+
DO_TEST("hugepages", QEMU_CAPS_MEM_PATH);
DO_TEST("disk-cdrom", NONE);
DO_TEST("disk-cdrom-empty", QEMU_CAPS_DRIVE);
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 87d9e7790..0a6da984b 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -138,6 +138,12 @@ mymain(void)
DO_TEST("cpu-kvmclock");
DO_TEST("cpu-host-kvmclock");
DO_TEST("kvmclock");
+
+ DO_TEST("cpu-eoi-disabled");
+ DO_TEST("cpu-eoi-enabled");
+ DO_TEST("eoi-disabled");
+ DO_TEST("eoi-enabled");
+
DO_TEST("hugepages");
DO_TEST("disk-aio");
DO_TEST("disk-cdrom");