Richard W.M. Jones
2010-Mar-21 17:21 UTC
[Libguestfs] [PATCH 0/10] Miscellaneous patches to fix some compile problems on Mac OS X
Patches 1-6 are general code quality improvements. Note that Guido previously asked us for the ability to build libguestfs without building the appliance. Patches 7-10 are specific to Mac OS X, but shouldn't break the build for existing platforms. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
Richard W.M. Jones
2010-Mar-21 17:22 UTC
[Libguestfs] [PATCH 1/10] configure: Move host_cpu definition to earlier in the file.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html -------------- next part -------------->From e352a8c5ec44ea43de23949748f1e8607cf78e37 Mon Sep 17 00:00:00 2001From: Richard Jones <rich at koneko.home.annexia.org> Date: Sun, 21 Mar 2010 16:32:27 +0000 Subject: [PATCH 01/10] configure: Move host_cpu definition to earlier in the file. --- configure.ac | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index aa757dc..e9d0fc0 100644 --- a/configure.ac +++ b/configure.ac @@ -128,6 +128,9 @@ AC_SYS_LARGEFILE dnl Check sizeof long. AC_CHECK_SIZEOF([long]) +dnl Define a C symbol for the host CPU architecture. +AC_DEFINE_UNQUOTED([host_cpu],["$host_cpu"],[Host architecture.]) + dnl Headers. AC_CHECK_HEADERS([errno.h sys/types.h sys/un.h sys/wait.h sys/socket.h endian.h byteswap.h]) @@ -335,9 +338,6 @@ AC_ARG_WITH([updates], UPDATES="$with_updates" AC_SUBST(UPDATES) -dnl Define a symbol for the host CPU architecture. -AC_DEFINE_UNQUOTED([host_cpu],["$host_cpu"],[Host architecture.]) - dnl --with-mirror to specify a local Fedora mirror. AC_ARG_WITH([mirror], [AS_HELP_STRING([--with-mirror], -- 1.6.4.1
Richard W.M. Jones
2010-Mar-21 17:23 UTC
[Libguestfs] [PATCH 2/10] Run qemu with -nographic option.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw -------------- next part -------------->From 6f0c788d45fa1be2140c46c2b375243241c29828 Mon Sep 17 00:00:00 2001From: Richard Jones <rich at koneko.home.annexia.org> Date: Sun, 21 Mar 2010 16:33:37 +0000 Subject: [PATCH 02/10] Run qemu with -nographic option. On Mac OS X this prevents a short "flash" as qemu opens a toplevel window. --- configure.ac | 6 +++--- src/guestfs.c | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index e9d0fc0..93b6256 100644 --- a/configure.ac +++ b/configure.ac @@ -176,7 +176,7 @@ dnl fallback to null vmchannel (still using SLIRP). See the dnl discussion in the README file. if test "x$vmchannel_test" != "xno"; then AC_MSG_CHECKING([for guestfwd support in $QEMU]) - if $QEMU --help | grep -sq guestfwd; then + if $QEMU -nographic --help | grep -sq guestfwd; then AC_MSG_RESULT([yes]) vmchannel_guestfwd=guestfwd else @@ -185,7 +185,7 @@ if test "x$vmchannel_test" != "xno"; then # test failing. This is because recent qemu will throw # up an SDL window and hang if we try to run this test. AC_MSG_CHECKING([for "-net channel" (old guestfwd) support in $QEMU]) - vmchannelout=`$QEMU -net channel /dev/zero 2>&1 ||:` + vmchannelout=`$QEMU -nographic -net channel /dev/zero 2>&1 ||:` echo "vmchannel test command output: $vmchannelout" >&AS_MESSAGE_LOG_FD if echo "$vmchannelout" | grep -sq "vmchannel wrong port number" ; then AC_MSG_RESULT([yes]) @@ -197,7 +197,7 @@ if test "x$vmchannel_test" != "xno"; then fi AC_MSG_CHECKING([for "-net user" (user mode network) support in $QEMU]) - if $QEMU --help | grep -sq -- "-net user"; then + if $QEMU -nographic --help | grep -sq -- "-net user"; then AC_MSG_RESULT([yes]) vmchannel_net_user=yes else diff --git a/src/guestfs.c b/src/guestfs.c index 02d5fdb..e308044 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -1620,7 +1620,7 @@ test_qemu (guestfs_h *g) char cmd[1024]; FILE *fp; - snprintf (cmd, sizeof cmd, "LC_ALL=C '%s' -help", g->qemu); + snprintf (cmd, sizeof cmd, "LC_ALL=C '%s' -nographic -help", g->qemu); fp = popen (cmd, "r"); /* qemu -help should always work (qemu -version OTOH wasn't @@ -1642,7 +1642,8 @@ test_qemu (guestfs_h *g) if (pclose (fp) == -1) goto error; - snprintf (cmd, sizeof cmd, "LC_ALL=C '%s' -version 2>/dev/null", g->qemu); + snprintf (cmd, sizeof cmd, "LC_ALL=C '%s' -nographic -version 2>/dev/null", + g->qemu); fp = popen (cmd, "r"); if (fp) { -- 1.6.4.1
Richard W.M. Jones
2010-Mar-21 17:23 UTC
[Libguestfs] [PATCH 3/10] configure: Add --disable-daemon and --disable-appliance options.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v -------------- next part -------------->From a6da2b2a9510ec8486d29428d96b850f1de1f438 Mon Sep 17 00:00:00 2001From: Richard Jones <rich at koneko.home.annexia.org> Date: Sun, 21 Mar 2010 16:03:16 +0000 Subject: [PATCH 03/10] configure: Add --disable-daemon and --disable-appliance options. Use these on any platforms where you don't want or need to build the daemon/appliance combination. --- Makefile.am | 15 ++++- configure.ac | 177 +++++++++++++++++++++++++++++++++------------------------- 2 files changed, 113 insertions(+), 79 deletions(-) diff --git a/Makefile.am b/Makefile.am index c1fc85d..df34d38 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ # libguestfs -# Copyright (C) 2009 Red Hat Inc. +# Copyright (C) 2009-2010 Red Hat Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,8 +19,17 @@ include $(top_srcdir)/subdir-rules.mk ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = gnulib/lib src daemon appliance fish po examples images \ - gnulib/tests capitests regressions test-tool +SUBDIRS = gnulib/lib src + +if ENABLE_DAEMON +SUBDIRS += daemon +endif +if ENABLE_APPLIANCE +SUBDIRS += appliance +endif + +SUBDIRS += fish po examples images +SUBDIRS += gnulib/tests capitests regressions test-tool # NB: Must build inspector directory after perl and before ocaml. # We could relax this if we combined the inspector_generator with diff --git a/configure.ac b/configure.ac index 93b6256..b13eaf9 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ # libguestfs -# Copyright (C) 2009 Red Hat Inc. +# Copyright (C) 2009-2010 Red Hat Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -134,6 +134,26 @@ AC_DEFINE_UNQUOTED([host_cpu],["$host_cpu"],[Host architecture.]) dnl Headers. AC_CHECK_HEADERS([errno.h sys/types.h sys/un.h sys/wait.h sys/socket.h endian.h byteswap.h]) +dnl Build the daemon? +AC_MSG_CHECKING([if we should build the daemon]) +AC_ARG_ENABLE([daemon], + [AS_HELP_STRING([--enable-daemon], + [enable building the daemon @<:@default=yes@:>@])], + [], + [enable_daemon=yes]) +AM_CONDITIONAL([ENABLE_DAEMON],[test "x$enable_daemon" = "xyes"]) +AC_MSG_RESULT([$enable_daemon]) + +dnl Build the appliance? +AC_MSG_CHECKING([if we should build the appliance]) +AC_ARG_ENABLE([appliance], + [AS_HELP_STRING([--enable-appliance], + [enable building the appliance @<:@default=yes@:>@])], + [], + [enable_appliance=yes]) +AM_CONDITIONAL([ENABLE_APPLIANCE],[test "x$enable_appliance" = "xyes"]) +AC_MSG_RESULT([$enable_appliance]) + dnl Check for rpcgen and XDR library. rpcgen is optional. AC_CHECK_PROG([RPCGEN],[rpcgen],[rpcgen],[no]) AM_CONDITIONAL([HAVE_RPCGEN],[test "x$RPCGEN" != "xno"]) @@ -251,59 +271,60 @@ AC_ARG_WITH([net-if], AC_DEFINE_UNQUOTED([NET_IF],["$with_net_if"],[Default network interface.]) dnl Check for febootstrap etc. -AC_CHECK_PROG([FEBOOTSTRAP], - [febootstrap],[febootstrap],[no]) -if test "x$FEBOOTSTRAP" != "xno"; then - AC_CHECK_PROG([FEBOOTSTRAP_RUN], - [febootstrap-run],[febootstrap-run],[no]) - test "x$FEBOOTSTRAP_RUN" = "xno" && \ - AC_MSG_ERROR([febootstrap-run must be installed]) - AC_CHECK_PROG([FEBOOTSTRAP_INSTALL], - [febootstrap-install],[febootstrap-install],[no]) - test "x$FEBOOTSTRAP_INSTALL" = "xno" && \ - AC_MSG_ERROR([febootstrap-install must be installed]) - AC_CHECK_PROG([FEBOOTSTRAP_MINIMIZE], - [febootstrap-minimize],[febootstrap-minimize],[no]) - test "x$FEBOOTSTRAP_MINIMIZE" = "xno" && \ - AC_MSG_ERROR([febootstrap-minimize must be installed]) - AC_CHECK_PROG([FEBOOTSTRAP_TO_INITRAMFS], - [febootstrap-to-initramfs],[febootstrap-to-initramfs],[no]) - test "x$FEBOOTSTRAP_TO_INITRAMFS" = "xno" && \ - AC_MSG_ERROR([febootstrap-to-initramfs must be installed]) - - dnl Check we have fakechroot >= 2.9 (it's an indirect requirement - dnl of febootstrap, but old versions will fail with yum). - AC_CHECK_PROG([FAKECHROOT], - [fakechroot],[fakechroot],[no]) - test "x$FAKECHROOT" = "xno" && \ - AC_MSG_ERROR([fakechroot must be installed]) - - AC_MSG_CHECKING([fakechroot version]) - fakechroot_version=`$FAKECHROOT --version | awk '{print $3}'` - if test -z "$fakechroot_version"; then - AC_MSG_RESULT([failed]) - AC_MSG_WARN([fakechroot --version command failed, proceeding anyway]) - else - AC_MSG_RESULT([$fakechroot_version]) - fakechroot_major=`echo "$fakechroot_version" | awk -F. '{print $1}'` - fakechroot_minor=`echo "$fakechroot_version" | awk -F. '{print $2}'` - if test "$fakechroot_major" -lt 2 -o \ +if test "x$enable_appliance" = "xyes"; then + AC_CHECK_PROG([FEBOOTSTRAP], + [febootstrap],[febootstrap],[no]) + if test "x$FEBOOTSTRAP" != "xno"; then + AC_CHECK_PROG([FEBOOTSTRAP_RUN], + [febootstrap-run],[febootstrap-run],[no]) + test "x$FEBOOTSTRAP_RUN" = "xno" && \ + AC_MSG_ERROR([febootstrap-run must be installed]) + AC_CHECK_PROG([FEBOOTSTRAP_INSTALL], + [febootstrap-install],[febootstrap-install],[no]) + test "x$FEBOOTSTRAP_INSTALL" = "xno" && \ + AC_MSG_ERROR([febootstrap-install must be installed]) + AC_CHECK_PROG([FEBOOTSTRAP_MINIMIZE], + [febootstrap-minimize],[febootstrap-minimize],[no]) + test "x$FEBOOTSTRAP_MINIMIZE" = "xno" && \ + AC_MSG_ERROR([febootstrap-minimize must be installed]) + AC_CHECK_PROG([FEBOOTSTRAP_TO_INITRAMFS], + [febootstrap-to-initramfs],[febootstrap-to-initramfs],[no]) + test "x$FEBOOTSTRAP_TO_INITRAMFS" = "xno" && \ + AC_MSG_ERROR([febootstrap-to-initramfs must be installed]) + + dnl Check we have fakechroot >= 2.9 (it's an indirect requirement + dnl of febootstrap, but old versions will fail with yum). + AC_CHECK_PROG([FAKECHROOT], + [fakechroot],[fakechroot],[no]) + test "x$FAKECHROOT" = "xno" && \ + AC_MSG_ERROR([fakechroot must be installed]) + + AC_MSG_CHECKING([fakechroot version]) + fakechroot_version=`$FAKECHROOT --version | awk '{print $3}'` + if test -z "$fakechroot_version"; then + AC_MSG_RESULT([failed]) + AC_MSG_WARN([fakechroot --version command failed, proceeding anyway]) + else + AC_MSG_RESULT([$fakechroot_version]) + fakechroot_major=`echo "$fakechroot_version" | awk -F. '{print $1}'` + fakechroot_minor=`echo "$fakechroot_version" | awk -F. '{print $2}'` + if test "$fakechroot_major" -lt 2 -o \ \( "$fakechroot_major" -eq 2 -a "$fakechroot_minor" -lt 9 \); then - AC_MSG_ERROR([fakechroot version must be >= 2.9]) - fi - fi - DIST="REDHAT" -else - # check for debootstrap and debirf - AC_CHECK_PROG([DEBOOTSTRAP], - [debootstrap],[debootstrap],[no]) - test "x$DEBOOTSTRAP" = "xno" && \ - AC_MSG_ERROR([Either febootstrap or debootstrap must be installed]) - AC_CHECK_PROG([DEBIRF],[debirf],[debirf],[no]) - test "x$DEBIRF" = "xno" && - AC_MSG_ERROR([debirf must be installed]) - DIST="DEBIAN" - case "$host_cpu" in + AC_MSG_ERROR([fakechroot version must be >= 2.9]) + fi + fi + DIST="REDHAT" + else + # check for debootstrap and debirf + AC_CHECK_PROG([DEBOOTSTRAP], + [debootstrap],[debootstrap],[no]) + test "x$DEBOOTSTRAP" = "xno" && \ + AC_MSG_ERROR([Either febootstrap or debootstrap must be installed]) + AC_CHECK_PROG([DEBIRF],[debirf],[debirf],[no]) + test "x$DEBIRF" = "xno" && + AC_MSG_ERROR([debirf must be installed]) + DIST="DEBIAN" + case "$host_cpu" in *86) DEBIAN_KERNEL_ARCH=486 ;; @@ -313,11 +334,29 @@ else *) DEBIAN_KERNEL_ARCH=$host_cpu ;; - esac - AC_SUBST(DEBIAN_KERNEL_ARCH) -fi -AC_SUBST(DIST) + esac + AC_SUBST(DEBIAN_KERNEL_ARCH) + fi + AC_SUBST(DIST) + dnl --with-updates to specify a Fedora updates repository. + AC_ARG_WITH([updates], + [AS_HELP_STRING([--with-updates], + [set name of Fedora updates repository @<:@default=updates-released-f11@:>@])], + [], + [with_updates=updates-released-f11]) + UPDATES="$with_updates" + AC_SUBST(UPDATES) + + dnl --with-mirror to specify a local Fedora mirror. + AC_ARG_WITH([mirror], + [AS_HELP_STRING([--with-mirror], + [set URI of a local Fedora mirror])], + [], + [with_mirror=]) + MIRROR="$with_mirror" + AC_SUBST(MIRROR) +fi dnl --with-repo to specify a Fedora repository. AC_ARG_WITH([repo], @@ -329,24 +368,6 @@ REPO="$with_repo" AC_SUBST(REPO) AC_DEFINE_UNQUOTED([REPO],["$REPO"],[Name of Fedora repository.]) -dnl --with-updates to specify a Fedora updates repository. -AC_ARG_WITH([updates], - [AS_HELP_STRING([--with-updates], - [set name of Fedora updates repository @<:@default=updates-released-f11@:>@])], - [], - [with_updates=updates-released-f11]) -UPDATES="$with_updates" -AC_SUBST(UPDATES) - -dnl --with-mirror to specify a local Fedora mirror. -AC_ARG_WITH([mirror], - [AS_HELP_STRING([--with-mirror], - [set URI of a local Fedora mirror])], - [], - [with_mirror=]) -MIRROR="$with_mirror" -AC_SUBST(MIRROR) - dnl Build the supermin appliance? Please see README file before dnl enabling this option. AC_ARG_ENABLE([supermin], @@ -712,7 +733,9 @@ MAX_PROC_NR=`cat $srcdir/src/MAX_PROC_NR` AC_SUBST(MAX_PROC_NR) dnl Run in subdirs. -AC_CONFIG_SUBDIRS([daemon]) +if test "x$enable_daemon" = "xyes"; then + AC_CONFIG_SUBDIRS([daemon]) +fi dnl Produce output files. AC_CONFIG_HEADERS([config.h]) @@ -754,6 +777,8 @@ echo "Thank you for downloading $PACKAGE_STRING" echo echo "This is how we have configured the optional components for you today:" echo +echo "Daemon .............................. $enable_daemon" +echo "Appliance ........................... $enable_appliance" echo "QEMU ................................ $QEMU" echo -n "OCaml bindings ...................... " if test "x$HAVE_OCAML_TRUE" = "x"; then echo "yes"; else echo "no"; fi -- 1.6.4.1
Richard W.M. Jones
2010-Mar-21 17:24 UTC
[Libguestfs] [PATCH 4/10] Remove out-of-date comment.
This comment is irrelevant because we did in fact combine the two generators together. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top -------------- next part -------------->From 68c7c6b56c828f8e1a79bf4cfb716f0685fec82d Mon Sep 17 00:00:00 2001From: Richard Jones <rich at koneko.home.annexia.org> Date: Sun, 21 Mar 2010 16:04:09 +0000 Subject: [PATCH 04/10] Remove out-of-date comment. --- Makefile.am | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index df34d38..87da5a8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,9 +31,6 @@ endif SUBDIRS += fish po examples images SUBDIRS += gnulib/tests capitests regressions test-tool -# NB: Must build inspector directory after perl and before ocaml. -# We could relax this if we combined the inspector_generator with -# the ordinary generator, but that brings other problems. if HAVE_PERL SUBDIRS += perl endif -- 1.6.4.1
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/ -------------- next part -------------->From 91ed44eae5e64c91d28fc90135c41bd44d126108 Mon Sep 17 00:00:00 2001From: Richard Jones <rich at koneko.home.annexia.org> Date: Sun, 21 Mar 2010 16:06:30 +0000 Subject: [PATCH 05/10] Ignore m4/intmax.m4 --- m4/.gitignore | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/m4/.gitignore b/m4/.gitignore index 0880f75..1655cff 100644 --- a/m4/.gitignore +++ b/m4/.gitignore @@ -168,3 +168,4 @@ xsize.m4 /usleep.m4 /stdarg.m4 /xvasprintf.m4 +/intmax.m4 -- 1.6.4.1
Richard W.M. Jones
2010-Mar-21 17:25 UTC
[Libguestfs] [PATCH 6/10] generator: Small fix for GODI users.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top -------------- next part -------------->From 25c3fb47811749f7acda4d5bad7882eff4cc9083 Mon Sep 17 00:00:00 2001From: Richard Jones <rich at koneko.home.annexia.org> Date: Sun, 21 Mar 2010 17:13:07 +0000 Subject: [PATCH 06/10] generator: Small fix for GODI users. GODI has an odd package layout, so the generator was unable to find xml-light. Add the GODI directory to the search path. --- src/generator.ml | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/generator.ml b/src/generator.ml index fdd228e..92a7735 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -42,6 +42,7 @@ #load "unix.cma";; #load "str.cma";; #directory "+xml-light";; +#directory "+../pkg-lib/xml-light";; (* for GODI users *) #load "xml-light.cma";; open Unix -- 1.6.4.1
Richard W.M. Jones
2010-Mar-21 17:25 UTC
[Libguestfs] [PATCH 7/10] Mac OS X: kill(2) requires <signal.h>
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html -------------- next part -------------->From 0862cdf0a92d173d2955b0d0f10a710a7d6d72c3 Mon Sep 17 00:00:00 2001From: Richard Jones <rich at koneko.home.annexia.org> Date: Sun, 21 Mar 2010 17:14:15 +0000 Subject: [PATCH 07/10] Mac OS X: kill(2) requires <signal.h> --- src/guestfs.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/guestfs.c b/src/guestfs.c index e308044..01e37cf 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -33,6 +33,7 @@ #include <sys/stat.h> #include <sys/select.h> #include <dirent.h> +#include <signal.h> #include <rpc/types.h> #include <rpc/xdr.h> -- 1.6.4.1
Richard W.M. Jones
2010-Mar-21 17:25 UTC
[Libguestfs] [PATCH 8/10] Mac OS X: define MAX macro if not already defined.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html -------------- next part -------------->From c7648e6d3d32218bc8947f5572c730aeaddb7a49 Mon Sep 17 00:00:00 2001From: Richard Jones <rich at koneko.home.annexia.org> Date: Sun, 21 Mar 2010 17:14:37 +0000 Subject: [PATCH 08/10] Mac OS X: define MAX macro if not already defined. --- src/guestfs.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/guestfs.c b/src/guestfs.c index 01e37cf..a00e8db 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -96,6 +96,10 @@ static int qemu_supports (guestfs_h *g, const char *option); #define UNIX_PATH_MAX 108 +#ifndef MAX +#define MAX(a,b) ((a)>(b)?(a):(b)) +#endif + /* Also in guestfsd.c */ #define GUESTFWD_ADDR "10.0.2.4" #define GUESTFWD_PORT "6666" -- 1.6.4.1
Richard W.M. Jones
2010-Mar-21 17:26 UTC
[Libguestfs] [PATCH 9/10] Mac OS X: strerror_r on Macs is not like GNU strerror_r.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v -------------- next part -------------->From 5cdfcf8c74aff89ea342afec6a296bee0c9d447a Mon Sep 17 00:00:00 2001From: Richard Jones <rich at koneko.home.annexia.org> Date: Sun, 21 Mar 2010 17:15:26 +0000 Subject: [PATCH 09/10] Mac OS X: strerror_r on Macs is not like GNU strerror_r. Really this should be turned into a configure-time test. Perhaps one exists already? --- src/guestfs.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/guestfs.c b/src/guestfs.c index a00e8db..01642b4 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -395,7 +395,7 @@ guestfs_perrorf (guestfs_h *g, const char *fs, ...) if (err < 0) return; -#ifndef _GNU_SOURCE +#if !defined(_GNU_SOURCE) || defined(__APPLE__) char buf[256]; strerror_r (errnum, buf, sizeof buf); #else -- 1.6.4.1
Richard W.M. Jones
2010-Mar-21 17:26 UTC
[Libguestfs] [PATCH 10/10] Mac OS X: Fix HAVE_GNU_CALLOC so it works when __GLIBC__ is not defined.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html -------------- next part -------------->From 13c0c9c47df55e86363821deeb1f5d78cb38ea86 Mon Sep 17 00:00:00 2001From: Richard Jones <rich at koneko.home.annexia.org> Date: Sun, 21 Mar 2010 17:16:04 +0000 Subject: [PATCH 10/10] Mac OS X: Fix HAVE_GNU_CALLOC so it works when __GLIBC__ is not defined. --- src/guestfs.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/guestfs.c b/src/guestfs.c index 01642b4..61e9302 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -439,7 +439,11 @@ guestfs_safe_malloc (guestfs_h *g, size_t nbytes) /* Technically we should add an autoconf test for this, testing for the desired functionality, like what's done in gnulib, but for now, this is fine. */ +#if defined(__GLIBC__) #define HAVE_GNU_CALLOC (__GLIBC__ >= 2) +#else +#define HAVE_GNU_CALLOC 0 +#endif /* Allocate zeroed memory for N elements of S bytes, with error checking. S must be nonzero. */ -- 1.6.4.1
Maybe Matching Threads
- [PATCH 0/4] Another four patches to get guestfish working
- [PATCH 0/9] Enhance virt-resize so it can really expand Linux and Windows guests
- [PATCH 0/13 v2] Prepare for adding write support to hivex (Windows registry) library
- [PATCH febootstrap 0/8] Add support for building an ext2-based appliance
- [PATCH 0/7] Prepare for adding write support to hivex (windows registry) library