[libvirt] [PATCH v2] virsh: Honor reedit opts printing to a function

2012-06-14 Thread Michal Privoznik
When printing reedit options we make stdin raw. However, this results in stdout being raw as well. Therefore we need to return carriage when doing new line. Unfortunately, '\r' cannot be part of internationalized messages hence we must move them to formatting string which then in turn become huge

[libvirt] [PATCH 2/2] qemu: Fix off-by-one error while unescaping monitor strings

2012-06-14 Thread Peter Krempa
While unescaping the commands the commands passed through to the monitor function qemuMonitorUnescapeArg() initialized lenght of the input string to strlen()+1 which is fine for alloc but not for iteration of the string. This patch fixes the off-by-one error and drops the pointless check for a

[libvirt] [PATCH 1/2] virsh: Don't generate invalid XML in attach-disk command

2012-06-14 Thread Peter Krempa
The attach-disk command used with parameter --cache created an invalid XML snippet as the beginning of the driver element was not printed when used solely with --cache and no other attribute to driver. --- tools/virsh.c | 16 1 files changed, 8 insertions(+), 8 deletions(-)

[libvirt] [PATCH 0/2] fix two issues while doing virsh attach-disk

2012-06-14 Thread Peter Krempa
First issue was caused by virsh generating invalid XML to attach the disk, and the second issue is a off-by-one error that crashes the daemon with 50-90% probability while doing virsh attach-disk dom /dev/zero vdx. Peter Krempa (2): virsh: Don't generate invalid XML in attach-disk command

[libvirt] [PATCH v3] virsh: Honor reedit opts printing to a function

2012-06-14 Thread Michal Privoznik
When printing reedit options we make stdin raw. However, this results in stdout being raw as well. Therefore we need to return carriage when doing new line. Unfortunately, '\r' cannot be part of internationalized messages hence we must move them to formatting string which then in turn become huge

Re: [libvirt] [PATCH v3] virsh: Honor reedit opts printing to a function

2012-06-14 Thread Peter Krempa
On 06/14/12 11:07, Michal Privoznik wrote: When printing reedit options we make stdin raw. However, this results in stdout being raw as well. Therefore we need to return carriage when doing new line. Unfortunately, '\r' cannot be part of internationalized messages hence we must move them to

[libvirt] [PATCH] virsh: Null terminated the string memcpy from buffer explicitly

2012-06-14 Thread Osier Yang
--- tools/virsh.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index 98305c0..4509020 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -15069,11 +15069,13 @@ cleanup: VIR_FREE(device_type); VIR_FREE(disk_type); if

Re: [libvirt] [PATCH 0/2] fix two issues while doing virsh attach-disk

2012-06-14 Thread Eric Blake
On 06/14/2012 02:53 AM, Peter Krempa wrote: First issue was caused by virsh generating invalid XML to attach the disk, and the second issue is a off-by-one error that crashes the daemon with 50-90% probability while doing virsh attach-disk dom /dev/zero vdx. Peter Krempa (2): virsh: Don't

[libvirt] [PATCH v2] storage backend: Add sheepdog support

2012-06-14 Thread Sebastian Wiedenroth
This patch brings support to manage sheepdog pools and volumes to libvirt. It uses the collie command-line utility that comes with sheepdog for that. A sheepdog pool in libvirt maps to a sheepdog cluster. It needs a host and port to connect to, which in most cases is just going to be the default

Re: [libvirt] [PATCH] virsh: Null terminated the string memcpy from buffer explicitly

2012-06-14 Thread Eric Blake
On 06/14/2012 05:09 AM, Osier Yang wrote: --- tools/virsh.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) A bit light on the commit message. Does this solve an actual crash, or does it just silence an overactive static code analyzer? diff --git a/tools/virsh.c

Re: [libvirt] [PATCH 0/2] fix two issues while doing virsh attach-disk

2012-06-14 Thread Peter Krempa
On 06/14/12 13:14, Eric Blake wrote: On 06/14/2012 02:53 AM, Peter Krempa wrote: First issue was caused by virsh generating invalid XML to attach the disk, and the second issue is a off-by-one error that crashes the daemon with 50-90% probability while doing virsh attach-disk dom /dev/zero vdx.

[libvirt] [PATCH] virsh: Report name from edited object

2012-06-14 Thread Michal Privoznik
There is a little easter egg in virsh: one can easily clone an object (domain, network, ...). Just 'virsh edit' change the name and remove uuid. And then, in the end when reporting success the new name was printed out. However, with recent edit rewrite we lost the final part and are still printing

Re: [libvirt] [PATCH] virsh: Report name from edited object

2012-06-14 Thread Eric Blake
On 06/14/2012 06:50 AM, Michal Privoznik wrote: There is a little easter egg in virsh: one can easily clone an object (domain, network, ...). Just 'virsh edit' change the name and remove uuid. And then, in the end when reporting success the new name was printed out. However, with recent edit

[libvirt] [PATCH] qemu: Enable disconnecting SPICE clients without changing password

2012-06-14 Thread Peter Krempa
Libvirt updates the configuration of SPICE server only when something changes. This is unfortunate when the user wants to disconnect a existing spice session when the connected attribute is already disconnect. This patch modifies the conditions for calling the password updater to be called when

Re: [libvirt] [PATCH] virsh: Report name from edited object

2012-06-14 Thread Michal Privoznik
On 14.06.2012 14:57, Eric Blake wrote: On 06/14/2012 06:50 AM, Michal Privoznik wrote: There is a little easter egg in virsh: one can easily clone an object (domain, network, ...). Just 'virsh edit' change the name and remove uuid. And then, in the end when reporting success the new name was

Re: [libvirt] [PATCH v3] virsh: Honor reedit opts printing to a function

2012-06-14 Thread Michal Privoznik
On 14.06.2012 11:22, Peter Krempa wrote: On 06/14/12 11:07, Michal Privoznik wrote: When printing reedit options we make stdin raw. However, this results in stdout being raw as well. Therefore we need to return carriage when doing new line. Unfortunately, '\r' cannot be part of

Re: [libvirt] [PATCH] qemu: Enable disconnecting SPICE clients without changing password

2012-06-14 Thread Eric Blake
On 06/14/2012 06:59 AM, Peter Krempa wrote: Libvirt updates the configuration of SPICE server only when something changes. This is unfortunate when the user wants to disconnect a existing spice session when the connected attribute is already disconnect. This patch modifies the conditions

Re: [libvirt] [PATCH] qemu: Enable disconnecting SPICE clients without changing password

2012-06-14 Thread Peter Krempa
On 06/14/12 15:12, Eric Blake wrote: On 06/14/2012 06:59 AM, Peter Krempa wrote: Libvirt updates the configuration of SPICE server only when something changes. This is unfortunate when the user wants to disconnect a existing spice session when the connected attribute is already disconnect.

Re: [libvirt] [Qemu-devel] [PATCH v2 2/4] qapi: Add passfd QMP command

2012-06-14 Thread Luiz Capitulino
On Wed, 13 Jun 2012 18:07:43 -0400 Corey Bryant cor...@linux.vnet.ibm.com wrote: On 06/13/2012 04:47 PM, Eric Blake wrote: On 06/13/2012 02:25 PM, Corey Bryant wrote: Also, getfd automatically closes a fd if an existing fdname is passed again. I don't think this is a good behavior,

Re: [libvirt] [PATCHv3 01/12] lib: Add public api to enable atomic listing of guest

2012-06-14 Thread Eric Blake
On 06/11/2012 04:33 AM, Peter Krempa wrote: This patch adds a new public api that lists domains. The new approach is different from those used before. There are key points to this: +int +virConnectListAllDomains(virConnectPtr conn, + virDomainPtr **domains, +

[libvirt] RFC: spice-server default listen behaviour change

2012-06-14 Thread David Jaša
Hi, I learned few things about ipv6 lately. Most importantly about dual-socket that means that a process that opens ::0 automatically listens on both ipv4 _and_ ipv6 unless it sets IPV6_ONLY option of setsockopt() to 0. This is pretty important wrt dual-stack configurations because they can be

[libvirt] [PATCH] Always pivot_root event if the new root source is '/'

2012-06-14 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com This reverts commit c16b4c43fcdd8ec02581f38377983b2e0925bfcd Author: Daniel P. Berrange berra...@redhat.com Date: Fri May 11 15:09:27 2012 +0100 Avoid LXC pivot root in the root source is still / This commit broke setup of /dev, because

[libvirt] [PATCH] Improve error message diagnosing incorrect XML CPU mode

2012-06-14 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com Tell the user what CPU mode value is wrong --- src/conf/cpu_conf.c |8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index 018d571..b520f7c 100644 --- a/src/conf/cpu_conf.c +++

Re: [libvirt] [PATCH] Improve error message diagnosing incorrect XML CPU mode

2012-06-14 Thread Michal Privoznik
On 14.06.2012 17:42, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Tell the user what CPU mode value is wrong --- src/conf/cpu_conf.c |8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) ACK Michal -- libvir-list mailing list

Re: [libvirt] [PATCH] Always pivot_root event if the new root source is '/'

2012-06-14 Thread Eric Blake
On 06/14/2012 09:40 AM, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com This reverts commit c16b4c43fcdd8ec02581f38377983b2e0925bfcd Author: Daniel P. Berrange berra...@redhat.com Date: Fri May 11 15:09:27 2012 +0100 Avoid LXC pivot root in the root

[libvirt] [PATCH v3 2/5] qapi: Add pass-fd QMP command

2012-06-14 Thread Corey Bryant
This patch adds the pass-fd QMP command using the QAPI framework. Like the getfd command, it is used to pass a file descriptor via SCM_RIGHTS. However, the pass-fd command also returns the received file descriptor, which is a difference in behavior from the getfd command, which returns nothing.

[libvirt] [PATCH v3 3/5] osdep: Enable qemu_open to dup pre-opened fd

2012-06-14 Thread Corey Bryant
This patch adds support to qemu_open to dup(fd) a pre-opened file descriptor if the filename is of the format /dev/fd/X. This can be used when QEMU is restricted from opening files, and the management application opens files on QEMU's behalf. If the fd was passed to the monitor with the pass-fd

[libvirt] [PATCH v3 0/5] file descriptor passing using pass-fd

2012-06-14 Thread Corey Bryant
libvirt's sVirt security driver provides SELinux MAC isolation for Qemu guest processes and their corresponding image files. In other words, sVirt uses SELinux to prevent a QEMU process from opening files that do not belong to it. sVirt provides this support by labeling guests and resources with

[libvirt] [PATCH v3 1/5] qapi: Convert getfd and closefd

2012-06-14 Thread Corey Bryant
Signed-off-by: Corey Bryant cor...@linux.vnet.ibm.com --- v2: -Convert getfd and closefd to QAPI (lcapitul...@redhat.com) -Remove changes that returned fd from getfd (lcapitul...@redhat.com) -Wrap hmp_* functions around qmp_* functions (kw...@redhat.com) -Move hmp_* functions to hmp.c

[libvirt] [PATCH v3 4/5] block: Convert open calls to qemu_open

2012-06-14 Thread Corey Bryant
This patch converts all block layer open calls to qemu_open. This enables all block layer open paths to dup(X) a pre-opened file descriptor if the filename is of the format /dev/fd/X. This is useful if QEMU is restricted from opening certain files. Note that this adds the O_CLOEXEC flag to the

[libvirt] [PATCH v3 5/5] block: Prevent /dev/fd/X filename from being detected as floppy

2012-06-14 Thread Corey Bryant
Reported-by: Kevin Wolf kw...@redhat.com Reviewed-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Corey Bryant cor...@linux.vnet.ibm.com --- v3: -This patch is new in v3. It was previously submitted on its own, and is now being included in this series. block/raw-posix.c |4 +++- 1

Re: [libvirt] libvirtd stopped launching

2012-06-14 Thread Zeeshan Ali (Khattak)
On Wed, Jun 13, 2012 at 5:00 PM, Zeeshan Ali (Khattak) zeesha...@gnome.org wrote: Hi everyone,   After I updated my libvirt repo/install from latest git master yesterday, libvirtd won't just launch for me anymore. The error in log was: 2012-06-13 11:59:47.427+: 30501: error :

Re: [libvirt] [PATCH] virsh: Null terminated the string memcpy from buffer explicitly

2012-06-14 Thread Osier Yang
On 2012年06月14日 19:16, Eric Blake wrote: On 06/14/2012 05:09 AM, Osier Yang wrote: --- tools/virsh.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) A bit light on the commit message. Does this solve an actual crash, or does it just silence an overactive static code

[libvirt] [PATCH] docs: Update domain XML schema

2012-06-14 Thread Osier Yang
'boot' tag shouldn't be exclusive with 'kernel', 'initrd', and 'cmdline', though the boot sequence doesn't make sense when the guest boots from kernel directly. But it's useful if booting from kernel is to install a newly guest, even it's not to install a guest, there is no hurt. And on the other

[libvirt] [PATCHv2 00/13] list all snapshots

2012-06-14 Thread Eric Blake
This is a v2 of the remaining patches in: https://www.redhat.com/archives/libvir-list/2012-June/msg00273.html https://www.redhat.com/archives/libvir-list/2012-June/msg00284.html It assumes that Peter's list all domain patches have been applied already, at least through patch 6/12:

[libvirt] [PATCHv2 06/13] snapshot: add additional filters when getting lists

2012-06-14 Thread Eric Blake
It turns out that one-bit filtering makes it hard to select the inverse set, so it is easier to provide filtering groups. For back-compat, omitting all bits within a group means the group is not used for filtering, and by definition of a group (each snapshot matches exactly one bit within the

[libvirt] [PATCHv2 02/13] snapshot: use new virsh function for snapshot-list

2012-06-14 Thread Eric Blake
Operating on a list of snapshot objects looks so much simpler. In particular, since the helper function already trimmed out irrelevant entries, we no longer have quite so many special cases on finding the first snapshot to operate on. Also, vshTreePrint no longer has a generic callback struct;

[libvirt] [PATCHv2 10/13] list: provide python bindings for snapshots

2012-06-14 Thread Eric Blake
This adds support for the new virDomainListAllSnapshots (a domain function) and virDomainSnapshotListAllChildren (a snapshot function) to the libvirt-python bindings. The implementation is done manually as the generator does not support wrapping lists of C pointers into python objects. *

[libvirt] [PATCHv2 04/13] snapshot: merge domain and snapshot computation

2012-06-14 Thread Eric Blake
Now that domain listing is a thin wrapper around child listing, it's easier to have a common entry point. This restores the hashForEach optimization lost in the previous patch when there are no snapshots being filtered out of the entire list. * src/conf/domain_conf.h

[libvirt] [PATCHv2 01/13] snapshot: new virsh function factored from snapshot-list

2012-06-14 Thread Eric Blake
This patch is based on the fallback code out of cmdSnapshotList, with tweaks to keep the snapshot objects around rather than just their name, and to remove unwanted elements before returning. It looks forward to a future patch when we add a way to list all snapshot objects at once, and the next

[libvirt] [PATCHv2 03/13] snapshot: use metaroot node to simplify management

2012-06-14 Thread Eric Blake
This idea was first suggested by Daniel Veillard here: https://www.redhat.com/archives/libvir-list/2011-October/msg00353.html Now that I am about to add more complexity to snapshot listing, it makes sense to avoid code duplication and special casing for domain listing (all snapshots) vs. snapshot

[libvirt] [PATCHv2 08/13] list: add virDomainListAllSnapshots API

2012-06-14 Thread Eric Blake
There was an inherent race between virDomainSnapshotNum() and virDomainSnapshotListNames(), where an additional snapshot could be created in the meantime, or where a snapshot could be deleted before converting the name back to a virDomainSnapshotPtr. It was also an awkward name: the function

[libvirt] [PATCHv2 05/13] snapshot: merge count and name collectoin

2012-06-14 Thread Eric Blake
Another case where we can do the same amount of work with fewer lines of redundant code, which will make adding new filters easier. * src/conf/domain_conf.c (virDomainSnapshotNameData): Adjust struct. (virDomainSnapshotObjListCount): Delete, now taken care of...

[libvirt] [PATCHv2 09/13] list: use the new snapshot API in virsh when possible

2012-06-14 Thread Eric Blake
Using the new API is so much shorter than the rest of the remainder of the function. * tools/virsh.c (vshSnapshotList): Use the new API. --- v2: fixes needed to pass testing tools/virsh.c | 31 ++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git

[libvirt] [PATCHv2 11/13] list: provide RPC call for snapshots

2012-06-14 Thread Eric Blake
The generator doesn't handle lists of virDomainSnapshotPtr, so this commit requires a bit more work than some RPC additions. * src/remote/remote_protocol.x (REMOTE_PROC_DOMAIN_LIST_ALL_SNAPSHOTS) (REMOTE_PROC_DOMAIN_SNAPSHOT_LIST_ALL_CHILDREN): New RPC calls, with corresponding structs. *

[libvirt] [PATCHv2 07/13] snapshot: expose new flags in virsh

2012-06-14 Thread Eric Blake
Previously, to get the name of all snapshots with children, it was necessary to get the name of all snapshots and then remove the name of leaf snapshots. This is racy, and somewhat inefficient compared to planned API additions. We can emulate --no-metadata on 0.9.5-0.9.12, but for now, there is

[libvirt] [PATCHv2 13/13] list: add qemu snapshot list support

2012-06-14 Thread Eric Blake
The two new functions are very similar to the existing functions; just a matter of different arguments and a call to a different helper function. * src/qemu/qemu_driver.c (qemuDomainSnapshotListNames) (qemuDomainSnapshotNum, qemuDomainSnapshotListChildrenNames) (qemuDomainSnapshotNumChildren):

[libvirt] [PATCHv2 12/13] list: new helper function to collect snapshots

2012-06-14 Thread Eric Blake
Wraps the conversion from 'char *name' to virDomainSnapshotPtr in a reusable manner. * src/conf/virdomainlist.h (virDomainListSnapshots): New declaration. * src/conf/virdomainlist.c (virDomainListSnapshots): Implement it. * src/libvirt_private.syms (virdomainlist.h): Export it. --- v2: no real

[libvirt] ask for help to explain the network about tap

2012-06-14 Thread Yong Sheng Gong
Hi, I don't know who helps qemu-kvm to create and open the tap file and when if I define an interface of a kvm vm like:     interface type='bridge'   mac address='52:54:00:e4:2e:c1'/   source bridge='br200'/   model type='virtio'/   address type='pci' domain='0x' bus='0x00'

Re: [libvirt] [PATCHv2 00/13] list all snapshots

2012-06-14 Thread Eric Blake
On 06/14/2012 10:18 PM, Eric Blake wrote: This is a v2 of the remaining patches in: https://www.redhat.com/archives/libvir-list/2012-June/msg00273.html https://www.redhat.com/archives/libvir-list/2012-June/msg00284.html It assumes that Peter's list all domain patches have been applied

Re: [libvirt] [PATCH] docs: Update domain XML schema

2012-06-14 Thread Eric Blake
Subject line is a bit misleading - this falls more into schemas: or rng: than docs:. On 06/14/2012 08:34 PM, Osier Yang wrote: 'boot' tag shouldn't be exclusive with 'kernel', 'initrd', and 'cmdline', though the boot sequence doesn't make sense when the guest boots from kernel directly. But

Re: [libvirt] ask for help to explain the network about tap

2012-06-14 Thread Eric Blake
On 06/14/2012 08:49 PM, Yong Sheng Gong wrote: Hi, I don't know who helps qemu-kvm to create and open the tap file and when if I define an interface of a kvm vm like: interface type='bridge' mac address='52:54:00:e4:2e:c1'/ source bridge='br200'/ model