mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Add new 'kvm' domain feature and ability to hide KVM signature
QEMU 2.1 added support for the kvm=off option to the -cpu command,
allowing the KVM hypervisor signature to be hidden from the guest.
This enables disabling of some paravirualization features in the
guest as well as allowing certain drivers which test for the
hypervisor to load. Domain XML syntax is as follows:
<domain type='kvm>
...
<features>
...
<kvm>
<hidden state='on'/>
</kvm>
</features>
...
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
This commit is contained in:
committed by
Ján Tomko
parent
4dfc34c301
commit
d071164272
@@ -284,6 +284,8 @@ mymain(void)
|
||||
|
||||
DO_TEST("hyperv");
|
||||
|
||||
DO_TEST("kvm-features");
|
||||
|
||||
DO_TEST("pseries-nvram");
|
||||
DO_TEST("pseries-disk");
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
|
||||
/usr/bin/qemu \
|
||||
-S -M pc -cpu qemu32 -m 214 -smp 6 -nographic \
|
||||
-monitor unix:/tmp/test-monitor,server,nowait \
|
||||
-boot n -usb -net none -serial none -parallel none
|
||||
27
tests/qemuxml2argvdata/qemuxml2argv-kvm-features-off.xml
Normal file
27
tests/qemuxml2argvdata/qemuxml2argv-kvm-features-off.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<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/>
|
||||
<kvm>
|
||||
<hidden state='off'/>
|
||||
</kvm>
|
||||
</features>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu</emulator>
|
||||
<controller type='usb' index='0'/>
|
||||
<controller type='pci' index='0' model='pci-root'/>
|
||||
<memballoon model='virtio'/>
|
||||
</devices>
|
||||
</domain>
|
||||
5
tests/qemuxml2argvdata/qemuxml2argv-kvm-features.args
Normal file
5
tests/qemuxml2argvdata/qemuxml2argv-kvm-features.args
Normal file
@@ -0,0 +1,5 @@
|
||||
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
|
||||
/usr/bin/qemu -S -M pc \
|
||||
-cpu qemu32,kvm=off -m 214 -smp 6 -nographic -monitor \
|
||||
unix:/tmp/test-monitor,server,nowait -boot n -usb -net none -serial none \
|
||||
-parallel none
|
||||
27
tests/qemuxml2argvdata/qemuxml2argv-kvm-features.xml
Normal file
27
tests/qemuxml2argvdata/qemuxml2argv-kvm-features.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<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/>
|
||||
<kvm>
|
||||
<hidden state='on'/>
|
||||
</kvm>
|
||||
</features>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu</emulator>
|
||||
<controller type='usb' index='0'/>
|
||||
<controller type='pci' index='0' model='pci-root'/>
|
||||
<memballoon model='none'/>
|
||||
</devices>
|
||||
</domain>
|
||||
@@ -672,6 +672,9 @@ mymain(void)
|
||||
DO_TEST("hyperv", NONE);
|
||||
DO_TEST("hyperv-off", NONE);
|
||||
|
||||
DO_TEST("kvm-features", NONE);
|
||||
DO_TEST("kvm-features-off", NONE);
|
||||
|
||||
DO_TEST("hugepages", QEMU_CAPS_MEM_PATH);
|
||||
DO_TEST("hugepages-pages", QEMU_CAPS_MEM_PATH, QEMU_CAPS_OBJECT_MEMORY_RAM,
|
||||
QEMU_CAPS_OBJECT_MEMORY_FILE);
|
||||
|
||||
@@ -198,6 +198,9 @@ mymain(void)
|
||||
DO_TEST("hyperv");
|
||||
DO_TEST("hyperv-off");
|
||||
|
||||
DO_TEST("kvm-features");
|
||||
DO_TEST("kvm-features-off");
|
||||
|
||||
DO_TEST("hugepages");
|
||||
DO_TEST("hugepages-pages");
|
||||
DO_TEST("hugepages-pages2");
|
||||
|
||||
Reference in New Issue
Block a user