diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2015-10-09 17:17:26 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2015-10-22 14:34:49 +0300 |
commit | 9a78a5dd272a190d262b5ba5d4721ab93d48c564 (patch) | |
tree | ca7a6204df8dca9d7e5c6920533408ed4c546a31 /hw/virtio/vhost.c | |
parent | 15324404f68cde561d0eeee3d18a7b203f57f095 (diff) | |
download | qemu-9a78a5dd272a190d262b5ba5d4721ab93d48c564.tar.gz qemu-9a78a5dd272a190d262b5ba5d4721ab93d48c564.tar.bz2 qemu-9a78a5dd272a190d262b5ba5d4721ab93d48c564.zip |
vhost-user: send log shm fd along with log_base
Send the shm for the dirty pages logging if the backend supports
VHOST_USER_PROTOCOL_F_LOG_SHMFD. Wait for a reply to make sure
the old log is no longer used.
Signed-off-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>
Tested-by: Thibaut Collet <thibaut.collet@6wind.com>
Diffstat (limited to 'hw/virtio/vhost.c')
-rw-r--r-- | hw/virtio/vhost.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index aec92d4691..65c09bf888 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -388,7 +388,7 @@ static inline void vhost_dev_log_resize(struct vhost_dev *dev, uint64_t size) /* inform backend of log switching, this must be done before releasing the current log, to ensure no logging is lost */ - r = dev->vhost_ops->vhost_set_log_base(dev, log_base); + r = dev->vhost_ops->vhost_set_log_base(dev, log_base, log); assert(r >= 0); vhost_log_put(dev, true); dev->log = log; @@ -1205,7 +1205,8 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice *vdev) vhost_dev_log_is_shared(hdev)); log_base = (uintptr_t)hdev->log->log; r = hdev->vhost_ops->vhost_set_log_base(hdev, - hdev->log_size ? log_base : 0); + hdev->log_size ? log_base : 0, + hdev->log); if (r < 0) { r = -errno; goto fail_log; |