From patchwork Fri May 13 08:19:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ingo Molnar X-Patchwork-Id: 781902 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4D8JP2J012118 for ; Fri, 13 May 2011 08:19:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757935Ab1EMITV (ORCPT ); Fri, 13 May 2011 04:19:21 -0400 Received: from mx3.mail.elte.hu ([157.181.1.138]:51753 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757797Ab1EMITT (ORCPT ); Fri, 13 May 2011 04:19:19 -0400 Received: from elvis.elte.hu ([157.181.1.14]) by mx3.mail.elte.hu with esmtp (Exim) id 1QKnaZ-0004Hs-JF from ; Fri, 13 May 2011 10:19:17 +0200 Received: by elvis.elte.hu (Postfix, from userid 1004) id 1268D3E2526; Fri, 13 May 2011 10:19:05 +0200 (CEST) Date: Fri, 13 May 2011 10:19:09 +0200 From: Ingo Molnar To: Pekka Enberg Cc: KVM devel mailing list Subject: [PATCH] kvm tools: Fix type mismatches on GCC 4.4 on 32-bit systems Message-ID: <20110513081909.GA14603@elte.hu> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-08-17) Received-SPF: neutral (mx3: 157.181.1.14 is neither permitted nor denied by domain of elte.hu) client-ip=157.181.1.14; envelope-from=mingo@elte.hu; helo=elvis.elte.hu; X-ELTE-SpamScore: -2.0 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-2.0 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.3.1 -2.0 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 13 May 2011 08:19:25 +0000 (UTC) FYI, the tools/kvm build still fails on 32-bit: cc1: warnings being treated as errors qcow.c: In function ‘qcow1_write_sector’: qcow.c:307: error: comparison between signed and unsigned integer expressions make: *** [qcow.o] Error 1 make: *** Waiting for unfinished jobs.... using: gcc version 4.4.4 20100630 (Red Hat 4.4.4-10) (GCC) The patch below addresses them but i haven't tested it beyond checking that it builds. The double cast of userspace_addr is doubly sad - it highlights our 32-bitness problems which are visible in the guest_pfn_to_host() function as well. Thanks, Ingo --- Signed-off-by: Ingo Molnar -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/tools/kvm/kvm.c b/tools/kvm/kvm.c index c69fcc4..e3f9d02 100644 --- a/tools/kvm/kvm.c +++ b/tools/kvm/kvm.c @@ -162,7 +162,7 @@ static void kvm_register_mem_slot(struct kvm *kvm, u32 slot, u64 guest_phys, u64 .slot = slot, .guest_phys_addr = guest_phys, .memory_size = size, - .userspace_addr = (u64)userspace_addr, + .userspace_addr = (u64)(long)userspace_addr, }; ret = ioctl(kvm->vm_fd, KVM_SET_USER_MEMORY_REGION, &mem); diff --git a/tools/kvm/qcow.c b/tools/kvm/qcow.c index 8e1b70d..bb2345c 100644 --- a/tools/kvm/qcow.c +++ b/tools/kvm/qcow.c @@ -295,7 +295,7 @@ static int qcow1_write_sector(struct disk_image *disk, u64 sector, void *src, u3 { struct qcow *q = disk->priv; struct qcow_header *header = q->header; - ssize_t nr_written; + u32 nr_written; char *buf; u64 offset; ssize_t nr;