qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 7/7] vhost-user: minor cleanups


From: Michael S. Tsirkin
Subject: [Qemu-devel] [PULL 7/7] vhost-user: minor cleanups
Date: Fri, 18 Jul 2014 02:41:12 +0300

assert to verify cast does not discard information
minor style fixup.

Signed-off-by: Michael S. Tsirkin <address@hidden>
---
 hw/virtio/vhost-user.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 3d23218..4e88d9c 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;
-- 
MST




reply via email to

[Prev in Thread] Current Thread [Next in Thread]