[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 01/27] vhost: Add vhost_dev_can_log
From: |
Eugenio Pérez |
Subject: |
[RFC PATCH 01/27] vhost: Add vhost_dev_can_log |
Date: |
Fri, 20 Nov 2020 19:50:39 +0100 |
Just syntactic sugar.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
hw/virtio/vhost.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 614ccc2bcb..2bd8cdf893 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -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())
{
--
2.18.4
- [RFC PATCH 00/27] vDPA software assisted live migration, Eugenio Pérez, 2020/11/20
- [RFC PATCH 01/27] vhost: Add vhost_dev_can_log,
Eugenio Pérez <=
- [RFC PATCH 02/27] vhost: Add device callback in vhost_migration_log, Eugenio Pérez, 2020/11/20
- [RFC PATCH 03/27] vhost: Move log resize/put to vhost_dev_set_log, Eugenio Pérez, 2020/11/20
- [RFC PATCH 04/27] vhost: add vhost_kernel_set_vring_enable, Eugenio Pérez, 2020/11/20
- [RFC PATCH 05/27] vhost: Add hdev->dev.sw_lm_vq_handler, Eugenio Pérez, 2020/11/20
- [RFC PATCH 06/27] virtio: Add virtio_queue_get_used_notify_split, Eugenio Pérez, 2020/11/20
- [RFC PATCH 07/27] vhost: Route guest->host notification through qemu, Eugenio Pérez, 2020/11/20
- [RFC PATCH 08/27] vhost: Add a flag for software assisted Live Migration, Eugenio Pérez, 2020/11/20
- [RFC PATCH 09/27] vhost: Route host->guest notification through qemu, Eugenio Pérez, 2020/11/20
- [RFC PATCH 10/27] vhost: Allocate shadow vring, Eugenio Pérez, 2020/11/20
- [RFC PATCH 11/27] virtio: const-ify all virtio_tswap* functions, Eugenio Pérez, 2020/11/20