* configure.in proxy/Makefile.am proxy/libvirt_proxy.c

src/Makefile.am src/libvirt.c src/qemu_internal.c src/test.c
  src/xen_internal.c src/xen_internal.h src/xend_internal.c
  src/xm_internal.c src/xml.c src/xs_internal.c
  tests/Makefile.am tests/sexpr2xmltest.c tests/xmconfigtest.c:
  allow selective compilation of Xen,QEmu/KVM and test support
  in or out at configure time. Also allows to compile on a system
  without Xen development installed. All drivers are selected by
  default.
Daniel
This commit is contained in:
Daniel Veillard 2007-03-15 07:43:16 +00:00
parent 98d3a3f1f8
commit 181ce1fdc6
17 changed files with 130 additions and 14 deletions

View File

@ -1,3 +1,15 @@
Thu Mar 15 08:40:33 CET 2007 Daniel Veillard <veillard@redhat.com>
* configure.in proxy/Makefile.am proxy/libvirt_proxy.c
src/Makefile.am src/libvirt.c src/qemu_internal.c src/test.c
src/xen_internal.c src/xen_internal.h src/xend_internal.c
src/xm_internal.c src/xml.c src/xs_internal.c
tests/Makefile.am tests/sexpr2xmltest.c tests/xmconfigtest.c:
allow selective compilation of Xen,QEmu/KVM and test support
in or out at configure time. Also allows to compile on a system
without Xen development installed. All drivers are selected by
default.
Wed Mar 14 14:12:32 CET 2007 Daniel Veillard <veillard@redhat.com>
* src/xend_internal.c: applied patch from Kazuki Mizushima, an

View File

@ -63,6 +63,14 @@ AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path],
[HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
AC_SUBST(HTML_DIR)
dnl Allow to build without Xen, QEMU/KVM or test driver
AC_ARG_WITH(xen,
[ --with-xen add XEN support (on)])
AC_ARG_WITH(qemu,
[ --with-qemu add QEMU/KVM support (on)])
AC_ARG_WITH(test,
[ --with-test add test driver support (on)])
dnl
dnl specific tests to setup DV devel environments with debug etc ...
dnl
@ -156,11 +164,35 @@ dnl
AC_ARG_WITH(depends,
[ --with-depends check for dependancies (on)])
LIBVIRT_FEATURES=
WITH_XEN=0
if test "$with_qemu" = "no" ; then
echo "Disabling QEMU/KVM support"
else
LIBVIRT_FEATURES="$LIBVIRT_FEATURES -DWITH_QEMU"
fi
if test "$with_test" = "no" ; then
echo "Disabling test driver support"
else
LIBVIRT_FEATURES="$LIBVIRT_FEATURES -DWITH_TEST"
fi
if test "$with_depends" != "no"
then
dnl search for the Xen store library
AC_SEARCH_LIBS(xs_read, [xenstore], [], [AC_MSG_ERROR([Xen store library not found])])
if test "$with_xen" = "no" ; then
echo Disabling XEN support
else
dnl search for the Xen store library
AC_SEARCH_LIBS(xs_read, [xenstore],
[WITH_XEN=1],
[AC_MSG_RESULT([Xen store library not found])])
if test "$WITH_XEN" != "0" ; then
LIBVIRT_FEATURES="$LIBVIRT_FEATURES -DWITH_XEN"
fi
fi
dnl
dnl check for libsyfs (>= 2.0.0); allow disabling bridge parameters support altogether
@ -245,6 +277,9 @@ AC_SUBST(VIRSH_LIBS)
# end of if with_depends
fi
AC_SUBST(WITH_XEN)
AC_SUBST(LIBVIRT_FEATURES)
dnl
dnl check for python
dnl

View File

@ -3,7 +3,7 @@
INCLUDES = -I$(top_builddir)/include -I@top_srcdir@/include \
-I@top_srcdir@/proxy -I@top_srcdir@/src @LIBXML_CFLAGS@ \
-DPROXY -DLOCALEBASEDIR=\""$(datadir)/locale"\" \
-DGETTEXT_PACKAGE=\"$(PACKAGE)\" $(WARN_CFLAGS)
-DGETTEXT_PACKAGE=\"$(PACKAGE)\" $(WARN_CFLAGS) $(LIBVIRT_FEATURES)
libexec_PROGRAMS = libvirt_proxy

View File

@ -19,6 +19,8 @@
#include <sys/un.h>
#include <locale.h>
#include "internal.h"
#ifdef WITH_XEN
#include "proxy_internal.h"
#include "xen_internal.h"
#include "xend_internal.h"
@ -786,3 +788,9 @@ int main(int argc, char **argv) {
proxyCloseUnixSocket();
exit(0);
}
#else /* WITHOUT_XEN */
int main(void) {
fprintf(stderr, "libvirt was compiled without Xen support\n");
exit(1);
}
#endif /* WITH_XEN */

View File

@ -3,7 +3,7 @@
INCLUDES = -I$(top_builddir)/include -I@top_srcdir@/include @LIBXML_CFLAGS@ -I@top_srcdir@/qemud \
-DBINDIR=\""$(libexecdir)"\" -DSBINDIR=\""$(sbindir)"\" -DLOCALEBASEDIR=\""$(datadir)/locale"\" \
-DLOCAL_STATE_DIR=\""$(localstatedir)"\" \
-DGETTEXT_PACKAGE=\"$(PACKAGE)\" $(WARN_CFLAGS)
-DGETTEXT_PACKAGE=\"$(PACKAGE)\" $(WARN_CFLAGS) $(LIBVIRT_FEATURES)
DEPS = libvirt.la
LDADDS = @STATIC_BINARIES@ libvirt.la
VIRSH_LIBS = @VIRSH_LIBS@

View File

@ -21,14 +21,16 @@
#include <libxml/parser.h>
#include <libxml/xpath.h>
#include <xs.h>
#include "internal.h"
#include "driver.h"
#ifdef WITH_XEN
#include <xs.h>
#include "xen_internal.h"
#include "xend_internal.h"
#include "xs_internal.h"
#include "xm_internal.h"
#endif
#include "proxy_internal.h"
#include "xml.h"
#include "test.h"
@ -69,13 +71,19 @@ virInitialize(void)
/*
* Note that the order is important the first ones have a higher priority
*/
#ifdef WITH_XEN
xenHypervisorRegister();
xenProxyRegister();
xenDaemonRegister();
xenStoreRegister();
xenXMRegister();
#endif
#ifdef WITH_TEST
testRegister();
#endif
#ifdef WITH_QEMU
qemuRegister();
#endif
return(0);
}
@ -1335,6 +1343,7 @@ virDomainGetUUID(virDomainPtr domain, unsigned char *uuid)
if (domain->id == 0) {
memset(uuid, 0, VIR_UUID_BUFLEN);
} else {
#ifdef WITH_XEN
if ((domain->uuid[0] == 0) && (domain->uuid[1] == 0) &&
(domain->uuid[2] == 0) && (domain->uuid[3] == 0) &&
(domain->uuid[4] == 0) && (domain->uuid[5] == 0) &&
@ -1345,6 +1354,7 @@ virDomainGetUUID(virDomainPtr domain, unsigned char *uuid)
(domain->uuid[14] == 0) && (domain->uuid[15] == 0))
xenDaemonDomainLookupByName_ids(domain->conn, domain->name,
&domain->uuid[0]);
#endif
memcpy(uuid, &domain->uuid[0], VIR_UUID_BUFLEN);
}
return (0);

View File

@ -21,6 +21,7 @@
* Author: Daniel P. Berrange <berrange@redhat.com>
*/
#ifdef WITH_QEMU
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
@ -1230,6 +1231,7 @@ void qemuRegister(void) {
virRegisterDriver(&qemuDriver);
virRegisterNetworkDriver(&qemuNetworkDriver);
}
#endif /* WITH_QEMU */
/*
* Local variables:

View File

@ -21,6 +21,7 @@
* Daniel Berrange <berrange@redhat.com>
*/
#ifdef WITH_TEST
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
@ -1375,6 +1376,7 @@ int testDomainUndefine(virDomainPtr domain) {
return (0);
}
#endif /* WITH_TEST */
/*
* Local variables:

View File

@ -8,6 +8,8 @@
* Daniel Veillard <veillard@redhat.com>
*/
#ifdef WITH_XEN
#include <stdio.h>
#include <string.h>
/* required for uint8_t, uint32_t, etc ... */
@ -1880,6 +1882,7 @@ xenHypervisorGetVcpuMax(virDomainPtr domain)
return maxcpu;
}
#endif /* WITH_XEN */
/*
* Local variables:
* indent-tabs-mode: nil

View File

@ -11,9 +11,6 @@
#ifndef __VIR_XEN_INTERNAL_H__
#define __VIR_XEN_INTERNAL_H__
/* required for dom0_getdomaininfo_t and DOM0_INTERFACE_VERSION */
#include <xen/dom0_ops.h>
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -10,6 +10,7 @@
* archive for more details.
*/
#ifdef WITH_XEN
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
@ -37,6 +38,9 @@
#include "xen_internal.h" /* for DOM0_INTERFACE_VERSION */
#include "xs_internal.h" /* To extract VNC port & Serial console TTY */
/* required for cpumap_t */
#include <xen/dom0_ops.h>
#ifndef PROXY
static const char * xenDaemonGetType(virConnectPtr conn);
static int xenDaemonListDomains(virConnectPtr conn, int *ids, int maxids);
@ -3123,9 +3127,7 @@ error:
}
#endif /* ! PROXY */
#endif /* WITH_XEN */
/*
* Local variables:

View File

@ -22,6 +22,7 @@
*
*/
#ifdef WITH_XEN
#include <dirent.h>
#include <time.h>
#include <sys/stat.h>
@ -2261,6 +2262,7 @@ int xenXMNumOfDefinedDomains(virConnectPtr conn) {
return virHashSize(nameConfigMap);
}
#endif /* WITH_XEN */
/*
* Local variables:
* indent-tabs-mode: nil

View File

@ -14,7 +14,9 @@
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#ifdef WITH_XEN
#include <xs.h>
#endif
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libxml/xpath.h>
@ -1340,7 +1342,9 @@ virDomainXMLDevID(virDomainPtr domain, char *xmldesc, char *class, char *ref)
xmlDocPtr xml = NULL;
xmlNodePtr node, cur;
xmlChar *attr = NULL;
#ifdef WITH_XEN
char *xref;
#endif /* WITH_XEN */
int ret = 0;
xml = xmlReadDoc((const xmlChar *) xmldesc, "domain.xml", NULL,
@ -1372,6 +1376,7 @@ virDomainXMLDevID(virDomainPtr domain, char *xmldesc, char *class, char *ref)
if (attr == NULL)
goto error;
#ifdef WITH_XEN
xref = xenStoreDomainGetNetworkID(domain->conn, domain->id,
(char *) attr);
if (xref != NULL) {
@ -1379,6 +1384,7 @@ virDomainXMLDevID(virDomainPtr domain, char *xmldesc, char *class, char *ref)
free(xref);
goto cleanup;
}
#endif /* WITH_XEN */
goto error;
}

View File

@ -8,6 +8,7 @@
* Daniel Veillard <veillard@redhat.com>
*/
#ifdef WITH_XEN
#include <stdio.h>
#include <string.h>
#include <unistd.h>
@ -836,3 +837,13 @@ xenStoreDomainGetNetworkID(virConnectPtr conn, int id, const char *mac) {
free(list);
return(ret);
}
#endif /* WITH_XEN */
/*
* Local variables:
* indent-tabs-mode: nil
* c-indent-level: 4
* c-basic-offset: 4
* tab-width: 4
* End:
*/

View File

@ -19,7 +19,8 @@ INCLUDES = \
-D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L \
-DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
$(COVERAGE_CFLAGS) \
$(WARN_CFLAGS)
$(WARN_CFLAGS) \
$(LIBVIRT_FEATURES)
LDADDS = \
@STATIC_BINARIES@ \

View File

@ -1,6 +1,7 @@
#include <stdio.h>
#include <string.h>
#ifdef WITH_XEN
#include "xml.h"
#include "xend_internal.h"
#include "testutils.h"
@ -190,3 +191,19 @@ main(int argc, char **argv)
exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
#else /* WITHOUT_XEN */
int
main(void)
{
fprintf(stderr, "libvirt compiled without Xen support\n");
exit(0);
}
#endif /* WITH_XEN */
/*
* Local variables:
* indent-tabs-mode: nil
* c-indent-level: 4
* c-basic-offset: 4
* tab-width: 4
* End:
*/

View File

@ -24,6 +24,7 @@
#include <stdio.h>
#include <string.h>
#ifdef WITH_XEN
#include "xm_internal.h"
#include "testutils.h"
#include "internal.h"
@ -214,7 +215,14 @@ main(int argc, char **argv)
exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
#else /* WITHOUT_XEN */
int
main(void)
{
fprintf(stderr, "libvirt compiled without Xen support\n");
exit(0);
}
#endif /* WITH_XEN */
/*
* Local variables: