summaryrefslogtreecommitdiff
path: root/hw/virtio/vhost-user.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2014-07-18 02:22:24 +0300
committerMichael S. Tsirkin <mst@redhat.com>2014-07-18 02:22:24 +0300
commitcd98639f673d92836b6b5fd60279b411748f2f1e (patch)
tree5682426a42a062375fe5ba351f7f600c219f33aa /hw/virtio/vhost-user.c
parentd6970e3b004a5b339abfe8adb0d70585dc8b7d6d (diff)
downloadqemu-cd98639f673d92836b6b5fd60279b411748f2f1e.zip
vhost-user: minor cleanups
assert to verify cast does not discard information minor style fixup. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/virtio/vhost-user.c')
-rw-r--r--hw/virtio/vhost-user.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 3d2321865b..4e88d9c5e9 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -217,7 +217,9 @@ static int vhost_user_call(struct vhost_dev *dev, unsigned long int request,
for (i = 0; i < dev->mem->nregions; ++i) {
struct vhost_memory_region *reg = dev->mem->regions + i;
ram_addr_t ram_addr;
- qemu_ram_addr_from_host((void *)reg->userspace_addr, &ram_addr);
+
+ assert((uintptr_t)reg->userspace_addr == reg->userspace_addr);
+ qemu_ram_addr_from_host((void *)(uintptr_t)reg->userspace_addr, &ram_addr);
fd = qemu_get_ram_fd(ram_addr);
if (fd > 0) {
msg.memory.regions[fd_num].userspace_addr = reg->userspace_addr;