[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 24/73] vdpa: block migration if SVQ does not admit a feature
From: |
Michael S. Tsirkin |
Subject: |
[PULL 24/73] vdpa: block migration if SVQ does not admit a feature |
Date: |
Tue, 7 Mar 2023 20:12:01 -0500 |
From: Eugenio Pérez <eperezma@redhat.com>
Next patches enable devices to be migrated even if vdpa netdev has not
been started with x-svq. However, not all devices are migratable, so we
need to block migration if we detect that.
Block migration if we detect the device expose a feature SVQ does not
know how to work with.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Message-Id: <20230303172445.1089785-13-eperezma@redhat.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/virtio/vhost-vdpa.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index e9167977d5..48ffb67a34 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -443,6 +443,21 @@ static int vhost_vdpa_init(struct vhost_dev *dev, void
*opaque, Error **errp)
return 0;
}
+ /*
+ * If dev->shadow_vqs_enabled at initialization that means the device has
+ * been started with x-svq=on, so don't block migration
+ */
+ if (dev->migration_blocker == NULL && !v->shadow_vqs_enabled) {
+ /* We don't have dev->features yet */
+ uint64_t features;
+ ret = vhost_vdpa_get_dev_features(dev, &features);
+ if (unlikely(ret)) {
+ error_setg_errno(errp, -ret, "Could not get device features");
+ return ret;
+ }
+ vhost_svq_valid_features(features, &dev->migration_blocker);
+ }
+
/*
* Similar to VFIO, we end up pinning all guest memory and have to
* disable discarding of RAM.
--
MST
- [PULL 13/73] vdpa net: move iova tree creation from init to start, (continued)
- [PULL 13/73] vdpa net: move iova tree creation from init to start, Michael S. Tsirkin, 2023/03/07
- [PULL 14/73] vdpa: Remember last call fd set, Michael S. Tsirkin, 2023/03/07
- [PULL 15/73] vdpa: Negotiate _F_SUSPEND feature, Michael S. Tsirkin, 2023/03/07
- [PULL 16/73] vdpa: rewind at get_base, not set_base, Michael S. Tsirkin, 2023/03/07
- [PULL 17/73] vdpa: add vhost_vdpa->suspended parameter, Michael S. Tsirkin, 2023/03/07
- [PULL 18/73] vdpa: add vhost_vdpa_suspend, Michael S. Tsirkin, 2023/03/07
- [PULL 19/73] vdpa: move vhost reset after get vring base, Michael S. Tsirkin, 2023/03/07
- [PULL 20/73] vdpa: add vdpa net migration state notifier, Michael S. Tsirkin, 2023/03/07
- [PULL 21/73] vdpa: disable RAM block discard only for the first device, Michael S. Tsirkin, 2023/03/07
- [PULL 22/73] vdpa net: block migration if the device has CVQ, Michael S. Tsirkin, 2023/03/07
- [PULL 24/73] vdpa: block migration if SVQ does not admit a feature,
Michael S. Tsirkin <=
- [PULL 26/73] vdpa: return VHOST_F_LOG_ALL in vhost-vdpa devices, Michael S. Tsirkin, 2023/03/07
- [PULL 23/73] vdpa: block migration if device has unsupported features, Michael S. Tsirkin, 2023/03/07
- [PULL 28/73] tests: acpi: whitelist new q35.noacpihp test and pc.hpbrroot, Michael S. Tsirkin, 2023/03/07
- [PULL 29/73] tests: acpi: add test_acpi_q35_tcg_no_acpi_hotplug test and extend test_acpi_piix4_no_acpi_pci_hotplug, Michael S. Tsirkin, 2023/03/07
- [PULL 30/73] tests: acpi: update expected blobs, Michael S. Tsirkin, 2023/03/07
- [PULL 25/73] vdpa net: allow VHOST_F_LOG_ALL, Michael S. Tsirkin, 2023/03/07
- [PULL 27/73] Revert "tests/qtest: Check for devices in bios-tables-test", Michael S. Tsirkin, 2023/03/07
- [PULL 31/73] tests: acpi: whitelist q35/DSDT.multi-bridge before extending testcase, Michael S. Tsirkin, 2023/03/07