qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [patch] Make qemu-nbd compile on OS X
       [not found] <4A9FE33F-BC49-4881-84CB-A751CCADB36D@hotmail.com>
@ 2008-06-02 17:44 ` C.W. Betts
  2008-06-02 18:21   ` Laurent Vivier
  2008-06-02 17:54 ` Daniel P. Berrange
  1 sibling, 1 reply; 5+ messages in thread
From: C.W. Betts @ 2008-06-02 17:44 UTC (permalink / raw)
  To: qemu-devel

The following is a patch to make qemu-nbd compile on Mac OS X Leopard  
(any other versions are untested)

Index: qemu-nbd.c
===================================================================
--- qemu-nbd.c	(revision 4654)
+++ qemu-nbd.c	(working copy)
@@ -21,7 +21,11 @@
  #include "block_int.h"
  #include "nbd.h"

+#ifdef __APPLE__
+#include <malloc/malloc.h>
+#else
  #include <malloc.h>
+#endif
  #include <stdarg.h>
  #include <stdio.h>
  #include <getopt.h>

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

* Re: [Qemu-devel] [patch] Make qemu-nbd compile on OS X
       [not found] <4A9FE33F-BC49-4881-84CB-A751CCADB36D@hotmail.com>
  2008-06-02 17:44 ` [Qemu-devel] [patch] Make qemu-nbd compile on OS X C.W. Betts
@ 2008-06-02 17:54 ` Daniel P. Berrange
  2008-06-02 18:34   ` Laurent Vivier
  2008-06-02 21:12   ` M. Warner Losh
  1 sibling, 2 replies; 5+ messages in thread
From: Daniel P. Berrange @ 2008-06-02 17:54 UTC (permalink / raw)
  To: qemu-devel

On Mon, Jun 02, 2008 at 11:44:17AM -0600, C.W. Betts wrote:
> The following is a patch to make qemu-nbd compile on Mac OS X Leopard  
> (any other versions are untested)
> 
> Index: qemu-nbd.c
> ===================================================================
> --- qemu-nbd.c	(revision 4654)
> +++ qemu-nbd.c	(working copy)
> @@ -21,7 +21,11 @@
>  #include "block_int.h"
>  #include "nbd.h"
> 
> +#ifdef __APPLE__
> +#include <malloc/malloc.h>
> +#else
>  #include <malloc.h>
> +#endif


The include of malloc.h looks rather bogus to me. malloc() is part
of stdlib.h, and is not even used in this file anyway. It compiles fine
on Linux if you remove include of malloc.h entirely

Regards,
Daniel.
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

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

* Re: [Qemu-devel] [patch] Make qemu-nbd compile on OS X
  2008-06-02 17:44 ` [Qemu-devel] [patch] Make qemu-nbd compile on OS X C.W. Betts
@ 2008-06-02 18:21   ` Laurent Vivier
  0 siblings, 0 replies; 5+ messages in thread
From: Laurent Vivier @ 2008-06-02 18:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: C.W. Betts

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

Le 2 juin 08 à 19:44, C.W. Betts a écrit :

> The following is a patch to make qemu-nbd compile on Mac OS X  
> Leopard (any other versions are untested)
>
> Index: qemu-nbd.c
> ===================================================================
> --- qemu-nbd.c	(revision 4654)
> +++ qemu-nbd.c	(working copy)
> @@ -21,7 +21,11 @@
> #include "block_int.h"
> #include "nbd.h"
>
> +#ifdef __APPLE__
> +#include <malloc/malloc.h>
> +#else
> #include <malloc.h>
> +#endif
> #include <stdarg.h>
> #include <stdio.h>
> #include <getopt.h>

You must also modify the configure: qemu-nbd is only compiled for  
linux (because others are not tested).
if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
   tools="qemu-img\$(EXESUF) $tools"
   if [ "$linux" = "yes" ] ; then
       tools="qemu-nbd\$(EXESUF) $tools"
   fi
fi
Regards,
Laurent
----------------------- Laurent Vivier ----------------------
"The best way to predict the future is to invent it."
- Alan Kay






[-- Attachment #2: Type: text/html, Size: 3722 bytes --]

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

* Re: [Qemu-devel] [patch] Make qemu-nbd compile on OS X
  2008-06-02 17:54 ` Daniel P. Berrange
@ 2008-06-02 18:34   ` Laurent Vivier
  2008-06-02 21:12   ` M. Warner Losh
  1 sibling, 0 replies; 5+ messages in thread
From: Laurent Vivier @ 2008-06-02 18:34 UTC (permalink / raw)
  To: Daniel P. Berrange, qemu-devel


Le 2 juin 08 à 19:54, Daniel P. Berrange a écrit :

> On Mon, Jun 02, 2008 at 11:44:17AM -0600, C.W. Betts wrote:
>> The following is a patch to make qemu-nbd compile on Mac OS X Leopard
>> (any other versions are untested)
>>
>> Index: qemu-nbd.c
>> ===================================================================
>> --- qemu-nbd.c	(revision 4654)
>> +++ qemu-nbd.c	(working copy)
>> @@ -21,7 +21,11 @@
>> #include "block_int.h"
>> #include "nbd.h"
>>
>> +#ifdef __APPLE__
>> +#include <malloc/malloc.h>
>> +#else
>> #include <malloc.h>
>> +#endif
>
>
> The include of malloc.h looks rather bogus to me. malloc() is part
> of stdlib.h, and is not even used in this file anyway. It compiles  
> fine
> on Linux if you remove include of malloc.h entirely


I agree, "man malloc" on MacOS X gives:

"MALLOC(3)                BSD Library Functions Manual                 
MALLOC(3)

NAME
      malloc, calloc, valloc, realloc, reallocf, free, malloc_size,
      malloc_good_size -- memory allocation

SYNOPSIS
      #include <stdlib.h>
..."

Laurent

----------------------- Laurent Vivier ----------------------
"The best way to predict the future is to invent it."
- Alan Kay

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

* Re: [Qemu-devel] [patch] Make qemu-nbd compile on OS X
  2008-06-02 17:54 ` Daniel P. Berrange
  2008-06-02 18:34   ` Laurent Vivier
@ 2008-06-02 21:12   ` M. Warner Losh
  1 sibling, 0 replies; 5+ messages in thread
From: M. Warner Losh @ 2008-06-02 21:12 UTC (permalink / raw)
  To: berrange, qemu-devel

In message: <20080602175417.GA19245@redhat.com>
            "Daniel P. Berrange" <berrange@redhat.com> writes:
: On Mon, Jun 02, 2008 at 11:44:17AM -0600, C.W. Betts wrote:
: > The following is a patch to make qemu-nbd compile on Mac OS X Leopard  
: > (any other versions are untested)
: > 
: > Index: qemu-nbd.c
: > ===================================================================
: > --- qemu-nbd.c	(revision 4654)
: > +++ qemu-nbd.c	(working copy)
: > @@ -21,7 +21,11 @@
: >  #include "block_int.h"
: >  #include "nbd.h"
: > 
: > +#ifdef __APPLE__
: > +#include <malloc/malloc.h>
: > +#else
: >  #include <malloc.h>
: > +#endif
: 
: 
: The include of malloc.h looks rather bogus to me. malloc() is part
: of stdlib.h, and is not even used in this file anyway. It compiles fine
: on Linux if you remove include of malloc.h entirely

Yes.  Years ago, malloc.h was typically needed for SunOS 4.x
compatibility.  Once malloc was codified to live in stdlib.h, malloc.h
was deprecated.

Warner

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

end of thread, other threads:[~2008-06-02 21:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <4A9FE33F-BC49-4881-84CB-A751CCADB36D@hotmail.com>
2008-06-02 17:44 ` [Qemu-devel] [patch] Make qemu-nbd compile on OS X C.W. Betts
2008-06-02 18:21   ` Laurent Vivier
2008-06-02 17:54 ` Daniel P. Berrange
2008-06-02 18:34   ` Laurent Vivier
2008-06-02 21:12   ` M. Warner Losh

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).