[libvirt] [PATCH] libxl: Unconditionally call virSysinfoRead() on driver init
by Jim Fehlig
No need to check if priviledged when reading hostsysinfo, since
that check was already done in libxlDriverShouldLoad(). The
libxl driver fails to load if not priviledged.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
src/libxl/libxl_driver.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 426167c..e2a6d44 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -873,8 +873,7 @@ libxlStateInitialize(bool privileged,
}
/* read the host sysinfo */
- if (privileged)
- libxl_driver->hostsysinfo = virSysinfoRead();
+ libxl_driver->hostsysinfo = virSysinfoRead();
libxl_driver->domainEventState = virDomainEventStateNew();
if (!libxl_driver->domainEventState)
--
1.8.1.4
11 years, 3 months
[libvirt] [PATCH] virsh: fix build on mingw, which lacks termios stuff
by Eric Blake
Recent patches to fix handling of Ctrl-C when interacting with
ssh are not portable to mingw, which lacks termios handling.
The simplest solution is to just compile that code out, and
if someone ever appears that has a serious interest in getting
virsh fully functional even with ssh connections, they can
provide patches at that time.
* tools/virsh.h (_vshControl): Make termattr conditional.
* tools/virsh.c (vshTTYIsInterruptCharacter)
(vshTTYDisableInterrupt, vshTTYRestore, cfmakeraw, vshTTYMakeRaw)
(main): Likewise.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the build-breaker rule, for ./autobuild.sh
tools/virsh.c | 25 ++++++++++++++++++-------
tools/virsh.h | 2 ++
2 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 37e9716..bf2fbf8 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -2213,20 +2213,23 @@ vshPrintExtra(vshControl *ctl, const char *format, ...)
bool
-vshTTYIsInterruptCharacter(vshControl *ctl,
- const char chr)
+vshTTYIsInterruptCharacter(vshControl *ctl ATTRIBUTE_UNUSED,
+ const char chr ATTRIBUTE_UNUSED)
{
+#ifndef WIN32
if (ctl->istty &&
ctl->termattr.c_cc[VINTR] == chr)
return true;
+#endif
return false;
}
int
-vshTTYDisableInterrupt(vshControl *ctl)
+vshTTYDisableInterrupt(vshControl *ctl ATTRIBUTE_UNUSED)
{
+#ifndef WIN32
struct termios termset = ctl->termattr;
if (!ctl->istty)
@@ -2241,25 +2244,28 @@ vshTTYDisableInterrupt(vshControl *ctl)
if (tcsetattr(STDIN_FILENO, TCSANOW, &termset) < 0)
return -1;
+#endif
return 0;
}
int
-vshTTYRestore(vshControl *ctl)
+vshTTYRestore(vshControl *ctl ATTRIBUTE_UNUSED)
{
+#ifndef WIN32
if (!ctl->istty)
return 0;
if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &ctl->termattr) < 0)
return -1;
+#endif
return 0;
}
-#ifndef HAVE_CFMAKERAW
+#if !defined(WIN32) && !defined(HAVE_CFMAKERAW)
/* provide fallback in case cfmakeraw isn't available */
static void
cfmakeraw(struct termios *attr)
@@ -2271,12 +2277,14 @@ cfmakeraw(struct termios *attr)
attr->c_cflag &= ~(CSIZE | PARENB);
attr->c_cflag |= CS8;
}
-#endif /* !HAVE_CFMAKERAW */
+#endif /* !WIN32 && !HAVE_CFMAKERAW */
int
-vshTTYMakeRaw(vshControl *ctl, bool report_errors)
+vshTTYMakeRaw(vshControl *ctl ATTRIBUTE_UNUSED,
+ bool report_errors ATTRIBUTE_UNUSED)
{
+#ifndef WIN32
struct termios rawattr = ctl->termattr;
char ebuf[1024];
@@ -2297,6 +2305,7 @@ vshTTYMakeRaw(vshControl *ctl, bool report_errors)
virStrerror(errno, ebuf, sizeof(ebuf)));
return -1;
}
+#endif
return 0;
}
@@ -3249,8 +3258,10 @@ main(int argc, char **argv)
if (isatty(STDIN_FILENO)) {
ctl->istty = true;
+#ifndef WIN32
if (tcgetattr(STDIN_FILENO, &ctl->termattr) < 0)
ctl->istty = false;
+#endif
}
if (virMutexInit(&ctl->lock) < 0) {
diff --git a/tools/virsh.h b/tools/virsh.h
index 8afe13f..b5e2715 100644
--- a/tools/virsh.h
+++ b/tools/virsh.h
@@ -242,7 +242,9 @@ struct _vshControl {
const char *escapeChar; /* String representation of
console escape character */
+# ifndef WIN32
struct termios termattr; /* settings of the tty terminal */
+# endif
bool istty; /* is the terminal a tty */
};
--
1.8.3.1
11 years, 3 months
[libvirt] [PATCH 0/3] Fix and clean up multiple issues in virsh console handling
by Peter Krempa
This series has to be applied on top of "virsh: Handle interrupting of jobs manually".
Peter Krempa (3):
tools: rename console.[ch] to virsh-console.[ch] and fix coding style
virsh: Rename vshMakeStdinRaw to vshTTYMakeRaw and move it to virsh.c
virsh-console: Avoid using signal() in multithreaded application
cfg.mk | 2 +-
po/POTFILES.in | 2 +-
tools/Makefile.am | 2 +-
tools/{console.c => virsh-console.c} | 153 +++++++++++++++--------------------
tools/{console.h => virsh-console.h} | 11 ++-
tools/virsh-domain.c | 4 +-
tools/virsh.c | 50 +++++++++++-
tools/virsh.h | 1 +
8 files changed, 123 insertions(+), 102 deletions(-)
rename tools/{console.c => virsh-console.c} (76%)
rename tools/{console.h => virsh-console.h} (81%)
--
1.8.3.2
11 years, 3 months
[libvirt] [PATCH 00/12] Various libxl driver improvements
by Jim Fehlig
This series contains several improvements for the libxl driver.
Patches 1 and 2 are primarily code movement, putting code in
files that are more consistent with other drivers.
Patches 3 through 12 improve locking of the libxlDriverPrivate
struct, similar to the work done in the QEMU and LXC drivers
Obviously post-1.1.2 material, but would be nice to get it in
soon thereafter for testing throughout the 1.1.3 cycle...
Jim Fehlig (12):
libxl: Move detection of autoballoon to libxl_conf
libxl: Introduce libxl_domain.[ch]
libxl: Earlier detection of not running on Xen
libxl: Add libxl_version_info to libxlDriverPrivate
libxl: libxl: Use per-domain ctx in libxlMakeDomCreateInfo
libxl: User per-domain ctx in libxlDomainGetInfo
libxl: Introduce libxlDriverConfig object
libxl: Use atomic ops for driver->nactive
libxl: Add comments to libxlDriverPrivate fields
libxl: Move driver lock/unlock to libxl_conf
libxl: Remove unnecessary driver locking
libxl: Add libxlDomObjFromDomain
po/POTFILES.in | 1 +
src/Makefile.am | 1 +
src/libxl/libxl_conf.c | 149 +++++-
src/libxl/libxl_conf.h | 87 +--
src/libxl/libxl_domain.c | 469 ++++++++++++++++
src/libxl/libxl_domain.h | 61 +++
src/libxl/libxl_driver.c | 1329 ++++++++++------------------------------------
7 files changed, 1010 insertions(+), 1087 deletions(-)
create mode 100644 src/libxl/libxl_domain.c
create mode 100644 src/libxl/libxl_domain.h
--
1.8.1.4
11 years, 3 months
[libvirt] Create ESXi vmknic using libvirt xml
by varun bhatnagar
Hi,
I am using libvirt on ESX hypervisor. Iam trying to create "vmknic" using
virsh but all my attempts are failing. Can anyone help me in achieving this?
Where can I find the xml template for this? or is there any wiki link which
I can follow to achieve this?
Regards,
Varun
11 years, 3 months
[libvirt] [PATCH] virGet{User, Group}Ent() don't say success on fail
by Doug Goldstein
When virGetUserEnt() and virGetGroupEnt() fail due to the uid or gid not
existing on the machine they'll print a message like:
$ virsh -c vbox:///session list
error: failed to connect to the hypervisor
error: Failed to find user record for uid '32655': Success
The success at the end is a bit confusing. This changes it to:
$ virsh -c vbox:///session list
error: failed to connect to the hypervisor
error: Failed to find user record for uid '32655'
---
src/util/virutil.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/src/util/virutil.c b/src/util/virutil.c
index 34f5998..39d4717 100644
--- a/src/util/virutil.c
+++ b/src/util/virutil.c
@@ -692,11 +692,16 @@ virGetUserEnt(uid_t uid, char **name, gid_t *group, char **dir)
if (VIR_RESIZE_N(strbuf, strbuflen, strbuflen, strbuflen) < 0)
goto cleanup;
}
- if (rc != 0 || pw == NULL) {
+ if (rc != 0) {
virReportSystemError(rc,
_("Failed to find user record for uid '%u'"),
(unsigned int) uid);
goto cleanup;
+ } else if (pw == NULL) {
+ virReportError(VIR_ERR_SYSTEM_ERROR,
+ _("Failed to find user record for uid '%u'"),
+ (unsigned int) uid);
+ goto cleanup;
}
if (name && VIR_STRDUP(*name, pw->pw_name) < 0)
@@ -746,9 +751,16 @@ static char *virGetGroupEnt(gid_t gid)
}
}
if (rc != 0 || gr == NULL) {
- virReportSystemError(rc,
- _("Failed to find group record for gid '%u'"),
- (unsigned int) gid);
+ if (rc != 0) {
+ virReportSystemError(rc,
+ _("Failed to find group record for gid '%u'"),
+ (unsigned int) gid);
+ } else {
+ virReportError(VIR_ERR_SYSTEM_ERROR,
+ _("Failed to find group record for gid '%u'"),
+ (unsigned int) gid);
+ }
+
VIR_FREE(strbuf);
return NULL;
}
--
1.8.1.5
11 years, 3 months
[libvirt] [PATCH] Ensure 'arch' is always set in cpuArchNodeData
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The s390, ppc and arm CPU drivers never set the 'arch' field
in their impl of cpuArchNodeData. This leads to error messages
being reported from cpuDataFree later, due to trying to use
VIR_ARCH_NONE.
#0 virRaiseErrorFull (filename=filename@entry=0x76f94434 "cpu/cpu.c", funcname=funcname@entry=0x76f942dc <__FUNCTION__.18096> "cpuGetSubDriver", linenr=linenr@entry=58,
domain=domain@entry=31, code=code@entry=1, level=level@entry=VIR_ERR_ERROR, str1=0x76f70e18 "internal error: %s",
str2=str2@entry=0x7155f2ec "undefined hardware architecture", str3=str3@entry=0x0, int1=int1@entry=-1, int2=int2@entry=-1, fmt=0x76f70e18 "internal error: %s")
at util/virerror.c:646
#1 0x76e682ea in virReportErrorHelper (domcode=domcode@entry=31, errorcode=errorcode@entry=1, filename=0x76f94434 "cpu/cpu.c",
funcname=0x76f942dc <__FUNCTION__.18096> "cpuGetSubDriver", linenr=linenr@entry=58, fmt=0x76f7e7e4 "%s") at util/virerror.c:1292
#2 0x76ed82d4 in cpuGetSubDriver (arch=<optimized out>) at cpu/cpu.c:57
#3 cpuGetSubDriver (arch=VIR_ARCH_NONE) at cpu/cpu.c:51
#4 0x76ed8818 in cpuDataFree (data=data@entry=0x70c22d78) at cpu/cpu.c:216
#5 0x716aaec0 in virQEMUCapsInitCPU (arch=VIR_ARCH_ARMV7L, caps=0x70c29a08) at qemu/qemu_capabilities.c:867
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/cpu/cpu.c | 2 +-
src/cpu/cpu.h | 2 +-
src/cpu/cpu_arm.c | 8 ++++++--
src/cpu/cpu_powerpc.c | 12 +++++-------
src/cpu/cpu_s390.c | 4 +++-
src/cpu/cpu_x86.c | 4 ++--
6 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c
index 023ce26..50c2de3 100644
--- a/src/cpu/cpu.c
+++ b/src/cpu/cpu.c
@@ -244,7 +244,7 @@ cpuNodeData(virArch arch)
return NULL;
}
- return driver->nodeData();
+ return driver->nodeData(arch);
}
diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h
index 7f1d4bd..69f6fae 100644
--- a/src/cpu/cpu.h
+++ b/src/cpu/cpu.h
@@ -70,7 +70,7 @@ typedef void
(*cpuArchDataFree) (virCPUDataPtr data);
typedef virCPUDataPtr
-(*cpuArchNodeData) (void);
+(*cpuArchNodeData) (virArch arch);
typedef virCPUCompareResult
(*cpuArchGuestData) (virCPUDefPtr host,
diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c
index d1b2a99..06c5dc0 100644
--- a/src/cpu/cpu_arm.c
+++ b/src/cpu/cpu_arm.c
@@ -31,11 +31,15 @@
static const virArch archs[] = { VIR_ARCH_ARMV7L };
static virCPUDataPtr
-ArmNodeData(void)
+ArmNodeData(virArch arch)
{
virCPUDataPtr data;
- ignore_value(VIR_ALLOC(data));
+ if (VIR_ALLOC(data) < 0)
+ return NULL;
+
+ data->arch = arch;
+
return data;
}
diff --git a/src/cpu/cpu_powerpc.c b/src/cpu/cpu_powerpc.c
index 647a8a1..35cb949 100644
--- a/src/cpu/cpu_powerpc.c
+++ b/src/cpu/cpu_powerpc.c
@@ -353,21 +353,23 @@ ppcDataFree(virCPUDataPtr data)
VIR_FREE(data);
}
-#if defined(__powerpc__) || defined(__powerpc64__)
static virCPUDataPtr
-ppcNodeData(void)
+ppcNodeData(virArch arch)
{
virCPUDataPtr cpuData;
if (VIR_ALLOC(cpuData) < 0)
return NULL;
+ cpuData->arch = arch;
+
+#if defined(__powerpc__) || defined(__powerpc64__)
asm("mfpvr %0"
: "=r" (cpuData->data.ppc.pvr));
+#endif
return cpuData;
}
-#endif
static int
ppcUpdate(virCPUDefPtr guest ATTRIBUTE_UNUSED,
@@ -474,11 +476,7 @@ struct cpuArchDriver cpuDriverPowerPC = {
.decode = ppcDecode,
.encode = NULL,
.free = ppcDataFree,
-#if defined(__powerpc__) || defined(__powerpc64__)
.nodeData = ppcNodeData,
-#else
- .nodeData = NULL,
-#endif
.guestData = NULL,
.baseline = ppcBaseline,
.update = ppcUpdate,
diff --git a/src/cpu/cpu_s390.c b/src/cpu/cpu_s390.c
index d997e06..de33e4a 100644
--- a/src/cpu/cpu_s390.c
+++ b/src/cpu/cpu_s390.c
@@ -32,13 +32,15 @@
static const virArch archs[] = { VIR_ARCH_S390, VIR_ARCH_S390X };
static virCPUDataPtr
-s390NodeData(void)
+s390NodeData(virArch arch)
{
virCPUDataPtr data;
if (VIR_ALLOC(data) < 0)
return NULL;
+ data->arch = arch;
+
return data;
}
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 41ce21f..3d5e16f 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -1675,7 +1675,7 @@ cpuidSet(uint32_t base, struct cpuX86cpuid **set)
static virCPUDataPtr
-x86NodeData(void)
+x86NodeData(virArch arch)
{
virCPUDataPtr cpuData = NULL;
struct cpuX86Data *data;
@@ -1692,7 +1692,7 @@ x86NodeData(void)
goto error;
data->extended_len = ret;
- if (!(cpuData = x86MakeCPUData(virArchFromHost(), &data)))
+ if (!(cpuData = x86MakeCPUData(arch, &data)))
goto error;
return cpuData;
--
1.8.3.1
11 years, 3 months
[libvirt] [PATCH] build: enforce makefile conditional style
by Eric Blake
Automake has builtin support to prevent botched conditional nesting,
but only if you use:
if FOO
else !FOO
endif !FOO
An example error message when using the wrong name:
daemon/Makefile.am:378: error: else reminder (LIBVIRT_INIT_SCRIPT_SYSTEMD_TRUE) incompatible with current conditional: LIBVIRT_INIT_SCRIPT_SYSTEMD_FALSE
daemon/Makefile.am:381: error: endif reminder (LIBVIRT_INIT_SCRIPT_SYSTEMD_TRUE) incompatible with current conditional: LIBVIRT_INIT_SCRIPT_SYSTEMD_FALSE
As our makefiles tend to have quite a bit of nested conditionals,
it's better to take advantage of the benefits of the build system
double-checking that our conditionals are well-nested, but that
requires a syntax check to enforce our usage stye.
Alas, unlike C preprocessor and spec files, we can't use indentation
to make it easier to see how deeply nesting goes.
* cfg.mk (sc_makefile_conditionals): New rule.
* daemon/Makefile.am: Enforce the style.
* gnulib/tests/Makefile.am: Likewise.
* python/Makefile.am: Likewise.
* src/Makefile.am: Likewise.
* tests/Makefile.am: Likewise.
* tools/Makefile.am: Likewise.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
cfg.mk | 8 ++
daemon/Makefile.am | 64 +++++-----
gnulib/tests/Makefile.am | 2 +-
python/Makefile.am | 4 +-
src/Makefile.am | 326 +++++++++++++++++++++++------------------------
tests/Makefile.am | 130 +++++++++----------
tools/Makefile.am | 14 +-
7 files changed, 278 insertions(+), 270 deletions(-)
diff --git a/cfg.mk b/cfg.mk
index f153e31..b839667 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -692,6 +692,14 @@ sc_spec_indentation:
echo '$(ME): skipping test $@: cppi not installed' 1>&2; \
fi
+# Nested conditionals are easier to understand if we enforce that endifs
+# can be paired back to the if
+sc_makefile_conditionals:
+ @prohibit='(else|endif)($$| *#)' \
+ in_vc_files='Makefile\.am' \
+ halt='match "if FOO" with "endif FOO" in Makefiles' \
+ $(_sc_search_regexp)
+
# Long lines can be harder to diff; too long, and git send-email chokes.
# For now, only enforce line length on files where we have intentionally
# fixed things and don't want to regress.
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index e34868b..90689f8 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -142,7 +142,7 @@ libvirtd_LDADD = \
if WITH_DTRACE_PROBES
libvirtd_LDADD += ../src/libvirt_probes.lo
-endif
+endif WITH_DTRACE_PROBES
libvirtd_LDADD += \
../src/libvirt-lxc.la \
@@ -153,53 +153,53 @@ if WITH_QEMU
libvirtd_LDADD += ../src/libvirt_driver_qemu.la
if WITH_DTRACE_PROBES
libvirtd_LDADD += ../src/libvirt_qemu_probes.lo
-endif
-endif
+endif WITH_DTRACE_PROBES
+endif WITH_QEMU
if WITH_LXC
libvirtd_LDADD += ../src/libvirt_driver_lxc.la
-endif
+endif WITH_LXC
if WITH_XEN
libvirtd_LDADD += ../src/libvirt_driver_xen.la
-endif
+endif WITH_XEN
if WITH_LIBXL
libvirtd_LDADD += ../src/libvirt_driver_libxl.la
-endif
+endif WITH_LIBXL
if WITH_UML
libvirtd_LDADD += ../src/libvirt_driver_uml.la
-endif
+endif WITH_UML
if WITH_VBOX
libvirtd_LDADD += ../src/libvirt_driver_vbox.la
-endif
+endif WITH_VBOX
if WITH_STORAGE
libvirtd_LDADD += ../src/libvirt_driver_storage.la
-endif
+endif WITH_STORAGE
if WITH_NETWORK
libvirtd_LDADD += ../src/libvirt_driver_network.la
-endif
+endif WITH_NETWORK
if WITH_INTERFACE
libvirtd_LDADD += ../src/libvirt_driver_interface.la
-endif
+endif WITH_INTERFACE
if WITH_NODE_DEVICES
libvirtd_LDADD += ../src/libvirt_driver_nodedev.la
-endif
+endif WITH_NODE_DEVICES
if WITH_SECRETS
libvirtd_LDADD += ../src/libvirt_driver_secret.la
-endif
+endif WITH_SECRETS
if WITH_NWFILTER
libvirtd_LDADD += ../src/libvirt_driver_nwfilter.la
-endif
-endif
+endif WITH_NWFILTER
+endif ! WITH_DRIVER_MODULES
libvirtd_LDADD += ../src/libvirt.la
@@ -207,11 +207,11 @@ if WITH_POLKIT
if WITH_POLKIT0
policydir = $(datadir)/PolicyKit/policy
policyauth = auth_admin_keep_session
-else
+else ! WITH_POLKIT0
policydir = $(datadir)/polkit-1/actions
policyauth = auth_admin_keep
-endif
-endif
+endif ! WITH_POLKIT0
+endif WITH_POLKIT
libvirtd.policy: libvirtd.policy.in $(top_builddir)/config.status
$(AM_V_GEN) sed \
@@ -243,10 +243,10 @@ install-data-polkit::
uninstall-data-polkit::
rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
rmdir $(DESTDIR)$(policydir) || :
-else
+else ! WITH_POLKIT
install-data-polkit::
uninstall-data-polkit::
-endif
+endif ! WITH_POLKIT
remote.c: $(DAEMON_GENERATED)
remote.h: $(DAEMON_GENERATED)
@@ -323,10 +323,10 @@ install-sysctl:
uninstall-sysctl:
rm -f $(DESTDIR)$(prefix)/lib/sysctl.d/libvirtd.conf
rmdir $(DESTDIR)$(prefix)/lib/sysctl.d || :
-else
+else ! WITH_SYSCTL
install-sysctl:
uninstall-sysctl:
-endif
+endif ! WITH_SYSCTL
if LIBVIRT_INIT_SCRIPT_RED_HAT
@@ -340,10 +340,10 @@ install-init-redhat: install-sysconfig libvirtd.init
uninstall-init-redhat: uninstall-sysconfig
rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
-else
+else ! LIBVIRT_INIT_SCRIPT_RED_HAT
install-init-redhat:
uninstall-init-redhat:
-endif # LIBVIRT_INIT_SCRIPT_RED_HAT
+endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
if LIBVIRT_INIT_SCRIPT_UPSTART
@@ -356,10 +356,10 @@ install-init-upstart: install-sysconfig
uninstall-init-upstart: uninstall-sysconfig
rm -f $(DESTDIR)$(sysconfdir)/event.d/libvirtd
rmdir $(DESTDIR)$(sysconfdir)/event.d || :
-else
+else ! LIBVIRT_INIT_SCRIPT_UPSTART
install-init-upstart:
uninstall-init-upstart:
-endif # LIBVIRT_INIT_SCRIPT_UPSTART
+endif ! LIBVIRT_INIT_SCRIPT_UPSTART
if LIBVIRT_INIT_SCRIPT_SYSTEMD
@@ -375,10 +375,10 @@ install-init-systemd: install-sysconfig libvirtd.service
uninstall-init-systemd: uninstall-sysconfig
rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service
rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
-else
+else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
install-init-systemd:
uninstall-init-systemd:
-endif # LIBVIRT_INIT_SCRIPT_SYSTEMD
+endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
libvirtd.init: libvirtd.init.in $(top_builddir)/config.status
$(AM_V_GEN)sed \
@@ -415,10 +415,10 @@ check-augeas: test_libvirtd.aug
# are used by nearly every other library.
libvirtd_LDADD += ../gnulib/lib/libgnu.la $(LIBSOCKET)
-else # WITH_LIBVIRTD
+else ! WITH_LIBVIRTD
install-data-local: install-data-sasl
uninstall-local:: uninstall-data-sasl
-endif # WITH_LIBVIRTD
+endif ! WITH_LIBVIRTD
POD2MAN = pod2man -c "Virtualization Support" \
-r "$(PACKAGE)-$(VERSION)" -s 8
@@ -438,10 +438,10 @@ install-data-sasl:
uninstall-data-sasl:
rm -f $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
rmdir $(DESTDIR)$(sysconfdir)/sasl2/ || :
-else
+else ! WITH_SASL
install-data-sasl:
uninstall-data-sasl:
-endif
+endif ! WITH_SASL
CLEANFILES += $(BUILT_SOURCES) $(man8_MANS)
diff --git a/gnulib/tests/Makefile.am b/gnulib/tests/Makefile.am
index 74d71e9..df4af59 100644
--- a/gnulib/tests/Makefile.am
+++ b/gnulib/tests/Makefile.am
@@ -26,7 +26,7 @@ if WITH_EXPENSIVE_TESTS
## Automake requires that at least one conditional call out all tests to
## be run, for those tests to be shipped in the tarball
TESTS = $(GNULIB_TESTS)
-endif
+endif WITH_EXPENSIVE_TESTS
## However, we want to change the set of tests based on the make environment,
## where the default was set at configure time. Use GNU make constructs to
## hide our actions from Automake, so we don't get it too confused.
diff --git a/python/Makefile.am b/python/Makefile.am
index 3f967a9..f327300 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -162,9 +162,9 @@ uninstall-local:
CLEANFILES= $(GENERATED) $(QEMU_GENERATED) $(LXC_GENERATED) $(GENERATE).stamp \
*.pyc
-else
+else ! WITH_PYTHON
all:
-endif
+endif ! WITH_PYTHON
dummy:
diff --git a/src/Makefile.am b/src/Makefile.am
index 83f514a..9b336fd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -51,14 +51,14 @@ THREAD_LIBS = $(LIB_PTHREAD) $(LTLIBMULTITHREAD)
SECDRIVER_LIBS =
if WITH_SECDRIVER_SELINUX
SECDRIVER_LIBS += $(SELINUX_LIBS)
-endif
+endif WITH_SECDRIVER_SELINUX
if WITH_SECDRIVER_APPARMOR
SECDRIVER_LIBS += $(APPARMOR_LIBS)
-endif
+endif WITH_SECDRIVER_APPARMOR
if WITH_NETWORK
UUID=$(shell uuidgen 2>/dev/null)
-endif
+endif WITH_NETWORK
lib_LTLIBRARIES = libvirt.la libvirt-qemu.la libvirt-lxc.la
@@ -414,9 +414,9 @@ if WITH_LINUX
check-symfile: libvirt.syms libvirt.la
$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt.syms \
.libs/libvirt.so
-else
+else ! WITH_LINUX
check-symfile:
-endif
+endif ! WITH_LINUX
check-symsorting:
$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
$(srcdir) $(SYM_FILES)
@@ -445,7 +445,7 @@ else !WITH_REMOTE
# The $(PROTOCOL_STRUCTS) files must live in git, because they cannot be
# re-generated when configured --without-remote.
check-protocol:
-endif
+endif !WITH_REMOTE
EXTRA_DIST += $(PROTOCOL_STRUCTS)
check-drivername:
@@ -531,7 +531,7 @@ XEN_DRIVER_SOURCES = \
xen/xs_internal.c xen/xs_internal.h
if WITH_XEN_INOTIFY
XEN_DRIVER_SOURCES += xen/xen_inotify.c xen/xen_inotify.h
-endif
+endif WITH_XEN_INOTIFY
LXC_MONITOR_PROTOCOL_GENERATED = \
$(srcdir)/lxc/lxc_monitor_protocol.h \
@@ -750,12 +750,12 @@ INTERFACE_DRIVER_SOURCES += \
if WITH_NETCF
INTERFACE_DRIVER_SOURCES += \
interface/interface_backend_netcf.c
-endif
+endif WITH_NETCF
if WITH_UDEV
INTERFACE_DRIVER_SOURCES += \
interface/interface_backend_udev.c
-endif
-endif
+endif WITH_UDEV
+endif WITH_INTERFACE
SECRET_DRIVER_SOURCES = \
secret/secret_driver.h secret/secret_driver.c
@@ -928,7 +928,7 @@ libvirt_la_BUILT_LIBADD += libvirt_vmx.la
libvirt_vmx_la_CFLAGS = \
-I$(top_srcdir)/src/conf $(AM_CFLAGS)
libvirt_vmx_la_SOURCES = $(VMX_SOURCES)
-endif
+endif WITH_VMX
if WITH_XENXS
noinst_LTLIBRARIES += libvirt_xenxs.la
@@ -936,7 +936,7 @@ libvirt_la_BUILT_LIBADD += libvirt_xenxs.la
libvirt_xenxs_la_CFLAGS = \
-I$(top_srcdir)/src/conf $(AM_CFLAGS)
libvirt_xenxs_la_SOURCES = $(XENXS_SOURCES)
-endif
+endif WITH_XENXS
noinst_LTLIBRARIES += libvirt_driver.la
@@ -964,7 +964,7 @@ libvirt_la_BUILT_LIBADD += libvirt_driver_test.la
libvirt_driver_test_la_CFLAGS = \
-I$(top_srcdir)/src/conf $(AM_CFLAGS)
libvirt_driver_test_la_SOURCES = $(TEST_DRIVER_SOURCES)
-endif
+endif WITH_TEST
if WITH_REMOTE
noinst_LTLIBRARIES += libvirt_driver_remote.la
@@ -1002,11 +1002,11 @@ if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_xen.la
libvirt_driver_xen_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_xen_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
-else
+else ! WITH_DRIVER_MODULES
noinst_LTLIBRARIES += libvirt_driver_xen.la
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_xen.la
-endif
+endif ! WITH_DRIVER_MODULES
libvirt_driver_xen_impl_la_CFLAGS = \
$(XEN_CFLAGS) \
@@ -1017,7 +1017,7 @@ libvirt_driver_xen_impl_la_CFLAGS = \
libvirt_driver_xen_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_xen_impl_la_LIBADD = $(XEN_LIBS)
libvirt_driver_xen_impl_la_SOURCES = $(XEN_DRIVER_SOURCES)
-endif
+endif WITH_XEN
if WITH_PHYP
noinst_LTLIBRARIES += libvirt_driver_phyp.la
@@ -1026,7 +1026,7 @@ libvirt_driver_phyp_la_LIBADD = $(SSH2_LIBS)
libvirt_driver_phyp_la_CFLAGS = $(SSH2_CFLAGS) \
-I$(top_srcdir)/src/conf $(AM_CFLAGS)
libvirt_driver_phyp_la_SOURCES = $(PHYP_DRIVER_SOURCES)
-endif
+endif WITH_PHYP
if WITH_OPENVZ
noinst_LTLIBRARIES += libvirt_driver_openvz.la
@@ -1034,7 +1034,7 @@ libvirt_la_BUILT_LIBADD += libvirt_driver_openvz.la
libvirt_driver_openvz_la_CFLAGS = \
-I$(top_srcdir)/src/conf $(AM_CFLAGS)
libvirt_driver_openvz_la_SOURCES = $(OPENVZ_DRIVER_SOURCES)
-endif
+endif WITH_OPENVZ
if WITH_VMWARE
noinst_LTLIBRARIES += libvirt_driver_vmware.la
@@ -1042,7 +1042,7 @@ libvirt_la_BUILT_LIBADD += libvirt_driver_vmware.la
libvirt_driver_vmware_la_CFLAGS = \
-I$(top_srcdir)/src/conf -I$(top_srcdir)/src/vmx $(AM_CFLAGS)
libvirt_driver_vmware_la_SOURCES = $(VMWARE_DRIVER_SOURCES)
-endif
+endif WITH_VMWARE
if WITH_VBOX
noinst_LTLIBRARIES += libvirt_driver_vbox_impl.la
@@ -1052,12 +1052,12 @@ if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_vbox.la
libvirt_driver_vbox_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
-else
+else ! WITH_DRIVER_MODULES
noinst_LTLIBRARIES += libvirt_driver_vbox.la
# GPLv2-only license requries that it be linked into
# libvirtd and *not* libvirt.so
#libvirt_la_BUILT_LIBADD += libvirt_driver_vbox.la
-endif
+endif ! WITH_DRIVER_MODULES
libvirt_driver_vbox_impl_la_CFLAGS = \
-I$(top_srcdir)/src/conf \
@@ -1065,7 +1065,7 @@ libvirt_driver_vbox_impl_la_CFLAGS = \
libvirt_driver_vbox_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_vbox_impl_la_LIBADD = $(DLOPEN_LIBS) $(MSCOM_LIBS)
libvirt_driver_vbox_impl_la_SOURCES = $(VBOX_DRIVER_SOURCES)
-endif
+endif WITH_VBOX
if WITH_XENAPI
noinst_LTLIBRARIES += libvirt_driver_xenapi.la
@@ -1075,7 +1075,7 @@ libvirt_driver_xenapi_la_CFLAGS = $(LIBXENSERVER_CFLAGS) $(CURL_CFLAGS) \
libvirt_driver_xenapi_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_xenapi_la_LIBADD = $(LIBXENSERVER_LIBS) $(CURL_LIBS)
libvirt_driver_xenapi_la_SOURCES = $(XENAPI_DRIVER_SOURCES)
-endif
+endif WITH_XENAPI
if WITH_LIBXL
noinst_LTLIBRARIES += libvirt_driver_libxl_impl.la
@@ -1085,11 +1085,11 @@ if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_libxl.la
libvirt_driver_libxl_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_libxl_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
-else
+else ! WITH_DRIVER_MODULES
noinst_LTLIBRARIES += libvirt_driver_libxl.la
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_libxl.la
-endif
+endif ! WITH_DRIVER_MODULES
libvirt_driver_libxl_impl_la_CFLAGS = \
$(LIBXL_CFLAGS) \
@@ -1100,7 +1100,7 @@ libvirt_driver_libxl_impl_la_CFLAGS = \
libvirt_driver_libxl_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_libxl_impl_la_LIBADD = $(LIBXL_LIBS) libvirt_xenxs.la
libvirt_driver_libxl_impl_la_SOURCES = $(LIBXL_DRIVER_SOURCES)
-endif
+endif WITH_LIBXL
if WITH_QEMU
noinst_LTLIBRARIES += libvirt_driver_qemu_impl.la
@@ -1110,11 +1110,11 @@ if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_qemu.la
libvirt_driver_qemu_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_qemu_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
-else
+else ! WITH_DRIVER_MODULES
noinst_LTLIBRARIES += libvirt_driver_qemu.la
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_qemu.la
-endif
+endif ! WITH_DRIVER_MODULES
libvirt_driver_qemu_impl_la_CFLAGS = \
$(GNUTLS_CFLAGS) \
@@ -1136,7 +1136,7 @@ augeas_DATA += qemu/libvirtd_qemu.aug
augeastest_DATA += test_libvirtd_qemu.aug
CLEANFILES += test_libvirtd_qemu.aug
-endif
+endif WITH_QEMU
EXTRA_DIST += qemu/qemu.conf qemu/libvirtd_qemu.aug \
qemu/test_libvirtd_qemu.aug.in qemu/THREADS.txt
@@ -1149,11 +1149,11 @@ if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_lxc.la
libvirt_driver_lxc_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_lxc_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
-else
+else ! WITH_DRIVER_MODULES
noinst_LTLIBRARIES += libvirt_driver_lxc.la
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_lxc.la
-endif
+endif ! WITH_DRIVER_MODULES
libvirt_driver_lxc_impl_la_CFLAGS = \
$(LIBNL_CFLAGS) \
@@ -1165,7 +1165,7 @@ libvirt_driver_lxc_impl_la_LIBADD = $(CAPNG_LIBS) $(LIBNL_LIBS) $(FUSE_LIBS)
if WITH_BLKID
libvirt_driver_lxc_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_lxc_impl_la_LIBADD += $(BLKID_LIBS)
-endif
+endif WITH_BLKID
libvirt_driver_lxc_impl_la_LIBADD += $(SECDRIVER_LIBS)
libvirt_driver_lxc_impl_la_SOURCES = $(LXC_DRIVER_SOURCES)
@@ -1175,7 +1175,7 @@ augeas_DATA += lxc/libvirtd_lxc.aug
augeastest_DATA += test_libvirtd_lxc.aug
CLEANFILES += test_libvirtd_lxc.aug
-endif
+endif WITH_LXC
EXTRA_DIST += lxc/lxc.conf lxc/libvirtd_lxc.aug lxc/test_libvirtd_lxc.aug.in
if WITH_UML
@@ -1186,11 +1186,11 @@ if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_uml.la
libvirt_driver_uml_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_uml_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
-else
+else ! WITH_DRIVER_MODULES
noinst_LTLIBRARIES += libvirt_driver_uml.la
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_uml.la
-endif
+endif ! WITH_DRIVER_MODULES
libvirt_driver_uml_impl_la_CFLAGS = \
-I$(top_srcdir)/src/access \
@@ -1199,7 +1199,7 @@ libvirt_driver_uml_impl_la_CFLAGS = \
libvirt_driver_uml_impl_la_LDFLAGS = $(AM_LDFLAGS)
# libvirt_driver_uml_impl_la_LIBADD =
libvirt_driver_uml_impl_la_SOURCES = $(UML_DRIVER_SOURCES)
-endif
+endif WITH_UML
BUILT_SOURCES += $(ESX_DRIVER_GENERATED)
@@ -1227,7 +1227,7 @@ libvirt_driver_esx_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_esx_la_LIBADD = $(CURL_LIBS)
libvirt_driver_esx_la_SOURCES = $(ESX_DRIVER_SOURCES)
libvirt_driver_esx_la_DEPENDENCIES = $(ESX_DRIVER_GENERATED)
-endif
+endif WITH_ESX
BUILT_SOURCES += $(HYPERV_DRIVER_GENERATED)
@@ -1254,7 +1254,7 @@ libvirt_driver_hyperv_la_CFLAGS = $(OPENWSMAN_CFLAGS) \
libvirt_driver_hyperv_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_hyperv_la_LIBADD = $(OPENWSMAN_LIBS)
libvirt_driver_hyperv_la_SOURCES = $(HYPERV_DRIVER_SOURCES)
-endif
+endif WITH_HYPERV
if WITH_PARALLELS
noinst_LTLIBRARIES += libvirt_driver_parallels.la
@@ -1262,7 +1262,7 @@ libvirt_la_BUILT_LIBADD += libvirt_driver_parallels.la
libvirt_driver_parallels_la_CFLAGS = \
-I$(top_srcdir)/src/conf $(AM_CFLAGS)
libvirt_driver_parallels_la_SOURCES = $(PARALLELS_DRIVER_SOURCES)
-endif
+endif WITH_PARALLELS
if WITH_NETWORK
noinst_LTLIBRARIES += libvirt_driver_network_impl.la
@@ -1275,11 +1275,11 @@ libvirt_driver_network_la_LIBADD += ../gnulib/lib/libgnu.la \
$(DBUS_LIBS) \
$(NULL)
libvirt_driver_network_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
-else
+else ! WITH_DRIVER_MODULES
noinst_LTLIBRARIES += libvirt_driver_network.la
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_network.la
-endif
+endif ! WITH_DRIVER_MODULES
libvirt_driver_network_impl_la_CFLAGS = \
$(LIBNL_CFLAGS) \
@@ -1289,18 +1289,18 @@ libvirt_driver_network_impl_la_CFLAGS = \
$(AM_CFLAGS)
libvirt_driver_network_impl_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
libvirt_driver_network_impl_la_LIBADD = $(DBUS_LIBS)
-endif
+endif WITH_NETWORK
EXTRA_DIST += network/default.xml
if WITH_INTERFACE
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_interface.la
-else
+else ! WITH_DRIVER_MODULES
noinst_LTLIBRARIES += libvirt_driver_interface.la
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_interface.la
-endif
+endif ! WITH_DRIVER_MODULES
libvirt_driver_interface_la_CFLAGS = \
-I$(top_srcdir)/src/access \
-I$(top_srcdir)/src/conf \
@@ -1310,27 +1310,27 @@ libvirt_driver_interface_la_LIBADD =
if WITH_NETCF
libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS)
-else
+else ! WITH_NETCF
if WITH_UDEV
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
-endif
-endif
+endif WITH_UDEV
+endif ! WITH_NETCF
if WITH_DRIVER_MODULES
libvirt_driver_interface_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
-endif
+endif WITH_DRIVER_MODULES
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
-endif
+endif WITH_INTERFACE
if WITH_SECRETS
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_secret.la
-else
+else ! WITH_DRIVER_MODULES
noinst_LTLIBRARIES += libvirt_driver_secret.la
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_secret.la
-endif
+endif ! WITH_DRIVER_MODULES
libvirt_driver_secret_la_CFLAGS = \
-I$(top_srcdir)/src/access \
-I$(top_srcdir)/src/conf \
@@ -1338,9 +1338,9 @@ libvirt_driver_secret_la_CFLAGS = \
if WITH_DRIVER_MODULES
libvirt_driver_secret_la_LIBADD = ../gnulib/lib/libgnu.la
libvirt_driver_secret_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
-endif
+endif WITH_DRIVER_MODULES
libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
-endif
+endif WITH_SECRETS
# Needed to keep automake quiet about conditionals
libvirt_driver_storage_impl_la_SOURCES =
@@ -1354,7 +1354,7 @@ libvirt_driver_storage_impl_la_LIBADD += $(SECDRIVER_LIBS)
if WITH_BLKID
libvirt_driver_storage_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(BLKID_LIBS)
-endif
+endif WITH_BLKID
if WITH_STORAGE
noinst_LTLIBRARIES += libvirt_driver_storage_impl.la
libvirt_driver_storage_la_SOURCES =
@@ -1363,55 +1363,55 @@ if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_storage.la
libvirt_driver_storage_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_storage_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
-else
+else ! WITH_DRIVER_MODULES
noinst_LTLIBRARIES += libvirt_driver_storage.la
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_storage.la
-endif
+endif ! WITH_DRIVER_MODULES
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_FS_SOURCES)
-endif
+endif WITH_STORAGE
if WITH_STORAGE_LVM
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_LVM_SOURCES)
-endif
+endif WITH_STORAGE_LVM
if WITH_STORAGE_ISCSI
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_ISCSI_SOURCES)
-endif
+endif WITH_STORAGE_ISCSI
if WITH_STORAGE_SCSI
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SCSI_SOURCES)
-endif
+endif WITH_STORAGE_SCSI
if WITH_STORAGE_MPATH
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_MPATH_SOURCES)
libvirt_driver_storage_impl_la_CFLAGS += $(DEVMAPPER_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(DEVMAPPER_LIBS)
-endif
+endif WITH_STORAGE_MPATH
if WITH_STORAGE_DISK
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_DISK_SOURCES)
-endif
+endif WITH_STORAGE_DISK
if WITH_STORAGE_RBD
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_RBD_SOURCES)
libvirt_driver_storage_impl_la_LIBADD += $(LIBRBD_LIBS)
-endif
+endif WITH_STORAGE_RBD
if WITH_STORAGE_SHEEPDOG
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SHEEPDOG_SOURCES)
-endif
+endif WITH_STORAGE_SHEEPDOG
if WITH_NODE_DEVICES
# Needed to keep automake quiet about conditionals
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_nodedev.la
-else
+else ! WITH_DRIVER_MODULES
noinst_LTLIBRARIES += libvirt_driver_nodedev.la
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_nodedev.la
-endif
+endif ! WITH_DRIVER_MODULES
libvirt_driver_nodedev_la_SOURCES = $(NODE_DEVICE_DRIVER_SOURCES)
libvirt_driver_nodedev_la_CFLAGS = \
@@ -1426,29 +1426,29 @@ if WITH_HAL
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(HAL_CFLAGS)
libvirt_driver_nodedev_la_LIBADD += $(HAL_LIBS)
-endif
+endif WITH_HAL
if WITH_UDEV
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_UDEV_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(UDEV_CFLAGS) $(PCIACCESS_CFLAGS)
libvirt_driver_nodedev_la_LIBADD += $(UDEV_LIBS) $(PCIACCESS_LIBS)
-endif
-endif
+endif WITH_UDEV
+endif WITH_LIBVIRTD
if WITH_DRIVER_MODULES
libvirt_driver_nodedev_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_nodedev_la_LDFLAGS += -module -avoid-version
-endif
-endif
+endif WITH_DRIVER_MODULES
+endif WITH_NODE_DEVICES
if WITH_NWFILTER
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_nwfilter.la
-else
+else ! WITH_DRIVER_MODULES
noinst_LTLIBRARIES += libvirt_driver_nwfilter.la
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_nwfilter.la
-endif
+endif ! WITH_DRIVER_MODULES
libvirt_driver_nwfilter_la_CFLAGS = \
$(LIBPCAP_CFLAGS) \
$(LIBNL_CFLAGS) \
@@ -1461,9 +1461,9 @@ libvirt_driver_nwfilter_la_LIBADD = $(LIBPCAP_LIBS) $(LIBNL_LIBS) $(DBUS_LIBS)
if WITH_DRIVER_MODULES
libvirt_driver_nwfilter_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_nwfilter_la_LDFLAGS += -module -avoid-version
-endif
+endif WITH_DRIVER_MODULES
libvirt_driver_nwfilter_la_SOURCES = $(NWFILTER_DRIVER_SOURCES)
-endif
+endif WITH_NWFILTER
libvirt_security_manager_la_SOURCES = $(SECURITY_DRIVER_SOURCES)
@@ -1476,11 +1476,11 @@ libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
if WITH_SECDRIVER_SELINUX
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
-endif
+endif WITH_SECDRIVER_SELINUX
if WITH_SECDRIVER_APPARMOR
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
-endif
+endif WITH_SECDRIVER_APPARMOR
libvirt_driver_access_la_SOURCES = \
$(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
@@ -1505,9 +1505,9 @@ $(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
-else
+else ! WITH_POLKIT1
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
-endif
+endif ! WITH_POLKIT1
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
@@ -1631,9 +1631,9 @@ check-augeas-qemu: test_libvirtd_qemu.aug
$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
'$(AUGPARSE)' -I $(srcdir)/qemu test_libvirtd_qemu.aug; \
fi
-else
+else ! WITH_QEMU
check-augeas-qemu:
-endif
+endif ! WITH_QEMU
if WITH_LXC
test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
@@ -1644,9 +1644,9 @@ check-augeas-lxc: test_libvirtd_lxc.aug
$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
'$(AUGPARSE)' -I $(srcdir)/lxc test_libvirtd_lxc.aug; \
fi
-else
+else ! WITH_LXC
check-augeas-lxc:
-endif
+endif ! WITH_LXC
if WITH_SANLOCK
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
@@ -1657,9 +1657,9 @@ check-augeas-sanlock: test_libvirt_sanlock.aug
$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
'$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
fi
-else
+else ! WITH_SANLOCK
check-augeas-sanlock:
-endif
+endif ! WITH_SANLOCK
test_libvirt_lockd.aug: locking/test_libvirt_lockd.aug.in \
locking/qemu-lockd.conf $(AUG_GENTEST)
@@ -1700,69 +1700,69 @@ check-augeas-virtlockd: test_virtlockd.aug
if WITH_DRIVER_MODULES
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
-else
+else ! WITH_DRIVER_MODULES
SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
-endif
+endif ! WITH_DRIVER_MODULES
if WITH_LINUX
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
-else
+else ! WITH_LINUX
SYM_FILES += $(srcdir)/libvirt_linux.syms
-endif
+endif ! WITH_LINUX
if WITH_ESX
USED_SYM_FILES += $(srcdir)/libvirt_esx.syms
-else
+else ! WITH_ESX
SYM_FILES += $(srcdir)/libvirt_esx.syms
-endif
+endif ! WITH_ESX
if WITH_LIBVIRTD
USED_SYM_FILES += $(srcdir)/libvirt_daemon.syms
-else
+else ! WITH_LIBVIRTD
SYM_FILES += $(srcdir)/libvirt_daemon.syms
-endif
+endif ! WITH_LIBVIRTD
if WITH_OPENVZ
USED_SYM_FILES += $(srcdir)/libvirt_openvz.syms
-else
+else ! WITH_OPENVZ
SYM_FILES += $(srcdir)/libvirt_openvz.syms
-endif
+endif ! WITH_OPENVZ
if WITH_VMX
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
-else
+else ! WITH_VMX
SYM_FILES += $(srcdir)/libvirt_vmx.syms
-endif
+endif ! WITH_VMX
if WITH_XENXS
USED_SYM_FILES += $(srcdir)/libvirt_xenxs.syms
-else
+else ! WITH_XENXS
SYM_FILES += $(srcdir)/libvirt_xenxs.syms
-endif
+endif ! WITH_XENXS
if WITH_SASL
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
-else
+else ! WITH_SASL
SYM_FILES += $(srcdir)/libvirt_sasl.syms
-endif
+endif ! WITH_SASL
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
-else
+else ! WITH_GNUTLS
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
-endif
+endif ! WITH_GNUTLS
if WITH_SSH2
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
-else
+else ! WITH_SSH2
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
-endif
+endif ! WITH_SSH2
if WITH_ATOMIC_OPS_PTHREAD
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
-else
+else ! WITH_ATOMIC_OPS_PTHREAD
SYM_FILES += $(srcdir)/libvirt_atomic.syms
-endif
+endif ! WITH_ATOMIC_OPS_PTHREAD
EXTRA_DIST += \
libvirt_public.syms \
@@ -1842,7 +1842,7 @@ nodist_libvirt_driver_remote_la_SOURCES = libvirt_probes.h
endif WITH_REMOTE
if WITH_DRIVER_MODULES
DTRACE2SYSTEMTAP_FLAGS = --with-modules
-endif
+endif WITH_DRIVER_MODULES
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp
@@ -1850,7 +1850,7 @@ if WITH_QEMU
libvirt_driver_qemu_la_LIBADD += libvirt_qemu_probes.lo
nodist_libvirt_driver_qemu_la_SOURCES = libvirt_qemu_probes.h
BUILT_SOURCES += libvirt_qemu_probes.h
-endif
+endif WITH_QEMU
tapsetdir = $(datadir)/systemtap/tapset
tapset_DATA = libvirt_probes.stp libvirt_qemu_probes.stp libvirt_functions.stp
@@ -1892,7 +1892,7 @@ CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
libvirt_qemu_probes.lo\
libvirt_functions.stp libvirt_probes.stp \
libvirt_qemu_probes.stp
-endif
+endif WITH_DTRACE_PROBES
EXTRA_DIST += libvirt_probes.d libvirt_qemu_probes.d
@@ -1940,12 +1940,12 @@ augeastest_DATA += test_libvirt_lockd.aug
CLEANFILES += test_libvirt_lockd.aug
if WITH_DTRACE_PROBES
lockd_la_LIBADD += libvirt_probes.lo
-endif
+endif WITH_DTRACE_PROBES
if WITH_QEMU
nodist_conf_DATA += locking/qemu-lockd.conf
BUILT_SOURCES += locking/qemu-lockd.conf
DISTCLEANFILES += locking/qemu-lockd.conf
-endif
+endif WITH_QEMU
locking/%-lockd.conf: $(srcdir)/locking/lockd.conf
$(AM_V_GEN)$(MKDIR_P) locking ; \
@@ -1979,12 +1979,12 @@ virtlockd_LDADD = \
$(NULL)
if WITH_DTRACE_PROBES
virtlockd_LDADD += libvirt_probes.lo
-endif
+endif WITH_DTRACE_PROBES
-else
+else ! WITH_LIBVIRTD
EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
$(LOCK_DRIVER_LOCKD_SOURCES)
-endif
+endif ! WITH_LIBVIRTD
EXTRA_DIST += locking/virtlockd.sysconf \
locking/lockd.conf \
@@ -2015,14 +2015,14 @@ uninstall-init:: uninstall-sysconfig
BUILT_SOURCES += virtlockd.init
DISTCLEANFILES += virtlockd.init
-else
+else ! LIBVIRT_INIT_SCRIPT_RED_HAT
install-init::
uninstall-init::
-endif
-else
+endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
+else ! WITH_LIBVIRTD
install-init::
uninstall-init::
-endif
+endif ! WITH_LIBVIRTD
virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
$(AM_V_GEN)sed \
@@ -2089,14 +2089,14 @@ uninstall-systemd: uninstall-sysconfig
rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.service \
$(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.socket
rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
-else
+else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
install-systemd:
uninstall-systemd:
-endif
-else
+endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
+else ! WITH_LIBVIRTD
install-systemd:
uninstall-systemd:
-endif
+endif ! WITH_LIBVIRTD
virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
$(AM_V_GEN)sed \
@@ -2131,10 +2131,10 @@ if WITH_QEMU
nodist_conf_DATA += locking/qemu-sanlock.conf
BUILT_SOURCES += locking/qemu-sanlock.conf
DISTCLEANFILES += locking/qemu-sanlock.conf
-endif
-else
+endif WITH_QEMU
+else ! WITH_SANLOCK
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
-endif
+endif ! WITH_SANLOCK
EXTRA_DIST += locking/sanlock.conf \
locking/libvirt_sanlock.aug \
locking/test_libvirt_sanlock.aug.in
@@ -2169,24 +2169,24 @@ libvirt_net_rpc_la_SOURCES = \
if WITH_SSH2
libvirt_net_rpc_la_SOURCES += \
rpc/virnetsshsession.h rpc/virnetsshsession.c
-else
+else ! WITH_SSH2
EXTRA_DIST += \
rpc/virnetsshsession.h rpc/virnetsshsession.c
-endif
+endif ! WITH_SSH2
if WITH_GNUTLS
libvirt_net_rpc_la_SOURCES += \
rpc/virnettlscontext.h rpc/virnettlscontext.c
-else
+else ! WITH_GNUTLS
EXTRA_DIST += \
rpc/virnettlscontext.h rpc/virnettlscontext.c
-endif
+endif ! WITH_GNUTLS
if WITH_SASL
libvirt_net_rpc_la_SOURCES += \
rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
-else
+else ! WITH_SASL
EXTRA_DIST += \
rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
-endif
+endif ! WITH_SASL
libvirt_net_rpc_la_CFLAGS = \
$(GNUTLS_CFLAGS) \
$(SASL_CFLAGS) \
@@ -2253,13 +2253,13 @@ libvirt_iohelper_LDADD = \
../gnulib/lib/libgnu.la
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
-endif
+endif WITH_DTRACE_PROBES
libvirt_iohelper_CFLAGS = \
$(AM_CFLAGS) \
$(PIE_CFLAGS) \
$(NULL)
-endif
+endif WITH_LIBVIRTD
if WITH_STORAGE_DISK
if WITH_LIBVIRTD
@@ -2276,15 +2276,15 @@ libvirt_parthelper_LDADD = \
../gnulib/lib/libgnu.la
if WITH_DTRACE_PROBES
libvirt_parthelper_LDADD += libvirt_probes.lo
-endif
+endif WITH_DTRACE_PROBES
libvirt_parthelper_CFLAGS = \
$(LIBPARTED_CFLAGS) \
$(AM_CFLAGS) \
$(PIE_CFLAGS) \
$(NULL)
-endif
-endif
+endif WITH_LIBVIRTD
+endif WITH_STORAGE_DISK
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)
@@ -2302,7 +2302,7 @@ libvirt_sanlock_helper_LDFLAGS = \
$(PIE_LDFLAGS) \
$(NULL)
libvirt_sanlock_helper_LDADD = libvirt.la
-endif
+endif WITH_SANLOCK
if WITH_LXC
if WITH_LIBVIRTD
@@ -2326,7 +2326,7 @@ libvirt_lxc_LDADD = \
../gnulib/lib/libgnu.la
if WITH_DTRACE_PROBES
libvirt_lxc_LDADD += libvirt_probes.lo
-endif
+endif WITH_DTRACE_PROBES
libvirt_lxc_LDADD += $(SECDRIVER_LIBS)
libvirt_lxc_CFLAGS = \
-I$(top_srcdir)/src/conf \
@@ -2338,15 +2338,15 @@ libvirt_lxc_CFLAGS = \
if WITH_BLKID
libvirt_lxc_CFLAGS += $(BLKID_CFLAGS)
libvirt_lxc_LDADD += $(BLKID_LIBS)
-endif
+endif WITH_BLKID
if WITH_SECDRIVER_SELINUX
libvirt_lxc_CFLAGS += $(SELINUX_CFLAGS)
-endif
+endif WITH_SECDRIVER_SELINUX
if WITH_SECDRIVER_APPARMOR
libvirt_lxc_CFLAGS += $(APPARMOR_CFLAGS)
-endif
-endif
-endif
+endif WITH_SECDRIVER_APPARMOR
+endif WITH_LIBVIRTD
+endif WITH_LXC
EXTRA_DIST += $(LXC_CONTROLLER_SOURCES)
if WITH_SECDRIVER_APPARMOR
@@ -2365,15 +2365,15 @@ virt_aa_helper_LDADD = \
../gnulib/lib/libgnu.la
if WITH_DTRACE_PROBES
virt_aa_helper_LDADD += libvirt_probes.lo
-endif
+endif WITH_DTRACE_PROBES
virt_aa_helper_CFLAGS = \
-I$(top_srcdir)/src/conf \
-I$(top_srcdir)/src/security \
$(AM_CFLAGS) \
$(PIE_CFLAGS) \
$(NULL)
-endif
-endif
+endif WITH_LIBVIRTD
+endif WITH_SECDRIVER_APPARMOR
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)
install-data-local: install-init install-systemd
@@ -2381,37 +2381,37 @@ if WITH_LIBVIRTD
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lockd"
-endif
+endif WITH_LIBVIRTD
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
if WITH_SANLOCK
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
-endif
+endif WITH_SANLOCK
if WITH_QEMU
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu/channel/target"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/qemu"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/qemu"
-endif
+endif WITH_QEMU
if WITH_LXC
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lxc"
-endif
+endif WITH_LXC
if WITH_LIBXL
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/libxl"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/libxl"
-endif
+endif WITH_LIBXL
if WITH_UML
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/uml"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/uml"
-endif
+endif WITH_UML
if WITH_XEN
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/xen"
-endif
+endif WITH_XEN
if WITH_NETWORK
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/network"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/dnsmasq"
@@ -2429,43 +2429,43 @@ if WITH_NETWORK
test -e $(DESTDIR)$(confdir)/qemu/networks/autostart/default.xml || \
ln -s ../default.xml \
$(DESTDIR)$(confdir)/qemu/networks/autostart/default.xml
-endif
+endif WITH_NETWORK
uninstall-local:: uninstall-init uninstall-systemd
if WITH_LIBVIRTD
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
-endif
+endif WITH_LIBVIRTD
rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
if WITH_SANLOCK
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
-endif
+endif WITH_SANLOCK
if WITH_QEMU
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu" ||:
rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/qemu" ||:
rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu" ||:
rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/qemu" ||:
-endif
+endif WITH_QEMU
if WITH_LXC
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||:
rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lxc" ||:
-endif
+endif WITH_LXC
if WITH_LIBXL
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||:
rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ||:
rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||:
-endif
+endif WITH_LIBXL
if WITH_UML
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/uml" ||:
rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/uml" ||:
-endif
+endif WITH_UML
if WITH_XEN
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/xen" ||:
-endif
+endif WITH_XEN
if WITH_NETWORK
rm -f $(DESTDIR)$(confdir)/qemu/networks/autostart/default.xml
rm -f $(DESTDIR)$(confdir)/qemu/networks/default.xml
@@ -2473,7 +2473,7 @@ if WITH_NETWORK
rmdir "$(DESTDIR)$(confdir)/qemu/networks" || :
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||:
rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/network" ||:
-endif
+endif WITH_NETWORK
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
diff --git a/tests/Makefile.am b/tests/Makefile.am
index c800179..1d38f76 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -41,12 +41,12 @@ AM_CFLAGS = \
if WITH_DRIVER_MODULES
INCLUDES += \
-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"
-endif
+endif WITH_DRIVER_MODULES
PROBES_O =
if WITH_DTRACE_PROBES
PROBES_O += ../src/libvirt_probes.lo
-endif
+endif WITH_DTRACE_PROBES
LDADDS = \
$(WARN_CFLAGS) \
@@ -135,24 +135,24 @@ test_programs = virshtest sockettest \
if WITH_DBUS
test_programs += virdbustest \
virsystemdtest
-endif
+endif WITH_DBUS
if WITH_GNUTLS
test_programs += virnettlscontexttest virnettlssessiontest
-endif
+endif WITH_GNUTLS
if WITH_SECDRIVER_SELINUX
if WITH_ATTR
test_programs += securityselinuxtest
if WITH_QEMU
test_programs += securityselinuxlabeltest
-endif
-endif
-endif
+endif WITH_QEMU
+endif WITH_ATTR
+endif WITH_SECDRIVER_SELINUX
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
-endif
+endif WITH_DRIVER_MODULES
# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
@@ -161,53 +161,53 @@ ssh_LDADD = $(COVERAGE_LDFLAGS)
if WITH_XEN
test_programs += xml2sexprtest sexpr2xmltest \
xmconfigtest xencapstest statstest reconnect
-endif
+endif WITH_XEN
if WITH_QEMU
test_programs += qemuxml2argvtest qemuxml2xmltest qemuxmlnstest \
qemuargv2xmltest qemuhelptest domainsnapshotxml2xmltest \
qemumonitortest qemumonitorjsontest qemuhotplugtest \
qemuagenttest
-endif
+endif WITH_QEMU
if WITH_LXC
test_programs += lxcxml2xmltest
-endif
+endif WITH_LXC
if WITH_OPENVZ
test_programs += openvzutilstest
-endif
+endif WITH_OPENVZ
if WITH_ESX
test_programs += esxutilstest
-endif
+endif WITH_ESX
if WITH_VMX
test_programs += vmx2xmltest xml2vmxtest
-endif
+endif WITH_VMX
if WITH_CIL
test_programs += object-locking
-endif
+endif WITH_CIL
if WITH_YAJL
test_programs += jsontest
-endif
+endif WITH_YAJL
test_programs += networkxml2xmltest networkxml2xmlupdatetest
if WITH_NETWORK
test_programs += networkxml2conftest
-endif
+endif WITH_NETWORK
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
-endif
+endif WITH_STORAGE_SHEEPDOG
test_programs += nwfilterxml2xmltest
if WITH_STORAGE
test_programs += storagevolxml2argvtest
-endif
+endif WITH_STORAGE
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
@@ -251,7 +251,7 @@ test_scripts += \
test_programs += \
eventtest \
libvirtdconftest
-else
+else ! WITH_LIBVIRTD
EXTRA_DIST += \
test_conf.sh \
cpuset \
@@ -269,13 +269,13 @@ EXTRA_DIST += \
virsh-synopsis \
virsh-undefine \
$(NULL)
-endif
+endif ! WITH_LIBVIRTD
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
-else
+else ! WITH_SECDRIVER_APPARMOR
EXTRA_DIST += virt-aa-helper-test
-endif
+endif ! WITH_SECDRIVER_APPARMOR
EXTRA_DIST += $(test_scripts)
@@ -285,19 +285,19 @@ test_libraries = libshunload.la \
$(NULL)
if WITH_QEMU
test_libraries += libqemumonitortestutils.la
-endif
+endif WITH_QEMU
if WITH_DBUS
test_libraries += virsystemdmock.la
-endif
+endif WITH_DBUS
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
noinst_LTLIBRARIES = $(test_libraries)
-else
+else ! WITH_TESTS
check_PROGRAMS = $(test_programs) $(test_helpers)
check_LTLIBRARIES = $(test_libraries)
-endif
+endif ! WITH_TESTS
TESTS = $(test_programs) \
$(test_scripts)
@@ -369,11 +369,11 @@ statstest_SOURCES = \
statstest.c testutils.h testutils.c
statstest_LDADD = $(xen_LDADDS)
-else
+else ! WITH_XEN
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
xencapstest.c reconnect.c \
testutilsxen.c testutilsxen.h
-endif
+endif ! WITH_XEN
QEMUMONITORTESTUTILS_SOURCES = \
qemumonitortestutils.c \
@@ -387,10 +387,10 @@ libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
if WITH_NETWORK
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
-endif
+endif WITH_NETWORK
if WITH_DTRACE_PROBES
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
-endif
+endif WITH_DTRACE_PROBES
qemu_LDADDS += $(LDADDS)
qemuxml2argvtest_SOURCES = \
@@ -444,39 +444,39 @@ domainsnapshotxml2xmltest_SOURCES = \
domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
testutils.c testutils.h
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
-else
+else ! WITH_QEMU
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
qemuxmlnstest.c qemuhelptest.c domainsnapshotxml2xmltest.c \
qemumonitortest.c testutilsqemu.c testutilsqemu.h \
qemumonitorjsontest.c qemuhotplugtest.c \
qemuagenttest.c \
$(QEMUMONITORTESTUTILS_SOURCES)
-endif
+endif ! WITH_QEMU
if WITH_LXC
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
if WITH_NETWORK
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
-endif
+endif WITH_NETWORK
lxc_LDADDS += $(LDADDS)
lxcxml2xmltest_SOURCES = \
lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
testutils.c testutils.h
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
-else
+else ! WITH_LXC
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
-endif
+endif ! WITH_LXC
if WITH_OPENVZ
openvzutilstest_SOURCES = \
openvzutilstest.c \
testutils.c testutils.h
openvzutilstest_LDADD = $(LDADDS)
-else
+else ! WITH_OPENVZ
EXTRA_DIST += openvzutilstest.c
-endif
+endif ! WITH_OPENVZ
EXTRA_DIST += openvzutilstest.conf
if WITH_ESX
@@ -484,9 +484,9 @@ esxutilstest_SOURCES = \
esxutilstest.c \
testutils.c testutils.h
esxutilstest_LDADD = $(LDADDS)
-else
+else ! WITH_ESX
EXTRA_DIST += esxutilstest.c
-endif
+endif ! WITH_ESX
if WITH_VMX
vmx2xmltest_SOURCES = \
@@ -498,9 +498,9 @@ xml2vmxtest_SOURCES = \
xml2vmxtest.c \
testutils.c testutils.h
xml2vmxtest_LDADD = $(LDADDS)
-else
+else ! WITH_VMX
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
-endif
+endif ! WITH_VMX
networkxml2xmltest_SOURCES = \
networkxml2xmltest.c \
@@ -517,9 +517,9 @@ networkxml2conftest_SOURCES = \
networkxml2conftest.c \
testutils.c testutils.h
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
-else
+else ! WITH_NETWORK
EXTRA_DIST += networkxml2conftest.c
-endif
+endif ! WITH_NETWORK
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
@@ -527,9 +527,9 @@ storagebackendsheepdogtest_SOURCES = \
testutils.c testutils.h
storagebackendsheepdogtest_LDADD = \
../src/libvirt_driver_storage_impl.la $(LDADDS)
-else
+else ! WITH_STORAGE_SHEEPDOG
EXTRA_DIST += storagebackendsheepdogtest.c
-endif
+endif ! WITH_STORAGE_SHEEPDOG
nwfilterxml2xmltest_SOURCES = \
nwfilterxml2xmltest.c \
@@ -542,9 +542,9 @@ storagevolxml2argvtest_SOURCES = \
testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
../src/libvirt_driver_storage_impl.la $(LDADDS)
-else
+else ! WITH_STORAGE
EXTRA_DIST += storagevolxml2argvtest.c
-endif
+endif ! WITH_STORAGE
storagevolxml2xmltest_SOURCES = \
storagevolxml2xmltest.c \
@@ -598,9 +598,9 @@ libvirtdconftest_SOURCES = \
libvirtdconftest.c testutils.h testutils.c \
../daemon/libvirtd-config.c
libvirtdconftest_LDADD = $(LDADDS)
-else
+else ! WITH_LIBVIRTD
EXTRA_DIST += libvirtdconftest.c
-endif
+endif ! WITH_LIBVIRTD
virnetmessagetest_SOURCES = \
virnetmessagetest.c testutils.h testutils.c
@@ -627,15 +627,15 @@ virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
virnettlssessiontest_SOURCES += pkix_asn1_tab.c
virnettlssessiontest_LDADD += -ltasn1
-else
+else ! HAVE_LIBTASN1
EXTRA_DIST += pkix_asn1_tab.c
-endif
-else
+endif ! HAVE_LIBTASN1
+else ! WITH_GNUTLS
EXTRA_DIST += \
virnettlscontexttest.c virnettlssessiontest.c \
virnettlshelpers.h virnettlshelpers.c \
testutils.h testutils.c pkix_asn1_tab.c
-endif
+endif ! WITH_GNUTLS
virtimetest_SOURCES = \
virtimetest.c testutils.h testutils.c
@@ -698,9 +698,9 @@ virsystemdmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
virsystemdmock_la_LDFLAGS = -module -avoid-version \
-rpath /evil/libtool/hack/to/force/shared/lib/creation
-else
+else ! WITH_DBUS
EXTRA_DIST += virdbustest.c virsystemdtest.c virsystemdmock.c
-endif
+endif ! WITH_DBUS
viruritest_SOURCES = \
viruritest.c testutils.h testutils.c
@@ -722,9 +722,9 @@ if WITH_SECDRIVER_SELINUX
if WITH_ATTR
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
-else
+else ! WITH_TESTS
check_LTLIBRARIES += libsecurityselinuxhelper.la
-endif
+endif ! WITH_TESTS
libsecurityselinuxhelper_la_SOURCES = \
securityselinuxhelper.c
@@ -744,9 +744,9 @@ securityselinuxlabeltest_SOURCES = \
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS)
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
../src/libvirt.la
-endif
-endif
-endif
+endif WITH_QEMU
+endif WITH_ATTR
+endif WITH_SECDRIVER_SELINUX
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \
securityselinuxhelper.c
@@ -782,13 +782,13 @@ if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
-endif
+endif WITH_DRIVER_MODULES
if WITH_LIBVIRTD
eventtest_SOURCES = \
eventtest.c testutils.h testutils.c
eventtest_LDADD = -lrt $(LDADDS)
-endif
+endif WITH_LIBVIRTD
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
@@ -830,9 +830,9 @@ object-locking: object-locking.cmx object-locking-files.txt
object-locking-files.txt:
find $(top_builddir)/src/ -name '*.i' > $@
-else
+else ! WITH_CIL
EXTRA_DIST += object-locking.ml
-endif
+endif ! WITH_CIL
CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.cmi *.cmx \
object-locking-files.txt
diff --git a/tools/Makefile.am b/tools/Makefile.am
index d9532dd..0193140 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -69,7 +69,7 @@ libexec_SCRIPTS = libvirt-guests.sh
if WITH_SANLOCK
sbin_SCRIPTS = virt-sanlock-cleanup
DISTCLEANFILES += virt-sanlock-cleanup
-endif
+endif WITH_SANLOCK
if WITH_LXC
conf_DATA += virt-login-shell.conf
@@ -87,7 +87,7 @@ dist_man1_MANS += virt-login-shell.1
endif WITH_LXC
if WITH_SANLOCK
dist_man8_MANS = virt-sanlock-cleanup.8
-endif
+endif WITH_SANLOCK
virt-xml-validate: virt-xml-validate.in Makefile
$(AM_V_GEN)sed -e 's|[@]schemadir@|$(pkgdatadir)/schemas|g' \
@@ -229,7 +229,7 @@ virsh_win_icon.$(OBJEXT): virsh_win_icon.rc
$(AM_V_GEN)$(WINDRES) \
--input-format rc --input $< \
--output-format coff --output $@
-endif
+endif WITH_WIN_ICON
virt-login-shell.1: virt-login-shell.pod $(top_srcdir)/configure.ac
$(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@ \
@@ -270,10 +270,10 @@ if LIBVIRT_INIT_SCRIPT_RED_HAT
BUILT_SOURCES += libvirt-guests.init
install-init: install-sysconfig install-initscript
uninstall-init: uninstall-sysconfig uninstall-initscript
-else
+else ! LIBVIRT_INIT_SCRIPT_RED_HAT
install-init:
uninstall-init:
-endif # LIBVIRT_INIT_SCRIPT_RED_HAT
+endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
libvirt-guests.sh: libvirt-guests.sh.in $(top_builddir)/config.status
$(AM_V_GEN)sed \
@@ -311,10 +311,10 @@ uninstall-systemd: uninstall-sysconfig
BUILT_SOURCES += libvirt-guests.service
-else
+else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
install-systemd:
uninstall-systemd:
-endif # LIBVIRT_INIT_SCRIPT_SYSTEMD
+endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
libvirt-guests.service: libvirt-guests.service.in $(top_builddir)/config.status
$(AM_V_GEN)sed \
--
1.8.3.1
11 years, 3 months
[libvirt] [PATCH] conf: Remove the actual hostdev when removing a network
by Peter Krempa
Commit 50348e6edfa reused the code to remove the hostdev portion of a
network definition on multiple places but forgot to take into account
that sometimes the "actual" network is passed and in some cases the
parent of that.
This patch uses the virDomainNetGetActualHostdev() helper to acquire the
correct pointer all the time while removing the hostdev portion from the
list.
---
src/conf/domain_conf.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e412f28..cef4cf9 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -10002,14 +10002,14 @@ void
virDomainNetRemoveHostdev(virDomainDefPtr def,
virDomainNetDefPtr net)
{
- if (net->type == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
- /* hostdev net devices are normally also be in the hostdevs
- * array, but might have already been removed by the time we
- * get here.
- */
- virDomainHostdevDefPtr hostdev = &net->data.hostdev.def;
- size_t i;
+ /* hostdev net devices are normally also be in the hostdevs
+ * array, but might have already been removed by the time we
+ * get here.
+ */
+ virDomainHostdevDefPtr hostdev = virDomainNetGetActualHostdev(net);
+ size_t i;
+ if (hostdev) {
for (i = 0; i < def->nhostdevs; i++) {
if (def->hostdevs[i] == hostdev) {
virDomainHostdevRemove(def, i);
--
1.8.3.2
11 years, 3 months