[libvirt] [PATCHv2 0/2] Support setting the 'removable' flag for USB disks
by Fred A. Kemp
From: "Fred A. Kemp" <anonym(a)riseup.net>
The commit message of patch #2 explains the purpose of this patch set.
A review would be greatly appreciated!
Note that I've only added the new capability for usb-storage.removable
to the qemu help tests of qemu(-kvm) version 1.2.0, since that's what I
had easily available to get the output of `-device usb-storage,?` from.
I hope that's not an issue, otherwise, is there a way to obtain these
outputs without having to hunt down and install all supported versions?
Previous submissions of this patch set to this list:
http://www.redhat.com/archives/libvir-list/2013-March/msg01051.html
http://www.redhat.com/archives/libvir-list/2013-May/msg02039.html
https://www.redhat.com/archives/libvir-list/2013-July/msg01635.html
https://www.redhat.com/archives/libvir-list/2013-August/msg00581.html
Fred A. Kemp (2):
qemu: Add capability flag for usb-storage
qemu: Support setting the 'removable' flag for USB disks
docs/formatdomain.html.in | 8 +++--
docs/schemas/domaincommon.rng | 8 +++++
src/conf/domain_conf.c | 31 ++++++++++++++++++--
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 10 +++++++
src/qemu/qemu_capabilities.h | 2 ++
src/qemu/qemu_command.c | 24 +++++++++++++++
tests/qemuhelpdata/qemu-1.2.0-device | 11 +++++++
tests/qemuhelpdata/qemu-kvm-1.2.0-device | 11 +++++++
tests/qemuhelptest.c | 20 +++++++++----
.../qemuxml2argv-disk-usb-device-removable.args | 8 +++++
.../qemuxml2argv-disk-usb-device-removable.xml | 27 +++++++++++++++++
tests/qemuxml2argvtest.c | 6 +++-
13 files changed, 155 insertions(+), 12 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device-removable.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device-removable.xml
--
1.7.10.4
11 years, 2 months
[libvirt] [PATCH 1/3] CPU: Implement guestData for PPC CPU driver
by Li Zhang
From: Li Zhang <zhlcindy(a)linux.vnet.ibm.com>
On Power platform, Power7+ can support Power7 guest.
It needs to define XML configuration to specify guest's CPU model.
For exmaple:
<cpu match='exact'>
<model>POWER7+_v2.1</model>
<vendor>IBM</vendor>
</cpu>
Signed-off-by: Li Zhang <zhlcindy(a)linux.vnet.ibm.com>
---
src/cpu/cpu_powerpc.c | 166 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 164 insertions(+), 2 deletions(-)
diff --git a/src/cpu/cpu_powerpc.c b/src/cpu/cpu_powerpc.c
index 647a8a1..84fa3f7 100644
--- a/src/cpu/cpu_powerpc.c
+++ b/src/cpu/cpu_powerpc.c
@@ -99,6 +99,23 @@ ppcModelFindPVR(const struct ppc_map *map,
return NULL;
}
+static struct ppc_model *
+ppcModelCopy(const struct ppc_model *model)
+{
+ struct ppc_model *copy;
+
+ if (VIR_ALLOC(copy) < 0 ||
+ VIR_STRDUP(copy->name, model->name) < 0) {
+ ppcModelFree(copy);
+ return NULL;
+ }
+
+ copy->data.pvr = model->data.pvr;
+ copy->vendor = model->vendor;
+
+ return copy;
+}
+
static struct ppc_vendor *
ppcVendorFind(const struct ppc_map *map,
const char *name)
@@ -126,6 +143,29 @@ ppcVendorFree(struct ppc_vendor *vendor)
VIR_FREE(vendor);
}
+static struct ppc_model *
+ppcModelFromCPU(const virCPUDefPtr cpu,
+ const struct ppc_map *map)
+{
+ struct ppc_model *model = NULL;
+
+ if ((model = ppcModelFind(map, cpu->model)) == NULL) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unknown CPU model %s"), cpu->model);
+ goto error;
+ }
+
+ if ((model = ppcModelCopy(model)) == NULL)
+ goto error;
+
+ return model;
+
+error:
+ ppcModelFree(model);
+ return NULL;
+}
+
+
static int
ppcVendorLoad(xmlXPathContextPtr ctxt,
struct ppc_map *map)
@@ -288,6 +328,112 @@ error:
return NULL;
}
+static virCPUDataPtr
+ppcMakeCPUData(virArch arch, struct cpuPPCData *data)
+{
+ virCPUDataPtr cpuData;
+
+ if (VIR_ALLOC(cpuData) < 0)
+ return NULL;
+
+ cpuData->arch = arch;
+ cpuData->data.ppc = *data;
+ data = NULL;
+
+ return cpuData;
+}
+
+static virCPUCompareResult
+ppcCompute(virCPUDefPtr host,
+ const virCPUDefPtr cpu,
+ virCPUDataPtr *guestData,
+ char **message)
+
+{
+ struct ppc_map *map = NULL;
+ struct ppc_model *host_model = NULL;
+ struct ppc_model *guest_model = NULL;
+
+ int ret = 0;
+ virArch arch;
+ size_t i;
+
+ if (cpu->arch != VIR_ARCH_NONE) {
+ bool found = false;
+
+ for (i = 0; i < ARRAY_CARDINALITY(archs); i++) {
+ if (archs[i] == cpu->arch) {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found) {
+ VIR_DEBUG("CPU arch %s does not match host arch",
+ virArchToString(cpu->arch));
+ if (message &&
+ virAsprintf(message,
+ _("CPU arch %s does not match host arch"),
+ virArchToString(cpu->arch)) < 0)
+ goto error;
+ return VIR_CPU_COMPARE_INCOMPATIBLE;
+ }
+ arch = cpu->arch;
+ } else {
+ arch = host->arch;
+ }
+
+ if (cpu->vendor &&
+ (!host->vendor || STRNEQ(cpu->vendor, host->vendor))) {
+ VIR_DEBUG("host CPU vendor does not match required CPU vendor %s",
+ cpu->vendor);
+ if (message &&
+ virAsprintf(message,
+ _("host CPU vendor does not match required "
+ "CPU vendor %s"),
+ cpu->vendor) < 0)
+ goto error;
+ return VIR_CPU_COMPARE_INCOMPATIBLE;
+ }
+
+ if (!(map = ppcLoadMap()) ||
+ !(host_model = ppcModelFromCPU(host, map)) ||
+ !(guest_model = ppcModelFromCPU(cpu, map)))
+ goto error;
+
+ if (guestData != NULL) {
+ if (cpu->type == VIR_CPU_TYPE_GUEST &&
+ cpu->match == VIR_CPU_MATCH_STRICT &&
+ STRNEQ(guest_model->name, host_model->name)) {
+ VIR_DEBUG("host CPU model does not match required CPU model %s",
+ guest_model->name);
+ if (message &&
+ virAsprintf(message,
+ _("host CPU model does not match required "
+ "CPU model %s"),
+ guest_model->name) < 0)
+ goto error;
+ return VIR_CPU_COMPARE_INCOMPATIBLE;
+ }
+
+ if (!(*guestData = ppcMakeCPUData(arch, &guest_model->data)))
+ goto error;
+ }
+
+ ret = VIR_CPU_COMPARE_IDENTICAL;
+
+out:
+ ppcMapFree(map);
+ ppcModelFree(host_model);
+ ppcModelFree(guest_model);
+ return ret;
+
+error:
+ ret = VIR_CPU_COMPARE_ERROR;
+ goto out;
+
+}
+
static virCPUCompareResult
ppcCompare(virCPUDefPtr host,
virCPUDefPtr cpu)
@@ -369,6 +515,15 @@ ppcNodeData(void)
}
#endif
+static virCPUCompareResult
+ppcGuestData(virCPUDefPtr host,
+ virCPUDefPtr guest,
+ virCPUDataPtr *data,
+ char **message)
+{
+ return ppcCompute(host, guest, data, message);
+}
+
static int
ppcUpdate(virCPUDefPtr guest ATTRIBUTE_UNUSED,
const virCPUDefPtr host ATTRIBUTE_UNUSED)
@@ -466,6 +621,13 @@ error:
goto cleanup;
}
+static int
+ppcHasFeature(const virCPUDataPtr data ATTRIBUTE_UNUSED,
+ const char *name ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
struct cpuArchDriver cpuDriverPowerPC = {
.name = "ppc64",
.arch = archs,
@@ -479,8 +641,8 @@ struct cpuArchDriver cpuDriverPowerPC = {
#else
.nodeData = NULL,
#endif
- .guestData = NULL,
+ .guestData = ppcGuestData,
.baseline = ppcBaseline,
.update = ppcUpdate,
- .hasFeature = NULL,
+ .hasFeature = ppcHasFeature,
};
--
1.8.1.4
11 years, 2 months
[libvirt] [PATCH] qemu_hotplug: Resolve DEADCODE coverity error
by John Ferlan
Remove unused 'cgroup' variable in qemuDomainAttachDeviceDiskLive() to
resolve coverity DEADCODE complaint
---
Refactoring of qemuDomainAttachDeviceDiskLive() in the following patch:
https://www.redhat.com/archives/libvir-list/2013-August/msg00079.html
seemed to wake up Coverity and it complained about deadcode as a result
of 'cgroup' only ever been NULL thus the check for it to be non-NULL in
order to call qemuTeardownDiskCgroup() would not be able to occur. The
code actually hadn't changed, but for some reason coverity now found it.
Followed example in qemuDomainChangeDiskMediaLive() and just removed the
'cgroup' variable.
src/qemu/qemu_hotplug.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 9c655ff..6cdee44 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -683,7 +683,6 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn,
virDomainDiskDefPtr orig_disk = NULL;
virDomainDeviceDefPtr dev_copy = NULL;
virDomainDiskDefPtr tmp = NULL;
- virCgroupPtr cgroup = NULL;
virCapsPtr caps = NULL;
int ret = -1;
@@ -773,10 +772,10 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn,
break;
}
- if (ret != 0 && cgroup) {
- if (qemuTeardownDiskCgroup(vm, disk) < 0)
- VIR_WARN("Failed to teardown cgroup for disk path %s",
- NULLSTR(disk->src));
+ if (ret != 0 &&
+ qemuTeardownDiskCgroup(vm, disk) < 0) {
+ VIR_WARN("Failed to teardown cgroup for disk path %s",
+ NULLSTR(disk->src));
}
end:
--
1.8.3.1
11 years, 2 months
[libvirt] [PATCH] Fix memory leak in cmdAttachDisk
by hwbi
When virBufferError is ok in cmdAttachDisk,the latter
should 'goto cleanup',instead of returning a false to
prevent memory leaking.
---
tools/virsh-domain.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 3fd57fd..568d61d 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -661,7 +661,7 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
if (virBufferError(&buf)) {
vshPrint(ctl, "%s", _("Failed to allocate XML buffer"));
- return false;
+ goto cleanup;
}
xml = virBufferContentAndReset(&buf);
--
1.7.1
11 years, 2 months
[libvirt] [PATCH] random: don't mix RAND_MAX with random_r
by Eric Blake
FreeBSD 10 recently changed their definition of RAND_MAX, to try
and cover the fact that their evenly distributed results really are
a smaller range than a full power of 2. As a result, I did some
investigation, and learned:
1. POSIX requires random() to be evenly distributed across exactly
31 bits. glibc also guarantees this for rand(), but the two are
unrelated, and POSIX only associates RAND_MAX with rand().
Avoiding RAND_MAX altogether thus avoids a build failure on
FreeBSD 10.
2. Concatenating random bits from a PRNG will NOT provide uniform
coverage over the larger value UNLESS the period of the original
PRNG is at least as large as the number of bits being concatenated.
Simple example: suppose that RAND_MAX were 1 with a period of 2**1
(which means that the PRNG merely alternates between 0 and 1).
Concatenating two successive rand() calls would then invariably
result in 01 or 10, which is a rather non-uniform distribution
(00 and 11 are impossible) and an even worse period (2**0, since
our second attempt will get the same number as our first attempt).
But a RAND_MAX of 1 with a period of 2**2 (alternating between
0, 1, 1, 0) provides sane coverage of all four values, if properly
tempered. (Back-to-back calls would still only see half the values
if we don't do some tempering). We therefore want to guarantee a
period of at least 2**64, preferably larger (as a tempering factor);
POSIX only makes this guarantee for random() with 256 bytes of info.
* src/util/virrandom.c (virRandomBits): Use constants that are
accurate for the PRNG we are using, not an unrelated PRNG.
(randomState): Ensure the period of our PRNG exceeds our usage.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
I debated pushing this under the build-breaker rule, but would
like to get feedback from an actual FreeBSD build first if possible.
src/util/virrandom.c | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/src/util/virrandom.c b/src/util/virrandom.c
index c233732..37d1a82 100644
--- a/src/util/virrandom.c
+++ b/src/util/virrandom.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Red Hat, Inc.
+ * Copyright (C) 2012-2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -36,7 +36,7 @@
#define VIR_FROM_THIS VIR_FROM_NONE
-static char randomState[128];
+static char randomState[256];
static struct random_data randomData;
static virMutex randomLock;
@@ -70,9 +70,20 @@ virRandomOnceInit(void)
VIR_ONCE_GLOBAL_INIT(virRandom)
-/* The algorithm of virRandomBits requires that RAND_MAX == 2^n-1 for
- * some n; gnulib's random_r meets this property. */
-verify(((RAND_MAX + 1U) & RAND_MAX) == 0);
+/* The algorithm of virRandomBits relies on gnulib's guarantee that
+ * random_r() matches the POSIX requirements on random() of being
+ * evenly distributed among exactly [0, 2**31) (that is, we always get
+ * exactly 31 bits). While this happens to be the value of RAND_MAX
+ * on glibc, note that POSIX only requires RAND_MAX to be tied to the
+ * weaker rand(), so there are platforms where RAND_MAX is smaller
+ * than the range of random_r(). For the results to be evenly
+ * distributed among up to 64 bits, we also rely on the period of
+ * random_r() to be at least 2**64, which POSIX only guarantees for
+ * random() if you use 256 bytes of state. */
+enum {
+ RANDOM_BITS_PER_ITER = 31,
+ RANDOM_BITS_MASK = (1U << RANDOM_BITS_PER_ITER) - 1,
+};
/**
* virRandomBits:
@@ -85,7 +96,6 @@ verify(((RAND_MAX + 1U) & RAND_MAX) == 0);
*/
uint64_t virRandomBits(int nbits)
{
- int bits_per_iter = count_one_bits(RAND_MAX);
uint64_t ret = 0;
int32_t bits;
@@ -98,10 +108,10 @@ uint64_t virRandomBits(int nbits)
virMutexLock(&randomLock);
- while (nbits > bits_per_iter) {
+ while (nbits > RANDOM_BITS_PER_ITER) {
random_r(&randomData, &bits);
- ret = (ret << bits_per_iter) | (bits & RAND_MAX);
- nbits -= bits_per_iter;
+ ret = (ret << RANDOM_BITS_PER_ITER) | (bits & RANDOM_BITS_MASK);
+ nbits -= RANDOM_BITS_PER_ITER;
}
random_r(&randomData, &bits);
--
1.8.3.1
11 years, 2 months
[libvirt] [PATCH] build: shipped files must not depend on BUILT_SOURCES
by Eric Blake
'make distcheck' was failing with:
make[3]: Entering directory `/home/eblake/libvirt-tmp2/libvirt-1.1.1/_build/docs'
perl ../../docs/genaclperms.pl ../../src/access/viraccessperm.h > ../../docs/aclperms.htmlinc
/bin/sh: ../../docs/aclperms.htmlinc: Permission denied
when simulating the case of a user doing a VPATH build from a
read-only source tree. The culprit? BUILT_SOURCES are _always_
built, and so must NOT be built into srcdir and need not be part
of the tarball. On the other hand, shipped files must never
depend on files in the builddir. While it would be possible to
fix the problem by generating aclperms.htmlinc into builddir,
we then have the problem that we ship acl.html - we'd have to
rejigger a lot of things to not ship pre-built html. So this
patch goes the other direction - we don't need BUILT_SOURCES,
but instead ensure that we have proper dependencies so that
all files in srcdir are up-to-date at the time the tarball is
created. And because we ship html files in the tarball, that
implies we don't expect users to be able to rebuild them, so
we must not clean any files that would trigger a rebuild except
under the maintainer rules.
* docs/Makefile.am (BUILT_SOURCES): Delete.
(CLEANFILES): Downgrade aclperms.htmlinc cleanup...
(maintainer-clean-local): ...and move hvsupport.html.in...
(MAINTAINERCLEANFILES): ...to a maintainer action.
(hvsupport.html.in): Write into srcdir.
(hvsupport.html): Ensure files are built in order.
(aclperms.htmlinc): Honor silent make.
(EXTRA_DIST): Ship aclperms.htmlinc.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the build-breaker rule. Still not there, but
getting much closer; now 'make distcheck' fails with:
rm -f Makefile
ERROR: files left in build directory after distclean:
./src/virtlockd.8
docs/Makefile.am | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 9939cc8..410c256 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -25,8 +25,6 @@ DOC_SOURCE_DIR=../src
DEVHELP_DIR=$(datadir)/gtk-doc/html/libvirt
-BUILT_SOURCES=hvsupport.html.in
-
apihtml = \
html/index.html \
html/libvirt-libvirt.html \
@@ -89,9 +87,15 @@ internals_html_in = \
$(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/internals/*.html.in))
internals_html = $(internals_html_in:%.html.in=%.html)
+# todo.html is special - it is shipped in the tarball, but we
+# have a dedicated 'todo' target to rebuild it from a proper
+# config file, all other users are able to build it locally.
+# For all other files, since we ship pre-built html in the
+# tarball, we must also ship the sources, even when those
+# sources are themselves generated.
dot_html_in = $(notdir $(wildcard $(srcdir)/*.html.in)) \
todo.html.in \
- hvsupport.html.in
+ $(srcdir)/hvsupport.html.in
dot_html = $(dot_html_in:%.html.in=%.html)
dot_php_in = $(notdir $(wildcard $(srcdir)/*.php.in))
@@ -136,25 +140,22 @@ EXTRA_DIST= \
$(xml) $(qemu_xml) $(lxc_xml) $(fig) $(png) $(css) \
$(patches) $(dot_php_in) $(dot_php_code_in) $(dot_php)\
$(internals_html_in) $(internals_html) \
- sitemap.html.in \
+ sitemap.html.in aclperms.htmlinc \
todo.pl hvsupport.pl todo.cfg-example
-BUILT_SOURCES += aclperms.htmlinc
-
-CLEANFILES = $(srcdir)/aclperms.htmlinc
-
acl.html:: $(srcdir)/aclperms.htmlinc
$(srcdir)/aclperms.htmlinc: $(top_srcdir)/src/access/viraccessperm.h \
$(srcdir)/genaclperms.pl Makefile.am
- $(PERL) $(srcdir)/genaclperms.pl $< > $@
+ $(AM_V_GEN)$(PERL) $(srcdir)/genaclperms.pl $< > $@
MAINTAINERCLEANFILES = \
$(addprefix $(srcdir)/,$(dot_html)) \
$(addprefix $(srcdir)/,$(apihtml)) \
$(addprefix $(srcdir)/,$(devhelphtml)) \
$(addprefix $(srcdir)/,$(internals_html)) \
- $(addprefix $(srcdir)/,$(dot_php))
+ $(addprefix $(srcdir)/,$(dot_php)) \
+ $(srcdir)/hvsupport.html.in $(srcdir)/aclperms.htmlinc
all-am: web
@@ -183,7 +184,9 @@ todo:
rm -f todo.html.in
$(MAKE) todo.html
-hvsupport.html.in: $(srcdir)/hvsupport.pl \
+hvsupport.html:: $(srcdir)/hvsupport.html.in
+
+$(srcdir)/hvsupport.html.in: $(srcdir)/hvsupport.pl \
$(srcdir)/../src/libvirt_public.syms \
$(srcdir)/../src/libvirt_qemu.syms $(srcdir)/../src/libvirt_lxc.syms \
$(srcdir)/../src/driver.h
@@ -295,7 +298,7 @@ clean-local:
maintainer-clean-local: clean-local
rm -rf $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml \
- todo.html.in hvsupport.html.in
+ todo.html.in
rm -rf $(srcdir)/libvirt-qemu-api.xml $(srcdir)/libvirt-qemu-refs.xml
rm -rf $(srcdir)/libvirt-lxc-api.xml $(srcdir)/libvirt-lxc-refs.xml
rm -rf $(APIBUILD_STAMP)
--
1.8.3.1
11 years, 2 months
[libvirt] [PATCH] build: fix virtlockd file distribution
by Eric Blake
Since virtlockd is only built when libvirtd is built, we should
not install its auxiliary files unconditionally. This solves
two failures. 1. 'make distcheck' complains:
rm -f Makefile
ERROR: files left in build directory after distclean:
./src/virtlockd.8
2. './autobuild.sh' complains:
Checking for unpackaged file(s): /usr/lib/rpm/check-files
/home/eblake/rpmbuild/BUILDROOT/mingw-libvirt-1.1.1-1.fc19.eblake1377879911.x86_64
error: Installed (but unpackaged) file(s) found:
/usr/i686-w64-mingw32/sys-root/mingw/etc/libvirt/virtlockd.conf
/usr/i686-w64-mingw32/sys-root/mingw/share/augeas/lenses/tests/test_virtlockd.aug
/usr/i686-w64-mingw32/sys-root/mingw/share/augeas/lenses/virtlockd.aug
/usr/i686-w64-mingw32/sys-root/mingw/share/man/man8/virtlockd.8
/usr/x86_64-w64-mingw32/sys-root/mingw/etc/libvirt/virtlockd.conf
/usr/x86_64-w64-mingw32/sys-root/mingw/share/augeas/lenses/tests/test_virtlockd.aug
/usr/x86_64-w64-mingw32/sys-root/mingw/share/augeas/lenses/virtlockd.aug
/usr/x86_64-w64-mingw32/sys-root/mingw/share/man/man8/virtlockd.8
* src/Makefile.am (CLEANFILES): Add virtlockd.8.
(man8_MANS, conf_DATA, augeas_DATA, augeastest_DATA): Only install
virtlockd files when daemon is built.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the build-breaker rule, once my testing completes.
src/Makefile.am | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index d8b943d..636bcbc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2046,14 +2046,16 @@ virtlockd.8: $(srcdir)/virtlockd.8.in
< $< > $@-t && \
mv $@-t $@
+if WITH_LIBVIRTD
man8_MANS = virtlockd.8
conf_DATA += locking/virtlockd.conf
augeas_DATA += locking/virtlockd.aug
augeastest_DATA += test_virtlockd.aug
+endif WITH_LIBVIRTD
-CLEANFILES += test_virtlockd.aug
+CLEANFILES += test_virtlockd.aug virtlockd.8
MAINTAINERCLEANFILES += $(srcdir)/virtlockd.8.in
EXTRA_DIST += \
--
1.8.3.1
11 years, 2 months
[libvirt] [PATCH] build: fix 'make distcheck' out of the box
by Eric Blake
With the 1.1.1 tarball, if a user does 'make && make distcheck',
things pass, but if they do 'make distcheck' after 'make clean',
there is an odd failure:
GEN ../../docs/devhelp/index.html
I/O error : Permission denied
I/O error : Permission denied
runtime error: file ../../docs/devhelp/devhelp.xsl line 43 element document
xsltDocumentElem: unable to save to ../../docs/devhelp/libvirt-virterror.html
I/O error : Permission denied
I/O error : Permission denied
This implies that the rules for 'make dist' are missing a
dependency - the generated documentation needs to be up-to-date
before creating the tarball, or else the tarball will be missing
files, where the end user will end up trying to rebuild files in
srcdir, and that fails when srcdir is read-only.
1.1.1 plus this patch now works without issues (other issues have
crept in to 1.1.2-rc1 that prevent 'make distcheck' from working,
but those will be cleaned up in later patches).
* docs/Makefile.am (dist-local): New dependency.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
All that explanation, and just one line to change. :)
Pushing under the build-breaker rule.
docs/Makefile.am | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 0b0d2d4..9939cc8 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -288,6 +288,7 @@ $(APIBUILD_STAMP): $(srcdir)/apibuild.py \
check-local: all
+dist-local: all
clean-local:
rm -f *~ *.bak *.hierarchy *.signals *-unused.txt *.html
--
1.8.3.1
11 years, 2 months
[libvirt] [PATCH] cgroup: Don't fail to start a VM when DBus isn't compiled in or running
by Peter Krempa
The systemd code to create cgroups has fallback means built in, but
fails to engage them if a host isn't running DBus or libvirtd is
compiled without DBus (yes, you still don't need to run DBus).
This patch changes the return value in case DBus isn't available to so
that the fallback code can be activated and cgroups are created
manually.
---
src/util/virsystemd.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c
index 251b846..25fcf96 100644
--- a/src/util/virsystemd.c
+++ b/src/util/virsystemd.c
@@ -145,8 +145,10 @@ int virSystemdCreateMachine(const char *name,
char *username = NULL;
char *slicename = NULL;
- if (!(conn = virDBusGetSystemBus()))
- return -1;
+ if (!(conn = virDBusGetSystemBus())) {
+ virResetLastError();
+ return -2;
+ }
if (privileged) {
if (virAsprintf(&machinename, "%s-%s", drivername, name) < 0)
--
1.8.3.2
11 years, 2 months