public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kvmctl.c: mmap() should be called with NULL rather than 0
@ 2007-07-23  8:36 Nguyen Anh Quynh
       [not found] ` <9cde8bff0707230136x4cee0099s4452dcb2f52a49c7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Nguyen Anh Quynh @ 2007-07-23  8:36 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

[-- Attachment #1: Type: text/plain, Size: 148 bytes --]

kvmctl.c: The first param of mmap() should be NULL rather than 0.

Signed-off-by: Nguyen Anh Quynh <aquynh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

[-- Attachment #2: patch17.patch --]
[-- Type: text/x-patch, Size: 1202 bytes --]

diff --git a/user/kvmctl.c b/user/kvmctl.c
index 3b0d8bc..43b374d 100644
--- a/user/kvmctl.c
+++ b/user/kvmctl.c
@@ -222,7 +222,7 @@ int kvm_create_vcpu(kvm_context_t kvm, int slot)
 		fprintf(stderr, "get vcpu mmap size: %m\n");
 		return r;
 	}
-	kvm->run[slot] = mmap(0, mmap_size, PROT_READ|PROT_WRITE, MAP_SHARED,
+	kvm->run[slot] = mmap(NULL, mmap_size, PROT_READ|PROT_WRITE, MAP_SHARED,
 			      kvm->vcpu_fd[slot], 0);
 	if (kvm->run[slot] == MAP_FAILED) {
 		r = -errno;
@@ -276,7 +276,7 @@ int kvm_create(kvm_context_t kvm, unsigned long memory, void **vm_mem)
 	kvm_memory_region_save_params(kvm, &low_memory);
 	kvm_memory_region_save_params(kvm, &extended_memory);
 
-	*vm_mem = mmap(0, memory, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
+	*vm_mem = mmap(NULL, memory, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
 	if (*vm_mem == MAP_FAILED) {
 		fprintf(stderr, "mmap: %m\n");
 		return -1;
@@ -318,7 +318,7 @@ void *kvm_create_phys_mem(kvm_context_t kvm, unsigned long phys_start,
 	if (writable)
 		prot |= PROT_WRITE;
 
-	ptr = mmap(0, len, prot, MAP_SHARED, fd, phys_start);
+	ptr = mmap(NULL, len, prot, MAP_SHARED, fd, phys_start);
 	if (ptr == MAP_FAILED)
 		return 0;
 	return ptr;

[-- Attachment #3: Type: text/plain, Size: 315 bytes --]

-------------------------------------------------------------------------
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/

[-- Attachment #4: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

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

* Re: [PATCH] kvmctl.c: mmap() should be called with NULL rather than 0
       [not found] ` <9cde8bff0707230136x4cee0099s4452dcb2f52a49c7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2007-07-23  8:59   ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2007-07-23  8:59 UTC (permalink / raw)
  To: Nguyen Anh Quynh; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Nguyen Anh Quynh wrote:
> kvmctl.c: The first param of mmap() should be NULL rather than 0.
>

Applied, thanks.


-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
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-07-23  8:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-23  8:36 [PATCH] kvmctl.c: mmap() should be called with NULL rather than 0 Nguyen Anh Quynh
     [not found] ` <9cde8bff0707230136x4cee0099s4452dcb2f52a49c7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-07-23  8:59   ` Avi Kivity

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