[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 11/20] virtio-balloon-pci: Allow setting nvectors, so we can use M
From: |
Thomas Huth |
Subject: |
[PULL 11/20] virtio-balloon-pci: Allow setting nvectors, so we can use MSI-X |
Date: |
Thu, 30 Jan 2025 14:15:25 +0100 |
From: Reza Arbab <arbab@linux.ibm.com>
Most virtio-pci devices allow MSI-X. Add it to virtio-balloon-pci, but
only enable it in new machine types, so we don't break migration of
existing machine types between different qemu versions.
This copies what was done for virtio-rng-pci in:
9ea02e8f1306 ("virtio-rng-pci: Allow setting nvectors, so we can use MSI-X")
bad9c5a5166f ("virtio-rng-pci: fix migration compat for vectors")
62bdb8871512 ("virtio-rng-pci: fix transitional migration compat for vectors")
Acked-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
Tested-by: Mario Casquero <mcasquer@redhat.com>
Message-ID: <20250115161425.246348-1-arbab@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/core/machine.c | 3 +++
hw/virtio/virtio-balloon-pci.c | 12 ++++++++++++
2 files changed, 15 insertions(+)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index c23b399496..8f396ef803 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -38,6 +38,9 @@
GlobalProperty hw_compat_9_2[] = {
{"arm-cpu", "backcompat-pauth-default-use-qarma5", "true"},
+ { "virtio-balloon-pci", "vectors", "0" },
+ { "virtio-balloon-pci-transitional", "vectors", "0" },
+ { "virtio-balloon-pci-non-transitional", "vectors", "0" },
};
const size_t hw_compat_9_2_len = G_N_ELEMENTS(hw_compat_9_2);
diff --git a/hw/virtio/virtio-balloon-pci.c b/hw/virtio/virtio-balloon-pci.c
index ce2645ba71..db7e1cb475 100644
--- a/hw/virtio/virtio-balloon-pci.c
+++ b/hw/virtio/virtio-balloon-pci.c
@@ -35,11 +35,22 @@ struct VirtIOBalloonPCI {
VirtIOBalloon vdev;
};
+static const Property virtio_balloon_properties[] = {
+ DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags,
+ VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true),
+ DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors,
+ DEV_NVECTORS_UNSPECIFIED),
+};
+
static void virtio_balloon_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
{
VirtIOBalloonPCI *dev = VIRTIO_BALLOON_PCI(vpci_dev);
DeviceState *vdev = DEVICE(&dev->vdev);
+ if (vpci_dev->nvectors == DEV_NVECTORS_UNSPECIFIED) {
+ vpci_dev->nvectors = 2;
+ }
+
vpci_dev->class_code = PCI_CLASS_OTHERS;
qdev_realize(vdev, BUS(&vpci_dev->bus), errp);
}
@@ -55,6 +66,7 @@ static void virtio_balloon_pci_class_init(ObjectClass *klass,
void *data)
pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_BALLOON;
pcidev_k->revision = VIRTIO_PCI_ABI_VERSION;
pcidev_k->class_id = PCI_CLASS_OTHERS;
+ device_class_set_props(dc, virtio_balloon_properties);
}
static void virtio_balloon_pci_instance_init(Object *obj)
--
2.48.1
- [PULL 01/20] tests/functional/qemu_test/decorators: Fix bad check for imports, (continued)
- [PULL 01/20] tests/functional/qemu_test/decorators: Fix bad check for imports, Thomas Huth, 2025/01/30
- [PULL 03/20] tests/functional: Convert the migration avocado test, Thomas Huth, 2025/01/30
- [PULL 06/20] tests/functional/test_mips_malta: Fix comment about endianness of the test, Thomas Huth, 2025/01/30
- [PULL 02/20] tests/functional: Fix broken decorators with lamda functions, Thomas Huth, 2025/01/30
- [PULL 04/20] tests/functional: Fix the aarch64_tcg_plugins test, Thomas Huth, 2025/01/30
- [PULL 05/20] tests/functional: Add a ppc64 mac99 test, Thomas Huth, 2025/01/30
- [PULL 09/20] tests/tcg/s390x: Test modifying code using the MVC instruction, Thomas Huth, 2025/01/30
- [PULL 14/20] tests/functional: Extend PPC 40p test with Linux boot, Thomas Huth, 2025/01/30
- [PULL 15/20] tests/functional: Add a decorator for skipping long running tests, Thomas Huth, 2025/01/30
- [PULL 16/20] tests/functional: Add the ReplayKernelBase class, Thomas Huth, 2025/01/30
- [PULL 11/20] virtio-balloon-pci: Allow setting nvectors, so we can use MSI-X,
Thomas Huth <=
- [PULL 13/20] s390x/s390-virtio-ccw: Support plugging PCI-based virtio memory devices, Thomas Huth, 2025/01/30
- [PULL 17/20] tests/functional/test_mipsel_malta: Convert the mipsel replay tests, Thomas Huth, 2025/01/30
- [PULL 10/20] hw/s390x/s390-virtio-ccw: Fix a record/replay deadlock, Thomas Huth, 2025/01/30
- [PULL 20/20] net/slirp: libslirp 4.9.0 compatibility, Thomas Huth, 2025/01/30
- [PULL 08/20] target/s390x: Fix MVC not always invalidating translation blocks, Thomas Huth, 2025/01/30
- [PULL 12/20] virtio-mem-pci: Allow setting nvectors, so we can use MSI-X, Thomas Huth, 2025/01/30
- [PULL 18/20] tests/functional/test_mips64el_malta: Convert the mips64el replay tests, Thomas Huth, 2025/01/30
- [PULL 19/20] tests/functional/test_mips_malta: Convert the mips big endian replay tests, Thomas Huth, 2025/01/30
- [PULL 07/20] target/s390x: Fix PPNO execution with icount, Thomas Huth, 2025/01/30