]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
bhyve: tests: cover 2 NVMe devices on 2 controllers case
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Sat, 25 Oct 2025 08:15:56 +0000 (10:15 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 29 Oct 2025 10:45:42 +0000 (11:45 +0100)
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tests/bhyvexml2argvdata/bhyvexml2argv-2-nvme-2-controllers.args [new file with mode: 0644]
tests/bhyvexml2argvdata/bhyvexml2argv-2-nvme-2-controllers.ldargs [new file with mode: 0644]
tests/bhyvexml2argvdata/bhyvexml2argv-2-nvme-2-controllers.xml [new file with mode: 0644]
tests/bhyvexml2argvtest.c
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-2-nvme-2-controllers.xml [new file with mode: 0644]
tests/bhyvexml2xmltest.c

diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-2-nvme-2-controllers.args b/tests/bhyvexml2argvdata/bhyvexml2argv-2-nvme-2-controllers.args
new file mode 100644 (file)
index 0000000..664eec9
--- /dev/null
@@ -0,0 +1,10 @@
+bhyve \
+-c 1 \
+-m 214 \
+-u \
+-H \
+-P \
+-s 0:0,hostbridge \
+-s 2:0,nvme,/tmp/freebsd.img \
+-s 3:0,nvme,/tmp/data.img \
+bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-2-nvme-2-controllers.ldargs b/tests/bhyvexml2argvdata/bhyvexml2argv-2-nvme-2-controllers.ldargs
new file mode 100644 (file)
index 0000000..5905f4b
--- /dev/null
@@ -0,0 +1,4 @@
+bhyveload \
+-m 214 \
+-d /tmp/freebsd.img \
+bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-2-nvme-2-controllers.xml b/tests/bhyvexml2argvdata/bhyvexml2argv-2-nvme-2-controllers.xml
new file mode 100644 (file)
index 0000000..30f3371
--- /dev/null
@@ -0,0 +1,21 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory>219136</memory>
+  <vcpu>1</vcpu>
+  <os>
+    <type>hvm</type>
+  </os>
+  <devices>
+    <disk type='file'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd.img'/>
+      <target dev='nvme0n1' bus='nvme'/>
+    </disk>
+    <disk type='file'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/data.img'/>
+      <target dev='nvme1n1' bus='nvme'/>
+    </disk>
+  </devices>
+</domain>
index 0a5202e4252ad2dd4b304f4a36c809f414a75c12..9d20e5669ee08f528a1d094547e8c6b5f4e54fc1 100644 (file)
@@ -261,6 +261,7 @@ mymain(void)
     DO_TEST("4-consoles");
     DO_TEST_FAILURE("serial-invalid-port");
     DO_TEST("nvme");
+    DO_TEST("2-nvme-2-controllers");
 
     /* Address allocation tests */
     DO_TEST("addr-single-sata-disk");
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-2-nvme-2-controllers.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-2-nvme-2-controllers.xml
new file mode 100644 (file)
index 0000000..d0eb9c7
--- /dev/null
@@ -0,0 +1,36 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd.img'/>
+      <target dev='nvme0n1' bus='nvme'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/data.img'/>
+      <target dev='nvme1n1' bus='nvme'/>
+      <address type='drive' controller='1' bus='0' target='0' unit='0'/>
+    </disk>
+    <controller type='pci' index='0' model='pci-root'/>
+    <controller type='nvme' index='0'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+    </controller>
+    <controller type='nvme' index='1'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </controller>
+  </devices>
+</domain>
index be69e2148493980ea22a094e73251e09d9cbba40..226eaccc6ad0d97914eabf0292484d08f3bc0f80 100644 (file)
@@ -118,6 +118,7 @@ mymain(void)
     DO_TEST_DIFFERENT("serial-tcp");
     DO_TEST_DIFFERENT("4-consoles");
     DO_TEST_DIFFERENT("nvme");
+    DO_TEST_DIFFERENT("2-nvme-2-controllers");
 
     /* Address allocation tests */
     DO_TEST_DIFFERENT("addr-single-sata-disk");