diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2014-11-02 20:00:28 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-11-03 18:32:48 +0200 |
commit | d3f16ec887bb58b19eac94fcae139a39a7933e15 (patch) | |
tree | 04cbb3af6b7f84e228cf27c4b63ab0b31da4e2b9 | |
parent | ac369a77967d5dd984a5430505eaf24a380af1c0 (diff) |
vhost-user: fix mmap offset calculation
qemu_get_ram_block_host_ptr should get ram_addr_t,
vhost-user passes in GPA.
That's very wrong.
Reported-by: Linhaifeng <haifeng.lin@huawei.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r-- | hw/virtio/vhost-user.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 4e88d9c5e9..aefe0bbaaf 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -226,7 +226,7 @@ static int vhost_user_call(struct vhost_dev *dev, unsigned long int request, msg.memory.regions[fd_num].memory_size = reg->memory_size; msg.memory.regions[fd_num].guest_phys_addr = reg->guest_phys_addr; msg.memory.regions[fd_num].mmap_offset = reg->userspace_addr - - (uintptr_t) qemu_get_ram_block_host_ptr(reg->guest_phys_addr); + (uintptr_t) qemu_get_ram_block_host_ptr(ram_addr); assert(fd_num < VHOST_MEMORY_MAX_NREGIONS); fds[fd_num++] = fd; } |