[libvirt] [PATCH] autogen: allow aclocal to receive arguments via an environment variable
by Justin Clift
On Mac OS X, the "Homebrew" build system (one of the three main ones)
has its m4 macro directory placed in a user configurable location.
This patch adds a simple way to pass this configuration information to
aclocal, using an environment variable called ACLOCAL_FLAGS. This allows
the packaging of libvirt into the Homebrew build system.
ie:
$ export ACLOCAL_FLAGS="-I /path/to/m4/macro/dir/"
---
Although this patch works, I'm kind of expecting Eric will have a better way
of achieving what this is trying to do, so this will get NACKed. No stress. :)
README-hacking | 6 ++++++
bootstrap | 2 +-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/README-hacking b/README-hacking
index 80b022c..74f3bed 100644
--- a/README-hacking
+++ b/README-hacking
@@ -33,6 +33,12 @@ reduce download time and disk space requirements:
$ export GNULIB_SRCDIR=/path/to/gnulib
+Also, if you have M4 macro files (.m4) in a non-standard location,
+you can include them in the build process with the ACLOCAL_FLAGS
+environment variable:
+
+ $ export ACLOCAL_FLAGS="-I /path/to/extra/macro/dir"
+
The next step is to get all required pieces from gnulib,
to run autoreconf, and to invoke ./configure:
diff --git a/bootstrap b/bootstrap
index 2422549..593e0b2 100755
--- a/bootstrap
+++ b/bootstrap
@@ -775,7 +775,7 @@ grep -E '^[ ]*AC_CONFIG_HEADERS?\>' configure.ac >/dev/null ||
for command in \
libtool \
- "${ACLOCAL-aclocal} --force -I m4" \
+ "${ACLOCAL-aclocal} --force -I m4 ${ACLOCAL_FLAGS}" \
"${AUTOCONF-autoconf} --force" \
"${AUTOHEADER-autoheader} --force" \
"${AUTOMAKE-automake} --add-missing --copy --force-missing"
--
1.7.2.1
14 years, 1 month
[libvirt] [PATCH V2] Rework configure logic for virtualport support
by Stefan Berger
V2:
- added missing AC_ARG_WITH() for --with-virtualport
In this patch I am reworking the logic around detecting virtual port
support and requiring the libnl dependency.
- It requires --with-macvtap and displays an error in case of
--without-macvtap --with-virtualport.
- It tests for availability of certain data in include files and
displays an error in case the include file is not at the correct level
and --with-virtualport was chosen
- displays 'checking' messages for macvtap and virtualport support and
results
- libnl support is required when macvtap is found or requested; if libnl
is not there, please supply without-macvtap
Signed-off-by: Stefan Berger <stefanb(a)us.ibm.com>
diff --git a/configure.ac b/configure.ac
index 6100610..da38b8b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2058,6 +2058,7 @@ AC_ARG_WITH([macvtap],
[with_macvtap=${withval}],
[with_macvtap=check])
+AC_MSG_CHECKING([whether to compile with macvtap support])
if test "$with_macvtap" != "no" ; then
AC_TRY_COMPILE([ #include <sys/socket.h>
#include <linux/rtnetlink.h> ],
@@ -2075,19 +2076,35 @@ if test "$with_macvtap" != "no" ; then
AC_DEFINE_UNQUOTED([WITH_MACVTAP], $val, [whether macvtap support
is enabled])
fi
AM_CONDITIONAL([WITH_MACVTAP], [test "$with_macvtap" = "yes"])
+AC_MSG_RESULT([$with_macvtap])
-AC_TRY_COMPILE([ #include <sys/socket.h>
- #include <linux/rtnetlink.h> ],
- [ int x = IFLA_PORT_MAX; ],
- [ with_virtualport=yes ],
- [ with_virtualport=no ])
-if test "$with_virtualport" = "yes"; then
- val=1
-else
- val=0
+AC_ARG_WITH([virtualport],
+ AC_HELP_STRING([--with-virtualport],[enable virtual port support
@<:@default=check@:>@]),
+ [with_virtualport=${withval}],
+ [with_virtualport=check])
+
+if test "$with_virtualport" != "no"; then
+ if test "$with_macvtap" = "no"; then
+ AC_MSG_ERROR([--with-virtualport requires --with-macvtap])
+ fi
+ AC_MSG_CHECKING([whether to compile with virtual port support])
+ AC_TRY_COMPILE([ #include <sys/socket.h>
+ #include <linux/rtnetlink.h> ],
+ [ int x = IFLA_PORT_MAX; ],
+ [ with_virtualport=yes ],
+ [ if test "$with_virtualport" = "yes" ; then
+ AC_MSG_ERROR([Installed linux headers don't
show support for virtual port support.])
+ fi
+ with_virtualport=no ])
+ if test "$with_virtualport" = "yes"; then
+ val=1
+ else
+ val=0
+ fi
+ AC_DEFINE_UNQUOTED([WITH_VIRTUALPORT], $val,
+ [whether vsi vepa support is enabled])
+ AC_MSG_RESULT([$with_virtualport])
fi
-AC_DEFINE_UNQUOTED([WITH_VIRTUALPORT], $val,
- [whether vsi vepa support is enabled])
AM_CONDITIONAL([WITH_VIRTUALPORT], [test "$with_virtualport" = "yes"])
@@ -2096,7 +2113,7 @@ dnl netlink library
LIBNL_CFLAGS=""
LIBNL_LIBS=""
-if test "$with_macvtap" = "yes" || test "$with_virtualport" = "yes"; then
+if test "$with_macvtap" = "yes"; then
PKG_CHECK_MODULES([LIBNL], [libnl-1 >= $LIBNL_REQUIRED], [
], [
AC_MSG_ERROR([libnl >= $LIBNL_REQUIRED is required for macvtap
support])
14 years, 1 month
[libvirt] [PATCH] mpath: disable devmapper-multipath checking on non-linux
by Justin Clift
The configure script was breaking on MacOS X unless passed:
--without-storage-mpath
This patch leverages Stefan Bergers earlier work for nwfilter,
so non-linux systems don't even attempt to build multipath.
---
configure.ac | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/configure.ac b/configure.ac
index 8dcd756..ee6f9b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1503,7 +1503,15 @@ if test "$with_storage_scsi" = "check"; then
fi
AM_CONDITIONAL([WITH_STORAGE_SCSI], [test "$with_storage_scsi" = "yes"])
-if test "$with_storage_mpath" = "check"; then
+with_linux=no
+case "$host" in
+ *-*-linux*)
+ with_linux=yes
+ ;;
+esac
+AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"])
+
+if test "$with_storage_mpath" = "check" && test "$with_linux" = "yes"; then
with_storage_mpath=yes
AC_DEFINE_UNQUOTED([WITH_STORAGE_MPATH], 1,
@@ -2022,14 +2030,6 @@ then
fi
AM_CONDITIONAL([WITH_NODE_DEVICES], [test "$with_nodedev" = "yes"])
-with_linux=no
-case "$host" in
- *-*-linux*)
- with_linux=yes
- ;;
-esac
-AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"])
-
with_nwfilter=yes
if test "$with_libvirtd" = "no" || test "$with_linux" != "yes"; then
--
1.7.3
14 years, 1 month
[libvirt] [PATCH] autogen: added glibtool and pkg-config checks
by Justin Clift
OSX MacPorts has libtool named as glibtool, with libtoolize
named as glibtoolize. This patch adds support for this, and also
adds a check for pkg-config, to warn when it is missing.
---
autogen.sh | 25 ++++++++++++++++++++-----
1 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/autogen.sh b/autogen.sh
index 01ba59c..810a189 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -25,11 +25,18 @@ DIE=0
}
(libtool --version) < /dev/null > /dev/null 2>&1 || {
- echo
- echo "You must have libtool installed to compile libvirt."
- echo "Download the appropriate package for your distribution,"
- echo "or see http://www.gnu.org/software/libtool"
- DIE=1
+ # GNU libtool wasn't found as "libtool",
+ # so we check if it's known as "glibtool"
+ (glibtool --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have libtool installed to compile libvirt."
+ echo "Download the appropriate package for your distribution,"
+ echo "or see http://www.gnu.org/software/libtool"
+ DIE=1
+ }
+ # These are only used if glibtool is what we want
+ export LIBTOOL=glibtool
+ export LIBTOOLIZE=glibtoolize
}
(automake --version) < /dev/null > /dev/null 2>&1 || {
@@ -40,6 +47,14 @@ DIE=0
echo "or see http://www.gnu.org/software/automake"
}
+(pkg-config --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ DIE=1
+ echo "You must have pkg-config installed to compile libvirt."
+ echo "Download the appropriate package for your distribution,"
+ echo "or see http://pkg-config.freedesktop.org"
+}
+
if test "$DIE" -eq 1; then
exit 1
fi
--
1.7.2.2
14 years, 1 month
[libvirt] RFC: add <currentVcpu> element
by Eric Blake
Some hypervisors have the ability to hot-plug VCPUs exposed to the
guest. Right now, libvirt XML only has the ability to describe the
total number of vcpus assigned to a domain (the <vcpu> element under
<domain>). It has the following APIs:
virConnectGetMaxVcpus - provide maximum that host can assign to guests
virDomainGetMaxVcpus - if domain is active, then max it was booted with;
if inactive, then same as virConnectGetMaxVcpus
virDomainSetVcpus - change current vcpus assigned to domain; active
domain only
virDomainPinVcpu - control how vcpus are pinned; active domain only
virDomainGetVcpus - detailed map of how vcpus are mapped to host cpus
And virsh has these commands:
setvcpus - maps to virDomainSetVcpus
vcpuinfo - maps to virDomainGetVcpus
vcpupin - maps to virDomainPinVcpu
https://bugzilla.redhat.com/show_bug.cgi?id=545118 describes the use
case of booting a Xen HV with one value set for the maximum vcpu count,
but another value for the current count. Technically, this can already
be approximated by calling virDomainSetVcpus immediately after the guest
is booted, but that can be resource-intensive, compared to the
alternative of using xen's command line options to boot with a smaller
current value than the maximum, and only later hot-plugging additional
vcpus when needed (up to the maximum set at boot time). And it is not
persistent, so the extra vcpus must be manually unplugged every boot.
At the XML layer, I'm proposing the addition of a new element <currentVcpu>:
<domain ...>
<vcpu>2</vcpu>
<currentVcpu>1</vcpu>
...
If absent, then we keep the status quo of starting the domain with the
same number of vcpus as the maximum. If present, it must be between 1
and <vcpu> inclusive (where supported, and exactly <vcpu> for
hypervisors that lack vcpu hot-plug support), and dumping the xml of a
domain will update the element to match virDomainSetVcpus; this provides
the persistence aspect, and allows domain startup to take advantage of
any command line options to start with a reduced current vcpu count
rather than having to unplug vcpus after the fact.
At the library API layer, I plan on adding:
virDomainSetMaxVcpus - alter the <vcpu> xml aspect of a domain for next
boot; only affects persistent state
virDomainSetVcpusFlags - alter the <currentVcpu> xml aspect of a domain,
with a flag to state whether the change is persistent (inactive domains
or affecting next boot of active domain) or live (active domains only).
and altering:
virDomainSetVcpus - can additionally be used on inactive domains to
affect next boot; no change to active semantics, basically now a wrapper
for virDomainSetVcpusFlags(,0)
virDomainGetMaxVcpus - on inactive domains, this value now matches the
<vcpu> setting rather than blindly matching virConnectGetMaxVcpus
I think that the existing virDomainGetVcpus is adequate for determining
the number of current vcpus in an active domain. Any other API changes
that you think might be necessary?
Finally, at the virsh layer, I plan on:
vcpuinfo: add --count flag; if flag is present, then inactive domains
show current and max vcpus rather than erroring out, and active domains
add current and max vcpu information to the overall output
setvcpus: add --max and --persistent flags; without flags, this still
maps to virDomainSetVcpus and only affects active domains; with --max,
it maps to virDomainSetMaxVcpus, with --persistent, it maps to
virDomainSetVcpusFlags
Any thoughts on this plan of attack before I start submitting code patches?
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
14 years, 1 month
[libvirt] [PATCH] Rework configure logic for virtualport support
by Stefan Berger
In this patch I am reworking the logic around detecting virtual port
support and requiring the libnl dependency.
- It requires --with-macvtap and displays an error in case of
--without-macvtap --with-virtualport.
- It tests for availability of certain data in include files and
displays an error in case the include file is not at the correct level
and --with-virtualport was chosen
- displays 'checking' messages for macvtap and virtualport support and
results
- libnl support is required when macvtap is found or requested; if libnl
is not there, please supply without-macvtap
Signed-off-by: Stefan Berger <stefanb(a)us.ibm.com>
diff --git a/configure.ac b/configure.ac
index 6100610..d94b510 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2058,6 +2058,7 @@ AC_ARG_WITH([macvtap],
[with_macvtap=${withval}],
[with_macvtap=check])
+AC_MSG_CHECKING([whether to compile with macvtap support])
if test "$with_macvtap" != "no" ; then
AC_TRY_COMPILE([ #include <sys/socket.h>
#include <linux/rtnetlink.h> ],
@@ -2075,19 +2076,31 @@ if test "$with_macvtap" != "no" ; then
AC_DEFINE_UNQUOTED([WITH_MACVTAP], $val, [whether macvtap support
is enabled])
fi
AM_CONDITIONAL([WITH_MACVTAP], [test "$with_macvtap" = "yes"])
+AC_MSG_RESULT([$with_macvtap])
-AC_TRY_COMPILE([ #include <sys/socket.h>
- #include <linux/rtnetlink.h> ],
- [ int x = IFLA_PORT_MAX; ],
- [ with_virtualport=yes ],
- [ with_virtualport=no ])
-if test "$with_virtualport" = "yes"; then
- val=1
-else
- val=0
+val=0
+if test "$with_virtualport" != "no"; then
+ if test "$with_macvtap" = "no"; then
+ AC_MSG_ERROR([--with-virtualport requires --with-macvtap])
+ fi
+ AC_MSG_CHECKING([whether to compile with virtual port support])
+ AC_TRY_COMPILE([ #include <sys/socket.h>
+ #include <linux/rtnetlink.h> ],
+ [ int x = IFLA_PORT_MAX; ],
+ [ with_virtualport=yes ],
+ [ if test "$with_virtualport" = "yes" ; then
+ AC_MSG_ERROR([Installed linux headers don't
show support for virtual port support.])
+ fi
+ with_virtualport=no ])
+ if test "$with_virtualport" = "yes"; then
+ val=1
+ else
+ val=0
+ fi
+ AC_DEFINE_UNQUOTED([WITH_VIRTUALPORT], $val,
+ [whether vsi vepa support is enabled])
+ AC_MSG_RESULT([$with_virtualport])
fi
-AC_DEFINE_UNQUOTED([WITH_VIRTUALPORT], $val,
- [whether vsi vepa support is enabled])
AM_CONDITIONAL([WITH_VIRTUALPORT], [test "$with_virtualport" = "yes"])
@@ -2096,7 +2109,7 @@ dnl netlink library
LIBNL_CFLAGS=""
LIBNL_LIBS=""
-if test "$with_macvtap" = "yes" || test "$with_virtualport" = "yes"; then
+if test "$with_macvtap" = "yes"; then
PKG_CHECK_MODULES([LIBNL], [libnl-1 >= $LIBNL_REQUIRED], [
], [
AC_MSG_ERROR([libnl >= $LIBNL_REQUIRED is required for macvtap
support])
14 years, 1 month
[libvirt] [PATCH] mac os x: don't compile failing example program on 32 bit mac os x
by Justin Clift
This addresses a compilation failure issue reported last year on
OS X:
https://www.redhat.com/archives/libvir-list/2009-May/msg00166.html
In testing here, the compilation only fails on 32 bit OS X, but works
on 64 bit, even when using exact same compile and linking flags.
This commit surgically disables compilation of this one example program
on 32 bit Mac OS X (only). Compilation still occurs, with a working
executable produced, on 64 bit Mac OS X.
---
examples/domain-events/events-c/event-test.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/examples/domain-events/events-c/event-test.c b/examples/domain-events/events-c/event-test.c
index 74eabba..3dff13b 100644
--- a/examples/domain-events/events-c/event-test.c
+++ b/examples/domain-events/events-c/event-test.c
@@ -5,7 +5,7 @@
#include <string.h>
#include <signal.h>
-#if HAVE_SYS_POLL_H
+#if HAVE_SYS_POLL_H && !(defined(__i386__) && defined(__APPLE__) && defined(__MACH__))
# include <sys/types.h>
# include <sys/poll.h>
# include <libvirt/libvirt.h>
--
1.7.3
14 years, 1 month
[libvirt] [PATCH] mac os x: use awk selected by build system rather than first in path
by Justin Clift
Prior to this patch, the ChangeLog generation was hard coded to use
"awk", when it should have been using the AWK variable set by our
build system.
This breaks compilation on a newly installed OS X system, where the
default path has the Mac (non GNU) awk in the default search PATH
before any installed GNU awk (gawk).
---
docs/Makefile.am | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 114ea1f..7fae40d 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -88,7 +88,7 @@ api: libvirt-api.xml libvirt-refs.xml
web: $(dot_html) html/index.html devhelp/index.html
ChangeLog.xml: ../ChangeLog ChangeLog.awk
- awk -f ChangeLog.awk < $< > $@
+ $(AWK) -f ChangeLog.awk < $< > $@
ChangeLog.html.in: ChangeLog.xml ChangeLog.xsl
@if [ -x $(XSLTPROC) ] ; then \
--
1.7.2.3
14 years, 1 month
[libvirt] [PATCH v2] nwfilter: Don't compile nwfilter driver on other systems than Linux
by Stefan Berger
v2: check 'with_linux' rather than using uname -s for checking for
target system
Don't compile the nwfilter driver (instantiating the rules) on other
systems than Linux.
Signed-off-by: Stefan Berger <stefanb(a)us.ibm.com>
diff --git a/configure.ac b/configure.ac
index 23181dd..6100610 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1360,15 +1360,6 @@ if test "$with_secrets" = "yes" ; then
fi
AM_CONDITIONAL([WITH_SECRETS], [test "$with_secrets" = "yes"])
-with_nwfilter=yes
-if test "$with_libvirtd" = "no"; then
- with_nwfilter=no
-fi
-if test "$with_nwfilter" = "yes" ; then
- AC_DEFINE([WITH_NWFILTER], 1, [whether local network filter
management driver is available])
-fi
-AM_CONDITIONAL([WITH_NWFILTER], [test "$with_nwfilter" = "yes"])
-
AC_ARG_WITH([storage-fs],
AC_HELP_STRING([--with-storage-fs], [with FileSystem backend for the
storage driver @<:@default=check@:>@]),[],[with_storage_fs=check])
@@ -2040,6 +2031,16 @@ esac
AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"])
+with_nwfilter=yes
+if test "$with_libvirtd" = "no" || test "$with_linux" != "yes"; then
+ with_nwfilter=no
+fi
+if test "$with_nwfilter" = "yes" ; then
+ AC_DEFINE([WITH_NWFILTER], 1, [whether local network filter
management driver is available])
+fi
+AM_CONDITIONAL([WITH_NWFILTER], [test "$with_nwfilter" = "yes"])
+
+
AC_ARG_WITH([qemu-user],
AC_HELP_STRING([--with-qemu-user], [username to run QEMU system
instance as @<:@default=root@:>@]),
[QEMU_USER=${withval}],
14 years, 1 month
[libvirt] [PATCH] virtualbox: fix a typo in the expected location on mac os x
by Justin Clift
Mac OS X provides an "/Applications" folder, not an "/Application" folder,
so installed VirtualBox wasn't being detected by default.
This 1 character patch fixes this.
---
Pushed this under the "trivial" rule. It really is fixing someones typo. :)
configure.ac | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/configure.ac b/configure.ac
index 6100610..0403d1c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -340,7 +340,7 @@ if test "x$with_vbox" = "xyes" || test "x$with_vbox" = "xcheck"; then
/opt/VirtualBox/amd64/VBoxXPCOMC.so \
/usr/local/lib/virtualbox/VBoxXPCOMC.so \
/usr/local/lib/VirtualBox/VBoxXPCOMC.so \
- /Application/VirtualBox.app/Contents/MacOS/VBoxXPCOMC.dylib \
+ /Applications/VirtualBox.app/Contents/MacOS/VBoxXPCOMC.dylib \
; do
if test -f "$vbox"; then
vbox_xpcomc_dir=`AS_DIRNAME(["$vbox"])`
--
1.7.2.3
14 years, 1 month