From d542d72f5c0a09fb3809e57b14c4eb37bba8c69c Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Wed, 22 Feb 2023 15:57:47 +0100 Subject: [PATCH] qemuxml2(argv|xml)test: Modernize 'cputune' test cases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use DO_TEST_CAPS_LATEST for cputune-numatune, cputune-zero-shares, cputune, and vcpu-placement-static cases. Do the necessary tweaks to work with actual data. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- ...gs => cputune-numatune.x86_64-latest.args} | 13 ++++--- ...=> cputune-zero-shares.x86_64-latest.args} | 15 ++++--- .../qemuxml2argvdata/cputune-zero-shares.xml | 4 +- ...putune.args => cputune.x86_64-latest.args} | 15 ++++--- tests/qemuxml2argvdata/cputune.xml | 4 +- .../vcpu-placement-static.args | 33 ---------------- .../vcpu-placement-static.x86_64-latest.args | 39 +++++++++++++++++++ .../vcpu-placement-static.xml | 16 ++++++++ tests/qemuxml2argvtest.c | 12 ++---- ...xml => cputune-numatune.x86_64-latest.xml} | 5 ++- ... => cputune-zero-shares.x86_64-latest.xml} | 9 +++-- ...{cputune.xml => cputune.x86_64-latest.xml} | 9 +++-- ...> vcpu-placement-static.x86_64-latest.xml} | 0 tests/qemuxml2xmltest.c | 10 ++--- 14 files changed, 109 insertions(+), 75 deletions(-) rename tests/qemuxml2argvdata/{cputune-numatune.args => cputune-numatune.x86_64-latest.args} (55%) rename tests/qemuxml2argvdata/{cputune-zero-shares.args => cputune-zero-shares.x86_64-latest.args} (59%) rename tests/qemuxml2argvdata/{cputune.args => cputune.x86_64-latest.args} (59%) delete mode 100644 tests/qemuxml2argvdata/vcpu-placement-static.args create mode 100644 tests/qemuxml2argvdata/vcpu-placement-static.x86_64-latest.args rename tests/qemuxml2xmloutdata/{cputune-numatune.xml => cputune-numatune.x86_64-latest.xml} (86%) rename tests/qemuxml2xmloutdata/{cputune-zero-shares.xml => cputune-zero-shares.x86_64-latest.xml} (84%) rename tests/qemuxml2xmloutdata/{cputune.xml => cputune.x86_64-latest.xml} (85%) rename tests/qemuxml2xmloutdata/{vcpu-placement-static.xml => vcpu-placement-static.x86_64-latest.xml} (100%) diff --git a/tests/qemuxml2argvdata/cputune-numatune.args b/tests/qemuxml2argvdata/cputune-numatune.x86_64-latest.args similarity index 55% rename from tests/qemuxml2argvdata/cputune-numatune.args rename to tests/qemuxml2argvdata/cputune-numatune.x86_64-latest.args index dbadcb9ec5..627be89d83 100644 --- a/tests/qemuxml2argvdata/cputune-numatune.args +++ b/tests/qemuxml2argvdata/cputune-numatune.x86_64-latest.args @@ -9,14 +9,16 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-dummy2/.config \ /usr/bin/qemu-system-x86_64 \ -name guest=dummy2,debug-threads=on \ -S \ --object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-dummy2/master-key.aes \ --machine pc,usb=off,dump-guest-core=off \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-dummy2/master-key.aes"}' \ +-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram \ -accel kvm \ +-cpu qemu64 \ -m 128 \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":134217728,"host-nodes":[0,1,2,3],"policy":"bind"}' \ -overcommit mem-lock=off \ -smp 2,maxcpus=6,sockets=6,cores=1,threads=1 \ --object iothread,id=iothread1 \ --object iothread,id=iothread2 \ +-object '{"qom-type":"iothread","id":"iothread1"}' \ +-object '{"qom-type":"iothread","id":"iothread2"}' \ -uuid 4d92ec27-9ebf-400b-ae91-20c71c647c19 \ -display none \ -no-user-config \ @@ -27,6 +29,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-dummy2/.config \ -no-shutdown \ -no-acpi \ -boot strict=on \ --usb \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/cputune-zero-shares.args b/tests/qemuxml2argvdata/cputune-zero-shares.x86_64-latest.args similarity index 59% rename from tests/qemuxml2argvdata/cputune-zero-shares.args rename to tests/qemuxml2argvdata/cputune-zero-shares.x86_64-latest.args index f30ed2fed6..d77c1db2c2 100644 --- a/tests/qemuxml2argvdata/cputune-zero-shares.args +++ b/tests/qemuxml2argvdata/cputune-zero-shares.x86_64-latest.args @@ -6,13 +6,15 @@ LOGNAME=test \ XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \ XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -/usr/bin/qemu-system-i386 \ +/usr/bin/qemu-system-x86_64 \ -name guest=QEMUGuest1,debug-threads=on \ -S \ --object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ --machine pc,usb=off,dump-guest-core=off \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram \ -accel tcg \ +-cpu qemu64 \ -m 214 \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \ -overcommit mem-lock=off \ -smp 2,sockets=2,cores=1,threads=1 \ -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ @@ -25,10 +27,11 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -no-shutdown \ -no-acpi \ -boot strict=on \ --usb \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ --device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ +-device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ --device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ +-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/cputune-zero-shares.xml b/tests/qemuxml2argvdata/cputune-zero-shares.xml index 0b1369fe05..643804ec53 100644 --- a/tests/qemuxml2argvdata/cputune-zero-shares.xml +++ b/tests/qemuxml2argvdata/cputune-zero-shares.xml @@ -13,7 +13,7 @@ - hvm + hvm @@ -21,7 +21,7 @@ restart destroy - /usr/bin/qemu-system-i386 + /usr/bin/qemu-system-x86_64 diff --git a/tests/qemuxml2argvdata/cputune.args b/tests/qemuxml2argvdata/cputune.x86_64-latest.args similarity index 59% rename from tests/qemuxml2argvdata/cputune.args rename to tests/qemuxml2argvdata/cputune.x86_64-latest.args index f30ed2fed6..d77c1db2c2 100644 --- a/tests/qemuxml2argvdata/cputune.args +++ b/tests/qemuxml2argvdata/cputune.x86_64-latest.args @@ -6,13 +6,15 @@ LOGNAME=test \ XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \ XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -/usr/bin/qemu-system-i386 \ +/usr/bin/qemu-system-x86_64 \ -name guest=QEMUGuest1,debug-threads=on \ -S \ --object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ --machine pc,usb=off,dump-guest-core=off \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram \ -accel tcg \ +-cpu qemu64 \ -m 214 \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \ -overcommit mem-lock=off \ -smp 2,sockets=2,cores=1,threads=1 \ -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ @@ -25,10 +27,11 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -no-shutdown \ -no-acpi \ -boot strict=on \ --usb \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ --device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \ +-device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ -audiodev '{"id":"audio1","driver":"none"}' \ --device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ +-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/cputune.xml b/tests/qemuxml2argvdata/cputune.xml index d7a5db0bb6..3c8116f637 100644 --- a/tests/qemuxml2argvdata/cputune.xml +++ b/tests/qemuxml2argvdata/cputune.xml @@ -17,7 +17,7 @@ - hvm + hvm @@ -25,7 +25,7 @@ restart destroy - /usr/bin/qemu-system-i386 + /usr/bin/qemu-system-x86_64 diff --git a/tests/qemuxml2argvdata/vcpu-placement-static.args b/tests/qemuxml2argvdata/vcpu-placement-static.args deleted file mode 100644 index 3502b92d5d..0000000000 --- a/tests/qemuxml2argvdata/vcpu-placement-static.args +++ /dev/null @@ -1,33 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/tmp/lib/domain--1-dummy2 \ -USER=test \ -LOGNAME=test \ -XDG_DATA_HOME=/tmp/lib/domain--1-dummy2/.local/share \ -XDG_CACHE_HOME=/tmp/lib/domain--1-dummy2/.cache \ -XDG_CONFIG_HOME=/tmp/lib/domain--1-dummy2/.config \ -/usr/bin/qemu-system-x86_64 \ --name guest=dummy2,debug-threads=on \ --S \ --object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-dummy2/master-key.aes \ --machine q35,usb=off,dump-guest-core=off \ --accel kvm \ --m 128 \ --overcommit mem-lock=off \ --smp 2,maxcpus=6,sockets=6,cores=1,threads=1 \ --object iothread,id=iothread1 \ --object iothread,id=iothread2 \ --uuid 4d92ec27-9ebf-400b-ae91-20c71c647c19 \ --display none \ --no-user-config \ --nodefaults \ --chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ --mon chardev=charmonitor,id=monitor,mode=control \ --rtc base=utc \ --no-shutdown \ --no-acpi \ --boot strict=on \ --audiodev '{"id":"audio1","driver":"none"}' \ --global ICH9-LPC.noreboot=off \ --watchdog-action reset \ --msg timestamp=on diff --git a/tests/qemuxml2argvdata/vcpu-placement-static.x86_64-latest.args b/tests/qemuxml2argvdata/vcpu-placement-static.x86_64-latest.args new file mode 100644 index 0000000000..d467a28680 --- /dev/null +++ b/tests/qemuxml2argvdata/vcpu-placement-static.x86_64-latest.args @@ -0,0 +1,39 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/tmp/lib/domain--1-dummy2 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/tmp/lib/domain--1-dummy2/.local/share \ +XDG_CACHE_HOME=/tmp/lib/domain--1-dummy2/.cache \ +XDG_CONFIG_HOME=/tmp/lib/domain--1-dummy2/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=dummy2,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-dummy2/master-key.aes"}' \ +-machine q35,usb=off,dump-guest-core=off,memory-backend=pc.ram \ +-accel kvm \ +-cpu qemu64 \ +-m 128 \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":134217728,"host-nodes":[0,1,2,3],"policy":"bind"}' \ +-overcommit mem-lock=off \ +-smp 2,maxcpus=6,sockets=6,cores=1,threads=1 \ +-object '{"qom-type":"iothread","id":"iothread1"}' \ +-object '{"qom-type":"iothread","id":"iothread2"}' \ +-uuid 4d92ec27-9ebf-400b-ae91-20c71c647c19 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-no-acpi \ +-boot strict=on \ +-device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \ +-device '{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci.1","addr":"0x0"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-global ICH9-LPC.noreboot=off \ +-watchdog-action reset \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/vcpu-placement-static.xml b/tests/qemuxml2argvdata/vcpu-placement-static.xml index 3fd604d496..916e5a3fec 100644 --- a/tests/qemuxml2argvdata/vcpu-placement-static.xml +++ b/tests/qemuxml2argvdata/vcpu-placement-static.xml @@ -16,6 +16,9 @@ hvm + + qemu64 + destroy restart @@ -26,6 +29,19 @@
+ + + +
+ + + + +
+ + +
+