qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] NBD cleanup
@ 2008-06-07 12:24 Laurent Vivier
  2008-06-12 17:09 ` Anthony Liguori
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent Vivier @ 2008-06-07 12:24 UTC (permalink / raw)
  To: qemu-devel@nongnu.org

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

This patch removes include of malloc.h from qemu-nbd.c to make it
compile on OS X. (as reported by C.W. Betts and commented by Daniel P.
Berrange)
It adjusts a printf format in nbd.c.
-- 
------------- Laurent.Vivier@bull.net ---------------
"The best way to predict the future is to invent it."
- Alan Kay

[-- Attachment #2: nbd-cleanup.patch --]
[-- Type: text/x-patch, Size: 668 bytes --]

Index: nbd.c
===================================================================
--- nbd.c	(révision 4690)
+++ nbd.c	(copie de travail)
@@ -388,7 +388,7 @@
 	}
 
 	if (len > sizeof(data)) {
-		LOG("len (%u) is larger than max len (%u)",
+		LOG("len (%u) is larger than max len (%lu)",
 		    len, sizeof(data));
 		errno = EINVAL;
 		return -1;
Index: qemu-nbd.c
===================================================================
--- qemu-nbd.c	(révision 4690)
+++ qemu-nbd.c	(copie de travail)
@@ -21,7 +21,6 @@
 #include "block_int.h"
 #include "nbd.h"
 
-#include <malloc.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <getopt.h>

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

* Re: [Qemu-devel] [PATCH] NBD cleanup
  2008-06-07 12:24 [Qemu-devel] [PATCH] NBD cleanup Laurent Vivier
@ 2008-06-12 17:09 ` Anthony Liguori
  2008-06-18  7:08   ` Carlo Marcelo Arenas Belon
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony Liguori @ 2008-06-12 17:09 UTC (permalink / raw)
  To: qemu-devel

Laurent Vivier wrote:
> This patch removes include of malloc.h from qemu-nbd.c to make it
> compile on OS X. (as reported by C.W. Betts and commented by Daniel P.
> Berrange)
> It adjusts a printf format in nbd.c.
>   

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>

Regards,

Anthony Liguori

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

* Re: [Qemu-devel] [PATCH] NBD cleanup
  2008-06-12 17:09 ` Anthony Liguori
@ 2008-06-18  7:08   ` Carlo Marcelo Arenas Belon
  0 siblings, 0 replies; 3+ messages in thread
From: Carlo Marcelo Arenas Belon @ 2008-06-18  7:08 UTC (permalink / raw)
  To: qemu-devel

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

On Thu, Jun 12, 2008 at 12:09:02PM -0500, Anthony Liguori wrote:
> Laurent Vivier wrote:
> >This patch removes include of malloc.h from qemu-nbd.c to make it
> >compile on OS X. (as reported by C.W. Betts and commented by Daniel P.
> >Berrange)
> >It adjusts a printf format in nbd.c.

this last snippet avoids the following warning on amd64 linux (and other LP64
platforms) :

  nbd.c: In function `nbd_trip':
  nbd.c:391: warning: unsigned int format, different type arg (arg 7)

but will trigger something similar in x86 linux (and other ILP32 platforms)
where sizeof returns unsigned instead.

to prevent this line to keep getting changed back and forth (as shown by r4676
and the two currently proposed patches that touch nbd) to avoid this warning;
casting it to unsigned long as suggested in the attached patch (to be applied
instead of this one) should be enough, if probably not that elegant.

> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>

Reviewed-by: Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe>

Carlo

[-- Attachment #2: qemu-nbd-cleanup.patch --]
[-- Type: text/plain, Size: 679 bytes --]

Index: nbd.c
===================================================================
--- nbd.c	(revision 4745)
+++ nbd.c	(working copy)
@@ -388,8 +388,8 @@
 	}
 
 	if (len > sizeof(data)) {
-		LOG("len (%u) is larger than max len (%u)",
-		    len, sizeof(data));
+		LOG("len (%u) is larger than max len (%lu)",
+		    len, (unsigned long)sizeof(data));
 		errno = EINVAL;
 		return -1;
 	}
Index: qemu-nbd.c
===================================================================
--- qemu-nbd.c	(revision 4745)
+++ qemu-nbd.c	(working copy)
@@ -21,7 +21,6 @@
 #include "block_int.h"
 #include "nbd.h"
 
-#include <malloc.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <getopt.h>

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

end of thread, other threads:[~2008-06-18  6:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-07 12:24 [Qemu-devel] [PATCH] NBD cleanup Laurent Vivier
2008-06-12 17:09 ` Anthony Liguori
2008-06-18  7:08   ` Carlo Marcelo Arenas Belon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).