[libvirt PATCH] tests: Cover virtio-mem being plugged into a bridge

Andrea Bolognani posted 1 patch 2 years, 3 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20220202145924.279445-1-abologna@redhat.com
.../memory-hotplug-virtio-mem.x86_64-latest.args           | 3 ++-
tests/qemuxml2argvdata/memory-hotplug-virtio-mem.xml       | 7 ++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
[libvirt PATCH] tests: Cover virtio-mem being plugged into a bridge
Posted by Andrea Bolognani 2 years, 3 months ago
This is a perfectly valid configuration that we need to keep
working, so add test coverage for it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 .../memory-hotplug-virtio-mem.x86_64-latest.args           | 3 ++-
 tests/qemuxml2argvdata/memory-hotplug-virtio-mem.xml       | 7 ++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args
index dba2452ccf..5aa8110aeb 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args
@@ -28,11 +28,12 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -no-shutdown \
 -no-acpi \
 -boot strict=on \
+-device '{"driver":"pci-bridge","chassis_nr":1,"id":"pci.1","bus":"pci.0","addr":"0x3"}' \
 -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
 -object '{"qom-type":"memory-backend-ram","id":"memvirtiomem0","reserve":false,"size":1073741824}' \
 -device '{"driver":"virtio-mem-pci","node":0,"block-size":2097152,"requested-size":536870912,"memdev":"memvirtiomem0","id":"virtiomem0","bus":"pci.0","addr":"0x2"}' \
 -object '{"qom-type":"memory-backend-file","id":"memvirtiomem1","mem-path":"/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1","reserve":false,"size":2147483648,"host-nodes":[1,2,3],"policy":"bind"}' \
--device '{"driver":"virtio-mem-pci","node":0,"block-size":2097152,"requested-size":1073741824,"memdev":"memvirtiomem1","prealloc":true,"id":"virtiomem1","bus":"pci.0","addr":"0x3"}' \
+-device '{"driver":"virtio-mem-pci","node":0,"block-size":2097152,"requested-size":1073741824,"memdev":"memvirtiomem1","prealloc":true,"id":"virtiomem1","bus":"pci.1","addr":"0x1"}' \
 -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 '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \
diff --git a/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.xml b/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.xml
index ea9f5e8765..73036d8602 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.xml
+++ b/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.xml
@@ -35,6 +35,11 @@
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
     </controller>
     <controller type='pci' index='0' model='pci-root'/>
+    <controller type='pci' index='1' model='pci-bridge'>
+      <model name='pci-bridge'/>
+      <target chassisNr='1'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </controller>
     <input type='mouse' bus='ps2'/>
     <input type='keyboard' bus='ps2'/>
     <audio id='1' type='none'/>
@@ -61,7 +66,7 @@
         <block unit='KiB'>2048</block>
         <requested unit='KiB'>1048576</requested>
       </target>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
     </memory>
   </devices>
 </domain>
-- 
2.34.1

Re: [libvirt PATCH] tests: Cover virtio-mem being plugged into a bridge
Posted by Michal Prívozník 2 years, 3 months ago
On 2/2/22 15:59, Andrea Bolognani wrote:
> This is a perfectly valid configuration that we need to keep
> working, so add test coverage for it.
> 
> Signed-off-by: Andrea Bolognani <abologna@redhat.com>
> ---
>  .../memory-hotplug-virtio-mem.x86_64-latest.args           | 3 ++-
>  tests/qemuxml2argvdata/memory-hotplug-virtio-mem.xml       | 7 ++++++-
>  2 files changed, 8 insertions(+), 2 deletions(-)

Fair enough.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal