public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch] cleanup warning of kvmctl.c
@ 2007-10-19 10:35 Akio Takebe
       [not found] ` <7EC8123BBADDD6takebe_akio-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Akio Takebe @ 2007-10-19 10:35 UTC (permalink / raw)
  To: kvm-devel

Hi,

Nice to meet you, all.
I recently got understanding kvm started,
and I found some worning at compiling kvm.

This patch is for cleanup of kvmctl.c.
I tested Booting Linux guest on x86_32.

Signed-off-by: Akio Takebe <takebe_akio-+CUm20s59erQFUHtdCDX3A@public.gmane.org>

--- kvm-48.orig/user/kvmctl.c	2007-10-19 01:42:58.000000000 +0900
+++ kvm-48/user/kvmctl.c	2007-10-19 19:14:05.000000000 +0900
@@ -313,7 +313,7 @@ int kvm_alloc_kernel_memory(kvm_context_
 	struct kvm_memory_region above_4g_memory = {
 		.slot = 4,
 		.memory_size = memory < pcimem ? 0 : memory - pcimem,
-		.guest_phys_addr = 0x100000000,
+		.guest_phys_addr = 0x100000000ULL,
 	};
 
 	if (memory >= pcimem)
@@ -372,12 +372,12 @@ int kvm_alloc_userspace_memory(kvm_conte
 	struct kvm_userspace_memory_region above_4g_memory = {
 		.slot = 4,
 		.memory_size = memory < pcimem ? 0 : memory - pcimem,
-		.guest_phys_addr = 0x100000000,
+		.guest_phys_addr = 0x100000000ULL,
 	};
 
 	if (memory >= pcimem) {
 		extended_memory.memory_size = pcimem - exmem;
-		*vm_mem = mmap(NULL, memory + 0x100000000 - pcimem,
+		*vm_mem = mmap(NULL, memory + 0x100000000ULL - pcimem,
 				PROT_READ|PROT_WRITE, MAP_ANONYMOUS |
 							MAP_SHARED, -1, 0);
 	}
@@ -413,13 +413,13 @@ int kvm_alloc_userspace_memory(kvm_conte
 	}
 
 	if (above_4g_memory.memory_size) {
-		r = munmap(*vm_mem + pcimem, 0x100000000 - pcimem);
+		r = munmap(*vm_mem + pcimem, 0x100000000ULL - pcimem);
 		if (r == -1) {
 			fprintf(stderr, "kvm_alloc_userspace_memory: %s",
 							strerror(errno));
 			return -1;
 		}
-		above_4g_memory.userspace_addr = (unsigned long)(*vm_mem + 0x100000000);
+		above_4g_memory.userspace_addr = (unsigned long)(*vm_mem + 0x100000000ULL);
 		r = ioctl(kvm->vm_fd, KVM_SET_USER_MEMORY_REGION, &above_4g_memory);
 		if (r == -1) {
 			fprintf(stderr, "kvm_create_memory_region: %m\n");


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-21  7:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-19 10:35 [Patch] cleanup warning of kvmctl.c Akio Takebe
     [not found] ` <7EC8123BBADDD6takebe_akio-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2007-10-21  7:03   ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox