All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Anthony Liguori <aliguori@amazon.com>
Subject: [Qemu-devel] [PULL v2 7/7] vhost-user: minor cleanups
Date: Fri, 18 Jul 2014 02:44:53 +0300	[thread overview]
Message-ID: <1405640614-9252-8-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1405640614-9252-1-git-send-email-mst@redhat.com>

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

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 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

  parent reply	other threads:[~2014-07-17 23:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-17 23:44 [Qemu-devel] [PULL v2 0/7] pc,vhost,test fixes Michael S. Tsirkin
2014-07-17 23:44 ` [Qemu-devel] [PULL v2 1/7] pc: fix qemu exiting with error when -m X < 128 with old machines types Michael S. Tsirkin
2014-07-17 23:44 ` [Qemu-devel] [PULL v2 2/7] pc_piix: Reuse pc_compat_1_2() for pc-0.1[0123] Michael S. Tsirkin
2014-07-17 23:44 ` [Qemu-devel] [PULL v2 3/7] fix typo: apci -> acpi Michael S. Tsirkin
2014-07-17 23:44 ` [Qemu-devel] [PULL v2 4/7] qtest: fix vhost-user-test compilation with old GLib Michael S. Tsirkin
2014-07-17 23:44 ` [Qemu-devel] [PULL v2 5/7] vhost-user: Fix VHOST_SET_MEM_TABLE processing Michael S. Tsirkin
2014-07-17 23:44 ` [Qemu-devel] [PULL v2 6/7] qtest: Adapt vhost-user-test to latest vhost-user changes Michael S. Tsirkin
2014-09-13  9:48   ` Linhaifeng
2014-07-17 23:44 ` Michael S. Tsirkin [this message]
2014-07-18 12:24 ` [Qemu-devel] [PULL v2 0/7] pc,vhost,test fixes Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1405640614-9252-8-git-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.