]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: qemuxmlconftest: test locking with older virtiofsd
authorJán Tomko <jtomko@redhat.com>
Thu, 17 Jul 2025 17:41:23 +0000 (19:41 +0200)
committerJán Tomko <jtomko@redhat.com>
Wed, 24 Sep 2025 13:11:18 +0000 (15:11 +0200)
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
tests/qemuxmlconfdata/vhost-user-fs-locking.x86_64-7.2.0.args [new file with mode: 0644]
tests/qemuxmlconfdata/vhost-user-fs-locking.x86_64-7.2.0.virtiofsd0.args [new file with mode: 0644]
tests/qemuxmlconfdata/vhost-user-fs-locking.x86_64-7.2.0.xml [new file with mode: 0644]
tests/qemuxmlconfdata/vhost-user-fs-locking.xml [new file with mode: 0644]
tests/qemuxmlconftest.c

diff --git a/tests/qemuxmlconfdata/vhost-user-fs-locking.x86_64-7.2.0.args b/tests/qemuxmlconfdata/vhost-user-fs-locking.x86_64-7.2.0.args
new file mode 100644 (file)
index 0000000..ee8625d
--- /dev/null
@@ -0,0 +1,35 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-guest \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
+/usr/bin/qemu-system-x86_64 \
+-name guest=guest,debug-threads=on \
+-S \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \
+-machine pc-i440fx-7.2,usb=off,dump-guest-core=off \
+-accel kvm \
+-cpu qemu64 \
+-m size=14680064k \
+-overcommit mem-lock=off \
+-smp 2,sockets=2,cores=1,threads=1 \
+-object '{"qom-type":"memory-backend-file","id":"ram-node0","mem-path":"/var/lib/libvirt/qemu/ram/-1-guest/ram-node0","share":true,"size":15032385536}' \
+-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
+-uuid 126f2720-6f8e-45ab-a886-ec9277079a67 \
+-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 \
+-chardev socket,id=chr-vu-fs0,path=/var/lib/libvirt/qemu/domain--1-guest/fs0-fs.sock \
+-device '{"driver":"vhost-user-fs-pci","id":"fs0","chardev":"chr-vu-fs0","queue-size":1024,"tag":"mount_tag","bus":"pci.0","addr":"0x2"}' \
+-audiodev '{"id":"audio1","driver":"none"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxmlconfdata/vhost-user-fs-locking.x86_64-7.2.0.virtiofsd0.args b/tests/qemuxmlconfdata/vhost-user-fs-locking.x86_64-7.2.0.virtiofsd0.args
new file mode 100644 (file)
index 0000000..c5db508
--- /dev/null
@@ -0,0 +1,4 @@
+/usr/libexec/virtiofsd \
+--fd=1730 \
+-o source=/path,cache=always,sandbox=namespace,xattr,flock,posix_lock \
+--thread-pool-size=16
diff --git a/tests/qemuxmlconfdata/vhost-user-fs-locking.x86_64-7.2.0.xml b/tests/qemuxmlconfdata/vhost-user-fs-locking.x86_64-7.2.0.xml
new file mode 100644 (file)
index 0000000..5909939
--- /dev/null
@@ -0,0 +1,46 @@
+<domain type='kvm'>
+  <name>guest</name>
+  <uuid>126f2720-6f8e-45ab-a886-ec9277079a67</uuid>
+  <memory unit='KiB'>14680064</memory>
+  <currentMemory unit='KiB'>14680064</currentMemory>
+  <memoryBacking>
+    <source type='file'/>
+    <access mode='shared'/>
+  </memoryBacking>
+  <vcpu placement='static'>2</vcpu>
+  <os>
+    <type arch='x86_64' machine='pc-i440fx-7.2'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>qemu64</model>
+    <numa>
+      <cell id='0' cpus='0-1' memory='14680064' unit='KiB' memAccess='shared'/>
+    </numa>
+  </cpu>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <controller type='usb' index='0' model='none'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <filesystem type='mount' accessmode='passthrough'>
+      <driver type='virtiofs' queue='1024'/>
+      <binary path='/usr/libexec/virtiofsd' xattr='on'>
+        <cache mode='always'/>
+        <sandbox mode='namespace'/>
+        <lock posix='on' flock='on'/>
+        <thread_pool size='16'/>
+      </binary>
+      <source dir='/path'/>
+      <target dir='mount_tag'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+    </filesystem>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <audio id='1' type='none'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxmlconfdata/vhost-user-fs-locking.xml b/tests/qemuxmlconfdata/vhost-user-fs-locking.xml
new file mode 100644 (file)
index 0000000..602f2c6
--- /dev/null
@@ -0,0 +1,46 @@
+<domain type='kvm'>
+  <name>guest</name>
+  <uuid>126f2720-6f8e-45ab-a886-ec9277079a67</uuid>
+  <memory unit='KiB'>14680064</memory>
+  <currentMemory unit='KiB'>14680064</currentMemory>
+  <memoryBacking>
+    <source type='file'/>
+    <access mode='shared'/>
+  </memoryBacking>
+  <vcpu placement='static'>2</vcpu>
+  <os>
+    <type arch='x86_64' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>qemu64</model>
+    <numa>
+      <cell id='0' cpus='0-1' memory='14680064' unit='KiB' memAccess='shared'/>
+    </numa>
+  </cpu>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <controller type='usb' index='0' model='none'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <filesystem type='mount' accessmode='passthrough'>
+      <driver type='virtiofs' queue='1024'/>
+      <binary path='/usr/libexec/virtiofsd' xattr='on'>
+        <cache mode='always'/>
+        <sandbox mode='namespace'/>
+        <lock posix='on' flock='on'/>
+        <thread_pool size='16'/>
+      </binary>
+      <source dir='/path'/>
+      <target dir='mount_tag'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+    </filesystem>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <audio id='1' type='none'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
index 11a2d2d244e6075ab9d4547bb0c63a7642320eb4..99e2e1dc930928453be33dbd5a673653e085498e 100644 (file)
@@ -3077,6 +3077,7 @@ mymain(void)
     DO_TEST_CAPS_LATEST("vhost-user-fs-fd-openfiles");
     DO_TEST_CAPS_LATEST("vhost-user-fs-hugepages");
     DO_TEST_CAPS_LATEST("vhost-user-fs-readonly");
+    DO_TEST_CAPS_VER("vhost-user-fs-locking", "7.2.0");
 
     DO_TEST_CAPS_ARCH_LATEST("vhost-user-fs-ccw", "s390x");
     DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("vhost-user-fs-ccw-bootindex", "s390x");