[libvirt] [PATCH v2] A bunch of extensions to libxl driver
by Marek Marczykowski-Górecki
This are some additional features to libxl driver. Some of them require change
in domain config structures/syntax. Details described with each patch.
There are two bugfix patches for deadlock during daemon startup.
Changes since v1:
- dropped 'script' disk parameter patches
- updated 'script' interface parameter handling
- dropped PCI passthrough patches - duplicates Chunyan's work
- dropped RFC: libxl: special 'stubdom-dm' emulator to use qemu in stub domain
- rebased on 1.0.6+
- VIR_STRDUP
- other changes described in individual patches
- new patches:
libxl: initialize device structures
libxl: support paused domain restore in virDomainRestoreFlags
libxl: support domain config modification in virDomainRestoreFlags
libxl: support network device attach/detach
libxl: pass ipaddr to libxl toolstack
libxl: implement lifecycle actions from domain
libxl: add tablet/mouse input device support
11 years, 5 months
[libvirt] [PATCH 0/2] avoid getpwuid_r deadlock
by Eric Blake
https://bugzilla.redhat.com/show_bug.cgi?id=964358
Posting now to get reviews started. I'd especially like to get
feedback that it doesn't break LXC, and that it works with root-squash
NFS when using qemu:qemu instead of root:root in /etc/libvirt/qemu.conf.
I hope to do more testing myself, and also see if I can try writing an
LD_PRELOAD shim as part of 'make check' to make it easier to test that
the right system calls are made during the sequence.
Eric Blake (2):
util: add virGetGroupList
util: make virSetUIDGID async-signal-safe
configure.ac | 7 +--
src/libvirt_private.syms | 1 +
src/security/security_dac.c | 16 ++++--
src/util/vircommand.c | 10 +++-
src/util/virfile.c | 30 +++++++++--
src/util/virutil.c | 123 ++++++++++++++++++++++++++++++--------------
src/util/virutil.h | 7 ++-
7 files changed, 142 insertions(+), 52 deletions(-)
--
1.8.1.4
11 years, 5 months
[libvirt] libvirt compliation from git source fails with "gnulib/tests/Makefile.in' not found" error
by chandrashekar shastri
Hi,
I am compiling the libvirt from source and I am getting the following error:
Don't forget to
- "include gnulib.mk" from within "gnulib/lib/Makefile.am",
- "include gnulib.mk" from within "gnulib/tests/Makefile.am",
- mention "-I gnulib/m4" in ACLOCAL_AMFLAGS in Makefile.am,
- mention "gnulib/m4/gnulib-cache.m4" in EXTRA_DIST in Makefile.am,
- invoke gl_EARLY in ./configure.ac, right after AC_PROG_CC,
- invoke gl_INIT in ./configure.ac.
running: AUTOPOINT=true LIBTOOLIZE=true autoreconf --verbose --install
--force -I gnulib/m4 --no-recursive
autoreconf: Entering directory `.'
autoreconf: running: true --force
autoreconf: running: aclocal -I m4 --force -I m4 -I gnulib/m4
autoreconf: configure.ac: tracing
autoreconf: running: true --copy --force
autoreconf: running: /usr/bin/autoconf --include=gnulib/m4 --force
autoreconf: running: /usr/bin/autoheader --include=gnulib/m4 --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:2424: required file `gnulib/lib/Makefile.in' not found
configure.ac:2424: required file `gnulib/tests/Makefile.in' not found
autoreconf: automake failed with exit status: 1
Libvirtd (libvirt) 1.0.5 we didn't any isssues. Please let us know if we
are missing something.
Thanks,
Chandrashekar
11 years, 5 months
[libvirt] Libvirt : Bootstrap fails for local gnulib
by chandrashekar shastri
Hi All,
The Libvirt compliation fails to bootstarp for local gnulib. We do not
have outbound access for the test machines.
So, we ll pull the gnulib from and copy to the test machines.
When we run ./bootstrap --no-git --gnulib-srcdir=/path/to/local, below
is the error:
./bootstrap: Bootstrapping from checked-out libvirt sources...
./bootstrap: consider installing git-merge-changelog from gnulib
./bootstrap: getting gnulib files...
fatal: Needed a single revision
Unable to find current revision in submodule path '.gnulib'
If we run autogen.sh it tries to pull from git though the $GNULIB_SRCDIR
is exported with the local gnulib.
./autogen.sh '--no-git'
I am going to run ./configure with no arguments - if you wish
to pass any to it, please specify them on the ./autogen.sh command line.
running bootstrap --no-git...
./bootstrap: Bootstrapping from checked-out libvirt sources...
./bootstrap: consider installing git-merge-changelog from gnulib
./bootstrap: getting gnulib files...
fatal: Unable to look up git.sv.gnu.org (port 9418) (Name or service not
known)
Unable to fetch in submodule path '.gnulib'
Failed to bootstrap, please investigate.
Please provide us the workaround for the same.
Thanks,
Chandrashekar
11 years, 5 months
[libvirt] [PATCH v3 00/12] Add user namespace support for libvirt lxc
by Gao feng
This patchset try to add userns support for libvirt lxc.
Since userns is nearly completed in linux-3.9, the old
kernel doesn't support userns, I add some New XML elements
to let people decide if enable userns.The userns is enabled
only when user configure the XML.
The format of user namespace related XML file like below:
<idmap>
<uid start='0' target='1000' count='10'>
<gid start='0' target='1000' count='10'>
</idmap>
it means the user in container (which uid:gid is 0:0) will
be mapped to the user in host (uid:gid is 1000:1000), count
is used to form an u/gid range: The users in container which
uid in [start, start + count -1] will be mapped.
You can have multiple lines to map differnet id ranges,
caution, you must make sure the root user of container has
been mapped.
This patchset also does the below jobs.
1, Because the uninit userns has no right to create devices,
we should create devices for container on host.
2, Changes the owner of fuse and tty device.
Change from v2:
1, Mount tmpfs on /stateDir/domain.dev
2, Create devices under /stateDir/doamin.dev/
3, Mount Move the /.oldroot/stateDir/doamin.dev/ on the /dev/ of container
4, Enhance the configuration, disallow the semi configuration
Gao feng (12):
LXC: Introduce New XML element for user namespace
LXC: enable user namespace only when user set the uidmap
LXC: sort the uidmap/gidmap of domain
LXC: introduce virLXCControllerSetupUserns and lxcContainerSetID
LXC: Creating devices for container on host side
LXC: Move creating /dev/ptmx to virLXCControllerSetupDevPTS
LXC: fuse: Change files owner to the root user of container
LXC: controller: change the owner of tty devices to the root user of
container
LXC: controller: change the owner of /dev to the root user of
container
LXC: controller: change the owner of devices created on host
LXC: controller: change the owner of /dev/pts and ptmx to the root of
container
LXC: introduce virLXCControllerChown
docs/formatdomain.html.in | 23 ++++
docs/schemas/domaincommon.rng | 31 +++++
src/conf/domain_conf.c | 115 ++++++++++++++++++
src/conf/domain_conf.h | 22 ++++
src/lxc/lxc_container.c | 183 ++++++++++++++--------------
src/lxc/lxc_controller.c | 271 +++++++++++++++++++++++++++++++++++++++++-
src/lxc/lxc_fuse.c | 6 +
7 files changed, 557 insertions(+), 94 deletions(-)
--
1.8.1.4
11 years, 5 months
[libvirt] [PATCH] LXC: blkio: allow to setup weight_device
by Gao feng
libivrt lxc can only set generic weight for container,
This patch allows user to setup per device blkio
weigh for container.
Signed-off-by: Gao feng <gaofeng(a)cn.fujitsu.com>
---
src/lxc/lxc_cgroup.c | 26 ++++++++++++++++++++------
1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c
index 5c8acb3..4443b83 100644
--- a/src/lxc/lxc_cgroup.c
+++ b/src/lxc/lxc_cgroup.c
@@ -123,21 +123,35 @@ cleanup:
static int virLXCCgroupSetupBlkioTune(virDomainDefPtr def,
virCgroupPtr cgroup)
{
- int ret = -1;
+ int i, rc;
if (def->blkio.weight) {
- int rc = virCgroupSetBlkioWeight(cgroup, def->blkio.weight);
+ rc = virCgroupSetBlkioWeight(cgroup, def->blkio.weight);
if (rc != 0) {
virReportSystemError(-rc,
_("Unable to set Blkio weight for domain %s"),
def->name);
- goto cleanup;
+ return -1;
}
}
- ret = 0;
-cleanup:
- return ret;
+ if (def->blkio.ndevices) {
+ for (i = 0; i < def->blkio.ndevices; i++) {
+ virBlkioDeviceWeightPtr dw = &def->blkio.devices[i];
+ if (!dw->weight)
+ continue;
+ rc = virCgroupSetBlkioDeviceWeight(cgroup, dw->path, dw->weight);
+ if (rc != 0) {
+ virReportSystemError(-rc,
+ _("Unable to set io device weight "
+ "for domain %s"),
+ def->name);
+ return -1;
+ }
+ }
+ }
+
+ return 0;
}
--
1.8.1.4
11 years, 5 months
[libvirt] Memory access API
by Marek Marczykowski-Górecki
Hi,
Is there any zero-copy VM memory access API in libvirt? I see only
virDomainMemoryPeek function, which copy some memory from VM and do not permit
VM memory modifications.
What I'm looking for is xen xc_map_foreign_pages or
xc_gnttab_map_domain_grant_refs equivalent/wrapper. IOW map memory pages to
dom0 address space, without copy. I know that not every hypervisor supports
it, but it is useful to build a high-performance communication channel on top
of it.
--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
11 years, 5 months
[libvirt] [PATCH 0/8] Filtering of object lists via ACLs
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The current ACL checks validate access to the object being
passed in to the API calls.
There are a few APIs (all the virConnectList* / virConnectNum*
ones) which are used to get lists of objects in the first
place. Currently you could find out that there is a VM called
"foo", but you can't then do virDomainLookupByName since the
ACL check may block it.
This series introduces filtering in the object list APIs,
so you can't even see the existance of an object called
"foo", if you don't have permission over it.
This is not yet filtering the legacy Xen driver.
Daniel P. Berrange (8):
Add access control filtering of domain objects
Add access control filtering of network objects
Add access control filtering of node device objects
Add access control filtering of storage objects
Add access control filtering of secret objects
Add access control filtering of nwfilter objects
Add access control filtering of interface objects
Extend the ACL test case to validate filter rule checks
src/Makefile.am | 1 +
src/check-aclrules.pl | 97 ++++++++++++
src/conf/domain_conf.c | 91 +++++++----
src/conf/domain_conf.h | 17 ++-
src/conf/interface_conf.h | 3 +
src/conf/network_conf.c | 12 +-
src/conf/network_conf.h | 13 +-
src/conf/node_device_conf.c | 12 +-
src/conf/node_device_conf.h | 12 +-
src/conf/storage_conf.c | 12 +-
src/conf/storage_conf.h | 11 +-
src/interface/interface_backend_netcf.c | 262 +++++++++++++++++++++++++++-----
src/interface/interface_backend_udev.c | 56 +++++--
src/libvirt_private.syms | 6 +-
src/libxl/libxl_driver.c | 15 +-
src/lxc/lxc_driver.c | 15 +-
src/network/bridge_driver.c | 44 +++---
src/node_device/node_device_driver.c | 28 ++--
src/nwfilter/nwfilter_driver.c | 39 +++--
src/openvz/openvz_driver.c | 7 +-
src/parallels/parallels_driver.c | 14 +-
src/parallels/parallels_network.c | 2 +-
src/qemu/qemu_driver.c | 24 +--
src/rpc/gendispatch.pl | 42 +++--
src/secret/secret_driver.c | 14 +-
src/storage/storage_driver.c | 62 +++++---
src/test/test_driver.c | 18 ++-
src/uml/uml_driver.c | 15 +-
src/vmware/vmware_driver.c | 12 +-
29 files changed, 716 insertions(+), 240 deletions(-)
--
1.8.1.4
11 years, 5 months
[libvirt] [PATCH v6 0/5] libvirt supports Guest Panicked
by Chen Fan
Changes:
v5-v6: Refactor the patches, and fix the incorrect indentation and name.
v4-v5: 1. fix the incorrect indentation and explanation (of some reasons).
v3-v4: 1. Supports the dumpcore options of the oncrash element in the XML.
2. Move the previous code to processWatchdogEvent().
v2-v3: 1. split into 3 patches
v1-v2: 1. fix the incorrect domain state: paused -> crashed, when crash
the guest while libvirt isn't running, then restart libvirtd.
Chen Fan (5):
libvirt: Define domain crash event types
qemu: Refactor the processwatchdogEvent code that can make the driver
workpool more generalized
qemu: Need to use qemuProcessShutdownOrReboot(), so we defined it at
qemu_process.h
qemu: Implement 'oncrash' events when guest panicked
qemu: Implement 'oncrash' coredump events when guest panicked
examples/domain-events/events-c/event-test.c | 10 ++
include/libvirt/libvirt.h.in | 16 ++
src/conf/domain_conf.c | 12 +-
src/qemu/qemu_domain.h | 11 +-
src/qemu/qemu_driver.c | 222 ++++++++++++++++++++++++---
src/qemu/qemu_monitor.c | 14 +-
src/qemu/qemu_monitor.h | 4 +
src/qemu/qemu_monitor_json.c | 7 +
src/qemu/qemu_process.c | 60 +++++++-
src/qemu/qemu_process.h | 3 +
tools/virsh-domain-monitor.c | 8 +
11 files changed, 328 insertions(+), 39 deletions(-)
--
1.8.1.4
11 years, 5 months
[libvirt] [PATCH] qemu: Restored original console alias
by Michal Privoznik
Because of some crazy backward compatibility, console device is in
some cases just an alias to a serial device. This means, in the process
of generating XML description of a domain, all the interesting info is
taken from corresponding serial device, if that's the case. Including
the device alias. That means, we produce:
<console type='pty' tty='/dev/pts/20'>
...
<alias name='serial0'/>
</console>
(notice the assigned alias)
Maybe this is okay, maybe its wrong either. Anyway, later, when libvirtd
restarts, and we parse the state XML file, we read the wrong alias back.
Hence, the internal representation is different to the state it was in
prior the libvirtd restart.
---
src/qemu/qemu_domain.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 8d79066..96d88ec 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -804,6 +804,34 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
dev->data.chr->source.data.nix.listen = true;
}
+ /* For some really crazy back compat in virDomainDefFormatInternal we must
+ * restore the original console alias. For hvm domains, we are formatting
+ * a dummy console device (based on a serial device which it refers to)
+ * instead of the original one. That means the device aliases in memory
+ * and in the formatted XML are not in sync. While in memory we still have
+ * 'consoleN', in the formatted XML we have 'serialN'. */
+ if (dev->type == VIR_DOMAIN_DEVICE_CHR &&
+ dev->data.chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE &&
+ dev->data.chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL &&
+ STREQ(def->os.type, "hvm")) {
+ int id;
+ char *alias = dev->data.chr->info.alias;
+ const char *serial_alias = "serial";
+
+ if (alias && STRPREFIX(alias, serial_alias)) {
+ alias += strlen(serial_alias);
+
+ if (virStrToLong_i(alias, NULL, 10, &id) < 0)
+ goto cleanup;
+
+ VIR_FREE(dev->data.chr->info.alias);
+ if (virAsprintf(&dev->data.chr->info.alias, "console%d", id) < 0) {
+ virReportOOMError();
+ goto cleanup;
+ }
+ }
+ }
+
ret = 0;
cleanup:
--
1.8.1.5
11 years, 5 months