]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Don't add memballoon by default on RISC-V master
authorAndrea Bolognani <abologna@redhat.com>
Tue, 16 Jan 2024 17:51:42 +0000 (18:51 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 6 Oct 2025 16:12:41 +0000 (18:12 +0200)
The idea of adding devices such as USB controllers or memory
balloons by default comes from attempting to match QEMU's own
defaults at a time when x86 was the only game in town.

The unfortunate consequence of this is that, if the user does
NOT want the device in question to be present, they have to
create a special XML element with model=none to stop libvirt.
This is counter-intuitive.

For architectures for which we've added support more recently,
such as aarch64 and loongarch64, we've generally chosen to do
the sensible thing and create very minimal guests by default.
The user is of course still able to ask for additional hardware
if they so desire.

When adding RISC-V support, we accidentally forgot to skip the
creation of the default memory balloon. Address that oversight.

This is technically a breaking change, but it's fairly safe to
apply it because:

  * it doesn't affect existing guests;
  * virt-manager will automatically add the memballoon device
    by default anyway;
  * RISC-V is still not widely used.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_postparse.c
tests/qemuxmlconfdata/riscv64-virt-acpi.riscv64-latest.args
tests/qemuxmlconfdata/riscv64-virt-acpi.riscv64-latest.xml
tests/qemuxmlconfdata/riscv64-virt-minimal.riscv64-latest.abi-update.args
tests/qemuxmlconfdata/riscv64-virt-minimal.riscv64-latest.abi-update.xml
tests/qemuxmlconfdata/riscv64-virt-minimal.riscv64-latest.args
tests/qemuxmlconfdata/riscv64-virt-minimal.riscv64-latest.xml

index e5a0913111a68004ec8cc93923620373767a1c38..fd27f8be27af244218d0c32df0463b5cd3882858 100644 (file)
@@ -1272,7 +1272,6 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver,
 
     case VIR_ARCH_RISCV32:
     case VIR_ARCH_RISCV64:
-        addDefaultMemballoon = true;
         if (qemuDomainIsRISCVVirt(def))
             addPCIeRoot = true;
         break;
index 05af882d46614cdd22823610e7329c513346b006..cc38be287c3bd4d7b550ebe26c5f7236f60b4e5d 100644 (file)
@@ -26,9 +26,6 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
 -rtc base=utc \
 -no-shutdown \
 -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"}' \
 -audiodev '{"id":"audio1","driver":"none"}' \
--device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.1","addr":"0x0"}' \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
index 1382faf68765f16c51aef4e293634461d6890812..dc440487d21bcdafbd6e528c5f34b21a7c3c5dbf 100644 (file)
   <devices>
     <emulator>/usr/bin/qemu-system-riscv64</emulator>
     <controller type='pci' index='0' model='pcie-root'/>
-    <controller type='pci' index='1' model='pcie-root-port'>
-      <model name='pcie-root-port'/>
-      <target chassis='1' port='0x8'/>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/>
-    </controller>
-    <controller type='pci' index='2' model='pcie-root-port'>
-      <model name='pcie-root-port'/>
-      <target chassis='2' port='0x9'/>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
-    </controller>
     <audio id='1' type='none'/>
-    <memballoon model='virtio'>
-      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
-    </memballoon>
   </devices>
 </domain>
index 95b732f728e89c2c75646023073cdc625bde37b2..74bf8bc1341bcb84a818b9d6b8fecd491910390e 100644 (file)
@@ -26,9 +26,6 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
 -rtc base=utc \
 -no-shutdown \
 -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"}' \
 -audiodev '{"id":"audio1","driver":"none"}' \
--device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.1","addr":"0x0"}' \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
index 86e2273741bcbcf1cd21850183beb9283ef0016c..09ba59fc0963dd7bbcc3b2666cf4b44b3af22f4d 100644 (file)
   <devices>
     <emulator>/usr/bin/qemu-system-riscv64</emulator>
     <controller type='pci' index='0' model='pcie-root'/>
-    <controller type='pci' index='1' model='pcie-root-port'>
-      <model name='pcie-root-port'/>
-      <target chassis='1' port='0x8'/>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/>
-    </controller>
-    <controller type='pci' index='2' model='pcie-root-port'>
-      <model name='pcie-root-port'/>
-      <target chassis='2' port='0x9'/>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
-    </controller>
     <audio id='1' type='none'/>
-    <memballoon model='virtio'>
-      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
-    </memballoon>
   </devices>
 </domain>
index 95b732f728e89c2c75646023073cdc625bde37b2..74bf8bc1341bcb84a818b9d6b8fecd491910390e 100644 (file)
@@ -26,9 +26,6 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
 -rtc base=utc \
 -no-shutdown \
 -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"}' \
 -audiodev '{"id":"audio1","driver":"none"}' \
--device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.1","addr":"0x0"}' \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
index 86e2273741bcbcf1cd21850183beb9283ef0016c..09ba59fc0963dd7bbcc3b2666cf4b44b3af22f4d 100644 (file)
   <devices>
     <emulator>/usr/bin/qemu-system-riscv64</emulator>
     <controller type='pci' index='0' model='pcie-root'/>
-    <controller type='pci' index='1' model='pcie-root-port'>
-      <model name='pcie-root-port'/>
-      <target chassis='1' port='0x8'/>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/>
-    </controller>
-    <controller type='pci' index='2' model='pcie-root-port'>
-      <model name='pcie-root-port'/>
-      <target chassis='2' port='0x9'/>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
-    </controller>
     <audio id='1' type='none'/>
-    <memballoon model='virtio'>
-      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
-    </memballoon>
   </devices>
 </domain>