[libvirt] [PATCH] Fix build with VirtualBox
by Jiri Denemark
Commit ba5f3c7c moved vbox driver into libvirtd but forgot to adapt
daemon's Makefile.am.
---
Pushed as a build breaker.
daemon/Makefile.am | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index f48dc85..d064ebd 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -155,6 +155,10 @@ if WITH_UML
libvirtd_LDADD += ../src/libvirt_driver_uml.la
endif
+if WITH_VBOX
+ libvirtd_LDADD += ../src/libvirt_driver_vbox.la
+endif
+
if WITH_STORAGE
libvirtd_LDADD += ../src/libvirt_driver_storage.la
endif
--
1.8.2.1
11 years, 6 months
[libvirt] [PATCH] Handle ENOTSUP from setfilecon on FUSE in LXC startup
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The setfilecon method can return ENOTSUP when trying to set
the context of the /proc/meminfo FUSE filesystem. We must
ignore this error and carry on, to prevent container startup
failing entirely
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/lxc/lxc_container.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 48ccc09..9295d80 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -782,10 +782,15 @@ static int lxcContainerMountProcFuse(virDomainDefPtr def,
ret = setfilecon(meminfo_path, scon);
freecon(scon);
if (ret < 0) {
- virReportSystemError(errno,
- _("Failed to set security context of %s for /proc/meminfo mount point"),
- meminfo_path);
- return ret;
+ if (errno == ENOTSUP) {
+ VIR_WARN("Setting security context of %s for /proc/meminfo not supported",
+ meminfo_path);
+ } else {
+ virReportSystemError(errno,
+ _("Failed to set security context of %s for /proc/meminfo mount point"),
+ meminfo_path);
+ return ret;
+ }
}
}
# endif
--
1.8.2.1
11 years, 6 months
[libvirt] 2013 Linux Plumbers Virtualization Microconference proposal call for participation
by Alex Williamson
Hey folks,
We'd like to hold another virtualization microconference as part of this
year's Linux Plumbers Conference. To do so, we need to show that
there's enough interest, materials, and people willing to attend.
Anthony and Amit have already started a wiki page for the
microconference:
http://wiki.linuxplumbersconf.org/2013:virtualization
Please help to fill it out and add topics you're interested in
discussing or presenting, or relevant topics to current development that
you'd like others to present. We don't need full abstracts or proposals
at this time, just enough to show that we have things to discuss and
enough people interested in attending to allocate space in the program.
If approved by the program committee we'll give precedence to proposals
that address current issues needing attention, help, or resolution.
This is also an excellent opportunity for cross-project discussions.
We're not sure when the LPC program committee will make a decision, so
please don't hesitate to add things to the wiki as soon as possible.
There's no commitment at this point though we obviously hope that many
of you will follow through with participation if this microconference is
approved. Please feel free to forward to anyone I've missed. Thanks,
Alex
11 years, 6 months
[libvirt] [PATCH v2] [TCK] nwfilter: probe for inverted ctdir
by Stefan Berger
Linux netfilter at some point inverted the meaning of the '--ctdir reply'
and newer netfilter implementations now expect '--ctdir original'
instead and vice-versa.
We probe for this netfilter change via an IMCP message over loopback and 3
filtering rules applied to INPUT. If the sent byte arrives, the newer
netfilter implementation has been detected and we convert the strings
in the iptables output to now match that inversion implemented by libvirt.
The downside of this is that probing of libvirt and this test tool are
independent and this test tool will only work correctly for all cases
if used with libvirt probing for 'ctdir inversion' as well.
Signed-off-by: Stefan Berger <stefanb(a)linux.vnet.ibm.com>
---
scripts/nwfilter/nwfilter2vmtest.sh | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
Index: libvirt-tck/scripts/nwfilter/nwfilter2vmtest.sh
===================================================================
--- libvirt-tck.orig/scripts/nwfilter/nwfilter2vmtest.sh
+++ libvirt-tck/scripts/nwfilter/nwfilter2vmtest.sh
@@ -28,6 +28,10 @@ FLAG_LIBVIRT_TEST="$((1<<3))"
FLAG_TAP_TEST="$((1<<4))"
FLAG_FORCE_CLEAN="$((1<<5))"
+# --ctdir original vs. --ctdir reply's meaning was inverted in
+# netfilter at some point. We probe for it.
+IPTABLES_CTRDIR_CORRECTED=0
+
failctr=0
passctr=0
attachfailctr=0
@@ -100,6 +104,15 @@ mktmpdir() {
return 0
}
+probeIptablesCtdir() {
+ # below gawk works for "2\.6\.39.*"; any non-digit immediately
+ # after '39' will be ignored
+ rev=$(uname -r | gawk -F. '{print $1 * 1000000 + $2 * 1000 + $3 }')
+ # 2.6.39 had the correction
+ if [ $rev -ge 2006039 ]; then
+ IPTABLES_CTDIR_CORRECTED=1
+ fi
+}
checkExpectedOutput() {
xmlfile="$1"
@@ -160,6 +173,14 @@ checkExpectedOutput() {
break
fi
+ if [ $IPTABLES_CTDIR_CORRECTED -ne 0 ]; then
+ #change --ctdir ORIGINAL to --ctdir REPLY
+ #and --ctdir REPLY to --ctdir ORIGINAL
+ sed -i "s/ctdir[ ]*ORIGINAL/ctdir _REPLY/" ${tmpfile}
+ sed -i "s/ctdir[ ]*REPLY/ctdir ORIGINAL/" ${tmpfile}
+ sed -i "s/ctdir _REPLY/ctdir REPLY/" ${tmpfile}
+ fi
+
diff -w ${tmpfile} ${tmpfile2} >/dev/null
if [ $? -ne 0 ]; then
@@ -551,6 +572,8 @@ main() {
echo "This script will only run on Linux."
fi
exit 1;
+ else
+ probeIptablesCtdir
fi
if [ $(($flags & $FLAG_TAP_TEST)) -ne 0 ]; then
11 years, 6 months
[libvirt] [PATCH 0/2] Fix storage schema issues
by Ján Tomko
Fix https://bugzilla.redhat.com/show_bug.cgi?id=893273
Ján Tomko (2):
schema: require target path in storage pool xml
schema: make source optional in volume XML
docs/schemas/storagepool.rng | 8 +++---
docs/schemas/storagevol.rng | 4 ++-
tests/Makefile.am | 2 ++
.../dir-missing-target-path-invalid.xml | 12 +++++++++
tests/storagepoolschematest | 2 +-
tests/storagevolschemadata/qcow2-no-source.xml | 29 ++++++++++++++++++++++
tests/storagevolschematest | 2 +-
7 files changed, 51 insertions(+), 8 deletions(-)
create mode 100644 tests/storagepoolschemadata/dir-missing-target-path-invalid.xml
create mode 100644 tests/storagevolschemadata/qcow2-no-source.xml
--
1.8.1.5
11 years, 6 months
[libvirt] [PATCH] qemu: Change values of disk discard
by Osier Yang
QEMU might support more values for "-drive discard", so using Bi-state
values (on/off) for it doesn't make sense.
"on" maps to "unmap", "off" maps to "ignore":
<...>
@var{discard} is one of "ignore" (or "off") or "unmap" (or "on") and
controls whether @dfn{discard} (also known as @dfn{trim} or @dfn{unmap})
requests are ignored or passed to the filesystem. Some machine types
may not support discard requests.
</...>
---
docs/formatdomain.html.in | 4 ++--
docs/schemas/domaincommon.rng | 4 ++--
src/conf/domain_conf.c | 4 ++--
src/conf/domain_conf.h | 4 ++--
tests/qemuxml2argvdata/qemuxml2argv-disk-drive-discard.args | 4 ++--
tests/qemuxml2argvdata/qemuxml2argv-disk-drive-discard.xml | 4 ++--
6 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index a71c484..26a3d0d 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1745,8 +1745,8 @@
The optional <code>discard</code> attribute controls whether
to discard (also known as "trim" or "unmap") requests are
ignored or passed to the filesystem. The value can be either
- "on" (allow the discard request to be passed) or "off" (ingore
- the discard request).
+ "unmap" (allow the discard request to be passed) or "ignore"
+ (gnore the discard request).
<span class='since'>Since 1.0.6 (QEMU and KVM only)</span>
</li>
</ul>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 018ca0b..b53099b 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1418,8 +1418,8 @@
<define name="discard">
<attribute name='discard'>
<choice>
- <value>on</value>
- <value>off</value>
+ <value>unmap</value>
+ <value>ignore</value>
</choice>
</attribute>
</define>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index b5e5d4d..e7a0381 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -745,8 +745,8 @@ VIR_ENUM_IMPL(virDomainTPMBackend, VIR_DOMAIN_TPM_TYPE_LAST,
VIR_ENUM_IMPL(virDomainDiskDiscard, VIR_DOMAIN_DISK_DISCARD_LAST,
"default",
- "on",
- "off")
+ "unmap",
+ "ignore")
#define VIR_DOMAIN_XML_WRITE_FLAGS VIR_DOMAIN_XML_SECURE
#define VIR_DOMAIN_XML_READ_FLAGS VIR_DOMAIN_XML_INACTIVE
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index a10b2ab..e74da1c 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -629,8 +629,8 @@ enum virDomainDeviceSGIO {
enum virDomainDiskDiscard {
VIR_DOMAIN_DISK_DISCARD_DEFAULT = 0,
- VIR_DOMAIN_DISK_DISCARD_ON,
- VIR_DOMAIN_DISK_DISCARD_OFF,
+ VIR_DOMAIN_DISK_DISCARD_UNMAP,
+ VIR_DOMAIN_DISK_DISCARD_IGNORE,
VIR_DOMAIN_DISK_DISCARD_LAST
};
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-discard.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-discard.args
index 02e2ddb..3c4687e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-discard.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-discard.args
@@ -1,8 +1,8 @@
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test \
/usr/bin/qemu -S -M pc-0.13 -m 1024 -smp 1 -nographic -nodefaults \
-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot dc -usb \
--drive file=/var/lib/libvirt/images/f14.img,if=none,id=drive-virtio-disk0,discard=on \
+-drive file=/var/lib/libvirt/images/f14.img,if=none,id=drive-virtio-disk0,discard=unmap \
-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0 \
--drive file=/var/lib/libvirt/Fedora-14-x86_64-Live-KDE.iso,if=none,media=cdrom,id=drive-ide0-1-0,discard=off \
+-drive file=/var/lib/libvirt/Fedora-14-x86_64-Live-KDE.iso,if=none,media=cdrom,id=drive-ide0-1-0,discard=ignore \
-device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-discard.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-discard.xml
index a6a8135..f01312f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-discard.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-discard.xml
@@ -17,13 +17,13 @@
<devices>
<emulator>/usr/bin/qemu</emulator>
<disk type='file' device='disk'>
- <driver name='qemu' type='qcow2' discard='on'/>
+ <driver name='qemu' type='qcow2' discard='unmap'/>
<source file='/var/lib/libvirt/images/f14.img'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</disk>
<disk type='file' device='cdrom'>
- <driver name='qemu' type='raw' discard='off'/>
+ <driver name='qemu' type='raw' discard='ignore'/>
<source file='/var/lib/libvirt/Fedora-14-x86_64-Live-KDE.iso'/>
<target dev='hdc' bus='ide'/>
<readonly/>
--
1.8.1.4
11 years, 6 months
[libvirt] [PATCH v2 0/2] Add support for locking domain's memory pages
by Jiri Denemark
Jiri Denemark (2):
Add support for locking domain's memory pages
qemu: Implement support for locking domain's memory pages
docs/formatdomain.html.in | 26 +++++++++++++---------
docs/schemas/domaincommon.rng | 5 +++++
src/conf/domain_conf.c | 20 +++++++++--------
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 11 +++++++++
tests/qemuxml2argvdata/qemuxml2argv-mlock-off.args | 4 ++++
tests/qemuxml2argvdata/qemuxml2argv-mlock-off.xml | 15 +++++++++++++
tests/qemuxml2argvdata/qemuxml2argv-mlock-on.args | 4 ++++
tests/qemuxml2argvdata/qemuxml2argv-mlock-on.xml | 18 +++++++++++++++
.../qemuxml2argv-mlock-unsupported.args | 4 ++++
.../qemuxml2argv-mlock-unsupported.xml | 15 +++++++++++++
tests/qemuxml2argvtest.c | 5 +++++
14 files changed, 112 insertions(+), 19 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mlock-off.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mlock-off.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mlock-on.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mlock-on.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mlock-unsupported.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mlock-unsupported.xml
--
1.8.2.1
11 years, 6 months
[libvirt] [PATCH] qemu: Fix cgroup handling when setting VCPU BW
by Martin Kletzander
Commit 632f78c introduced a regression which causes schedinfo being
unable to set some parameters. When migrating to priv->cgroup there
was missing variable left out and due to passed NULL to underlying
function, the setting failed.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=963592
---
As 632f78c describes as v1.0.4-161-g632f78c, I'll push this into
v1.0.5-maint as well once ACK'd.
src/qemu/qemu_driver.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b1630f8..9e77fd6 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -8009,7 +8009,6 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom,
{
virQEMUDriverPtr driver = dom->conn->privateData;
int i;
- virCgroupPtr group = NULL;
virDomainObjPtr vm = NULL;
virDomainDefPtr vmdef = NULL;
unsigned long long value_ul;
@@ -8087,7 +8086,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom,
QEMU_SCHED_MIN_PERIOD, QEMU_SCHED_MAX_PERIOD);
if (flags & VIR_DOMAIN_AFFECT_LIVE && value_ul) {
- if ((rc = qemuSetVcpusBWLive(vm, group, value_ul, 0)))
+ if ((rc = qemuSetVcpusBWLive(vm, priv->cgroup, value_ul, 0)))
goto cleanup;
vm->def->cputune.period = value_ul;
@@ -8101,7 +8100,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom,
QEMU_SCHED_MIN_QUOTA, QEMU_SCHED_MAX_QUOTA);
if (flags & VIR_DOMAIN_AFFECT_LIVE && value_l) {
- if ((rc = qemuSetVcpusBWLive(vm, group, 0, value_l)))
+ if ((rc = qemuSetVcpusBWLive(vm, priv->cgroup, 0, value_l)))
goto cleanup;
vm->def->cputune.quota = value_l;
@@ -8115,7 +8114,8 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom,
QEMU_SCHED_MIN_PERIOD, QEMU_SCHED_MAX_PERIOD);
if (flags & VIR_DOMAIN_AFFECT_LIVE && value_ul) {
- if ((rc = qemuSetEmulatorBandwidthLive(vm, group, value_ul, 0)))
+ if ((rc = qemuSetEmulatorBandwidthLive(vm, priv->cgroup,
+ value_ul, 0)))
goto cleanup;
vm->def->cputune.emulator_period = value_ul;
@@ -8129,7 +8129,8 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom,
QEMU_SCHED_MIN_QUOTA, QEMU_SCHED_MAX_QUOTA);
if (flags & VIR_DOMAIN_AFFECT_LIVE && value_l) {
- if ((rc = qemuSetEmulatorBandwidthLive(vm, group, 0, value_l)))
+ if ((rc = qemuSetEmulatorBandwidthLive(vm, priv->cgroup,
+ 0, value_l)))
goto cleanup;
vm->def->cputune.emulator_quota = value_l;
--
1.8.2.1
11 years, 6 months
[libvirt] [PATCH] Fix failure to detect missing cgroup partitions
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Change bbe97ae968eba60b71e0066d49f9fc909966d9d6 caused the
QEMU driver to ignore ENOENT errors from cgroups, in order
to cope with missing /proc/cgroups. This is not good though
because many other things can cause ENOENT and should not
be ignored. The callers expect to see ENXIO when cgroups
are not present, so adjust the code to report that errno
when /proc/cgroups is missing
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/qemu/qemu_cgroup.c | 3 +--
src/util/vircgroup.c | 7 ++++++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index aaf94cf..9784f31 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -456,8 +456,7 @@ int qemuInitCgroup(virQEMUDriverPtr driver,
if (rc != 0) {
if (rc == -ENXIO ||
rc == -EPERM ||
- rc == -EACCES ||
- rc == -ENOENT) { /* No cgroups mounts == success */
+ rc == -EACCES) { /* No cgroups mounts == success */
VIR_DEBUG("No cgroups present/configured/accessible, ignoring error");
goto done;
}
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 5780785..07ea2c3 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -1110,8 +1110,13 @@ static int virCgroupPartitionNeedsEscaping(const char *path)
path[0] == '.')
return 1;
- if (!(fp = fopen("/proc/cgroups", "r")))
+ if (!(fp = fopen("/proc/cgroups", "r"))) {
+ /* The API contract is that we return ENXIO
+ * if cgroups are not available on a host */
+ if (errno == ENOENT)
+ errno = ENXIO;
return -errno;
+ }
/*
* Data looks like this:
--
1.8.2.1
11 years, 6 months