[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 13/15] vdpa: block migration if SVQ does not admit a feature
From: |
Eugenio Pérez |
Subject: |
[PATCH v4 13/15] vdpa: block migration if SVQ does not admit a feature |
Date: |
Fri, 24 Feb 2023 16:54:36 +0100 |
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>
---
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 25b64ae854..8702780ad6 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.
--
2.31.1
- Re: [PATCH v4 05/15] vdpa: move vhost reset after get vring base, (continued)
- [PATCH v4 09/15] vdpa: add vdpa net migration state notifier, Eugenio Pérez, 2023/02/24
- [PATCH v4 14/15] vdpa net: allow VHOST_F_LOG_ALL, Eugenio Pérez, 2023/02/24
- [PATCH v4 06/15] vdpa: add vhost_vdpa->suspended parameter, Eugenio Pérez, 2023/02/24
- [PATCH v4 07/15] vdpa: add vhost_vdpa_suspend, Eugenio Pérez, 2023/02/24
- [PATCH v4 10/15] vdpa: disable RAM block discard only for the first device, Eugenio Pérez, 2023/02/24
- [PATCH v4 13/15] vdpa: block migration if SVQ does not admit a feature,
Eugenio Pérez <=
- [PATCH v4 08/15] vdpa: rewind at get_base, not set_base, Eugenio Pérez, 2023/02/24
- [PATCH v4 12/15] vdpa: block migration if device has unsupported features, Eugenio Pérez, 2023/02/24
- [PATCH v4 11/15] vdpa net: block migration if the device has CVQ, Eugenio Pérez, 2023/02/24
- [PATCH v4 15/15] vdpa: return VHOST_F_LOG_ALL in vhost-vdpa devices, Eugenio Pérez, 2023/02/24
- Re: [PATCH v4 00/15] Dynamically switch to vhost shadow virtqueues at vdpa net migration, Alvaro Karsz, 2023/02/27