[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 12/24] vhost-user: add a migration blocker
From: |
marcandre . lureau |
Subject: |
[Qemu-devel] [PATCH v6 12/24] vhost-user: add a migration blocker |
Date: |
Tue, 29 Sep 2015 18:34:42 +0200 |
From: Marc-André Lureau <address@hidden>
If VHOST_USER_PROTOCOL_F_LOG_SHMFD is not announced, block vhost-user
migration.
Signed-off-by: Marc-André Lureau <address@hidden>
---
hw/virtio/vhost-user.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index cf14e38..cef4aae 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -15,6 +15,7 @@
#include "qemu/error-report.h"
#include "qemu/sockets.h"
#include "exec/ram_addr.h"
+#include "migration/migration.h"
#include <fcntl.h>
#include <unistd.h>
@@ -442,6 +443,14 @@ static int vhost_user_init(struct vhost_dev *dev, void
*opaque)
}
}
+ if (!virtio_has_feature(dev->protocol_features,
+ VHOST_USER_PROTOCOL_F_LOG_SHMFD)) {
+ migrate_add_blocker(dev->migration_blocker);
+ error_setg(&dev->migration_blocker,
+ "Migration disabled: vhost-user backend lacks "
+ "VHOST_USER_PROTOCOL_F_LOG_SHMFD feature.");
+ }
+
return 0;
}
@@ -466,6 +475,10 @@ static int vhost_user_cleanup(struct vhost_dev *dev)
assert(dev->vhost_ops->backend_type == VHOST_BACKEND_TYPE_USER);
dev->opaque = 0;
+ if (dev->migration_blocker) {
+ migrate_del_blocker(dev->migration_blocker);
+ error_free(dev->migration_blocker);
+ }
return 0;
}
--
2.4.3
- Re: [Qemu-devel] [PATCH v6 06/24] memfd: add fallback for memfd, (continued)
- [Qemu-devel] [PATCH v6 16/24] vhost user: add support of live migration, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v6 23/24] vhost-user-test: check ownership during migration, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v6 22/24] vhost-user-test: add live-migration test, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v6 24/24] vhost-user: use an enum helper for features mask, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v6 01/24] vhost-user: unit test for new messages, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v6 04/24] util: add linux-only memfd fallback, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v6 07/24] vhost: document log resizing, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v6 12/24] vhost-user: add a migration blocker,
marcandre . lureau <=
- [Qemu-devel] [PATCH v6 03/24] linux-headers: add unistd.h, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v6 17/24] vhost user: add rarp sending after live migration for legacy guest, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v6 20/24] vhost-user-test: wrap server in TestServer struct, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v6 02/24] configure: probe for memfd, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v6 05/24] util: add memfd helpers, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v6 10/24] vhost: alloc shareable log, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v6 18/24] vhost-user-test: move wait_for_fds() out, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v6 19/24] vhost-user-test: remove useless static check, marcandre . lureau, 2015/10/08