@@ -61,6 +61,11 @@ bool vhost_has_free_slot(void)
return slots_limit > used_memslots;
}
+static bool vhost_dev_can_log(const struct vhost_dev *hdev)
+{
+ return hdev->features & (0x1ULL << VHOST_F_LOG_ALL);
+}
+
static void vhost_dev_sync_region(struct vhost_dev *dev,
MemoryRegionSection *section,
uint64_t mfirst, uint64_t mlast,
@@ -1347,7 +1352,7 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
};
if (hdev->migration_blocker == NULL) {
- if (!(hdev->features & (0x1ULL << VHOST_F_LOG_ALL))) {
+ if (!vhost_dev_can_log(hdev)) {
error_setg(&hdev->migration_blocker,
"Migration disabled: vhost lacks VHOST_F_LOG_ALL feature.");
} else if (vhost_dev_log_is_shared(hdev) && !qemu_memfd_alloc_check()) {
Just syntactic sugar. Signed-off-by: Eugenio PĂ©rez <eperezma@redhat.com> --- hw/virtio/vhost.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)