All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: avi@redhat.com, kvm@vger.kernel.org
Subject: [PATCH 2/3] qemu-kvm: fix build on 32 bit
Date: Wed, 7 Oct 2009 13:19:22 +0200	[thread overview]
Message-ID: <20091007111922.GC20835@redhat.com> (raw)
In-Reply-To: <cover.1254914295.git.mst@redhat.com>

Fix build on 32 bit system: cast 64 bit integer
to pointer through pointer-sized integer.  Without this, I get:
qemu-kvm.c:1557: error: cast to pointer from integer of different size

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 qemu-kvm.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/qemu-kvm.c b/qemu-kvm.c
index a4a90ed..62ca050 100644
--- a/qemu-kvm.c
+++ b/qemu-kvm.c
@@ -588,7 +588,7 @@ int kvm_register_phys_mem(kvm_context_t kvm,
     struct kvm_userspace_memory_region memory = {
         .memory_size = len,
         .guest_phys_addr = phys_start,
-        .userspace_addr = (unsigned long) (intptr_t) userspace_addr,
+        .userspace_addr = (unsigned long) (uintptr_t) userspace_addr,
         .flags = log ? KVM_MEM_LOG_DIRTY_PAGES : 0,
     };
     int r;
@@ -1554,7 +1554,8 @@ static void sigbus_handler(int n, struct qemu_signalfd_siginfo *siginfo,
         CPUState *cenv;
 
         /* Hope we are lucky for AO MCE */
-        if (do_qemu_ram_addr_from_host((void *)siginfo->ssi_addr, &paddr)) {
+        if (do_qemu_ram_addr_from_host((void *)(intptr_t)siginfo->ssi_addr,
+				       &paddr)) {
             fprintf(stderr, "Hardware memory error for memory used by "
                     "QEMU itself instead of guest system!: %llx\n",
                     (unsigned long long)siginfo->ssi_addr);
-- 
1.6.5.rc2


  parent reply	other threads:[~2009-10-07 11:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1254914295.git.mst@redhat.com>
2009-10-07 11:19 ` [PATCH 1/3] qemu-kvm: fix build with KVM_CAP_SET_GUEST_DEBUG Michael S. Tsirkin
2009-10-07 12:16   ` Jan Kiszka
2009-10-07 12:18     ` Michael S. Tsirkin
2009-10-07 12:23       ` Jan Kiszka
2009-10-07 11:19 ` Michael S. Tsirkin [this message]
2009-10-07 11:19 ` [PATCH 3/3] qemu-kvm: convert kvm_types to ISO Michael S. Tsirkin
2009-10-08 13:18   ` Avi Kivity

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=20091007111922.GC20835@redhat.com \
    --to=mst@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.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.