]> git.proxmox.com Git - mirror_qemu.git/commitdiff
vhost: migration blocker only if shared log is used
authorRafael David Tinoco <rafael.tinoco@canonical.com>
Mon, 24 Oct 2016 15:35:03 +0000 (15:35 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 15 Nov 2016 15:20:37 +0000 (17:20 +0200)
Commit 31190ed7 added a migration blocker in vhost_dev_init() to
check if memfd would succeed. It is better if this blocker first
checks if vhost backend requires shared log. This will avoid a
situation where a blocker is added inappropriately (e.g. shared
log allocation fails when vhost backend doesn't support it).

Signed-off-by: Rafael David Tinoco <rafael.tinoco@canonical.com>
Reviewed-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>
hw/virtio/vhost.c

index 131f1643b2a45a3b315a000ed17d9ac1b3d830c3..25bf67f3cc98f0d07df79aef9b2af2483add8024 100644 (file)
@@ -1122,7 +1122,7 @@ 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()) {
+        } else if (vhost_dev_log_is_shared(hdev) && !qemu_memfd_check()) {
             error_setg(&hdev->migration_blocker,
                        "Migration disabled: failed to allocate shared memory");
         }