+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
[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
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
# end of if with_depends
fi
+AC_SUBST(WITH_XEN)
+AC_SUBST(LIBVIRT_FEATURES)
+
dnl
dnl check for python
dnl
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
#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"
proxyCloseUnixSocket();
exit(0);
}
+#else /* WITHOUT_XEN */
+int main(void) {
+ fprintf(stderr, "libvirt was compiled without Xen support\n");
+ exit(1);
+}
+#endif /* WITH_XEN */
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@
#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"
/*
* 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);
}
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) &&
(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);
* Author: Daniel P. Berrange <berrange@redhat.com>
*/
+#ifdef WITH_QEMU
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
virRegisterDriver(&qemuDriver);
virRegisterNetworkDriver(&qemuNetworkDriver);
}
+#endif /* WITH_QEMU */
/*
* Local variables:
* Daniel Berrange <berrange@redhat.com>
*/
+#ifdef WITH_TEST
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
return (0);
}
+#endif /* WITH_TEST */
/*
* Local variables:
* Daniel Veillard <veillard@redhat.com>
*/
+#ifdef WITH_XEN
+
#include <stdio.h>
#include <string.h>
/* required for uint8_t, uint32_t, etc ... */
return maxcpu;
}
+#endif /* WITH_XEN */
/*
* Local variables:
* indent-tabs-mode: nil
#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
* archive for more details.
*/
+#ifdef WITH_XEN
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#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);
}
#endif /* ! PROXY */
-
-
-
+#endif /* WITH_XEN */
/*
* Local variables:
*
*/
+#ifdef WITH_XEN
#include <dirent.h>
#include <time.h>
#include <sys/stat.h>
return virHashSize(nameConfigMap);
}
+#endif /* WITH_XEN */
/*
* Local variables:
* indent-tabs-mode: nil
#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>
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,
if (attr == NULL)
goto error;
+#ifdef WITH_XEN
xref = xenStoreDomainGetNetworkID(domain->conn, domain->id,
(char *) attr);
if (xref != NULL) {
free(xref);
goto cleanup;
}
+#endif /* WITH_XEN */
goto error;
}
* Daniel Veillard <veillard@redhat.com>
*/
+#ifdef WITH_XEN
#include <stdio.h>
#include <string.h>
#include <unistd.h>
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:
+ */
-D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L \
-DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
$(COVERAGE_CFLAGS) \
- $(WARN_CFLAGS)
+ $(WARN_CFLAGS) \
+ $(LIBVIRT_FEATURES)
LDADDS = \
@STATIC_BINARIES@ \
#include <stdio.h>
#include <string.h>
+#ifdef WITH_XEN
#include "xml.h"
#include "xend_internal.h"
#include "testutils.h"
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:
+ */
#include <stdio.h>
#include <string.h>
+#ifdef WITH_XEN
#include "xm_internal.h"
#include "testutils.h"
#include "internal.h"
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: