qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

vhost: migration blocker only if shared log is used

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>

authored by

Rafael David Tinoco and committed by
Michael S. Tsirkin
0d34fbab 2a083ffd

+1 -1
+1 -1
hw/virtio/vhost.c
··· 1122 1122 if (!(hdev->features & (0x1ULL << VHOST_F_LOG_ALL))) { 1123 1123 error_setg(&hdev->migration_blocker, 1124 1124 "Migration disabled: vhost lacks VHOST_F_LOG_ALL feature."); 1125 - } else if (!qemu_memfd_check()) { 1125 + } else if (vhost_dev_log_is_shared(hdev) && !qemu_memfd_check()) { 1126 1126 error_setg(&hdev->migration_blocker, 1127 1127 "Migration disabled: failed to allocate shared memory"); 1128 1128 }