Re: [libvirt] [PATCH] vbox: fix VIR_STRDUP value check

2013-05-22 Thread Ján Tomko
On 05/20/2013 05:08 PM, Michal Privoznik wrote: On 20.05.2013 11:59, Ján Tomko wrote: In my review of 31532ca I missed the fact that VIR_STRDUP now returns 1 on success, and 0 if the source was NULL. (This still doesn't add proper OOM error handling.) --- src/vbox/vbox_tmpl.c | 12

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

2013-05-22 Thread Manuel VIVES
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 management for snapshots with virtualbox, and my work is based on Virtualbox 4.2 so that's why I'm re sending this patch. Regards, Manuel VIVES

[libvirt] [PATCH RESEND 5/5] vbox template support for VirtualBox v4.2

2013-05-22 Thread Manuel VIVES
From: ryan woodsmall rwoodsm...@gmail.com --- src/vbox/vbox_tmpl.c | 90 -- 1 file changed, 80 insertions(+), 10 deletions(-) diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index d37888c..5bef956 100644 --- a/src/vbox/vbox_tmpl.c +++

[libvirt] [PATCH RESEND 4/5] vbox driver support for VirtualBox v4.2

2013-05-22 Thread Manuel VIVES
From: ryan woodsmall rwoodsm...@gmail.com --- src/vbox/vbox_driver.c |8 1 file changed, 8 insertions(+) diff --git a/src/vbox/vbox_driver.c b/src/vbox/vbox_driver.c index a68f33d..9d07574 100644 --- a/src/vbox/vbox_driver.c +++ b/src/vbox/vbox_driver.c @@ -61,6 +61,9 @@ extern

[libvirt] [PATCH RESEND 2/5] vbox version-specific C file for VirtualBox v4.2

2013-05-22 Thread Manuel VIVES
From: ryan woodsmall rwoodsm...@gmail.com --- src/vbox/vbox_V4_2.c | 13 + 1 file changed, 13 insertions(+) create mode 100644 src/vbox/vbox_V4_2.c diff --git a/src/vbox/vbox_V4_2.c b/src/vbox/vbox_V4_2.c new file mode 100644 index 000..8c5b61c --- /dev/null +++

[libvirt] [PATCH RESEND 3/5] Makefile.am additions for VirtualBox v4.2

2013-05-22 Thread Manuel VIVES
From: ryan woodsmall rwoodsm...@gmail.com --- src/Makefile.am |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 430a356..467ec5d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -593,7 +593,8 @@ VBOX_DRIVER_SOURCES =

[libvirt] [test-API][PATCH] Add env check function for memory_params_live

2013-05-22 Thread Wayne Sun
In this case, domain memory cgroup path is hardcoded and fail the case after cgroup path changed recently. To avoid such failure, add check function for lscgroup command before run this case, if check fail then skip this case. Signed-off-by: Wayne Sun g...@redhat.com ---

Re: [libvirt] [PATCH 0/3 v4] add 'sharePolicy' attribute for qemu vnc sharing policy

2013-05-22 Thread Guannan Ren
On 05/22/2013 01:50 PM, Ján Tomko wrote: On 05/21/2013 04:31 PM, Guannan Ren wrote: v3-v4 add missing .args, .xml files (I raw it in git Untracked files this morning and thought about it for a while, then git-cleaned them...) rebase work. v2-v3 rebase work. v1-v2: changed

[libvirt] [PATCH] conf: fix use after free in virChrdevOpen

2013-05-22 Thread Ján Tomko
Don't free the stream on error if we've successfully added it to the hash table, since it will be freed by virChrdevHashEntryFree callback. Preserve the error message before calling virStreamFree, since it resets the error. Reported by Sergey Fionov on libvir-list. --- src/conf/virchrdev.c | 15

[libvirt] [PATCH 03/12] storage_conf: Remove the useless casting

2013-05-22 Thread Osier Yang
--- src/conf/storage_conf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 073099b..6f89f1c 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -672,7 +672,7 @@

[libvirt] [PATCH 01/12] storage_conf: Fix the wrong error message

2013-05-22 Thread Osier Yang
It's for parsing login attribute of auth. --- src/conf/storage_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 6cb98bf..bd8eef0 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -447,7 +447,7 @@

[libvirt] [PATCH 02/12] storage_conf: Don't leak uuid in virStoragePoolDefParseAuthCephx

2013-05-22 Thread Osier Yang
Any string returned from virXPathString should be freed. --- src/conf/storage_conf.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index bd8eef0..073099b 100644 --- a/src/conf/storage_conf.c +++

[libvirt] [PATCH 04/12] storage_conf: Use xmlStrEqual instead of STREQ

2013-05-22 Thread Osier Yang
And improve the error message --- src/conf/storage_conf.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 6f89f1c..5c8577e 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -975,9 +975,11

[libvirt] [PATCH 07/12] storage_conf: Improve the memory deallocation of pool def parsing

2013-05-22 Thread Osier Yang
Changes: * Free all the strings at cleanup, instead of freeing them in the middle * Remove xmlFree * s/tmppath/target_path/, to make it more sensible * Add new goto label error --- src/conf/storage_conf.c | 54 - 1 file

[libvirt] [PATCH 08/12] storage_conf: Improve the memory deallocation of virStorageVolDefParseXML

2013-05-22 Thread Osier Yang
Changes: * Add a new goto label error * Free the strings at cleanup * Remove the unnecessary frees --- src/conf/storage_conf.c | 29 ++--- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index

[libvirt] [PATCH 05/12] storage_conf: Put %s at the same line with error type

2013-05-22 Thread Osier Yang
Trivial, but it allows the error message to have more spaces. --- src/conf/storage_conf.c | 95 - 1 file changed, 47 insertions(+), 48 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 5c8577e..76dae52 100644 ---

[libvirt] [PATCH 10/12] storage_conf: Use VIR_STRDUP instead of strdup

2013-05-22 Thread Osier Yang
--- src/conf/storage_conf.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 1f376ef..44ecb2a 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -888,11 +888,8 @@

[libvirt] [PATCH 12/12] storage_conf: Use uid_t/gid_t instead of int to cast the value

2013-05-22 Thread Osier Yang
And error out if the casted value is not same with the original one, which prevents the bug on platform(s) where uid_t/gid_t has different size with long. --- src/conf/storage_conf.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/conf/storage_conf.c

[libvirt] [PATCH 06/12] storage_conf: Fix the error type

2013-05-22 Thread Osier Yang
s/VIR_ERR_INTERNAL_ERROR/VIR_ERR_XML_ERROR/. --- src/conf/storage_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 76dae52..efe02e8 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -829,7 +829,7

[libvirt] [PATCH 00/12 v2] storage_conf: left cleanup/fixes/improvement patches

2013-05-22 Thread Osier Yang
Part of v1 are pushed, the left patches are splitted Osier Yang (12): storage_conf: Fix the wrong error message storage_conf: Don't leak uuid in virStoragePoolDefParseAuthCephx storage_conf: Remove the useless casting storage_conf: Use xmlStrEqual instead of STREQ storage_conf: Put %s

[libvirt] [PATCH 09/12] storage_conf: Use NULLSTR instead

2013-05-22 Thread Osier Yang
--- src/conf/storage_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 4c08cea..1f376ef 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -1485,7 +1485,7 @@

[libvirt] [PATCH 11/12] storage_conf: Improve error messages

2013-05-22 Thread Osier Yang
virStoragePoolDefParseSource: * Better error message virStoragePoolObjLoad: * Break the line line --- src/conf/storage_conf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 44ecb2a..a62629e 100644 ---

Re: [libvirt] [PATCH 12/12] storage_conf: Use uid_t/gid_t instead of int to cast the value

2013-05-22 Thread Osier Yang
On 22/05/13 20:05, Osier Yang wrote: And error out if the casted value is not same with the original one, which prevents the bug on platform(s) where uid_t/gid_t has different size with long. --- src/conf/storage_conf.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff

Re: [libvirt] [virt-tools-list] Q on virsh attach-disk , why no network disk ?

2013-05-22 Thread Cole Robinson
On 05/22/2013 08:55 AM, Deepak C Shetty wrote: Hi All, I was looking at virsh attach-disk and i see the below [snip] DESCRIPTION Attach new disk device. OPTIONS [--domain] string domain name, id or uuid [--source] string source of disk device [--target]

Re: [libvirt] [PATCH RESENT 01/12] libxl: allow script for any network interface, not only bridge

2013-05-22 Thread Jim Fehlig
Jim Fehlig wrote: Jim Fehlig wrote: Laine Stump wrote: On 04/10/2013 05:10 AM, Daniel P. Berrange wrote: On Wed, Apr 10, 2013 at 04:44:43AM +0200, Marek Marczykowski wrote: This can be useful for route or NAT networks, or any other

Re: [libvirt] [Qemu-devel] [PATCH] qapi-schema.json: Reformat TargetType enum to one-per-line

2013-05-22 Thread Anthony Liguori
Peter Maydell peter.mayd...@linaro.org writes: On 22 May 2013 14:15, Anthony Liguori aligu...@us.ibm.com wrote: Paolo Bonzini pbonz...@redhat.com writes: You don't need to know what targets were supported in the version that you compiled from. Only one target is supported in this executable

Re: [libvirt] [PATCH RESENT 02/12] libxl: PCI passthrough support

2013-05-22 Thread Jim Fehlig
Jim Fehlig wrote: Daniel P. Berrange wrote: On Wed, Apr 10, 2013 at 04:44:43AM +0200, Marek Marczykowski wrote: --- src/libxl/libxl_conf.c | 72 ++ src/libxl/libxl_conf.h | 2 ++ 2 files changed, 74 insertions(+)

Re: [libvirt] [PATCH RESENT 03/12] libxl: nodeDevice* support for PCI devices

2013-05-22 Thread Jim Fehlig
Marek Marczykowski wrote: For now only for PCI devices. Mostly copy-paste from old xen driver. This one is (or will be) covered by Chanyan's work as well right? Regards, Jim --- src/libxl/libxl_driver.c | 193 +++ 1 file changed, 193

Re: [libvirt] [Qemu-devel] [PATCH] qapi-schema.json: Reformat TargetType enum to one-per-line

2013-05-22 Thread Paolo Bonzini
Il 22/05/2013 16:29, Anthony Liguori ha scritto: Peter Maydell peter.mayd...@linaro.org writes: On 22 May 2013 14:15, Anthony Liguori aligu...@us.ibm.com wrote: Paolo Bonzini pbonz...@redhat.com writes: You don't need to know what targets were supported in the version that you compiled

Re: [libvirt] [PATCH] conf: fix use after free in virChrdevOpen

2013-05-22 Thread Eric Blake
On 05/22/2013 05:37 AM, Ján Tomko wrote: Don't free the stream on error if we've successfully added it to the hash table, since it will be freed by virChrdevHashEntryFree callback. Preserve the error message before calling virStreamFree, since it resets the error. Reported by Sergey

Re: [libvirt] [Xen-devel] [PATCH RESENT 04/12] libxl: populate xenstore memory entries at startup

2013-05-22 Thread Jim Fehlig
Marek Marczykowski wrote: On 19.04.2013 13:10, Stefano Stabellini wrote: On Thu, 11 Apr 2013, Marek Marczykowski wrote: On 11.04.2013 09:52, Ian Campbell wrote: On Thu, 2013-04-11 at 05:09 +0100, Jim Fehlig wrote: +/* This will fill xenstore info about free and

Re: [libvirt] [PATCH RESENT 07/12] conf: support backend domain name in disk and network devices

2013-05-22 Thread Jim Fehlig
Marek Marczykowski wrote: At least Xen supports backend drivers in another domain (aka driver domain). This patch introduces XML config option for such setting as 'domain' element with 'name' attribute. Verification its content is left for the driver. In the future some option will be needed

Re: [libvirt] [Qemu-devel] [qemu-devel] Default machine type setting for ppc64

2013-05-22 Thread Li Zhang
On 2013年05月22日 04:01, Anthony Liguori wrote: Daniel P. Berrange berra...@redhat.com writes: On Tue, May 21, 2013 at 11:12:26AM -0600, Eric Blake wrote: I have also argued in the past that it would be useful for libvirt to support the idea of a template, where you can specify a domain XML that

Re: [libvirt] [PATCHv4 3/4] qemu: Adapt qemuBuildInterfaceCommandLine to to multiqueue net

2013-05-22 Thread Michal Privoznik
On 21.05.2013 18:37, Laine Stump wrote: On 05/21/2013 10:18 AM, Michal Privoznik wrote: In order to learn libvirt multiqueue several things must be done: 1) The '/dev/net/tun' device needs to be opened multiple times with IFF_MULTI_QUEUE flag passed to ioctl(fd, TUNSETIFF, ifr); 2) Similar,

[libvirt] [PATCH] virNetDevTapCreate: Fail on systems not supporting IFF_MULTI_QUEUE

2013-05-22 Thread Michal Privoznik
In my previous patches I enabled the IFF_MULTI_QUEUE flag every time the user requested multiqueue TAP device. However, this works only at runtime. During build time the flag may be undeclared. --- src/util/virnetdevtap.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git

Re: [libvirt] [PATCH 1/2] util: add virGetGroupList

2013-05-22 Thread Laine Stump
On 05/21/2013 11:24 PM, Eric Blake wrote: Since neither getpwuid_r() nor initgroups() are safe to call in between fork and exec (they obtain a mutex, but if some other thread in the parent also held the mutex at the time of the fork, the child will deadlock), we have to split out the

Re: [libvirt] [PATCH] virNetDevTapCreate: Fail on systems not supporting IFF_MULTI_QUEUE

2013-05-22 Thread Eric Blake
On 05/22/2013 10:37 AM, Michal Privoznik wrote: In my previous patches I enabled the IFF_MULTI_QUEUE flag every time the user requested multiqueue TAP device. However, this works only at runtime. During build time the flag may be undeclared. --- src/util/virnetdevtap.c | 9 - 1

Re: [libvirt] [PATCH] virNetDevTapCreate: Fail on systems not supporting IFF_MULTI_QUEUE

2013-05-22 Thread Michal Privoznik
On 22.05.2013 18:50, Eric Blake wrote: On 05/22/2013 10:37 AM, Michal Privoznik wrote: In my previous patches I enabled the IFF_MULTI_QUEUE flag every time the user requested multiqueue TAP device. However, this works only at runtime. During build time the flag may be undeclared. ---

Re: [libvirt] [PATCH 1/2] util: add virGetGroupList

2013-05-22 Thread Eric Blake
On 05/22/2013 10:49 AM, Laine Stump wrote: On 05/21/2013 11:24 PM, Eric Blake wrote: Since neither getpwuid_r() nor initgroups() are safe to call in between fork and exec (they obtain a mutex, but if some other thread in the parent also held the mutex at the time of the fork, the child will

Re: [libvirt] [PATCH v4 03/13] Change virConnectDomainEventGraphicsCallback signature

2013-05-22 Thread Michal Privoznik
On 21.05.2013 01:20, Eric Blake wrote: On 05/20/2013 11:55 AM, Michal Privoznik wrote: For future work we need _virDomainEventGraphicsAddress and _virDomainEventGraphicsSubjectIdentity members to be char * not const char *. We are strdup()ing them anyway, so they should have been char *

Re: [libvirt] [Xen-devel] [PATCH RESENT 04/12] libxl: populate xenstore memory entries at startup\

2013-05-22 Thread Stefano Stabellini
On Wed, 22 May 2013, Jim Fehlig wrote: Marek Marczykowski wrote: On 19.04.2013 13:10, Stefano Stabellini wrote: On Thu, 11 Apr 2013, Marek Marczykowski wrote: On 11.04.2013 09:52, Ian Campbell wrote: On Thu, 2013-04-11 at 05:09 +0100, Jim Fehlig wrote: +

Re: [libvirt] [PATCH 2/2] util: make virSetUIDGID async-signal-safe

2013-05-22 Thread Laine Stump
On 05/21/2013 11:24 PM, Eric Blake wrote: https://bugzilla.redhat.com/show_bug.cgi?id=964358 POSIX states that multi-threaded apps should not use functions that are not async-signal-safe between fork and exec, yet we were using getpwuid_r and initgroups. Although rare, it is possible to hit

[libvirt] Schedule for next release ?

2013-05-22 Thread Daniel Veillard
It seems that if we want to have the release at the end of the month we ought to enter freeze next Monday the 27 for a release on the 3rd (I may have a hard time making the release on Friday 31 or w.e.). Is there any problem with freezing next Monday ? If not let's proceed that way, in that case

Re: [libvirt] [PATCH v4 05/13] Adapt to VIR_STRDUP and VIR_STRNDUP in src/qemu/*

2013-05-22 Thread Eric Blake
On 05/20/2013 11:55 AM, Michal Privoznik wrote: --- src/qemu/qemu_capabilities.c | 79 +++- src/qemu/qemu_cgroup.c | 4 +- src/qemu/qemu_command.c | 428 +-- src/qemu/qemu_conf.c | 64 +++ src/qemu/qemu_domain.c

Re: [libvirt] [PATCH v4 06/13] Adapt to VIR_STRDUP and VIR_STRNDUP in src/remote/*

2013-05-22 Thread Eric Blake
On 05/20/2013 11:55 AM, Michal Privoznik wrote: --- src/remote/remote_driver.c | 114 + 1 file changed, 44 insertions(+), 70 deletions(-) @@ -497,24 +497,21 @@ doRemoteOpen(virConnectPtr conn, ... if (conn-uri conn-uri-user -

Re: [libvirt] Remove OPTION section in output of 'virsh help command' if no option exists.

2013-05-22 Thread Eric Blake
On 05/21/2013 09:15 PM, Zhang Xiaohe wrote: Don't print 'OPTION' if there's no options. Just behaves as DESCRIPTION does. This mostly affects 'interface' command group. Signed-off-by: Zhang Xiaohe zhan...@cn.fujitsu.com Reported-by: Li Yang liyang.f...@cn.fujitsu.com --- tools/virsh.c |

[libvirt] need custom /dev entries in LXC

2013-05-22 Thread Michael R. Hines
Hi, We run nvidia devices inside libvirt-managed LXC containers. It used to be that simply doing: $ echo 'c 195:* rwm' /sys/fs/cgroup/devices/libvirt/lxc Then, after booting the container, we would do: $ mknod -m 666 /dev/nvidia0 c 195 0 would be good enough to run our CUDA

Re: [libvirt] [PATCH v4 07/13] Adapt to VIR_STRDUP and VIR_STRNDUP in src/rpc/*

2013-05-22 Thread Eric Blake
On 05/20/2013 11:55 AM, Michal Privoznik wrote: --- src/rpc/gendispatch.pl | 21 src/rpc/virnetclient.c | 16 - src/rpc/virnetmessage.c | 27 +-- src/rpc/virnetsaslcontext.c | 6 ++-- src/rpc/virnetserver.c | 6 ++--

Re: [libvirt] two hostdev devices problem

2013-05-22 Thread Dominik Mostowiec
I tested on 1.0.5 patched version and vm with 2 vfs working fine. I have another problem When i set max_vfs=63: internal error missing IFLA_VF_INFO in netlink response Its working when max_vfs=31 -- Dominik 21 maj 2013 15:19, Dominik Mostowiec dominikmostow...@gmail.com napisał(a): Hmm, It

Re: [libvirt] [PATCH v4 08/13] Adapt to VIR_STRDUP and VIR_STRNDUP in src/security/*

2013-05-22 Thread Eric Blake
On 05/20/2013 11:55 AM, Michal Privoznik wrote: --- src/security/security_apparmor.c | 20 ++ src/security/security_dac.c | 21 +++ src/security/security_nop.c | 7 +--- src/security/security_selinux.c | 79 +++-

Re: [libvirt] Ongoing work on lock contention in qemu driver?

2013-05-22 Thread Peter Feiner
One theory I had was that the virDomainObjListSearchName method could be a bottleneck, becaue that acquires a lock on every single VM. This is invoked when starting a VM, when we call virDomainObjListAddLocked. I tried removing this locking though didn't see any performance

Re: [libvirt] [PATCH RESENT 03/12] libxl: nodeDevice* support for PCI devices

2013-05-22 Thread Marek Marczykowski
On 22.05.2013 16:36, Jim Fehlig wrote: Marek Marczykowski wrote: For now only for PCI devices. Mostly copy-paste from old xen driver. This one is (or will be) covered by Chanyan's work as well right? Right. Regards, Jim --- src/libxl/libxl_driver.c | 193

Re: [libvirt] [PATCH RESENT 02/12] libxl: PCI passthrough support

2013-05-22 Thread Marek Marczykowski
On 22.05.2013 16:33, Jim Fehlig wrote: Jim Fehlig wrote: Daniel P. Berrange wrote: On Wed, Apr 10, 2013 at 04:44:43AM +0200, Marek Marczykowski wrote: --- src/libxl/libxl_conf.c | 72 ++ src/libxl/libxl_conf.h | 2 ++ 2 files

Re: [libvirt] [Xen-devel] [PATCH RESENT 04/12] libxl: populate xenstore memory entries at startup\

2013-05-22 Thread Marek Marczykowski
On 22.05.2013 18:58, Stefano Stabellini wrote: On Wed, 22 May 2013, Jim Fehlig wrote: Marek Marczykowski wrote: On 19.04.2013 13:10, Stefano Stabellini wrote: On Thu, 11 Apr 2013, Marek Marczykowski wrote: On 11.04.2013 09:52, Ian Campbell wrote: On Thu, 2013-04-11 at 05:09

[libvirt] [PATCH] remote: fix dom-id after virDomainCreateWithFlags

2013-05-22 Thread Marek Marczykowski
The same issue as (already fixed) in virDomainCreate - REMOTE_PROC_DOMAIN_CREATE_WITH_FLAGS doesn't return new domain ID, only -1 on error or 0 on success. Besides this one fix it is more general problem - local domain object ID can desynchronize with the real one, for example in case of another

Re: [libvirt] Remove OPTION section in output of 'virsh help command' if no option exists.

2013-05-22 Thread Zhang Xiaohe
于 2013年05月23日 06:19, Eric Blake 写道: On 05/21/2013 09:15 PM, Zhang Xiaohe wrote: Don't print 'OPTION' if there's no options. Just behaves as DESCRIPTION does. This mostly affects 'interface' command group. Signed-off-by: Zhang Xiaohezhan...@cn.fujitsu.com Reported-by: Li

[libvirt] [PATCH v3 09/12] LXC: controller: change the owner of /dev to the root user of container

2013-05-22 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 | 14 ++ 1 file changed, 14 insertions(+) diff --git a/src/lxc/lxc_controller.c

[libvirt] [PATCH v3 07/12] LXC: fuse: Change files owner to the root user of container

2013-05-22 Thread Gao feng
Otherwise we will fail to mount the meminfo file. This patch also allows any users to access the fuse mount point. Signed-off-by: Gao feng gaof...@cn.fujitsu.com --- src/lxc/lxc_fuse.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c index

[libvirt] [PATCH v3 03/12] LXC: sort the uidmap/gidmap of domain

2013-05-22 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 v3 08/12] LXC: controller: change the owner of tty devices to the root user of container

2013-05-22 Thread Gao feng
Since these tty devices will be used by container, the owner of them should be the root user of container. Signed-off-by: Gao feng gaof...@cn.fujitsu.com --- src/lxc/lxc_controller.c | 43 +-- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git

[libvirt] [PATCH v3 11/12] LXC: controller: change the owner of /dev/pts and ptmx to the root of container

2013-05-22 Thread Gao feng
This two 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 | 30 ++ 1 file changed, 30 insertions(+) diff --git a/src/lxc/lxc_controller.c

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

2013-05-22 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 v3 00/12] Add user namespace support for libvirt lxc

2013-05-22 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 v3 06/12] LXC: Move creating /dev/ptmx to virLXCControllerSetupDevPTS

2013-05-22 Thread Gao feng
Make codes clearer and reduce some virAsprintf. Signed-off-by: Gao feng gaof...@cn.fujitsu.com --- src/lxc/lxc_controller.c | 44 +++- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index

[libvirt] [PATCH v3 05/12] LXC: Creating devices for container on host side

2013-05-22 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 v3 04/12] LXC: introduce virLXCControllerSetupUserns and lxcContainerSetID

2013-05-22 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 v3 12/12] LXC: introduce virLXCControllerChown

2013-05-22 Thread Gao feng
use virLXCControllerChown to make codes clearer. Signed-off-by: Gao feng gaof...@cn.fujitsu.com --- src/lxc/lxc_controller.c | 81 ++-- 1 file changed, 31 insertions(+), 50 deletions(-) diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c

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

2013-05-22 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 | 14 ++ 1 file changed, 14 insertions(+) diff --git a/src/lxc/lxc_controller.c

[libvirt] [PATCH v3 01/12] LXC: Introduce New XML element for user namespace

2013-05-22 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 v3 08/12] LXC: controller: change the owner of tty devices to the root user of container

2013-05-22 Thread Richard RW. Weinberger
Hi! - Ursprüngliche Mail - Since these tty devices will be used by container, the owner of them should be the root user of container. Signed-off-by: Gao feng gaof...@cn.fujitsu.com --- src/lxc/lxc_controller.c | 43 +-- 1 file changed, 37

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

2013-05-22 Thread Richard RW. Weinberger
Hi! - Ursprüngliche Mail - 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 | 14 ++ 1 file changed, 14 insertions(+) diff --git

Re: [libvirt] [PATCH v3 11/12] LXC: controller: change the owner of /dev/pts and ptmx to the root of container

2013-05-22 Thread Richard RW. Weinberger
Hi! - Ursprüngliche Mail - This two 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 | 30 ++ 1 file changed, 30 insertions(+) diff --git