[libvirt] [PATCH 01/13] Move daemon-related parts of virNetServer to virNetDaemon

2015-06-16 Thread Martin Kletzander
This allows to have more servers in one daemon which helps isolating some resources. Signed-off-by: Martin Kletzander mklet...@redhat.com --- daemon/libvirtd.c | 101 ++--- docs/internals.html.in | 4 +- docs/internals/rpc.html.in | 7 + po/POTFILES.in

[libvirt] [PATCH 09/13] Add configuration options for permissions on daemon's admin socket

2015-06-16 Thread Martin Kletzander
This is not going to be very widely used, but for some corner cases and easier (unsafe) debugging, it might be nice. Signed-off-by: Martin Kletzander mklet...@redhat.com --- daemon/libvirtd-config.c | 27 +-- daemon/libvirtd-config.h | 13 -

[libvirt] [PATCH 04/13] Add admin protocol

2015-06-16 Thread Martin Kletzander
For now there are only CONNECT_OPEN and CONNECT_CLOSE procedures. Signed-off-by: Martin Kletzander mklet...@redhat.com --- .gitignore | 1 + src/Makefile.am| 17 -- src/admin/admin_protocol.x | 77 ++

[libvirt] [PATCH 03/13] Teach gendispatch how to handle admin dispatching files

2015-06-16 Thread Martin Kletzander
Since this is just a new option for gendispatch, it looks more like a cleanup. The only differences handled by it are connect pointers, private pointers and API naming customs. Signed-off-by: Martin Kletzander mklet...@redhat.com --- src/rpc/gendispatch.pl | 254

Re: [libvirt] [PATCH v2 2/2] lxc: properly clean up qemu-nbd

2015-06-16 Thread Daniel P. Berrange
On Tue, Jun 16, 2015 at 11:18:49AM +0200, Cédric Bosdonnat wrote: Add the qemu-nbd tasks to the container cgroup to make sure those will be killed when the container is stopped. In order to reliably get the qemu-nbd tasks PIDs, we use /sys/devices/virtual/block/DEV/pid as qemu-nbd is

Re: [libvirt] [sandbox v2 1/4] Make sure the sandbox state dir and config can be accessed

2015-06-16 Thread Daniel P. Berrange
On Tue, Jun 16, 2015 at 11:16:00AM +0200, Cédric Bosdonnat wrote: When running a KVM sandbox as root, the qemu process will run as another user (likely qemu). We need to make sure this user can access the vmlinux and initrd.img, sandbox.cfg and mounts.cfg files. ---

Re: [libvirt] [sandbox v2 4/4] Add host-image format parameter

2015-06-16 Thread Daniel P. Berrange
On Tue, Jun 16, 2015 at 11:16:03AM +0200, Cédric Bosdonnat wrote: Let the user specify the format of the source disk image in host-image mounts. This will allow us to mount other image types than raw ones. --- .../libvirt-sandbox-builder-container.c| 10 +++

Re: [libvirt] [PATCH] libxl: rework reference counting

2015-06-16 Thread Anthony PERARD
On Mon, Jun 15, 2015 at 08:36:47PM -0600, Jim Fehlig wrote: Similar to commit 540c339a for the QEMU driver, rework reference counting in the libxl driver to make it more deterministic and the code a bit cleaner. Signed-off-by: Jim Fehlig jfeh...@suse.com --- I've been testing this patch

[libvirt] [EXAMPLE PATCH 12/13] admin: Add virAdmHello function

2015-06-16 Thread Martin Kletzander
Just one of the simplest functions that returns string Clients: X where X is the number of connected clients to daemon's first subserver (the original one), so it can be tested using virsh, ipython, etc. The subserver is gathered by incrementing its reference counter (similarly to getting qemu

[libvirt] [PATCH 07/13] Add libvirt-admin library

2015-06-16 Thread Martin Kletzander
Initial scratch of the admin library. It has its own virAdmConnectPtr that inherits from virAbstractConnectPtr and thus trivially supports error reporting. There's pkg-config file added and spec-file adjusted as well. Since the library should be minimalistic and not depend on any other library,

[libvirt] [EXAMPLE PATCH 13/13] Example virt-admin

2015-06-16 Thread Martin Kletzander
You had only one job. That's what you can say about this example binary. In future, parts of virsh that are usable for this binary should be split into separate shell-utils and virt-admin should gain all the cool features of virsh without too much code addition. Signed-off-by: Martin Kletzander

[libvirt] [PATCH 06/13] Add admin error domain

2015-06-16 Thread Martin Kletzander
Just the addition of VIR_FROM_ADMIN to the enum of error domains. Signed-off-by: Martin Kletzander mklet...@redhat.com --- include/libvirt/virterror.h | 3 ++- src/util/virerror.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/libvirt/virterror.h

[libvirt] [PATCH 05/13] Build client headers for admin protocol

2015-06-16 Thread Martin Kletzander
Signed-off-by: Martin Kletzander mklet...@redhat.com --- .gitignore | 1 + cfg.mk | 5 - src/Makefile.am | 9 - 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b60c16258739..e5e078889c14 100644 --- a/.gitignore +++

[libvirt] [PATCH 08/13] Add XML files with admin API specification

2015-06-16 Thread Martin Kletzander
No online docs are build from it since it doesn't really fit into our document structure and new page will need to be created for it, but this is at least a heads-up commit for easier parsing in order to build some documentation (or python bindings) later on. Signed-off-by: Martin Kletzander

[libvirt] [PATCH 10/13] Add support for admin API in libvirt daemon

2015-06-16 Thread Martin Kletzander
For this to pe properly separated from other protocols used by the server, there is second server added which allows access to the whole virNetDaemon to its clients. Signed-off-by: Martin Kletzander mklet...@redhat.com --- cfg.mk| 3 ++ daemon/Makefile.am| 32

[libvirt] [PATCH 02/13] tests: Adapt virnetservertest to daemon refactor

2015-06-16 Thread Martin Kletzander
Rename the test to virnetdaemontest and use virNetDaemon objects instead of virNetServer inside. Signed-off-by: Martin Kletzander mklet...@redhat.com --- tests/Makefile.am | 10 +- .../{virnetserverdata = virnetdaemondata}/README | 0

[libvirt] [PATCH 00/13] Admin API

2015-06-16 Thread Martin Kletzander
This is a real post for an Admin API to get in. Everything discussed in previous posts should be a addressed. I'll start a discussion later on today about the ideas for the APIs to be added and the general near-future desing moves. I'm also keeping the last three example patches in so you can

Re: [libvirt] [PATCH v2 1/2] Add virProcessGetPids to get all tasks of a process

2015-06-16 Thread Daniel P. Berrange
On Tue, Jun 16, 2015 at 11:18:48AM +0200, Cédric Bosdonnat wrote: This function gets all the PIDs listed in /proc/PID/task. This will be needed at least to move all qmeu-nbd tasks to the container cgroup. --- src/libvirt_private.syms | 1 + src/util/virprocess.c| 47

Re: [libvirt] [sandbox v2 2/4] Write /dev/vd* instead of vd* in mounts.cfg

2015-06-16 Thread Daniel P. Berrange
On Tue, Jun 16, 2015 at 11:16:01AM +0200, Cédric Bosdonnat wrote: Fixes a regression introduced by d74b4350: the init-qemu tool expects /dev/vd* sources to create the block device, while we were just having vd*. Write again /dev/vd* to mounts.cfg. ---

Re: [libvirt] [sandbox v2 3/4] qemu: mount all host-images as ext4

2015-06-16 Thread Daniel P. Berrange
On Tue, Jun 16, 2015 at 11:16:02AM +0200, Cédric Bosdonnat wrote: To avoid troubles when mounting ext4 images, hard-code ext4 as mount format instead of ext3. --- libvirt-sandbox/libvirt-sandbox-builder-machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ACK, no modern system

Re: [libvirt] [PATCH 07/13] Add libvirt-admin library

2015-06-16 Thread Martin Kletzander
On Tue, Jun 16, 2015 at 11:42:52AM +0100, Daniel P. Berrange wrote: On Tue, Jun 16, 2015 at 11:58:24AM +0200, Martin Kletzander wrote: Initial scratch of the admin library. It has its own virAdmConnectPtr that inherits from virAbstractConnectPtr and thus trivially supports error reporting.

Re: [libvirt] [PATCH] qemu: add value range check of option granularity

2015-06-16 Thread Peter Krempa
On Tue, Jun 16, 2015 at 18:43:32 +0800, Shanzhi Yu wrote: The default value of the granularity is the image cluster size clamped between 4096 and 65536. Libvirt should add a check for this otherwise qemu will report error like below: $ virsh blockcopy r7 vda /var/lib/libvirt/images/r7.s1

Re: [libvirt] [PATCH 07/13] Add libvirt-admin library

2015-06-16 Thread Daniel P. Berrange
On Tue, Jun 16, 2015 at 01:16:56PM +0200, Martin Kletzander wrote: On Tue, Jun 16, 2015 at 11:42:52AM +0100, Daniel P. Berrange wrote: On Tue, Jun 16, 2015 at 11:58:24AM +0200, Martin Kletzander wrote: Initial scratch of the admin library. It has its own virAdmConnectPtr that inherits from

[libvirt] [PATCH sandbox 2/3] Explicitly check for supported URIs when starting guests

2015-06-16 Thread Daniel P. Berrange
While the sandbox API is designed to be hypervisor agnostic, the internal implementation needs work for each hypervisor target. To avoid user errors at runtime, do an upfront check to see if the URI they supply is suitable. Since we don't support remote executions, we do a straight string

[libvirt] [PATCH sandbox 3/3] Add LIBVIRT_SANDBOX_INIT_DEBUG env variable

2015-06-16 Thread Daniel P. Berrange
Allow debugging of the init process separately from debugging of libvirt sandbox infrastructure, by using the new env var LIBVIRT_SANDBOX_INIT_DEBUG=1. --- libvirt-sandbox/libvirt-sandbox-builder-container.c | 3 +-- libvirt-sandbox/libvirt-sandbox-builder-machine.c | 3 +-- 2 files changed, 2

[libvirt] [PATCH sandbox 0/3] Misc patches

2015-06-16 Thread Daniel P. Berrange
This is just a handful of patches for libvirt-sandbox. Traditionally I've just directly pushed code to libvirt-sandbox, but since we now have a few other people working on it, I'll start posting my patches for review first. Daniel P. Berrange (3): Support lzma and gzip compressed kernel modules

[libvirt] [PATCH sandbox 1/3] Support lzma and gzip compressed kernel modules

2015-06-16 Thread Daniel P. Berrange
Modern distros like Fedora have started to compress their kernel module files, so we can't simply read the file contents and load the module. We have to first do a decompression step, as the kernel won't do that itself. While Fedora uses lzma, upstream kernels are also capable of using gzip.

Re: [libvirt] [PATCH 07/13] Add libvirt-admin library

2015-06-16 Thread Martin Kletzander
On Tue, Jun 16, 2015 at 12:18:53PM +0100, Daniel P. Berrange wrote: On Tue, Jun 16, 2015 at 01:16:56PM +0200, Martin Kletzander wrote: On Tue, Jun 16, 2015 at 11:42:52AM +0100, Daniel P. Berrange wrote: On Tue, Jun 16, 2015 at 11:58:24AM +0200, Martin Kletzander wrote: Initial scratch of the

Re: [libvirt] [PATCH 07/13] Add libvirt-admin library

2015-06-16 Thread Daniel P. Berrange
On Tue, Jun 16, 2015 at 01:30:54PM +0200, Martin Kletzander wrote: On Tue, Jun 16, 2015 at 12:18:53PM +0100, Daniel P. Berrange wrote: On Tue, Jun 16, 2015 at 01:16:56PM +0200, Martin Kletzander wrote: On Tue, Jun 16, 2015 at 11:42:52AM +0100, Daniel P. Berrange wrote: On Tue, Jun 16, 2015 at

<    1   2