aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio/vhost.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2016-02-21 17:01:47 +0200
committerMichael S. Tsirkin <mst@redhat.com>2016-02-23 12:55:16 +0200
commitffe42cc14c770549abc7995a90cf53bca3659b7f (patch)
treed9db618d305306cb65e8931859c740f0355ca4dd /hw/virtio/vhost.c
parentb54ca0c3df4f21315bebdb96dc81cdf1abb9b214 (diff)
vhost-user: don't merge regions with different fds
vhost currently merges regions with contiguious virtual and physical addresses. This breaks for vhost-user since that also needs fds to match. Add a vhost_ops entry to compare the fds for vhost-user only. Cc: qemu-stable@nongnu.org Cc: Victor Kaplansky <victork@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/virtio/vhost.c')
-rw-r--r--hw/virtio/vhost.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 72d0c9e9ae..392d848819 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -260,6 +260,13 @@ static void vhost_dev_assign_memory(struct vhost_dev *dev,
continue;
}
+ if (dev->vhost_ops->vhost_backend_can_merge &&
+ !dev->vhost_ops->vhost_backend_can_merge(dev, uaddr, size,
+ reg->userspace_addr,
+ reg->memory_size)) {
+ continue;
+ }
+
if (merged) {
--to;
assert(to >= 0);