Re: [libvirt] [PATCH v4 5/5] on_missing: Emit event on disk source dropping

2011-10-21 Thread Jiri Denemark
On Thu, Oct 20, 2011 at 16:32:55 +0100, Daniel P. Berrange wrote: On Thu, Oct 20, 2011 at 04:52:52PM +0200, Michal Privoznik wrote: ... +/** + * virConnectDomainEventDiskEjectCallback: + * @conn: connection object + * @dom: domain on which the event occurred + * @target: target which

Re: [libvirt] [PATCH v4 5/5] on_missing: Emit event on disk source dropping

2011-10-21 Thread Daniel P. Berrange
On Fri, Oct 21, 2011 at 08:48:48AM +0200, Jiri Denemark wrote: On Thu, Oct 20, 2011 at 16:32:55 +0100, Daniel P. Berrange wrote: On Thu, Oct 20, 2011 at 04:52:52PM +0200, Michal Privoznik wrote: ... +/** + * virConnectDomainEventDiskEjectCallback: + * @conn: connection object + *

Re: [libvirt] [Qemu-devel] passing secrets to block devices

2011-10-21 Thread Daniel P. Berrange
On Fri, Oct 21, 2011 at 09:37:11AM +0800, shu ming wrote: On 2011-10-21 5:48, Josh Durgin wrote: On 10/20/2011 12:24 PM, Daniel P. Berrange wrote: On Thu, Oct 20, 2011 at 11:30:42AM -0700, Josh Durgin wrote: We're working on libvirt support for block device authentication [1]. To

Re: [libvirt] [PATCH libvirt-glib] Fix GIR scanner on uninstalled environment

2011-10-21 Thread Daniel P. Berrange
On Fri, Oct 21, 2011 at 12:58:09AM +0200, Marc-André Lureau wrote: --- libvirt-gobject/Makefile.am |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/libvirt-gobject/Makefile.am b/libvirt-gobject/Makefile.am index 7013675..1c36fb0 100644 ---

Re: [libvirt] passing secrets to block devices

2011-10-21 Thread Daniel P. Berrange
On Thu, Oct 20, 2011 at 02:48:15PM -0700, Josh Durgin wrote: On 10/20/2011 12:24 PM, Daniel P. Berrange wrote: On Thu, Oct 20, 2011 at 11:30:42AM -0700, Josh Durgin wrote: We're working on libvirt support for block device authentication [1]. To authenticate, rbd needs a username and a secret.

Re: [libvirt] [PATCHv2 04/13] virbuf: add auto-indentation support

2011-10-21 Thread Hai Dong Li
On 10/21/2011 05:35 AM, Eric Blake wrote: On 10/19/2011 08:31 PM, Hai Dong Li wrote: This email is just for your attention. I'm relatively new to work in a community, so I didn't pay much attention to the readability of the comments last email. It seems comments lie in a large patch like this

Re: [libvirt] [PATCH libvirt-glib] Fix vapigen on uninstalled environment

2011-10-21 Thread Daniel P. Berrange
On Fri, Oct 21, 2011 at 01:17:19AM +0200, Marc-André Lureau wrote: --- vapi/Makefile.am | 20 +++- 1 files changed, 11 insertions(+), 9 deletions(-) diff --git a/vapi/Makefile.am b/vapi/Makefile.am index 129ce58..1e94a87 100644 --- a/vapi/Makefile.am +++

Re: [libvirt] [PATCHv2 07/13] snapshot: simplify indentation of sysinfo

2011-10-21 Thread Hai Dong Li
On 10/21/2011 06:41 AM, Eric Blake wrote: On 10/20/2011 04:20 AM, Daniel P. Berrange wrote: On Thu, Oct 20, 2011 at 12:14:57PM +0200, Peter Krempa wrote: On 09/29/2011 06:22 PM, Eric Blake wrote: The improvements to virBuffer, along with a paradigm shift to pass the original buffer through

Re: [libvirt] passing secrets to block devices

2011-10-21 Thread Kevin Wolf
Am 20.10.2011 23:48, schrieb Josh Durgin: On 10/20/2011 12:24 PM, Daniel P. Berrange wrote: On Thu, Oct 20, 2011 at 11:30:42AM -0700, Josh Durgin wrote: We're working on libvirt support for block device authentication [1]. To authenticate, rbd needs a username and a secret. Normally, to avoid

Re: [libvirt] passing secrets to block devices

2011-10-21 Thread Daniel P. Berrange
On Fri, Oct 21, 2011 at 10:30:39AM +0200, Kevin Wolf wrote: Am 20.10.2011 23:48, schrieb Josh Durgin: On 10/20/2011 12:24 PM, Daniel P. Berrange wrote: On Thu, Oct 20, 2011 at 11:30:42AM -0700, Josh Durgin wrote: We're working on libvirt support for block device authentication [1]. To

[libvirt] [libvirt-glib] Make vala optional by default

2011-10-21 Thread Christophe Fergeau
04368c60c added vala binding generation to libvirt-glib. To do that, it needs vapigen, so it checks for its presence during configure. However, configure errors out when vapigen is not found unless --disable-vala has been explicitly passed. In particular, vapigen must be available when running

Re: [libvirt] [libvirt-glib] Make vala optional by default

2011-10-21 Thread Daniel P. Berrange
On Fri, Oct 21, 2011 at 10:59:12AM +0200, Christophe Fergeau wrote: 04368c60c added vala binding generation to libvirt-glib. To do that, it needs vapigen, so it checks for its presence during configure. However, configure errors out when vapigen is not found unless --disable-vala has been

[libvirt] [PATCH 2/8] Extend graphics event to include UNIX socket

2011-10-21 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com Not all VNC/SPICE servers use a TCP socket for their connections. It is possible to configure a UNIX socket server. The graphics event must thus include a UNIX socket address type. * include/libvirt/libvirt.h.in: Add UNIX socket address type for

[libvirt] [PATCH 6/8] Add client side support for FD passing

2011-10-21 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com Extend the RPC client code to allow file descriptors to be sent to the server with calls, and received back with replies. * src/remote/remote_driver.c: Stub extra args * src/libvirt_private.syms, src/rpc/virnetclient.c, src/rpc/virnetclient.h,

[libvirt] [PATCH 8/8] Implement RPC driver support for virDomainOpenGraphics

2011-10-21 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com Since it needs to access file descriptors pass in the msg, the RPC driver for virDomainOpenGraphics needs to be manually implemented. * daemon/remote.c: RPC server dispatcher * src/remote/remote_driver.c: RPC client dispatcher *

[libvirt] [PATCH 1/8] Introduce the virDomainOpenGraphics API

2011-10-21 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The virDomainOpenGraphics API allows a libvirt client to pass in a file descriptor for an open socket pair, and get it connected to the graphics display of the guest. This is limited to working with local libvirt hypervisors conencted over a UNIX

[libvirt] [PATCH 4/8] Add APIs for virNetSocket for sending/receiving file descriptors

2011-10-21 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com Add APIs to the virNetSocket object, to allow file descriptors to be send/received over UNIX domain socket connections * src/rpc/virnetsocket.c, src/rpc/virnetsocket.h, src/libvirt_private.syms: Add APIs for FD send/recv ---

[libvirt] [PATCH 7/8] Extend RPC server to allow FD passing

2011-10-21 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The RPC server classes are extended to allow FDs to be received from clients with calls. THere is not currently any way for a procedure to pass FDs back to the client with replies * daemon/remote.c, src/rpc/gendispatch.pl: Change

[libvirt] [PATCH 3/8] Wire up QEMU implementation for virDomainOpenGraphics

2011-10-21 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The QEMU monitor command 'add_client' can be used to connect to a VNC or SPICE graphics display. This allows for implementaton of the virDomainOpenGraphics API * src/qemu/qemu_driver.c: Implement virDomainOpenGraphics * src/qemu/qemu_monitor.c,

[libvirt] [PATCH 0/8 v2] Allow a client to connect to QEMU's VNC by passing an FD via libvirt

2011-10-21 Thread Daniel P. Berrange
A overdue followup to https://www.redhat.com/archives/libvir-list/2011-June/msg01130.html New in this series - Completely re-written all RPC integration, to work with the new RPC layer code - Added systemtap probes for FD passing - Split into multiple patches - Renamed API to

[libvirt] [PATCH 5/8] Extend RPC protocol to allow FD passing

2011-10-21 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com Define two new RPC message types VIR_NET_CALL_WITH_FDS and VIR_NET_REPLY_WITH_FDS. These message types are equivalent to VIR_NET_CALL and VIR_NET_REPLY, except that between the message header, and payload there is a 32-bit integer field specifying how

[libvirt] [PATCH v5 2/5] util: Create virFileAccessibleAs function

2011-10-21 Thread Michal Privoznik
This function checks if a given path is accessible under given uid and gid. --- src/util/util.c | 83 +++ src/util/util.h |3 ++ 2 files changed, 86 insertions(+), 0 deletions(-) diff --git a/src/util/util.c b/src/util/util.c index

Re: [libvirt] [PATCH v5 5/5] startupPolicy: Emit event on disk source dropping

2011-10-21 Thread Daniel P. Berrange
On Fri, Oct 21, 2011 at 03:13:30PM +0200, Michal Privoznik wrote: If a disk source gets dropped because it is not accessible, mgmt application might want to be informed about this. Therefore we need to emit an event. The event presented in this patch is however a bit superset of what written

[libvirt] [PATCH] docs: Document filesystem type='block' for LXC

2011-10-21 Thread Ryota Ozaki
Commit 77791dc0e allows LXC to use a host block device as a guest filesystem, but it isn't documented yet. --- docs/formatdomain.html.in |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 95d33c0..dc6b152 100644

Re: [libvirt] [PATCH v5 5/5] startupPolicy: Emit event on disk source dropping

2011-10-21 Thread Eric Blake
On 10/21/2011 07:13 AM, Michal Privoznik wrote: If a disk source gets dropped because it is not accessible, mgmt application might want to be informed about this. Therefore we need to emit an event. The event presented in this patch is however a bit superset of what written above. The reason is

Re: [libvirt] [PATCH v5 2/5] util: Create virFileAccessibleAs function

2011-10-21 Thread Eric Blake
On 10/21/2011 07:12 AM, Michal Privoznik wrote: This function checks if a given path is accessible under given uid and gid. --- src/util/util.c | 83 +++ src/util/util.h |3 ++ 2 files changed, 86 insertions(+), 0 deletions(-) diff

Re: [libvirt] [PATCH] docs: Document filesystem type='block' for LXC

2011-10-21 Thread Eric Blake
On 10/21/2011 08:26 AM, Ryota Ozaki wrote: Commit 77791dc0e allows LXC to use a host block device as a guest filesystem, but it isn't documented yet. --- docs/formatdomain.html.in |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/docs/formatdomain.html.in

Re: [libvirt] [PATCH] qemu: simplify use of HAVE_YAJL

2011-10-21 Thread Eric Blake
On 10/20/2011 07:30 PM, Wen Congyang wrote: At 10/21/2011 04:39 AM, Eric Blake Write: Rather than making all clients of monitor commands that are JSON-only check whether yajl support was compiled in, it is simpler to just avoid setting the capability bit up front if we can't use the capability.

[libvirt] [PATCHv2] qemu: simplify use of HAVE_YAJL

2011-10-21 Thread Eric Blake
Rather than making all clients of monitor commands that are JSON-only check whether yajl support was compiled in, it is simpler to just avoid setting the capability bit up front if we can't use the capability. * src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags): Only set capability bit if we

[libvirt] [PATCH/RFC] Introduce VIR_MIGRATE_FORCE flag to allow for risky migration

2011-10-21 Thread Guido Günther
Hi, Migration will be disallowed when the vm uses host devices or has snapshots (qemuMigrationIsAllowed)[1]. Would it make sense to introduce a VIR_MIGRATE_FORCE similar to VIR_REVERT_FORCE here? We could then introduce error codes similar to the snapshot case (VIR_ERR_MIGRATE_RISKY). This path

[libvirt] [PATCH V1 2/4] Create rules for each member of a list

2011-10-21 Thread Stefan Berger
This patch extends the NWFilter driver for Linux (ebiptables) to create rules for each member of a previously introduced list. If for example an attribute value looks like this: IP = [10.0.0.1, 10.0.0.2, 10.0.0.3] then 3 rules will be generated for a rule accessing the variable 'IP', one for

Re: [libvirt] [PATCHv2 11/13] snapshot: simplify indentation of disk encryption xml

2011-10-21 Thread Peter Krempa
Dňa 29.9.2011 18:22, Eric Blake wrote / napísal(a): Use auto-indent in more places. * src/conf/storage_encryption_conf.h (virStorageEncryptionFormat): Drop parameter. * src/conf/storage_encryption_conf.c (virStorageEncryptionFormat) (virStorageEncryptionSecretFormat): Simplify with

[libvirt] [PATCH V1 0/4] Support for multiple IP addresses using lists

2011-10-21 Thread Stefan Berger
This patch series builds on the previously posted patch series https://www.redhat.com/archives/libvir-list/2011-October/msg00912.html and introduces the capability to assign a list to a variable and have multiple rules instantiated, one for each item in the list. This means, that if for example

[libvirt] [PATCH V1 4/4] Add test cases for parsing of list values

2011-10-21 Thread Stefan Berger
This patch adds a test case for parsing of the list values. Signed-off-by: Stefan Berger stef...@linux.vnet.ibm.com --- tests/nwfilterxml2xmlin/attr-value-test.xml | 24 tests/nwfilterxml2xmlout/attr-value-test.xml | 19 +++

[libvirt] [PATCH V1 1/4] Rework value part of name-value pairs

2011-10-21 Thread Stefan Berger
NWFilters can be provided name-value pairs using the following XML notiation: filterref filter='xyz' parameter name='PORT' value='80'/ parameter name='VAL' value='abc'/ /filterref The internal representation currently is so that a name is stored as a string and the

[libvirt] [PATCH V1 3/4] Parse lists of values

2011-10-21 Thread Stefan Berger
This patch introduces a parser for parsing lists of values as for example found in the XML here: parameter name='TEST' value='[10.1.2.3,10.2.3.4, 10.1.1.1]'/ The list of values is then stored in the newly introduced data type virNWFilterVarValue. Adapt the XML schema to be able to

Re: [libvirt] [PATCHv2 12/13] snapshot: minor cleanups from reviewing indentation

2011-10-21 Thread Peter Krempa
Dňa 29.9.2011 18:22, Eric Blake wrote / napísal(a): Break some long lines, and use more efficient functions when possible, such as relying on virBufferEscapeString to skip output on a NULL arg. Ensure that output does not embed newlines, since auto-indent won't work in those situations. *

Re: [libvirt] [PATCHv2 12/13] snapshot: minor cleanups from reviewing indentation

2011-10-21 Thread Eric Blake
On 10/21/2011 02:08 PM, Peter Krempa wrote: - if (def-data.ethernet.dev) - virBufferEscapeString(buf, source dev='%s'/\n, - def-data.ethernet.dev); + virBufferEscapeString(buf, source dev='%s'/\n, + def-data.ethernet.dev); if (def-data.ethernet.ipaddr) virBufferAsprintf(buf, ip address='%s'/\n,

[libvirt] [PATCHv2] waitpid: improve safety

2011-10-21 Thread Eric Blake
Based on a report by Coverity. waitpid() can leak resources if it fails with EINTR, so it should never be used without checking return status. But we already have a helper function that does that, so use it in more places. * src/lxc/lxc_controller.c (lxcPidGone): Check waitpid return value.

[libvirt] [PATCH] storage: avoid null deref on qemu-img failure

2011-10-21 Thread Eric Blake
Detected by Coverity. Only possible if qemu-img gives bogus output, but we might as well be robust. * src/storage/storage_backend.c (virStorageBackendQEMUImgBackingFormat): Check for strstr failure. --- src/storage/storage_backend.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)

Re: [libvirt] [PATCH] storage: avoid null deref on qemu-img failure

2011-10-21 Thread Peter Krempa
Dňa 21.10.2011 23:39, Eric Blake wrote / napísal(a): Detected by Coverity. Only possible if qemu-img gives bogus output, but we might as well be robust. * src/storage/storage_backend.c (virStorageBackendQEMUImgBackingFormat): Check for strstr failure. --- src/storage/storage_backend.c |

[libvirt] [PATCH 1/2] storage: plug iscsi memory leak

2011-10-21 Thread Eric Blake
Detected by Coverity. virStoragePoolSourceFree does not free the actual passed-in pointer. A bigger patch would be to rename it virStoragePoolSourceClear to match behavior, or even split it into two functions depending on needed behavior; but this is the minimal fix to the one location out of

[libvirt] [PATCH 2/2] storage: make previous leak less likely to regress

2011-10-21 Thread Eric Blake
Splitting into two functions allows the user to call the right function, rather than having to remember that a *Free function is an exception to the rule. * src/conf/storage_conf.h (virStoragePoolSourceClear): New function. * src/libvirt_private.syms (storage_conf.h): Export it. *

[libvirt] [PATCH] qemu: avoid leaking uninit data from hotplug to dumpxml

2011-10-21 Thread Eric Blake
Detected by Coverity. Both text and JSON monitors set only the bus and unit fields, which means driveAddr.controller spends life as garbage on the stack, and is then memcpy()'d into the in-memory representation which the user can see via dumpxml. * src/qemu/qemu_hotplug.c

[libvirt] [PATCH][Take2] virsh: Fix vol-info's 'Type' output

2011-10-21 Thread Ryota Ozaki
We have a new vol type dir in addition to file and block, but virsh doesn't know it. Fix it. Additionally, the patch lets virsh output unknown if not matched any of them. --- tools/virsh.c | 19 --- 1 files changed, 16 insertions(+), 3 deletions(-) diff --git a/tools/virsh.c

Re: [libvirt] [PATCH] virsh: Fix vol-info's 'Type' output

2011-10-21 Thread Ryota Ozaki
On Thu, Oct 20, 2011 at 8:30 PM, Osier Yang jy...@redhat.com wrote: 于 2011年10月20日 18:44, Ryota Ozaki 写道: We have a new type dir in addition to file and block, but s/type/vol type/ virsh doen't know it. Fix it. s/doen't/doesn't/ Additionally, the patch lets virsh output unknown if not