aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2015-10-09 17:17:34 +0200
committerMichael S. Tsirkin <mst@redhat.com>2015-10-22 14:34:49 +0300
commit31190ed781a81d2de65cea405e4cb3441ab929fc (patch)
treea92dd588148f39ba39fd0268b02409a27ec20574 /hw
parentde1372d466fb4a7bed13f64f50bff14aaa4a5931 (diff)
downloadqemu-31190ed781a81d2de65cea405e4cb3441ab929fc.zip
qemu-31190ed781a81d2de65cea405e4cb3441ab929fc.tar.gz
qemu-31190ed781a81d2de65cea405e4cb3441ab929fc.tar.bz2
vhost: add migration block if memfd failed
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Thibaut Collet <thibaut.collet@6wind.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/virtio/vhost.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 2e78e4b..feeaaa4 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1019,6 +1019,9 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
if (!(hdev->features & (0x1ULL << VHOST_F_LOG_ALL))) {
error_setg(&hdev->migration_blocker,
"Migration disabled: vhost lacks VHOST_F_LOG_ALL feature.");
+ } else if (!qemu_memfd_check()) {
+ error_setg(&hdev->migration_blocker,
+ "Migration disabled: failed to allocate shared memory");
}
}