[libvirt] [PATCH 1/1] lxc: allow fallback to no apparmor.
by Serge Hallyn
The security_driver line in /etc/libvirt/qemu.conf is best-effort - if
selinux is not available on the host, then 'none' will be used.
The security_driver line in /etc/libvirt/lxc.conf doesn't behave the
same way - if apparmor is specified but policies are not available
on the host, then container creation fails.
This patch always tries to fall back to 'none' if the requested
driver is not available. A better patch would allow an option list
like qemu.conf allows, but this patch doesn't do that.
Signed-off-by: Serge Hallyn <serge.hallyn(a)ubuntu.com>
---
src/lxc/lxc_driver.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index c3cd62c..233e558 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -1541,6 +1541,11 @@ lxcSecurityInit(virLXCDriverConfigPtr cfg)
cfg->securityDefaultConfined,
cfg->securityRequireConfined);
if (!mgr)
+ mgr = virSecurityManagerNew(NULL, LXC_DRIVER_NAME, false,
+ cfg->securityDefaultConfined,
+ cfg->securityRequireConfined);
+
+ if (!mgr)
goto error;
return mgr;
--
2.1.0
10 years, 3 months
[libvirt] [PATCH] conf: sanitize tap and vhost paths
by Martin Kletzander
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/conf/domain_conf.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index bb4a4cb..9cc118c 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7065,8 +7065,15 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
if (virNetDevVlanParse(cur, ctxt, &def->vlan) < 0)
goto error;
} else if (xmlStrEqual(cur->name, BAD_CAST "backend")) {
- def->backend.tap = virXMLPropString(cur, "tap");
- def->backend.vhost = virXMLPropString(cur, "vhost");
+ char *tmp = NULL;
+
+ if ((tmp = virXMLPropString(cur, "tap")))
+ def->backend.tap = virFileSanitizePath(tmp);
+ VIR_FREE(tmp);
+
+ if ((tmp = virXMLPropString(cur, "vhost")))
+ def->backend.vhost = virFileSanitizePath(tmp);
+ VIR_FREE(tmp);
}
}
cur = cur->next;
--
2.1.0
10 years, 3 months
[libvirt] [PATCH] qemuBuildNumaArgStr: Discard def->cpu check
by Michal Privoznik
In the function at one place we check if def->cpu is NULL prior
to accessing def->cpu->ncells. Then, later in the code,
def->cpu->ncells is accessed directly, without the check. This
makes coverity unhappy, because the first check makes it think
def->cpu can be NULL. However, the function is not called if
def->cpu is NULL. Therefore, remove the first check and hopefully
make coverity cheer again.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_command.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index d470b1b..65864d2 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6594,7 +6594,7 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg,
continue;
}
- if (def->cpu && def->cpu->ncells) {
+ if (def->cpu->ncells) {
/* Fortunately, we allow only guest NUMA nodes to be continuous
* starting from zero. */
pos = def->cpu->ncells - 1;
--
1.8.5.5
10 years, 3 months
[libvirt] [PATCH 0/6] RDMA migration support
by Jiri Denemark
This is a modified version of RDMA migration patches sent back in
January by Michael R. Hines. See individual patches for (numerous)
changes since v2.
Jiri Denemark (3):
qemu: Fix old tcp:host URIs more cleanly
qemu: Prepare support for arbitrary migration protocol
qemu: Add RDMA migration capabilities
Michael R. Hines (3):
qemu: Expose additional migration statistics
qemu: RDMA migration support
qemu: Memory pre-pinning support for RDMA migration
include/libvirt/libvirt.h.in | 26 +
src/qemu/qemu.conf | 8 +
src/qemu/qemu_capabilities.c | 32 +-
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 8 +
src/qemu/qemu_domain.c | 18 +
src/qemu/qemu_migration.c | 216 +-
src/qemu/qemu_migration.h | 3 +-
src/qemu/qemu_monitor.c | 25 +-
src/qemu/qemu_monitor.h | 13 +
src/qemu/qemu_monitor_json.c | 61 +-
src/qemu/qemu_monitor_json.h | 2 +
tests/qemucapabilitiesdata/caps_1.2.2-1.replies | 10 +
tests/qemucapabilitiesdata/caps_1.3.1-1.replies | 10 +
tests/qemucapabilitiesdata/caps_1.4.2-1.replies | 10 +
tests/qemucapabilitiesdata/caps_1.5.3-1.replies | 10 +
tests/qemucapabilitiesdata/caps_1.6.0-1.replies | 22 +
tests/qemucapabilitiesdata/caps_1.6.50-1.replies | 22 +
tests/qemucapabilitiesdata/caps_2.1.1-1.caps | 162 ++
tests/qemucapabilitiesdata/caps_2.1.1-1.replies | 3264 ++++++++++++++++++++++
tests/qemucapabilitiestest.c | 1 +
tools/virsh-domain.c | 34 +
22 files changed, 3886 insertions(+), 72 deletions(-)
create mode 100644 tests/qemucapabilitiesdata/caps_2.1.1-1.caps
create mode 100644 tests/qemucapabilitiesdata/caps_2.1.1-1.replies
--
2.1.0
10 years, 3 months
[libvirt] [PATCH] nodeinfo: Prefer MIN in nodeGetFreePages
by Michal Privoznik
It's better to use a macro instead of if-else construct.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Pushed under trivial rule.
src/nodeinfo.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index 1b4a8d7..2459922 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -2041,9 +2041,7 @@ nodeGetFreePages(unsigned int npages,
goto cleanup;
}
- lastCell = startCell + cellCount;
- if (startCell + cellCount < lastCell)
- lastCell = startCell + cellCount;
+ lastCell = MIN(lastCell, startCell + cellCount);
for (cell = startCell; cell < lastCell; cell++) {
for (i = 0; i < npages; i++) {
--
1.8.5.5
10 years, 3 months
[libvirt] Bug 993411 - Compilation fails on lxc/lxc_monitor_protocol.c 31: undefined reference to xdr_uinit64_t [NEEDINFO]
by Gerald Palmer
Description of problem: Fail to compile
Version-Release number of selected component (if applicable):
Version 1.0.3 through 1.1.1
How reproducible:
Steps to Reproduce:
1./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc
2.make
Actual results:
libvirt_lxc-lxc_monitor_protocol.o: In function `xdr_virLXCMonitorInitEventMsg':
/usr/local/src/libvirt/libvirt-1.1.1/src/./lxc/lxc_monitor_protocol.c:31: undefined reference to `xdr_uint64_t'
Expected results:
Successful Compilation
Additional info: patch resolving compilation issue
--- lxc_monitor_protocol.h 2013-08-05 20:22:23.963000000 +0000
+++ libvirt-1.1.1/src/lxc/lxc_monitor_protocol.h 2013-08-05 20:22:46.226000000 +0000
@@ -5,6 +5,8 @@
#ifndef _LXC_MONITOR_PROTOCOL_H_RPCGEN
#define _LXC_MONITOR_PROTOCOL_H_RPCGEN
+# define xdr_uint64_t xdr_u_int64_t
+
#include <rpc/rpc.h>
Gerald Palmer | Information Technology | Larry Gordon Agency Inc.
233 N Michigan Ave | STE 2450 | Chicago IL 60601 | WWW.LGANET.COM
(312) 540-9400 | (800) 666-6988 | DIRECT (312) 540-5458 | FAX (312) 540-5440
BRAMCO | Solid Products. Strong Support. Maximum Value.
Forms & Quotes available at www.lganet.com<http://www.lganet.com/>
10 years, 3 months
[libvirt] [PATCH 0/3] enhance freepages related
by Jincheng Miao
Jincheng Miao (3):
virsh-host: fix pagesize unit of freepages
nodeinfo: report error when given node is out of range
Fix typo of virNodeGetFreePages comment
src/libvirt.c | 2 +-
src/nodeinfo.c | 24 +++++++++++++++++++++---
tools/virsh-host.c | 27 ++++++++++++++++++---------
3 files changed, 40 insertions(+), 13 deletions(-)
--
1.8.3.1
10 years, 3 months
[libvirt] [PATCH v3 0/2] Add machine type pc-1.0-qemu-kvm for live migrate compatibility with qemu-kvm
by Alex Bligh
This patch series adds inbound migrate capability from qemu-kvm version
1.0. The main ideas are those set out in Cole Robinson's patch here:
http://pkgs.fedoraproject.org/cgit/qemu.git/tree/0001-Fix-migration-from-...
however, rather than patching statically (and breaking inbound
migration on existing machine types), I have added a new machine
type (pc-1.0-qemu-kvm) without affecting any other machine types.
The existing pc-1.0 machine type is renamed to pc-1.0-qemu-git,
with pc-1.0 becoming an alias for one or another, as selected
by a configure option (defaulting to pc-1.0-qemu-git, IE no
change).
Two aproaches are taken:
* In hw/timer/i8254_common.c, the VMSTATE_UINT32_TEST macro
is used to test the version for the irq_disable flags,
allowing version 3 or more, or version 2 for an inbound
migrate from qemu-kvm (only).
* In hw/acpi/piix4.c, qemu-kvm incorrectly uses version 2 for
a version 3 structure, causing acpi_load_old to be used.
acpi_load_old detects this situation based on the machine type
and restarts the attempt to load the vmstate using a
customised VMStateDescription. The above cleaner approach is
unavailable here.
I developed this on qemu 2.0 but have forward ported it (trivially)
to master. My testing has been on a VM live-migrated-to-file from
Ubuntu Precise qemu-kvm 1.0.
I have given this a moderate degree of testing but it could do
with more.
Note that certain hardware devices (including QXL) will not
migrate properly due to a fundamental difference in their internal
state between versions.
Also note that (as expected) migration from qemu-2.x to qemu-1.0
will not work, even if the machine types are the same.
Alex Bligh (2):
Add machine type pc-1.0-qemu-kvm for live migrate compatibility with
qemu-kvm
Add configure option --enable-pc-1-0-qemu-kvm
configure | 12 ++++++++++++
hw/acpi/piix4.c | 47 +++++++++++++++++++++++++++++++++++++++++++++--
hw/i386/pc_piix.c | 38 +++++++++++++++++++++++++++++++++++++-
hw/timer/i8254_common.c | 10 +++++++++-
4 files changed, 103 insertions(+), 4 deletions(-)
--
1.7.9.5
10 years, 3 months
[libvirt] [PATCH] cpu: fix wrong single quote mark
by Chen Fan
Signed-off-by: Chen Fan <chen.fan.fnst(a)cn.fujitsu.com>
---
src/conf/cpu_conf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index 6c454ee..116aa58 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -413,7 +413,7 @@ virCPUDefParseXML(xmlNodePtr node,
for (j = 0; j < i; j++) {
if (STREQ(name, def->features[j].name)) {
virReportError(VIR_ERR_XML_ERROR,
- _("CPU feature `%s' specified more than once"),
+ _("CPU feature '%s' specified more than once"),
name);
VIR_FREE(name);
goto error;
@@ -731,7 +731,7 @@ virCPUDefUpdateFeatureInternal(virCPUDefPtr def,
}
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("CPU feature `%s' specified more than once"),
+ _("CPU feature '%s' specified more than once"),
name);
return -1;
--
1.9.3
10 years, 3 months
[libvirt] [PATCH v1 0/3] Check migration configuration
by Chen Fan
This version differs from the patch set
"conf: Check migration_host is valid or not during libvirt restarts"
I posted 2 weeks ago, I droped checking the migration_host on target
host. and find an issue when setting migration_host.
Chen Fan (3):
migration: add migration_host support for Ipv6 address without
brackets
conf: Check migration_host is localhost or not during restart
conf: Check migration_address is valid or not during restart
src/qemu/qemu.conf | 2 +-
src/qemu/qemu_conf.c | 21 +++++++++++++++++++++
src/qemu/qemu_migration.c | 19 +++++++++++++++----
src/qemu/test_libvirtd_qemu.aug.in | 2 +-
4 files changed, 38 insertions(+), 6 deletions(-)
--
1.9.3
10 years, 3 months