[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 13/14] vdpa: block migration if SVQ does not admit a feature
From: |
Eugenio Pérez |
Subject: |
[PATCH v3 13/14] vdpa: block migration if SVQ does not admit a feature |
Date: |
Wed, 15 Feb 2023 18:38:49 +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 | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 3a85f9f1ed..9b8c22bda3 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -461,6 +461,15 @@ static int vhost_vdpa_init(struct vhost_dev *dev, void
*opaque, Error **errp)
if (!(backend_features & BIT_ULL(VHOST_BACKEND_F_SUSPEND))) {
error_setg(&dev->migration_blocker,
"vhost-vdpa backend lacks VHOST_BACKEND_F_SUSPEND feature.");
+ } else {
+ /* 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);
}
}
--
2.31.1
- [PATCH v3 02/14] vdpa: stop svq at vhost_vdpa_dev_start(false), (continued)
- [PATCH v3 02/14] vdpa: stop svq at vhost_vdpa_dev_start(false), Eugenio Pérez, 2023/02/15
- [PATCH v3 03/14] vdpa: Negotiate _F_SUSPEND feature, Eugenio Pérez, 2023/02/15
- [PATCH v3 04/14] vdpa: add vhost_vdpa_suspend, Eugenio Pérez, 2023/02/15
- [PATCH v3 05/14] vdpa: move vhost reset after get vring base, Eugenio Pérez, 2023/02/15
- [PATCH v3 06/14] vdpa: rewind at get_base, not set_base, Eugenio Pérez, 2023/02/15
- [PATCH v3 07/14] vdpa net: allow VHOST_F_LOG_ALL, Eugenio Pérez, 2023/02/15
- [PATCH v3 08/14] vdpa: add vdpa net migration state notifier, Eugenio Pérez, 2023/02/15
- [PATCH v3 10/14] vdpa net: block migration if the device has CVQ, Eugenio Pérez, 2023/02/15
- [PATCH v3 11/14] vdpa: block migration if device has unsupported features, Eugenio Pérez, 2023/02/15
- [PATCH v3 12/14] vdpa: block migration if dev does not have _F_SUSPEND, Eugenio Pérez, 2023/02/15
- [PATCH v3 13/14] vdpa: block migration if SVQ does not admit a feature,
Eugenio Pérez <=
- [PATCH v3 14/14] vdpa: return VHOST_F_LOG_ALL in vhost-vdpa devices, Eugenio Pérez, 2023/02/15
- [PATCH v3 09/14] vdpa: disable RAM block discard only for the first device, Eugenio Pérez, 2023/02/15