[libvirt] [PATCH v4 05/10] LXC: Creating devices for container on host side

2013-06-07 Thread Gao feng
user namespace doesn't allow to create devices in uninit userns. We should create devices on host side. We first mount tmpfs on dev directroy under state dir of container. then create devices under this dev dir. Finally in container, mount the dev directroy created on host to the /dev/ directroy

[libvirt] [PATCH v4 03/10] LXC: sort the uidmap/gidmap of domain

2013-06-07 Thread Gao feng
Make sure the mapping line contains the root user of container is the first element of idmap array. So we can get the real user id on host for the container easily. This patch also check the map information, User must map the root user of container to any user of host. Signed-off-by: Gao feng

[libvirt] [PATCH v4 00/10] Add user namespace support for libvirt lxc

2013-06-07 Thread 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

[libvirt] [PATCH v4 04/10] LXC: introduce virLXCControllerSetupUserns and lxcContainerSetID

2013-06-07 Thread Gao feng
This patch introduces new helper function virLXCControllerSetupUserns, in this function, we set the files uid_map and gid_map of the init task of container. lxcContainerSetID is used for creating cred for tasks running in container. Since after setuid/setgid, we may be a new user. This patch

[libvirt] [PATCH v4 06/10] LXC: controller: change the owner of tty devices to the root user of container

2013-06-07 Thread Gao feng
Since these tty devices will be used by container, the owner of them should be the root user of container. This patch also adds a new function virLXCControllerChown, we can use this general function to change the owner of files. Signed-off-by: Gao feng gaof...@cn.fujitsu.com ---

[libvirt] [PATCH v4 08/10] LXC: controller: change the owner of devices created on host

2013-06-07 Thread Gao feng
Since these devices are created for the container. the owner should be the root user of the container. Signed-off-by: Gao feng gaof...@cn.fujitsu.com --- src/lxc/lxc_controller.c | 4 1 file changed, 4 insertions(+) diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index

[libvirt] [PATCH v4 09/10] LXC: controller: change the owner of /dev/pts and ptmx to the root of container

2013-06-07 Thread Gao feng
These files are created for container, the owner should be the root user of container. Signed-off-by: Gao feng gaof...@cn.fujitsu.com --- src/lxc/lxc_controller.c | 4 1 file changed, 4 insertions(+) diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index dd85235..d12c4c2

[libvirt] [PATCH v4 07/10] LXC: controller: change the owner of /dev to the root user of container

2013-06-07 Thread Gao feng
container will create /dev/pts directory in /dev. the owner of /dev should be the root user of container. Signed-off-by: Gao feng gaof...@cn.fujitsu.com --- src/lxc/lxc_controller.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index

[libvirt] [PATCH v4 02/10] LXC: enable user namespace only when user set the uidmap

2013-06-07 Thread Gao feng
User namespace will be enabled only when the idmap exist in configuration. If you want disable user namespace,just remove these elements from XML. If kernel doesn't support user namespace and idmap exist in configuration file, libvirt lxc will start failed and return Kernel doesn't support user

[libvirt] [PATCH v4 10/10] LXC: fuse: Change files owner to the root user of container

2013-06-07 Thread Gao feng
The owner of the /proc/meminfo in container should be the root user of container. Signed-off-by: Gao feng gaof...@cn.fujitsu.com --- src/lxc/lxc_fuse.c | 4 1 file changed, 4 insertions(+) diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c index 32886cd..b98a0d9 100644 ---

[libvirt] [PATCH v4 01/10] LXC: Introduce New XML element for user namespace

2013-06-07 Thread Gao feng
This patch introduces new element idmap for user namespace. for example idmap uid start='0' target='1000' count='10'/ gid start='0' target='1000' count='10'/ /idmap this new element is used for setting proc files /proc/pid/{uid_map,gid_map}. This patch also supports multiple uid/gid

Re: [libvirt] [PATCH 2/3] qemu: Set cpuset.cpus for domain process

2013-06-07 Thread Martin Kletzander
On 05/24/2013 11:08 AM, Osier Yang wrote: When either cpuset of vcpu is specified, or the placement of vcpu is auto, only setting the cpuset.mems might cause the guest starting to fail. E.g. (placement of both vcpu and numatune is auto): After spending a lot of time with this, I'm still not

Re: [libvirt] [PATCH 3/3] qemu: Prohibit getting the numa parameters if mode is not strict

2013-06-07 Thread Martin Kletzander
On 05/24/2013 11:08 AM, Osier Yang wrote: I don't see any reason to getting the numa parameters if mode is not strict, as long as setNumaParameters doesn't allow to set nodeset if the mode is not strict, and cpuset.mems only understand strict mode. NACK, this makes sense for 'interleave' as

Re: [libvirt] [PATCH] spec: Drop Requires: vbox

2013-06-07 Thread Daniel P. Berrange
On Thu, Jun 06, 2013 at 01:55:17PM -0400, Cole Robinson wrote: Since this package isn't provided by any stock RH based distro. The upstream RPMs are called VirtualBox anyways. --- libvirt.spec.in | 1 - 1 file changed, 1 deletion(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index

Re: [libvirt] [PATCH 1/2] qemu: Resolve issue with virsh schedinfo for non running domain

2013-06-07 Thread Martin Kletzander
On 05/30/2013 02:24 PM, John Ferlan wrote: Since commit '632f78ca' the 'virsh schedinfo domain' command returns: Scheduler : Unknown error: Requested operation is not valid: cgroup CPU controller is not mounted Prior to that change a non running domain would return: Scheduler

Re: [libvirt] [PATCH 1/2] qemu: Resolve issue with virsh schedinfo for non running domain

2013-06-07 Thread Daniel P. Berrange
On Thu, May 30, 2013 at 08:24:59AM -0400, John Ferlan wrote: Since commit '632f78ca' the 'virsh schedinfo domain' command returns: Scheduler : Unknown error: Requested operation is not valid: cgroup CPU controller is not mounted Prior to that change a non running domain would return:

[libvirt] [PATCH v6 4/5] qemu: Implement 'oncrash' events when guest panicked

2013-06-07 Thread Chen Fan
Add monitor callback API domainGuestPanic, that implements 'destroy', 'restart' and 'preserve' events of the 'on_crash' in the XML when domain crashed. --- src/qemu/qemu_domain.h | 1 + src/qemu/qemu_driver.c | 92 src/qemu/qemu_monitor.c

[libvirt] [PATCH v6 1/5] libvirt: Define domain crash event types

2013-06-07 Thread Chen Fan
This patch introduces domain crashed types and crashed reasons which will be used while guest panicked. --- examples/domain-events/events-c/event-test.c | 10 ++ include/libvirt/libvirt.h.in | 16 src/conf/domain_conf.c | 12

[libvirt] [PATCH v6 0/5] libvirt supports Guest Panicked

2013-06-07 Thread 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

[libvirt] [PATCH v6 5/5] qemu: Implement 'oncrash' coredump events when guest panicked

2013-06-07 Thread Chen Fan
Add doDumpCoreToAutoPath to implement 'coredump-destroy' and 'coredump-restart' events of the 'on_crash' in the XML when domain crashed. --- src/qemu/qemu_driver.c | 65 ++ 1 file changed, 65 insertions(+) diff --git a/src/qemu/qemu_driver.c

[libvirt] [PATCH v6 3/5] qemu: Need to use qemuProcessShutdownOrReboot(), so we defined it at qemu_process.h

2013-06-07 Thread Chen Fan
--- src/qemu/qemu_process.c | 2 +- src/qemu/qemu_process.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 7a1535e..163bd96 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -611,7 +611,7 @@

[libvirt] [PATCH v6 2/5] qemu: Refactor the processwatchdogEvent code that can make the driver workpool more generalized

2013-06-07 Thread Chen Fan
--- src/qemu/qemu_domain.h | 10 ++-- src/qemu/qemu_driver.c | 65 +++-- src/qemu/qemu_process.c | 13 +- 3 files changed, 56 insertions(+), 32 deletions(-) diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index

[libvirt] [PATCH] udev: fix crash in libudev logging

2013-06-07 Thread Ján Tomko
VIR_ERROR_INT calls virLogMessage(..., const char *fmt, ...). Call virLogVMessage(..., const char *fmt, va_list list) instead, since libudev called us with a va_list object, not a list of arguments. https://bugzilla.redhat.com/show_bug.cgi?id=969152 --- Without the cast, I was getting:

Re: [libvirt] [PATCH v4 01/10] LXC: Introduce New XML element for user namespace

2013-06-07 Thread Daniel P. Berrange
On Fri, Jun 07, 2013 at 03:12:18PM +0800, Gao feng wrote: This patch introduces new element idmap for user namespace. for example idmap uid start='0' target='1000' count='10'/ gid start='0' target='1000' count='10'/ /idmap this new element is used for setting proc files

Re: [libvirt] [PATCH v4 02/10] LXC: enable user namespace only when user set the uidmap

2013-06-07 Thread Daniel P. Berrange
On Fri, Jun 07, 2013 at 03:12:19PM +0800, Gao feng wrote: User namespace will be enabled only when the idmap exist in configuration. If you want disable user namespace,just remove these elements from XML. If kernel doesn't support user namespace and idmap exist in configuration file,

Re: [libvirt] [PATCH v2 1/2] virsocket: Introduce virSocketAddrIsAny

2013-06-07 Thread Jiri Denemark
On Thu, Jun 06, 2013 at 18:11:39 +0200, Michal Privoznik wrote: This internal API checks, if passed address is ANYCAST address. --- src/libvirt_private.syms | 1 + src/util/virsocketaddr.c | 20 src/util/virsocketaddr.h | 1 + tests/sockettest.c | 38

Re: [libvirt] [PATCH v4 04/10] LXC: introduce virLXCControllerSetupUserns and lxcContainerSetID

2013-06-07 Thread Daniel P. Berrange
On Fri, Jun 07, 2013 at 03:12:21PM +0800, Gao feng wrote: This patch introduces new helper function virLXCControllerSetupUserns, in this function, we set the files uid_map and gid_map of the init task of container. lxcContainerSetID is used for creating cred for tasks running in container.

Re: [libvirt] [PATCH v4 03/10] LXC: sort the uidmap/gidmap of domain

2013-06-07 Thread Daniel P. Berrange
On Fri, Jun 07, 2013 at 03:12:20PM +0800, Gao feng wrote: Make sure the mapping line contains the root user of container is the first element of idmap array. So we can get the real user id on host for the container easily. This patch also check the map information, User must map the root

Re: [libvirt] [PATCH v4 05/10] LXC: Creating devices for container on host side

2013-06-07 Thread Daniel P. Berrange
On Fri, Jun 07, 2013 at 03:12:22PM +0800, Gao feng wrote: user namespace doesn't allow to create devices in uninit userns. We should create devices on host side. We first mount tmpfs on dev directroy under state dir of container. then create devices under this dev dir. Finally in

Re: [libvirt] [PATCH v4 06/10] LXC: controller: change the owner of tty devices to the root user of container

2013-06-07 Thread Daniel P. Berrange
On Fri, Jun 07, 2013 at 03:12:23PM +0800, Gao feng wrote: Since these tty devices will be used by container, the owner of them should be the root user of container. This patch also adds a new function virLXCControllerChown, we can use this general function to change the owner of files.

Re: [libvirt] [PATCH v4 08/10] LXC: controller: change the owner of devices created on host

2013-06-07 Thread Daniel P. Berrange
On Fri, Jun 07, 2013 at 03:12:25PM +0800, Gao feng wrote: Since these devices are created for the container. the owner should be the root user of the container. Signed-off-by: Gao feng gaof...@cn.fujitsu.com --- src/lxc/lxc_controller.c | 4 1 file changed, 4 insertions(+) diff

Re: [libvirt] [PATCH v4 07/10] LXC: controller: change the owner of /dev to the root user of container

2013-06-07 Thread Daniel P. Berrange
On Fri, Jun 07, 2013 at 03:12:24PM +0800, Gao feng wrote: container will create /dev/pts directory in /dev. the owner of /dev should be the root user of container. Signed-off-by: Gao feng gaof...@cn.fujitsu.com --- src/lxc/lxc_controller.c | 3 +++ 1 file changed, 3 insertions(+) diff

Re: [libvirt] [PATCH v4 09/10] LXC: controller: change the owner of /dev/pts and ptmx to the root of container

2013-06-07 Thread Daniel P. Berrange
On Fri, Jun 07, 2013 at 03:12:26PM +0800, Gao feng wrote: These files are created for container, the owner should be the root user of container. Signed-off-by: Gao feng gaof...@cn.fujitsu.com --- src/lxc/lxc_controller.c | 4 1 file changed, 4 insertions(+) diff --git

Re: [libvirt] [PATCH v4 10/10] LXC: fuse: Change files owner to the root user of container

2013-06-07 Thread Daniel P. Berrange
On Fri, Jun 07, 2013 at 03:12:27PM +0800, Gao feng wrote: The owner of the /proc/meminfo in container should be the root user of container. Signed-off-by: Gao feng gaof...@cn.fujitsu.com --- src/lxc/lxc_fuse.c | 4 1 file changed, 4 insertions(+) diff --git a/src/lxc/lxc_fuse.c

Re: [libvirt] [PATCH v2 1/2] virsocket: Introduce virSocketAddrIsAny

2013-06-07 Thread Daniel P. Berrange
On Fri, Jun 07, 2013 at 01:42:10PM +0200, Jiri Denemark wrote: On Thu, Jun 06, 2013 at 18:11:39 +0200, Michal Privoznik wrote: This internal API checks, if passed address is ANYCAST address. --- src/libvirt_private.syms | 1 + src/util/virsocketaddr.c | 20

Re: [libvirt] [PATCH v2] iscsi: pass hostnames to iscsiadm instead of resolving them

2013-06-07 Thread Daniel P. Berrange
On Thu, Jun 06, 2013 at 05:08:12PM +0200, Ján Tomko wrote: iscsiadm now supports specifying hostnames in the portal argument [1] Instead of resolving the hostname to a single IPv4 address, pass the hostname to isciadm, allowing IPv6 targets to work. Resolves:

Re: [libvirt] [PATCH v2 2/2] qemuDomainMigrateGraphicsRelocate: Use then new virSocketAddrIsWildcard

2013-06-07 Thread Daniel P. Berrange
On Thu, Jun 06, 2013 at 06:11:40PM +0200, Michal Privoznik wrote: Since we have the new internal API to check for wildcard address, we can use it instead of parsing and formatting. --- src/qemu/qemu_migration.c | 18 ++ 1 file changed, 2 insertions(+), 16 deletions(-) diff

Re: [libvirt] [PATCH v2 1/2] virsocket: Introduce virSocketAddrIsAny

2013-06-07 Thread Daniel P. Berrange
On Thu, Jun 06, 2013 at 06:11:39PM +0200, Michal Privoznik wrote: This internal API checks, if passed address is ANYCAST address. --- src/libvirt_private.syms | 1 + src/util/virsocketaddr.c | 20 src/util/virsocketaddr.h | 1 + tests/sockettest.c | 38

Re: [libvirt] [PATCH v2 0/2]impl separite module for hostdev passthrough

2013-06-07 Thread Daniel P. Berrange
On Thu, Jun 06, 2013 at 06:00:13PM -0400, Chunyan Liu wrote: This patch series include two patches: 1/2 is the implementation of the hostdev passthrough common library. To meet two purposes: a. move qemu hostdev APIs to common library so that it could be used by all hypervisor drivers. b.

Re: [libvirt] [PATCH 1/2] qemu: Resolve issue with virsh schedinfo for non running domain

2013-06-07 Thread Martin Kletzander
On 06/07/2013 12:19 PM, Daniel P. Berrange wrote: On Thu, May 30, 2013 at 08:24:59AM -0400, John Ferlan wrote: Since commit '632f78ca' the 'virsh schedinfo domain' command returns: Scheduler : Unknown error: Requested operation is not valid: cgroup CPU controller is not mounted Prior

Re: [libvirt] [PATCH 1/2] qemu: Resolve issue with virsh schedinfo for non running domain

2013-06-07 Thread Daniel P. Berrange
On Fri, Jun 07, 2013 at 01:55:36PM +0200, Martin Kletzander wrote: On 06/07/2013 12:19 PM, Daniel P. Berrange wrote: On Thu, May 30, 2013 at 08:24:59AM -0400, John Ferlan wrote: Since commit '632f78ca' the 'virsh schedinfo domain' command returns: Scheduler : Unknown error:

[libvirt] [PATCH] qemu: Fix memory leak in Prepare phase

2013-06-07 Thread Jiri Denemark
Avoid leaking virDomainDef if Prepare phase fails before it gets to qemuMigrationPrepareAny. --- src/qemu/qemu_driver.c| 12 src/qemu/qemu_migration.c | 29 ++--- src/qemu/qemu_migration.h | 4 ++-- 3 files changed, 20 insertions(+), 25 deletions(-) diff

Re: [libvirt] [PATCHv2 01/14] virsh-domain-monitor: Remove ATTRIBUTE_UNUSED from a argument

2013-06-07 Thread Daniel P. Berrange
On Wed, Jun 05, 2013 at 03:43:52PM +0200, Peter Krempa wrote: The cmd argument in cmdList is now used. Unmark it as unused. --- tools/virsh-domain-monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index

Re: [libvirt] [PATCHv2 02/14] qemu: Use bool instead of int in qemuMonitorSetCPU APIs

2013-06-07 Thread Daniel P. Berrange
On Wed, Jun 05, 2013 at 03:43:53PM +0200, Peter Krempa wrote: The 'online' parameter has only two possible values. Use a bool for it. --- src/qemu/qemu_driver.c | 4 ++-- src/qemu/qemu_monitor.c | 2 +- src/qemu/qemu_monitor.h | 2 +- src/qemu/qemu_monitor_json.c | 2 +-

Re: [libvirt] [PATCHv2 03/14] qemu: Extract more information about vCPUs and threads

2013-06-07 Thread Daniel P. Berrange
On Wed, Jun 05, 2013 at 03:43:54PM +0200, Peter Krempa wrote: The qemu monitor provides more information about vCPUs of a guest than we needed currently. This patch upgrades the extraction function to easily extract new data about the vCPUs and fixes code to cope with the new structure. The

Re: [libvirt] [PATCHv2 04/14] qemu_agent: Introduce helpers for agent based CPU hot(un)plug

2013-06-07 Thread Daniel P. Berrange
On Wed, Jun 05, 2013 at 03:43:55PM +0200, Peter Krempa wrote: The qemu guest agent allows to online and offline CPUs from the perspective of the guest. This patch adds helpers that call 'guest-get-vcpus' and 'guest-set-vcpus' guest agent functions and convert the data for internal libvirt

Re: [libvirt] [PATCHv2 05/14] API: Introduce VIR_DOMAIN_VCPU_AGENT, for agent based CPU hot(un)plug

2013-06-07 Thread Daniel P. Berrange
On Wed, Jun 05, 2013 at 03:43:56PM +0200, Peter Krempa wrote: This flag will allow to use qemu guest agent commands to disable (offline) and enable (online) processors in a live guest that has the guest agent running. --- include/libvirt/libvirt.h.in | 1 + src/libvirt.c|

Re: [libvirt] [PATCHv2 06/14] qemu: Implement request of vCPU state using the guest agent

2013-06-07 Thread Daniel P. Berrange
On Wed, Jun 05, 2013 at 03:43:57PM +0200, Peter Krempa wrote: This patch implements the VIR_DOMAIN_VCPU_AGENT flag for the qemuDomainGetVcpusFlags() libvirt API implementation. --- src/qemu/qemu_driver.c | 60 ++ 1 file changed, 56

Re: [libvirt] [PATCHv2 06/14] qemu: Implement request of vCPU state using the guest agent

2013-06-07 Thread Daniel P. Berrange
On Wed, Jun 05, 2013 at 03:43:57PM +0200, Peter Krempa wrote: This patch implements the VIR_DOMAIN_VCPU_AGENT flag for the qemuDomainGetVcpusFlags() libvirt API implementation. --- src/qemu/qemu_driver.c | 60 ++ 1 file changed, 56

Re: [libvirt] [PATCHv2 07/14] qemu: Implement support for VIR_DOMAIN_VCPU in qemuDomainSetVcpusFlags

2013-06-07 Thread Daniel P. Berrange
On Wed, Jun 05, 2013 at 03:43:58PM +0200, Peter Krempa wrote: This patch adds support for agent-based cpu disabling and enabling to qemuDomainSetVcpusFlags() API. --- src/qemu/qemu_driver.c | 129 - 1 file changed, 116 insertions(+), 13

Re: [libvirt] [PATCH v2] iscsi: pass hostnames to iscsiadm instead of resolving them

2013-06-07 Thread Ján Tomko
On 06/07/2013 01:49 PM, Daniel P. Berrange wrote: On Thu, Jun 06, 2013 at 05:08:12PM +0200, Ján Tomko wrote: iscsiadm now supports specifying hostnames in the portal argument [1] Instead of resolving the hostname to a single IPv4 address, pass the hostname to isciadm, allowing IPv6 targets to

Re: [libvirt] [PATCH RESEND 0/5] VirtualBox version 4.2 support for libvirt vbox driver

2013-06-07 Thread Daniel P. Berrange
On Mon, Jun 03, 2013 at 11:19:15AM +0100, Daniel P. Berrange wrote: On Wed, May 22, 2013 at 10:00:12AM +0200, Manuel VIVES wrote: Hello, I'm re-sending this patch for reviewing. If necessary I'm willing to make some changes to those patches. I'm currently working on a better

[libvirt] [PATCH] Prefer VIR_STRDUP over virAsprintf(dst, %s, str)

2013-06-07 Thread Michal Privoznik
There's no sense in using virAsprintf() just to duplicate a string. We should use VIR_STRDUP which is designed just for that. --- daemon/libvirtd-config.c | 2 +- src/conf/domain_audit.c | 2 +- src/libxl/libxl_driver.c | 30

Re: [libvirt] [PATCHv2 11/14] qemu: Implement new QMP command for cpu hotplug

2013-06-07 Thread Michal Privoznik
On 05.06.2013 15:44, Peter Krempa wrote: This patch implements support for the cpu-add QMP command that plugs CPUs into a live guest. The cpu-add command was introduced in QEMU 1.5. For the hotplug to work machine type pc-i440fx-1.5 is required. --- src/qemu/qemu_monitor_json.c | 37

Re: [libvirt] [PATCHv2 11/14] qemu: Implement new QMP command for cpu hotplug

2013-06-07 Thread Peter Krempa
On 06/07/13 16:15, Michal Privoznik wrote: On 05.06.2013 15:44, Peter Krempa wrote: This patch implements support for the cpu-add QMP command that plugs CPUs into a live guest. The cpu-add command was introduced in QEMU 1.5. For the hotplug to work machine type pc-i440fx-1.5 is required. ---

Re: [libvirt] [PATCHv2 02/14] qemu: Use bool instead of int in qemuMonitorSetCPU APIs

2013-06-07 Thread Peter Krempa
On 06/07/13 15:02, Daniel P. Berrange wrote: On Wed, Jun 05, 2013 at 03:43:53PM +0200, Peter Krempa wrote: The 'online' parameter has only two possible values. Use a bool for it. --- src/qemu/qemu_driver.c | 4 ++-- src/qemu/qemu_monitor.c | 2 +- src/qemu/qemu_monitor.h | 2

Re: [libvirt] [PATCHv2 01/14] virsh-domain-monitor: Remove ATTRIBUTE_UNUSED from a argument

2013-06-07 Thread Peter Krempa
On 06/07/13 15:01, Daniel P. Berrange wrote: On Wed, Jun 05, 2013 at 03:43:52PM +0200, Peter Krempa wrote: The cmd argument in cmdList is now used. Unmark it as unused. --- tools/virsh-domain-monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ACK, trivial Pushed; Thanks.

Re: [libvirt] [PATCHv2 03/14] qemu: Extract more information about vCPUs and threads

2013-06-07 Thread Peter Krempa
On 06/07/13 15:06, Daniel P. Berrange wrote: On Wed, Jun 05, 2013 at 03:43:54PM +0200, Peter Krempa wrote: The qemu monitor provides more information about vCPUs of a guest than we needed currently. This patch upgrades the extraction function to easily extract new data about the vCPUs and fixes

Re: [libvirt] [PATCHv2 04/14] qemu_agent: Introduce helpers for agent based CPU hot(un)plug

2013-06-07 Thread Peter Krempa
On 06/07/13 15:10, Daniel P. Berrange wrote: On Wed, Jun 05, 2013 at 03:43:55PM +0200, Peter Krempa wrote: The qemu guest agent allows to online and offline CPUs from the perspective of the guest. This patch adds helpers that call 'guest-get-vcpus' and 'guest-set-vcpus' guest agent functions

[libvirt] [PATCH] qemuDomainGetVcpusFlags: Initialize ncpuinfo

2013-06-07 Thread Michal Privoznik
Currently, there's a path to use the ncpuinfo variable uninitialized, which leads to a compiler warning: qemu/qemu_driver.c: In function 'qemuDomainGetVcpusFlags': qemu/qemu_driver.c:4573:9: error: 'ncpuinfo' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Re: [libvirt] [PATCHv2 06/14] qemu: Implement request of vCPU state using the guest agent

2013-06-07 Thread Daniel P. Berrange
On Wed, Jun 05, 2013 at 03:43:57PM +0200, Peter Krempa wrote: This patch implements the VIR_DOMAIN_VCPU_AGENT flag for the qemuDomainGetVcpusFlags() libvirt API implementation. --- src/qemu/qemu_driver.c | 60 ++ 1 file changed, 56

Re: [libvirt] [PATCH 1/2] qemu: Resolve issue with virsh schedinfo for non running domain

2013-06-07 Thread John Ferlan
On 06/07/2013 06:14 AM, Martin Kletzander wrote: On 05/30/2013 02:24 PM, John Ferlan wrote: Since commit '632f78ca' the 'virsh schedinfo domain' command returns: Scheduler : Unknown error: Requested operation is not valid: cgroup CPU controller is not mounted Prior to that change a non

[libvirt] [PATCH] Fix commit 29c1e913e459058c12d02b3f4b767b3dd428a498

2013-06-07 Thread Peter Krempa
This patch fixes changes done in commit 29c1e913e459058c12d02b3f4b767b3 that was pushed without implementing review feedback. The flag introduced by the patch is changed to VIR_DOMAIN_VCPU_GUEST and documentation makes the difference between regular hotplug and this new functionality more

Re: [libvirt] [PATCH] Fix commit 29c1e913e459058c12d02b3f4b767b3dd428a498

2013-06-07 Thread Michal Privoznik
On 07.06.2013 17:18, Peter Krempa wrote: This patch fixes changes done in commit 29c1e913e459058c12d02b3f4b767b3 that was pushed without implementing review feedback. The flag introduced by the patch is changed to VIR_DOMAIN_VCPU_GUEST and documentation makes the difference between regular

Re: [libvirt] [PATCH] Prefer VIR_STRDUP over virAsprintf(dst, %s, str)

2013-06-07 Thread Ján Tomko
On 06/07/2013 04:06 PM, Michal Privoznik wrote: There's no sense in using virAsprintf() just to duplicate a string. We should use VIR_STRDUP which is designed just for that. --- daemon/libvirtd-config.c | 2 +- src/conf/domain_audit.c | 2 +-

Re: [libvirt] How does virsh lxc-enter-namespace work? Does it?

2013-06-07 Thread Daniel P. Berrange
On Thu, Jun 06, 2013 at 09:13:27AM +0100, Daniel P. Berrange wrote: On Thu, Jun 06, 2013 at 10:07:26AM +0200, Richard Weinberger wrote: I'm sure in my case setns() fails because the calling thread did not open() the ns files itself. Do you have user namespaces enabled by chance ?

Re: [libvirt] [libvirt-designer PATCHv4 0/9] Handle more devices in GVirDesignerDomain

2013-06-07 Thread Christophe Fergeau
On Thu, Jun 06, 2013 at 09:07:22AM +0200, Michal Privoznik wrote: You've addressed all my concerns. ACK series. Thanks, pushed. Christophe pgpnVIWpV9UJ9.pgp Description: PGP signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 04/11] util: Add util to find PCI device address by its vendor and product IDs

2013-06-07 Thread Osier Yang
As the first user of virTraverseDirectory, it falls through to the 2 depth from /sys/devices, and returns the address of the PCI device of which both vendor and device have the specified value. See the test for an example. --- src/libvirt_private.syms | 1 +

[libvirt] [PATCH 08/11] util: Add util to pad string

2013-06-07 Thread Osier Yang
The string can be padded either on the left (@from_right=false) or right (@from_right=true). --- src/libvirt_private.syms | 1 + src/util/virstring.c | 38 ++ src/util/virstring.h | 6 ++ tests/utiltest.c | 28

[libvirt] [PATCH 11/11] storage_scsi: Allow the omitted 'unique_id'

2013-06-07 Thread Osier Yang
--- src/storage/storage_backend_scsi.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backend_scsi.c index 5635f73..da6a5dd 100644 --- a/src/storage/storage_backend_scsi.c +++

[libvirt] [PATCH 00/11] storage_scsi: Stable SCSI host addressing support

2013-06-07 Thread Osier Yang
The SCSI host number is not stable on Linux platform, the number can be changed after a system rebooting or scsi kernel modules reloaded. To have a stable address for the scsi_host adapter of scsi pool, this introduces new XMLs like: adapter type='scsi_host' parent='pci__00_1f_2'

[libvirt] [PATCH 09/11] storage_scsi: Allow the direct PCI address for 'parent'

2013-06-07 Thread Osier Yang
To be more flexible, except allowing to specify 'parent' with name produced by node device udev/HAL backends, this supports to specify 'parent' with PCI address directly (e.g. :00:1f:2). The specified address will be padded if it's not consistent with what sysfs exposed. (e.g 0:0:2:2 will be

[libvirt] [PATCH 01/11] storage: Add a struct for scsi_host type adapter

2013-06-07 Thread Osier Yang
Later patch will add new XML attributes for scsi_host adapter, this is the preparation patch. --- src/conf/storage_conf.c| 15 --- src/conf/storage_conf.h| 4 +++- src/phyp/phyp_driver.c | 8 src/storage/storage_backend_scsi.c | 2 +- 4

[libvirt] [PATCH 10/11] util: Add a util to guess the scsi host name with specified parent

2013-06-07 Thread Osier Yang
Not really guessing, it returns host name of the scsi host which has smallest unique_id. --- src/libvirt_private.syms | 1 + src/util/virutil.c | 122 +++ src/util/virutil.h | 4 ++ tests/utiltest.c | 27 +++ 4 files

[libvirt] [PATCH 02/11] storage: Introduce new XMLs for stable SCSI host addressing

2013-06-07 Thread Osier Yang
The SCSI host number is not stable on Linux platform, the number can be changed after a system rebooting or scsi kernel modules reloaded. To have a stable address for the scsi_host adapter of scsi pool, this introduces new XMLs like: adapter type='scsi_host' parent='pci__00_1f_2'

[libvirt] [PATCH 07/11] storage_scsi: Translate the stable address into scsi host number

2013-06-07 Thread Osier Yang
This takes use of the two utils introduced in previous patches. Node device HAL backend represents PCI device like PCI_8086_2922, (I.E PCI_$vendor_$product), to get the PCI address, we have to traverse /sys/devices/ to find it out. And to get the current scsi host number assigned by the system

[libvirt] [PATCH 03/11] util: Add a util to traverse directory tree

2013-06-07 Thread Osier Yang
There is POSIX calls to walk through direcotry tree, nftw(3), but there is no way to allow one to pass user data to the callback: int nftw(const char *dirpath, int (*fn) (const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf), int

[libvirt] [PATCH 06/11] storage_scsi: Don't ignore the return value of VIR_STRDUP

2013-06-07 Thread Osier Yang
--- src/storage/storage_backend_scsi.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backend_scsi.c index 0a79e6c..13c498d 100644 --- a/src/storage/storage_backend_scsi.c +++

[libvirt] [PATCH 05/11] util: Add util to parse the stable scsi host address

2013-06-07 Thread Osier Yang
By traversing sysfs directory like /sys/bus/pci/devices/:00:1f:2/ to find out the scsi host whose unique_id has the specified value. And returns the host number. Address like :00:1f:2 will be retrieved from the parent of scsi_host adapter. E.g. adapter type='scsi_host'

Re: [libvirt] [PATCH 09/11] storage_scsi: Allow the direct PCI address for 'parent'

2013-06-07 Thread Osier Yang
On 08/06/13 01:03, Osier Yang wrote: To be more flexible, except allowing to specify 'parent' with name produced by node device udev/HAL backends, this supports to specify 'parent' with PCI address directly (e.g. :00:1f:2). The specified address will be padded if it's not consistent with

Re: [libvirt] How does virsh lxc-enter-namespace work? Does it?

2013-06-07 Thread Richard Weinberger
Am 07.06.2013 17:34, schrieb Daniel P. Berrange: On Thu, Jun 06, 2013 at 09:13:27AM +0100, Daniel P. Berrange wrote: On Thu, Jun 06, 2013 at 10:07:26AM +0200, Richard Weinberger wrote: I'm sure in my case setns() fails because the calling thread did not open() the ns files itself. Do you