From: Andrea Bolognani Date: Tue, 16 Jan 2024 17:51:42 +0000 (+0100) Subject: qemu: Don't add memballoon by default on RISC-V X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=thirdparty%2Flibvirt.git qemu: Don't add memballoon by default on RISC-V 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 Reviewed-by: Peter Krempa --- diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c index e5a0913111..fd27f8be27 100644 --- a/src/qemu/qemu_postparse.c +++ b/src/qemu/qemu_postparse.c @@ -1272,7 +1272,6 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, case VIR_ARCH_RISCV32: case VIR_ARCH_RISCV64: - addDefaultMemballoon = true; if (qemuDomainIsRISCVVirt(def)) addPCIeRoot = true; break; diff --git a/tests/qemuxmlconfdata/riscv64-virt-acpi.riscv64-latest.args b/tests/qemuxmlconfdata/riscv64-virt-acpi.riscv64-latest.args index 05af882d46..cc38be287c 100644 --- a/tests/qemuxmlconfdata/riscv64-virt-acpi.riscv64-latest.args +++ b/tests/qemuxmlconfdata/riscv64-virt-acpi.riscv64-latest.args @@ -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 diff --git a/tests/qemuxmlconfdata/riscv64-virt-acpi.riscv64-latest.xml b/tests/qemuxmlconfdata/riscv64-virt-acpi.riscv64-latest.xml index 1382faf687..dc440487d2 100644 --- a/tests/qemuxmlconfdata/riscv64-virt-acpi.riscv64-latest.xml +++ b/tests/qemuxmlconfdata/riscv64-virt-acpi.riscv64-latest.xml @@ -21,19 +21,6 @@ /usr/bin/qemu-system-riscv64 - - - -
- - - - -
-