Do conditional driver config in Makefile.am, not source files

This commit is contained in:
Daniel P. Berrange 2008-08-20 20:48:35 +00:00
parent 6334cd16df
commit bb16f4a25d
42 changed files with 1514 additions and 1579 deletions

View File

@ -1,4 +1,22 @@
Wed Aug 20 42:42:09 BST 2008 Daniel P. Berrange <berrange@redhat.com> Wed Aug 20 21:05:09 BST 2008 Daniel P. Berrange <berrange@redhat.com>
* configure.in, qemud/Makefile.am, src/Makefile.am: Use automake
conditions when deciding which files to include in build
* src/bridge.c, src/bridge.h, src/conf.h, src/console.h,
src/driver.h, src/hash.h, src/internal.h, src/libvirt.c,
src/lxc_conf.c, src/lxc_conf.h, src/lxc_container.c,
src/lxc_container.h, src/lxc_driver.c, src/lxc_driver.h,
src/nodeinfo.h, src/openvz_conf.c, src/openvz_driver.c,
src/proxy_internal.c, src/proxy_internal.h, src/qemu_conf.c,
src/qemu_conf.h, src/qemu_driver.c, src/qemu_driver.h,
src/remote_internal.h, src/test.c, src/test.h, src/veth.c,
src/xen_internal.c, src/xen_internal.h, src/xen_unified.c,
src/xen_unified.h, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xs_internal.c, src/xs_internal.h
tests/testutils.h: Remove preprocessor conditions for driver
compilation. Remove unneccessary "extern C" declarations.
Wed Aug 20 20:42:09 BST 2008 Daniel P. Berrange <berrange@redhat.com>
* src/util.c, src/util.h: Add convenience APIs for stripping * src/util.c, src/util.h: Add convenience APIs for stripping
a file extension a file extension

View File

@ -242,27 +242,35 @@ fi
LIBVIRT_FEATURES= LIBVIRT_FEATURES=
WITH_XEN=0 WITH_XEN=0
if test "$with_openvz" = "yes" ; then if test "$with_openvz" = "yes"; then
LIBVIRT_FEATURES="$LIBVIRT_FEATURES -DWITH_OPENVZ" LIBVIRT_FEATURES="$LIBVIRT_FEATURES -DWITH_OPENVZ"
fi fi
AM_CONDITIONAL([WITH_OPENVZ], [test "$with_openvz" = "yes"])
if test "$with_lxc" = "yes" ; then if test "$with_lxc" = "yes" ; then
LIBVIRT_FEATURES="$LIBVIRT_FEATURES -DWITH_LXC" LIBVIRT_FEATURES="$LIBVIRT_FEATURES -DWITH_LXC"
fi fi
AM_CONDITIONAL([WITH_LXC], [test "$with_lxc" = "yes"])
if test "$with_qemu" = "yes" ; then if test "$with_qemu" = "yes" ; then
LIBVIRT_FEATURES="$LIBVIRT_FEATURES -DWITH_QEMU" LIBVIRT_FEATURES="$LIBVIRT_FEATURES -DWITH_QEMU"
fi fi
AM_CONDITIONAL([WITH_QEMU], [test "$with_qemu" = "yes"])
if test "$with_test" = "yes" ; then if test "$with_test" = "yes" ; then
LIBVIRT_FEATURES="$LIBVIRT_FEATURES -DWITH_TEST" LIBVIRT_FEATURES="$LIBVIRT_FEATURES -DWITH_TEST"
fi fi
AM_CONDITIONAL([WITH_TEST], [test "$with_test" = "yes"])
if test "$with_remote" = "yes" ; then if test "$with_remote" = "yes" ; then
LIBVIRT_FEATURES="$LIBVIRT_FEATURES -DWITH_REMOTE" LIBVIRT_FEATURES="$LIBVIRT_FEATURES -DWITH_REMOTE"
fi fi
AM_CONDITIONAL([WITH_REMOTE], [test "$with_remote" = "yes"])
if test "$with_libvirtd" = "yes" ; then if test "$with_libvirtd" = "yes" ; then
LIBVIRT_FEATURES="$LIBVIRT_FEATURES -DWITH_LIBVIRTD" LIBVIRT_FEATURES="$LIBVIRT_FEATURES -DWITH_LIBVIRTD"
fi fi
AM_CONDITIONAL([WITH_LIBVIRTD], [test "$with_libvirtd" = "yes"])
if test "$with_xen" = "yes" ; then if test "$with_xen" = "yes" ; then
dnl search for the Xen store library dnl search for the Xen store library
@ -295,11 +303,12 @@ if test "$with_xen" = "yes" ; then
#include <xen/xen.h> #include <xen/xen.h>
]) ])
fi fi
AM_CONDITIONAL([WITH_XEN], [test "$WITH_XEN" = "1"])
dnl dnl
dnl check for kernel headers required by qemud/bridge.c dnl check for kernel headers required by src/bridge.c
dnl dnl
if test "$with_qemu" = "yes" ; then if test "$with_qemu" = "yes" -o "$with_lxc" = "yes" ; then
AC_CHECK_HEADERS([linux/param.h linux/sockios.h linux/if_bridge.h linux/if_tun.h],, AC_CHECK_HEADERS([linux/param.h linux/sockios.h linux/if_bridge.h linux/if_tun.h],,
AC_MSG_ERROR([You must install kernel-headers in order to compile libvirt])) AC_MSG_ERROR([You must install kernel-headers in order to compile libvirt]))
fi fi

File diff suppressed because it is too large Load Diff

View File

@ -2,19 +2,30 @@
INCLUDES = $(LIBVIRT_FEATURES) INCLUDES = $(LIBVIRT_FEATURES)
# Distribute the generated files so that rpcgen isn't required on the DAEMON_SOURCES = \
# target machine (although almost any Unix machine will have it). event.c event.h \
EXTRA_DIST = libvirtd.init.in libvirtd.sysconf default-network.xml \ qemud.c qemud.h \
remote_protocol.x \ remote.c \
remote_protocol.c remote_protocol.h \ remote_dispatch_prototypes.h \
remote_generate_stubs.pl rpcgen_fix.pl \ remote_dispatch_localvars.h \
remote_dispatch_prototypes.h \ remote_dispatch_proc_switch.h \
remote_dispatch_localvars.h \ remote_protocol.h remote_protocol.c \
remote_dispatch_proc_switch.h \ $(srcdir)/../src/util-lib.c
mdns.c mdns.h \
libvirtd.sasl \ AVAHI_SOURCES = \
libvirtd.conf \ mdns.c mdns.h
libvirtd.policy
EXTRA_DIST = \
default-network.xml \
remote_generate_stubs.pl rpcgen_fix.pl \
remote_protocol.x \
libvirtd.conf \
libvirtd.init.in \
libvirtd.policy \
libvirtd.sasl \
libvirtd.sysconf \
$(AVAHI_SOURCES) \
$(DAEMON_SOURCES)
if RPCGEN if RPCGEN
SUFFIXES = .x SUFFIXES = .x
@ -45,12 +56,7 @@ sbin_PROGRAMS = libvirtd
confdir = $(sysconfdir)/libvirt/ confdir = $(sysconfdir)/libvirt/
conf_DATA = libvirtd.conf conf_DATA = libvirtd.conf
libvirtd_SOURCES = \ libvirtd_SOURCES = $(DAEMON_SOURCES)
qemud.c qemud.h \
remote_protocol.h remote_protocol.c \
remote.c \
$(srcdir)/../src/util-lib.c \
event.c event.h
#-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L #-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
libvirtd_CFLAGS = \ libvirtd_CFLAGS = \
@ -79,7 +85,7 @@ policydir = $(datadir)/PolicyKit/policy
endif endif
if HAVE_AVAHI if HAVE_AVAHI
libvirtd_SOURCES += mdns.c mdns.h libvirtd_SOURCES += $(AVAHI_SOURCES)
libvirtd_CFLAGS += $(AVAHI_CFLAGS) libvirtd_CFLAGS += $(AVAHI_CFLAGS)
libvirtd_LDADD += $(AVAHI_LIBS) libvirtd_LDADD += $(AVAHI_LIBS)
endif endif

View File

@ -30,80 +30,176 @@ EXTRA_DIST = libvirt_sym.version $(conf_DATA)
lib_LTLIBRARIES = libvirt.la lib_LTLIBRARIES = libvirt.la
CLIENT_SOURCES = \ # These files are not related to driver APIs. Simply generic
libvirt.c internal.h \ # helper APIs for various purposes
gnutls_1_0_compat.h \ GENERIC_LIB_SOURCES = \
socketcompat.h \
memory.c memory.h \
hash.c hash.h \
test.c test.h \
buf.c buf.h \
qparams.c qparams.h \
domain_conf.c domain_conf.h \
capabilities.c capabilities.h \
xml.c xml.h \
event.c event.h \
xen_unified.c xen_unified.h \
xen_internal.c xen_internal.h \
xs_internal.c xs_internal.h \
xend_internal.c xend_internal.h \
stats_linux.c stats_linux.h \
sexpr.c sexpr.h \
virterror.c \
driver.h \
proxy_internal.c proxy_internal.h \
conf.c conf.h \
network_conf.c network_conf.h \
xm_internal.c xm_internal.h \
remote_internal.c remote_internal.h \
bridge.c bridge.h \ bridge.c bridge.h \
buf.c buf.h \
conf.c conf.h \
event.c event.h \
iptables.c iptables.h \ iptables.c iptables.h \
memory.c memory.h \
qparams.c qparams.h \
stats_linux.c stats_linux.h \
uuid.c uuid.h \ uuid.c uuid.h \
qemu_driver.c qemu_driver.h \ util.c util.h \
qemu_conf.c qemu_conf.h \ virterror.c \
openvz_conf.c openvz_conf.h \ xml.c xml.h
openvz_driver.c openvz_driver.h \
lxc_driver.c lxc_driver.h \ # Domain driver generic impl APIs
lxc_controller.c lxc_controller.h \ DOMAIN_CONF_SOURCES = \
capabilities.c capabilities.h \
domain_conf.c domain_conf.h \
nodeinfo.h nodeinfo.c
# Network driver generic impl APIs
NETWORK_CONF_SOURCES = \
network_conf.c network_conf.h
# Storage driver generic impl APIs
STORAGE_CONF_SOURCES = \
storage_conf.h storage_conf.c
# The remote RPC driver, covering domains, storage, networks, etc
REMOTE_DRIVER_SOURCES = \
gnutls_1_0_compat.h \
remote_internal.c remote_internal.h \
../qemud/remote_protocol.c \
../qemud/remote_protocol.h \
socketcompat.h
# Mock driver, covering domains, storage, networks, etc
TEST_DRIVER_SOURCES = \
test.c test.h
# Now the Hypervisor specific drivers
XEN_DRIVER_SOURCES = \
proxy_internal.c proxy_internal.h \
sexpr.c sexpr.h \
xen_internal.c xen_internal.h \
xen_unified.c xen_unified.h \
xend_internal.c xend_internal.h \
xm_internal.c xm_internal.h \
xs_internal.c xs_internal.h
LXC_DRIVER_SOURCES = \
lxc_conf.c lxc_conf.h \ lxc_conf.c lxc_conf.h \
lxc_container.c lxc_container.h \ lxc_container.c lxc_container.h \
veth.c veth.h \ lxc_controller.c lxc_controller.h \
nodeinfo.h nodeinfo.c \ lxc_driver.c lxc_driver.h \
util.c util.h veth.c veth.h
SERVER_SOURCES = \ OPENVZ_DRIVER_SOURCES = \
../qemud/remote_protocol.c ../qemud/remote_protocol.h openvz_conf.c openvz_conf.h \
openvz_driver.c openvz_driver.h
if WITH_LIBVIRTD # XXX network driver should be split out of this
QEMU_DRIVER_SOURCES = \
qemu_conf.c qemu_conf.h \
qemu_driver.c qemu_driver.h
CLIENT_SOURCES += \
storage_conf.h storage_conf.c \ # And finally storage backend specific impls
STORAGE_DRIVER_SOURCES = \
storage_driver.h storage_driver.c \ storage_driver.h storage_driver.c \
storage_backend.h storage_backend.c \ storage_backend.h storage_backend.c
STORAGE_DRIVER_FS_SOURCES = \
storage_backend_fs.h storage_backend_fs.c storage_backend_fs.h storage_backend_fs.c
STORAGE_DRIVER_LVM_SOURCES = \
storage_backend_logical.h \
storage_backend_logical.c
STORAGE_DRIVER_ISCSI_SOURCES = \
storage_backend_iscsi.h storage_backend_iscsi.c
STORAGE_DRIVER_DISK_SOURCES = \
storage_backend_disk.h storage_backend_disk.c
STORAGE_HELPER_DISK_SOURCES = \
parthelper.c
#########################
#
# Build up list of libvirt.la source files based on configure conditions
#
# First deal with sources usable in non-daemon context
libvirt_la_SOURCES = \
driver.h \
hash.c hash.h \
internal.h \
libvirt.c \
$(GENERIC_LIB_SOURCES) \
$(DOMAIN_CONF_SOURCES) \
$(NETWORK_CONF_SOURCES) \
$(STORAGE_CONF_SOURCES)
# Drivers usable outside daemon context
if WITH_TEST
libvirt_la_SOURCES += $(TEST_DRIVER_SOURCES)
endif
if WITH_REMOTE
libvirt_la_SOURCES += $(REMOTE_DRIVER_SOURCES)
endif
if WITH_XEN
libvirt_la_SOURCES += $(XEN_DRIVER_SOURCES)
endif
# Drivers usable inside daemon context
if WITH_LIBVIRTD
libvirt_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
libvirt_la_SOURCES += $(STORAGE_DRIVER_FS_SOURCES)
if WITH_QEMU
libvirt_la_SOURCES += $(QEMU_DRIVER_SOURCES)
endif
if WITH_LXC
libvirt_la_SOURCES += $(LXC_DRIVER_SOURCES)
endif
if WITH_OPENVZ
libvirt_la_SOURCES += $(OPENVZ_DRIVER_SOURCES)
endif
if WITH_STORAGE_LVM if WITH_STORAGE_LVM
CLIENT_SOURCES += storage_backend_logical.h storage_backend_logical.c libvirt_la_SOURCES += $(STORAGE_DRIVER_LVM_SOURCES)
else
EXTRA_DIST += storage_backend_logical.h storage_backend_logical.c
endif endif
if WITH_STORAGE_ISCSI if WITH_STORAGE_ISCSI
CLIENT_SOURCES += storage_backend_iscsi.h storage_backend_iscsi.c libvirt_la_SOURCES += $(STORAGE_DRIVER_ISCSI_SOURCES)
else
EXTRA_DIST += storage_backend_iscsi.h storage_backend_iscsi.c
endif endif
if WITH_STORAGE_DISK if WITH_STORAGE_DISK
CLIENT_SOURCES += storage_backend_disk.h storage_backend_disk.c libvirt_la_SOURCES += $(STORAGE_DRIVER_DISK_SOURCES)
else endif
EXTRA_DIST += storage_backend_disk.h storage_backend_disk.c
endif endif
endif # Add all conditional sources just in case...
EXTRA_DIST += \
$(TEST_DRIVER_SOURCES) \
$(REMOTE_DRIVER_SOURCES) \
$(XEN_DRIVER_SOURCES) \
$(QEMU_DRIVER_SOURCES) \
$(LXC_DRIVER_SOURCES) \
$(OPENVZ_DRIVER_SOURCES) \
$(STORAGE_DRIVER_SOURCES) \
$(STORAGE_DRIVER_FS_SOURCES) \
$(STORAGE_DRIVER_LVM_SOURCES) \
$(STORAGE_DRIVER_ISCSI_SOURCES) \
$(STORAGE_DRIVER_DISK_SOURCES)
libvirt_la_SOURCES = $(CLIENT_SOURCES) $(SERVER_SOURCES)
libvirt_la_LIBADD = $(LIBXML_LIBS) $(GNUTLS_LIBS) $(SASL_LIBS) $(SELINUX_LIBS) \ libvirt_la_LIBADD = $(LIBXML_LIBS) $(GNUTLS_LIBS) $(SASL_LIBS) $(SELINUX_LIBS) \
$(NUMACTL_LIBS) \ $(NUMACTL_LIBS) \
@CYGWIN_EXTRA_LIBADD@ ../gnulib/lib/libgnu.la @CYGWIN_EXTRA_LIBADD@ ../gnulib/lib/libgnu.la
@ -134,7 +230,11 @@ libvirt_test_la_CFLAGS = $(COVERAGE_CFLAGS)
bin_PROGRAMS = virsh bin_PROGRAMS = virsh
virsh_SOURCES = virsh.c console.c console.h util-lib.c util-lib.h virsh_SOURCES = \
console.c console.h \
util-lib.c util-lib.h \
virsh.c
virsh_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDFLAGS) virsh_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDFLAGS)
virsh_DEPENDENCIES = $(DEPS) virsh_DEPENDENCIES = $(DEPS)
virsh_LDADD = $(LDADDS) $(VIRSH_LIBS) virsh_LDADD = $(LDADDS) $(VIRSH_LIBS)
@ -176,14 +276,14 @@ if WITH_STORAGE_DISK
if WITH_LIBVIRTD if WITH_LIBVIRTD
libexec_PROGRAMS = libvirt_parthelper libexec_PROGRAMS = libvirt_parthelper
libvirt_parthelper_SOURCES = parthelper.c libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
libvirt_parthelper_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDCFLAGS) libvirt_parthelper_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDCFLAGS)
libvirt_parthelper_LDADD = $(LIBPARTED_LIBS) libvirt_parthelper_LDADD = $(LIBPARTED_LIBS)
libvirt_parthelper_CFLAGS = $(LIBPARTED_CFLAGS) libvirt_parthelper_CFLAGS = $(LIBPARTED_CFLAGS)
endif endif
else
EXTRA_DIST += parthelper.c
endif endif
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)
# Create the /var/cache/libvirt directory when installing. # Create the /var/cache/libvirt directory when installing.
install-exec-local: install-exec-local:

View File

@ -21,7 +21,7 @@
#include <config.h> #include <config.h>
#ifdef WITH_QEMU #if defined(WITH_QEMU) || defined(WITH_LXC)
#include "bridge.h" #include "bridge.h"
@ -750,4 +750,4 @@ brSetEnableSTP(brControl *ctl ATTRIBUTE_UNUSED,
return retval; return retval;
} }
#endif /* WITH_QEMU */ #endif /* WITH_QEMU || WITH_LXC */

View File

@ -24,7 +24,7 @@
#include <config.h> #include <config.h>
#ifdef WITH_QEMU #if defined(WITH_QEMU) || defined(WITH_LXC)
#include <net/if.h> #include <net/if.h>
#include <netinet/in.h> #include <netinet/in.h>
@ -98,6 +98,6 @@ int brGetEnableSTP (brControl *ctl,
const char *bridge, const char *bridge,
int *enable); int *enable);
#endif /* WITH_QEMU */ #endif /* WITH_QEMU || WITH_LXC */
#endif /* __QEMUD_BRIDGE_H__ */ #endif /* __QEMUD_BRIDGE_H__ */

View File

@ -11,10 +11,6 @@
#ifndef __VIR_CONF_H__ #ifndef __VIR_CONF_H__
#define __VIR_CONF_H__ #define __VIR_CONF_H__
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* virConfType: * virConfType:
* one of the possible type for a value from the configuration file * one of the possible type for a value from the configuration file
@ -93,7 +89,4 @@ int __virConfWriteMem (char *memory,
#define virConfWriteFile(f,c) __virConfWriteFile((f),(c)) #define virConfWriteFile(f,c) __virConfWriteFile((f),(c))
#define virConfWriteMem(m,l,c) __virConfWriteMem((m),(l),(c)) #define virConfWriteMem(m,l,c) __virConfWriteMem((m),(l),(c))
#ifdef __cplusplus
}
#endif
#endif /* __VIR_CONF_H__ */ #endif /* __VIR_CONF_H__ */

View File

@ -25,15 +25,7 @@
#ifndef __MINGW32__ #ifndef __MINGW32__
#ifdef __cplusplus int vshRunConsole(const char *tty);
extern "C" {
#endif
int vshRunConsole(const char *tty);
#ifdef __cplusplus
}
#endif
#endif /* !__MINGW32__ */ #endif /* !__MINGW32__ */

View File

@ -13,10 +13,6 @@
#include <signal.h> #include <signal.h>
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* List of registered drivers numbers * List of registered drivers numbers
*/ */
@ -611,7 +607,4 @@ int virRegisterStorageDriver(virStorageDriverPtr);
int virRegisterStateDriver(virStateDriverPtr); int virRegisterStateDriver(virStateDriverPtr);
#endif #endif
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __VIR_DRIVER_H__ */ #endif /* __VIR_DRIVER_H__ */

View File

@ -12,10 +12,6 @@
#ifndef __VIR_HASH_H__ #ifndef __VIR_HASH_H__
#define __VIR_HASH_H__ #define __VIR_HASH_H__
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* The hash table. * The hash table.
*/ */
@ -90,7 +86,4 @@ int virHashForEach(virHashTablePtr table, virHashIterator iter, const void *data
int virHashRemoveSet(virHashTablePtr table, virHashSearcher iter, virHashDeallocator f, const void *data); int virHashRemoveSet(virHashTablePtr table, virHashSearcher iter, virHashDeallocator f, const void *data);
void *virHashSearch(virHashTablePtr table, virHashSearcher iter, const void *data); void *virHashSearch(virHashTablePtr table, virHashSearcher iter, const void *data);
#ifdef __cplusplus
}
#endif
#endif /* ! __VIR_HASH_H__ */ #endif /* ! __VIR_HASH_H__ */

View File

@ -38,10 +38,6 @@
#include "libvirt/virterror.h" #include "libvirt/virterror.h"
#include "driver.h" #include "driver.h"
#ifdef __cplusplus
extern "C" {
#endif
/* On architectures which lack these limits, define them (ie. Cygwin). /* On architectures which lack these limits, define them (ie. Cygwin).
* Note that the libvirt code should be robust enough to handle the * Note that the libvirt code should be robust enough to handle the
* case where actual value is longer than these limits (eg. by setting * case where actual value is longer than these limits (eg. by setting
@ -366,7 +362,4 @@ int __virDomainMigratePrepare (virConnectPtr dconn, char **cookie, int *cookiele
int __virDomainMigratePerform (virDomainPtr domain, const char *cookie, int cookielen, const char *uri, unsigned long flags, const char *dname, unsigned long bandwidth); int __virDomainMigratePerform (virDomainPtr domain, const char *cookie, int cookielen, const char *uri, unsigned long flags, const char *dname, unsigned long bandwidth);
virDomainPtr __virDomainMigrateFinish (virConnectPtr dconn, const char *dname, const char *cookie, int cookielen, const char *uri, unsigned long flags); virDomainPtr __virDomainMigrateFinish (virConnectPtr dconn, const char *dname, const char *cookie, int cookielen, const char *uri, unsigned long flags);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __VIR_INTERNAL_H__ */ #endif /* __VIR_INTERNAL_H__ */

View File

@ -36,17 +36,26 @@
#include "uuid.h" #include "uuid.h"
#include "util.h" #include "util.h"
#ifdef WITH_TEST
#include "test.h" #include "test.h"
#endif
#ifdef WITH_XEN
#include "xen_unified.h" #include "xen_unified.h"
#endif
#ifdef WITH_REMOTE
#include "remote_internal.h" #include "remote_internal.h"
#endif
#ifdef WITH_QEMU
#include "qemu_driver.h" #include "qemu_driver.h"
#include "storage_driver.h" #endif
#ifdef WITH_OPENVZ #ifdef WITH_OPENVZ
#include "openvz_driver.h" #include "openvz_driver.h"
#endif #endif
#ifdef WITH_LXC #ifdef WITH_LXC
#include "lxc_driver.h" #include "lxc_driver.h"
#endif #endif
#include "storage_driver.h"
/* /*
* TODO: * TODO:
@ -273,23 +282,23 @@ virInitialize(void)
#ifdef WITH_TEST #ifdef WITH_TEST
if (testRegister() == -1) return -1; if (testRegister() == -1) return -1;
#endif #endif
#ifdef WITH_QEMU
if (qemudRegister() == -1) return -1;
#endif
#ifdef WITH_XEN #ifdef WITH_XEN
if (xenUnifiedRegister () == -1) return -1; if (xenUnifiedRegister () == -1) return -1;
#endif #endif
#ifdef WITH_LIBVIRTD
#ifdef WITH_QEMU
if (qemudRegister() == -1) return -1;
#endif
#ifdef WITH_OPENVZ #ifdef WITH_OPENVZ
if (openvzRegister() == -1) return -1; if (openvzRegister() == -1) return -1;
#endif #endif
#ifdef WITH_LXC #ifdef WITH_LXC
if (lxcRegister() == -1) return -1; if (lxcRegister() == -1) return -1;
#endif #endif
#ifdef WITH_LIBVIRTD
if (storageRegister() == -1) return -1; if (storageRegister() == -1) return -1;
#endif
#ifdef WITH_REMOTE #ifdef WITH_REMOTE
if (remoteRegister () == -1) return -1; if (remoteRegister () == -1) return -1;
#endif
#endif #endif
return(0); return(0);

View File

@ -25,8 +25,6 @@
/* includes */ /* includes */
#include <config.h> #include <config.h>
#ifdef WITH_LXC
#include <sys/utsname.h> #include <sys/utsname.h>
#include "lxc_conf.h" #include "lxc_conf.h"
@ -111,4 +109,3 @@ no_memory:
} }
#endif /* WITH_LXC */

View File

@ -26,8 +26,6 @@
#include <config.h> #include <config.h>
#ifdef WITH_LXC
#include "internal.h" #include "internal.h"
#include "domain_conf.h" #include "domain_conf.h"
#include "capabilities.h" #include "capabilities.h"
@ -52,6 +50,5 @@ void lxcError(virConnectPtr conn,
int code, const char *fmt, ...) int code, const char *fmt, ...)
ATTRIBUTE_FORMAT(printf,4,5); ATTRIBUTE_FORMAT(printf,4,5);
#endif /* WITH_LXC */
#endif /* LXC_CONF_H */ #endif /* LXC_CONF_H */

View File

@ -23,8 +23,6 @@
#include <config.h> #include <config.h>
#ifdef WITH_LXC
#include <fcntl.h> #include <fcntl.h>
#include <limits.h> #include <limits.h>
#include <stdlib.h> #include <stdlib.h>
@ -406,4 +404,3 @@ int lxcContainerAvailable(int features)
return 0; return 0;
} }
#endif /* WITH_LXC */

View File

@ -26,8 +26,6 @@
#include "lxc_conf.h" #include "lxc_conf.h"
#ifdef WITH_LXC
enum { enum {
LXC_CONTAINER_FEATURE_NET = (1 << 0), LXC_CONTAINER_FEATURE_NET = (1 << 0),
}; };
@ -42,6 +40,4 @@ int lxcContainerStart(virDomainDefPtr def,
int lxcContainerAvailable(int features); int lxcContainerAvailable(int features);
#endif /* LXC_DRIVER_H */
#endif /* LXC_CONTAINER_H */ #endif /* LXC_CONTAINER_H */

View File

@ -23,8 +23,6 @@
#include <config.h> #include <config.h>
#ifdef WITH_LXC
#include <fcntl.h> #include <fcntl.h>
#include <sched.h> #include <sched.h>
#include <sys/utsname.h> #include <sys/utsname.h>
@ -1112,5 +1110,3 @@ int lxcRegister(void)
virRegisterStateDriver(&lxcStateDriver); virRegisterStateDriver(&lxcStateDriver);
return 0; return 0;
} }
#endif /* WITH_LXC */

View File

@ -26,11 +26,7 @@
#include <config.h> #include <config.h>
#ifdef WITH_LXC
/* Function declarations */ /* Function declarations */
int lxcRegister(void); int lxcRegister(void);
#endif /* WITH_LXC */
#endif /* LXC_DRIVER_H */ #endif /* LXC_DRIVER_H */

View File

@ -26,14 +26,6 @@
#include "libvirt/libvirt.h" #include "libvirt/libvirt.h"
#ifdef __cplusplus int virNodeInfoPopulate(virConnectPtr conn, virNodeInfoPtr nodeinfo);
extern "C" {
#endif
int virNodeInfoPopulate(virConnectPtr conn, virNodeInfoPtr nodeinfo);
#ifdef __cplusplus
}
#endif
#endif /* __VIR_NODEINFO_H__*/ #endif /* __VIR_NODEINFO_H__*/

View File

@ -25,8 +25,6 @@
* *
*/ */
#ifdef WITH_OPENVZ
#include <config.h> #include <config.h>
#include <stdio.h> #include <stdio.h>
@ -826,4 +824,3 @@ int openvzAssignUUIDs(void)
return 0; return 0;
} }
#endif

View File

@ -25,8 +25,6 @@
* *
*/ */
#ifdef WITH_OPENVZ
#include <config.h> #include <config.h>
#include <sys/types.h> #include <sys/types.h>
@ -1015,4 +1013,3 @@ int openvzRegister(void) {
return 0; return 0;
} }
#endif /* WITH_OPENVZ */

View File

@ -8,8 +8,6 @@
* Daniel Veillard <veillard@redhat.com> * Daniel Veillard <veillard@redhat.com>
*/ */
#ifdef WITH_XEN
#include <config.h> #include <config.h>
#include <stdio.h> #include <stdio.h>
@ -1097,4 +1095,4 @@ xenProxyDomainGetOSType(virDomainPtr domain)
return(ostype); return(ostype);
} }
#endif /* WITH_XEN */

View File

@ -14,10 +14,6 @@
#include "libvirt/libvirt.h" #include "libvirt/libvirt.h"
#ifdef __cplusplus
extern "C" {
#endif
#define PROXY_SOCKET_PATH "/tmp/livirt_proxy_conn" #define PROXY_SOCKET_PATH "/tmp/livirt_proxy_conn"
#define PROXY_PROTO_VERSION 1 #define PROXY_PROTO_VERSION 1
@ -98,7 +94,4 @@ extern virDomainPtr xenProxyLookupByName(virConnectPtr conn,
extern char * xenProxyDomainDumpXML(virDomainPtr domain, extern char * xenProxyDomainDumpXML(virDomainPtr domain,
int flags); int flags);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __LIBVIR_PROXY_H__ */ #endif /* __LIBVIR_PROXY_H__ */

View File

@ -23,8 +23,6 @@
#include <config.h> #include <config.h>
#ifdef WITH_QEMU
#include <dirent.h> #include <dirent.h>
#include <string.h> #include <string.h>
#include <limits.h> #include <limits.h>
@ -1256,5 +1254,3 @@ int qemudBuildCommandLine(virConnectPtr conn,
#undef ADD_ARG_SPACE #undef ADD_ARG_SPACE
} }
#endif /* WITH_QEMU */

View File

@ -26,8 +26,6 @@
#include <config.h> #include <config.h>
#ifdef WITH_QEMU
#include "internal.h" #include "internal.h"
#include "iptables.h" #include "iptables.h"
#include "bridge.h" #include "bridge.h"
@ -102,6 +100,4 @@ int qemudBuildCommandLine (virConnectPtr conn,
const char *qemudVirtTypeToString (int type); const char *qemudVirtTypeToString (int type);
#endif /* WITH_QEMU */
#endif /* __QEMUD_CONF_H */ #endif /* __QEMUD_CONF_H */

View File

@ -23,8 +23,6 @@
#include <config.h> #include <config.h>
#ifdef WITH_QEMU
#include <sys/types.h> #include <sys/types.h>
#include <sys/poll.h> #include <sys/poll.h>
#include <dirent.h> #include <dirent.h>
@ -3971,4 +3969,3 @@ int qemudRegister(void) {
return 0; return 0;
} }
#endif /* WITH_QEMU */

View File

@ -27,12 +27,8 @@
#include <config.h> #include <config.h>
#ifdef WITH_QEMU
#include "internal.h" #include "internal.h"
int qemudRegister(void); int qemudRegister(void);
#endif /* WITH_QEMU */
#endif /* QEMUD_DRIVER_H */ #endif /* QEMUD_DRIVER_H */

View File

@ -26,10 +26,6 @@
#include "libvirt/virterror.h" #include "libvirt/virterror.h"
#ifdef __cplusplus
extern "C" {
#endif
int remoteRegister (void); int remoteRegister (void);
#define LIBVIRTD_LISTEN_ADDR NULL #define LIBVIRTD_LISTEN_ADDR NULL
@ -48,7 +44,5 @@ int remoteRegister (void);
#define LIBVIRT_SERVERKEY LIBVIRT_PKI_DIR "/libvirt/private/serverkey.pem" #define LIBVIRT_SERVERKEY LIBVIRT_PKI_DIR "/libvirt/private/serverkey.pem"
#define LIBVIRT_SERVERCERT LIBVIRT_PKI_DIR "/libvirt/servercert.pem" #define LIBVIRT_SERVERCERT LIBVIRT_PKI_DIR "/libvirt/servercert.pem"
#ifdef __cplusplus
}
#endif
#endif /* __VIR_REMOTE_INTERNAL_H__ */ #endif /* __VIR_REMOTE_INTERNAL_H__ */

View File

@ -23,8 +23,6 @@
#include <config.h> #include <config.h>
#ifdef WITH_TEST
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <sys/time.h> #include <sys/time.h>
@ -32,8 +30,6 @@
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "socketcompat.h"
#include "test.h" #include "test.h"
#include "buf.h" #include "buf.h"
#include "util.h" #include "util.h"
@ -1645,5 +1641,3 @@ testRegister(void)
return -1; return -1;
return 0; return 0;
} }
#endif /* WITH_TEST */

View File

@ -26,13 +26,6 @@
#include "internal.h" #include "internal.h"
#ifdef __cplusplus
extern "C" {
#endif
int testRegister(void); int testRegister(void);
#ifdef __cplusplus
}
#endif
#endif /* __VIR_TEST_INTERNAL_H__ */ #endif /* __VIR_TEST_INTERNAL_H__ */

View File

@ -11,8 +11,6 @@
#include <config.h> #include <config.h>
#ifdef WITH_LXC
#include <string.h> #include <string.h>
#include "veth.h" #include "veth.h"
@ -218,4 +216,4 @@ error_out:
VIR_FREE(pid); VIR_FREE(pid);
return rc; return rc;
} }
#endif

View File

@ -8,8 +8,6 @@
* Daniel Veillard <veillard@redhat.com> * Daniel Veillard <veillard@redhat.com>
*/ */
#ifdef WITH_XEN
#include <config.h> #include <config.h>
#include <stdio.h> #include <stdio.h>
@ -3293,4 +3291,3 @@ xenHypervisorGetVcpuMax(virDomainPtr domain)
return maxcpu; return maxcpu;
} }
#endif /* WITH_XEN */

View File

@ -11,10 +11,6 @@
#ifndef __VIR_XEN_INTERNAL_H__ #ifndef __VIR_XEN_INTERNAL_H__
#define __VIR_XEN_INTERNAL_H__ #define __VIR_XEN_INTERNAL_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "internal.h" #include "internal.h"
#include "capabilities.h" #include "capabilities.h"
@ -102,7 +98,5 @@ int xenHypervisorNodeGetCellsFreeMemory(virConnectPtr conn,
unsigned long long *freeMems, unsigned long long *freeMems,
int startCell, int startCell,
int maxCells); int maxCells);
#ifdef __cplusplus
}
#endif
#endif /* __VIR_XEN_INTERNAL_H__ */ #endif /* __VIR_XEN_INTERNAL_H__ */

View File

@ -10,8 +10,6 @@
#include <config.h> #include <config.h>
#ifdef WITH_XEN
/* Note: /* Note:
* *
* This driver provides a unified interface to the five * This driver provides a unified interface to the five
@ -1383,4 +1381,3 @@ xenUnifiedRegister (void)
return virRegisterDriver (&xenUnifiedDriver); return virRegisterDriver (&xenUnifiedDriver);
} }
#endif /* WITH_XEN */

View File

@ -21,10 +21,6 @@
#include <winsock2.h> #include <winsock2.h>
#endif #endif
#ifdef __cplusplus
extern "C" {
#endif
extern int xenUnifiedRegister (void); extern int xenUnifiedRegister (void);
#define XEN_UNIFIED_HYPERVISOR_OFFSET 0 #define XEN_UNIFIED_HYPERVISOR_OFFSET 0
@ -93,7 +89,6 @@ struct xenUnifiedDriver {
*/ */
struct _xenUnifiedPrivate { struct _xenUnifiedPrivate {
virCapsPtr caps; virCapsPtr caps;
#ifdef WITH_XEN
int handle; /* Xen hypervisor handle */ int handle; /* Xen hypervisor handle */
int xendConfigVersion; /* XenD config version */ int xendConfigVersion; /* XenD config version */
@ -107,7 +102,6 @@ struct _xenUnifiedPrivate {
struct sockaddr_in addr_in; /* the inet address */ struct sockaddr_in addr_in; /* the inet address */
struct xs_handle *xshandle; /* handle to talk to the xenstore */ struct xs_handle *xshandle; /* handle to talk to the xenstore */
#endif /* WITH_XEN */
int proxy; /* fd of proxy. */ int proxy; /* fd of proxy. */
@ -124,8 +118,5 @@ typedef struct _xenUnifiedPrivate *xenUnifiedPrivatePtr;
int xenNbCells(virConnectPtr conn); int xenNbCells(virConnectPtr conn);
int xenNbCpus(virConnectPtr conn); int xenNbCpus(virConnectPtr conn);
char *xenDomainUsedCpus(virDomainPtr dom); char *xenDomainUsedCpus(virDomainPtr dom);
#ifdef __cplusplus
}
#endif
#endif /* __VIR_XEN_UNIFIED_H__ */ #endif /* __VIR_XEN_UNIFIED_H__ */

View File

@ -10,7 +10,6 @@
* archive for more details. * archive for more details.
*/ */
#ifdef WITH_XEN
#include <config.h> #include <config.h>
#include <stdio.h> #include <stdio.h>
@ -5549,4 +5548,3 @@ virDomainXMLDevID(virDomainPtr domain,
} }
#endif /* ! PROXY */ #endif /* ! PROXY */
#endif /* WITH_XEN */

View File

@ -25,10 +25,6 @@
#include "domain_conf.h" #include "domain_conf.h"
#include "buf.h" #include "buf.h"
#ifdef __cplusplus
extern "C" {
#endif
int int
xenDaemonOpen_unix(virConnectPtr conn, const char *path); xenDaemonOpen_unix(virConnectPtr conn, const char *path);

View File

@ -22,7 +22,6 @@
* *
*/ */
#ifdef WITH_XEN
#include <config.h> #include <config.h>
#include <dirent.h> #include <dirent.h>
@ -2685,4 +2684,3 @@ xenXMDomainBlockPeek (virDomainPtr dom,
return -1; return -1;
} }
#endif /* WITH_XEN */

View File

@ -8,7 +8,6 @@
* Daniel Veillard <veillard@redhat.com> * Daniel Veillard <veillard@redhat.com>
*/ */
#ifdef WITH_XEN
#include <config.h> #include <config.h>
#include <stdio.h> #include <stdio.h>
@ -938,5 +937,3 @@ char *xenStoreDomainGetName(virConnectPtr conn,
return xs_read(priv->xshandle, 0, prop, &len); return xs_read(priv->xshandle, 0, prop, &len);
} }
#endif /* WITH_XEN */

View File

@ -11,10 +11,6 @@
#ifndef __VIR_XS_INTERNAL_H__ #ifndef __VIR_XS_INTERNAL_H__
#define __VIR_XS_INTERNAL_H__ #define __VIR_XS_INTERNAL_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "internal.h" #include "internal.h"
extern struct xenUnifiedDriver xenStoreDriver; extern struct xenUnifiedDriver xenStoreDriver;
@ -57,7 +53,4 @@ char * xenStoreDomainGetDiskID(virConnectPtr conn,
char * xenStoreDomainGetName(virConnectPtr conn, char * xenStoreDomainGetName(virConnectPtr conn,
int id); int id);
#ifdef __cplusplus
}
#endif
#endif /* __VIR_XS_INTERNAL_H__ */ #endif /* __VIR_XS_INTERNAL_H__ */

View File

@ -13,40 +13,32 @@
#ifndef __VIT_TEST_UTILS_H__ #ifndef __VIT_TEST_UTILS_H__
#define __VIT_TEST_UTILS_H__ #define __VIT_TEST_UTILS_H__
#ifdef __cplusplus double virtTestCountAverage(double *items,
extern "C" { int nitems);
#endif
int virtTestRun(const char *title,
int nloops,
int (*body)(const void *data),
const void *data);
int virtTestLoadFile(const char *name,
char **buf,
int buflen);
int virtTestCaptureProgramOutput(const char *const argv[],
char **buf,
int buflen);
double virtTestCountAverage(double *items, int virtTestDifference(FILE *stream,
int nitems); const char *expect,
const char *actual);
int virtTestRun(const char *title, int virtTestMain(int argc,
int nloops, char **argv,
int (*body)(const void *data), int (*func)(int, char **));
const void *data);
int virtTestLoadFile(const char *name,
char **buf,
int buflen);
int virtTestCaptureProgramOutput(const char *const argv[],
char **buf,
int buflen);
int virtTestDifference(FILE *stream,
const char *expect,
const char *actual);
int virtTestMain(int argc,
char **argv,
int (*func)(int, char **));
#define VIRT_TEST_MAIN(func) \ #define VIRT_TEST_MAIN(func) \
int main(int argc, char **argv) { \ int main(int argc, char **argv) { \
return virtTestMain(argc,argv, func); \ return virtTestMain(argc,argv, func); \
} }
#ifdef __cplusplus
}
#endif
#endif /* __VIT_TEST_UTILS_H__ */ #endif /* __VIT_TEST_UTILS_H__ */