Test cases that depend on duplicating fds are using fairly big
values as targets.

This works fine on Linux, where RLIMIT_NOFILE is 1024 by
default, but fails on macOS which uses 256 as the default.

Decrease the values so that they're valid across all platforms.

Signed-off-by: Andrea Bolognani <abolo...@redhat.com>
---
 .../qemuxml2argvdata/disk-source-fd.x86_64-latest.args | 10 +++++-----
 .../qemuxml2argvdata/disk-vhostvdpa.x86_64-latest.args |  2 +-
 tests/qemuxml2argvtest.c                               |  8 ++++----
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tests/qemuxml2argvdata/disk-source-fd.x86_64-latest.args 
b/tests/qemuxml2argvdata/disk-source-fd.x86_64-latest.args
index 9d8109a8f4..1341b7d032 100644
--- a/tests/qemuxml2argvdata/disk-source-fd.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/disk-source-fd.x86_64-latest.args
@@ -27,18 +27,18 @@ 
XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
 -no-shutdown \
 -boot strict=on \
 -device 
'{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
--add-fd set=2,fd=700,opaque=libvirt-4-storage0 \
--add-fd set=2,fd=705,opaque=libvirt-4-storage1 \
+-add-fd set=2,fd=200,opaque=libvirt-4-storage0 \
+-add-fd set=2,fd=205,opaque=libvirt-4-storage1 \
 -blockdev 
'{"driver":"file","filename":"/dev/fdset/2","node-name":"libvirt-4-storage","auto-read-only":true,"discard":"unmap"}'
 \
 -blockdev 
'{"node-name":"libvirt-4-format","read-only":false,"driver":"qcow2","file":"libvirt-4-storage"}'
 \
 -device 
'{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x2","drive":"libvirt-4-format","id":"virtio-disk4","bootindex":1}'
 \
 -blockdev 
'{"driver":"file","filename":"/var/lib/libvirt/images/rhel7.1484071876","node-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap"}'
 \
 -blockdev 
'{"node-name":"libvirt-3-format","read-only":true,"driver":"qcow2","file":"libvirt-3-storage","backing":null}'
 \
--add-fd set=1,fd=777,opaque=libvirt-2-storage0 \
--add-fd set=1,fd=778,opaque=libvirt-2-storage1 \
+-add-fd set=1,fd=247,opaque=libvirt-2-storage0 \
+-add-fd set=1,fd=248,opaque=libvirt-2-storage1 \
 -blockdev 
'{"driver":"file","filename":"/dev/fdset/1","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}'
 \
 -blockdev 
'{"node-name":"libvirt-2-format","read-only":true,"driver":"qcow2","file":"libvirt-2-storage","backing":"libvirt-3-format"}'
 \
--add-fd set=0,fd=704,opaque=libvirt-1-storage0 \
+-add-fd set=0,fd=204,opaque=libvirt-1-storage0 \
 -blockdev 
'{"driver":"file","filename":"/dev/fdset/0","node-name":"libvirt-1-storage","read-only":false,"discard":"unmap"}'
 \
 -blockdev 
'{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage","backing":"libvirt-2-format"}'
 \
 -device 
'{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x3","drive":"libvirt-1-format","id":"virtio-disk5"}'
 \
diff --git a/tests/qemuxml2argvdata/disk-vhostvdpa.x86_64-latest.args 
b/tests/qemuxml2argvdata/disk-vhostvdpa.x86_64-latest.args
index b987455ee4..27035184ad 100644
--- a/tests/qemuxml2argvdata/disk-vhostvdpa.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/disk-vhostvdpa.x86_64-latest.args
@@ -27,7 +27,7 @@ 
XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
 -no-shutdown \
 -boot strict=on \
 -device 
'{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
--add-fd set=0,fd=801,opaque=libvirt-1-storage-vdpa \
+-add-fd set=0,fd=201,opaque=libvirt-1-storage-vdpa \
 -blockdev 
'{"driver":"virtio-blk-vhost-vdpa","path":"/dev/fdset/0","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}'
 \
 -blockdev 
'{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"raw","file":"libvirt-1-storage"}'
 \
 -device 
'{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x2","drive":"libvirt-1-format","id":"virtio-disk0","bootindex":1,"write-cache":"on"}'
 \
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 48058cb924..4fda68a4ce 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1186,7 +1186,7 @@ mymain(void)
     DO_TEST_CAPS_LATEST("disk-vhostuser-numa");
     DO_TEST_CAPS_LATEST("disk-vhostuser");
     DO_TEST_CAPS_ARCH_LATEST_FULL("disk-vhostvdpa", "x86_64",
-                                  ARG_VDPA_FD, "/dev/vhost-vdpa-0", 801);
+                                  ARG_VDPA_FD, "/dev/vhost-vdpa-0", 201);
     DO_TEST_CAPS_LATEST_PARSE_ERROR("disk-device-lun-type-invalid");
     DO_TEST_CAPS_LATEST_PARSE_ERROR("disk-attaching-partition-nosupport");
     DO_TEST_CAPS_LATEST("disk-usb-device");
@@ -1226,9 +1226,9 @@ mymain(void)
     DO_TEST_CAPS_LATEST("disk-backing-chains-index");
     DO_TEST_CAPS_LATEST("disk-backing-chains-noindex");
     DO_TEST_CAPS_ARCH_LATEST_FULL("disk-source-fd", "x86_64",
-                                  ARG_FD_GROUP, "testgroup2", 2, 700, 705,
-                                  ARG_FD_GROUP, "testgroup5", 1, 704,
-                                  ARG_FD_GROUP, "testgroup6", 2, 777, 778);
+                                  ARG_FD_GROUP, "testgroup2", 2, 200, 205,
+                                  ARG_FD_GROUP, "testgroup5", 1, 204,
+                                  ARG_FD_GROUP, "testgroup6", 2, 247, 248);
 
     DO_TEST_CAPS_LATEST("disk-slices");
     DO_TEST_CAPS_LATEST("disk-rotation");
-- 
2.41.0

Reply via email to