[PATCH 2/3] qemu-kvm: fix build on 32 bit

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

 



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@xxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux