]> git.proxmox.com Git - mirror_qemu.git/blobdiff - hw/virtio/vhost.c
vhost: add migration block if memfd failed
[mirror_qemu.git] / hw / virtio / vhost.c
index 2e78e4b706c9bc0d42dee238dfef66d94a520983..feeaaa418686c47a01c3f19ef3073730c8ddaada 100644 (file)
@@ -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");
         }
     }