Re: [libvirt] [PATCH] remote_driver: Avoid double free in EventControl building

2011-10-07 Thread Michal Privoznik
On 06.10.2011 20:43, Eric Blake wrote: On 10/06/2011 07:41 AM, Michal Privoznik wrote: Don't xdr_free event data as they are freed by our caller virNetClientProgramDispatch. --- src/remote/remote_driver.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git

Re: [libvirt] [PATCHv2 13/7] snapshot: implement snapshot children listing in vbox

2011-10-07 Thread Matthias Bolte
2011/10/7 Eric Blake ebl...@redhat.com: Adding this for VBox was a bit harder than for ESX, but the same principles apply for starting the traversal at a known point rather than covering the entire hierarchy. * src/vbox/vbox_tmpl.c (vboxCountDescendants) (vboxDomainSnapshotNumChildren)

Re: [libvirt] [libvirt-glib 1/3] Don't use empty message when building a GError

2011-10-07 Thread Daniel P. Berrange
On Thu, Oct 06, 2011 at 08:24:10PM +0200, Christophe Fergeau wrote: After testing that 'message' is NULL, gvir_error_new_literal is using it to build a GError. What was meant was to use verr-message. --- libvirt-glib/libvirt-glib-error.c |2 +- 1 files changed, 1 insertions(+), 1

[libvirt] [PATCH] virsh: Update the help information for undefine command.

2011-10-07 Thread tangchen
virsh undefine command can now undefine an active guest, but the help information is still the old. This patch modifies it and make it coincident to the manpage of virsh. Signed-off-by: tangchen tangc...@cn.fujitsu.com --- tools/virsh.c |6 -- 1 files changed, 4 insertions(+), 2

[libvirt] [libvirt-glib 08/23] Implement gvir_config_domain_set_name

2011-10-07 Thread Christophe Fergeau
--- libvirt-gconfig/libvirt-gconfig-domain.c | 27 +++ libvirt-gconfig/libvirt-gconfig-domain.h |1 + libvirt-gconfig/libvirt-gconfig.sym |1 + 3 files changed, 29 insertions(+), 0 deletions(-) diff --git a/libvirt-gconfig/libvirt-gconfig-domain.c

[libvirt] [libvirt-glib 04/23] Add GVirConfigObject::node property

2011-10-07 Thread Christophe Fergeau
This property stores the XML node corresponding to the current configuration object in the XML tree. When creating configuration objects from a XML string, the XML file will be lazily loaded, and this property will be set. --- libvirt-gconfig/libvirt-gconfig-object.c | 35

[libvirt] [libvirt-glib 10/23] Add gvir_config_object_to_xml

2011-10-07 Thread Christophe Fergeau
--- libvirt-gconfig/libvirt-gconfig-object.c | 19 +++ libvirt-gconfig/libvirt-gconfig-object.h |2 ++ libvirt-gconfig/libvirt-gconfig.sym |1 + 3 files changed, 22 insertions(+), 0 deletions(-) diff --git a/libvirt-gconfig/libvirt-gconfig-object.c

[libvirt] [libvirt-glib 03/23] Add getters for GVirConfig xmlNode and xmlDoc

2011-10-07 Thread Christophe Fergeau
They will be useful in subclasses to access the parsed document, and to external users needing to directly interact with the generated XML. --- libvirt-gconfig/libvirt-gconfig-object.c | 18 ++ libvirt-gconfig/libvirt-gconfig-object.h |2 ++

[libvirt] [libvirt-glib 00/24] libvirt-gconfig patches

2011-10-07 Thread Christophe Fergeau
Hi, Here is a set of patches which start to implement functionality to libvirt-gconfig. The end result is that the name, memory and features properties are implemented for the Domain class. Most of the work is about reworking the low-level plumbing to make the implementation as easy as possible.

[libvirt] [libvirt-glib 05/23] Add GVir::Config::Domain::name property

2011-10-07 Thread Christophe Fergeau
For now, it's read-only, but is exposed as a gobject property too. --- libvirt-gconfig/libvirt-gconfig-domain.c | 50 ++ libvirt-gconfig/libvirt-gconfig-domain.h |2 + libvirt-gconfig/libvirt-gconfig.sym |1 + 3 files changed, 53 insertions(+), 0

[libvirt] [libvirt-glib 02/23] gvir_config_object_parse: don't parse empty documents

2011-10-07 Thread Christophe Fergeau
Report an error when trying to parse the current XML document associated with the GVirConfig object when no document has been set. --- libvirt-gconfig/libvirt-gconfig-object.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/libvirt-gconfig/libvirt-gconfig-object.c

[libvirt] [libvirt-glib 01/23] Add helpers in libvirt-gconfig-helpers.[ch]

2011-10-07 Thread Christophe Fergeau
These helper functions will be useful later on. --- examples/Makefile.am |1 + libvirt-gconfig/Makefile.am |3 + libvirt-gconfig/libvirt-gconfig-helpers.c | 179 + libvirt-gconfig/libvirt-gconfig-helpers.h | 48

[libvirt] [libvirt-glib 07/23] Add gvir_config_domain_new to create an empty domain

2011-10-07 Thread Christophe Fergeau
--- libvirt-gconfig/libvirt-gconfig-domain.c | 12 libvirt-gconfig/libvirt-gconfig-domain.h |1 + libvirt-gconfig/libvirt-gconfig.sym |1 + 3 files changed, 14 insertions(+), 0 deletions(-) diff --git a/libvirt-gconfig/libvirt-gconfig-domain.c

[libvirt] [libvirt-glib 12/23] Add domain creation/parsing test

2011-10-07 Thread Christophe Fergeau
--- configure.ac |1 + libvirt-gconfig/Makefile.am |1 + libvirt-gconfig/tests/Makefile.am | 16 ++ libvirt-gconfig/tests/test-domain-create.c| 53 +++ libvirt-gconfig/tests/test-domain-invalid.xml

[libvirt] [libvirt-glib 20/23] Add test-domain-duplicate.xml which currently fails

2011-10-07 Thread Christophe Fergeau
This test has 3 duplicate name nodes in the domain XML, I don't know what the right behaviour is in this case :) --- libvirt-gconfig/tests/test-domain-duplicate.xml |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) create mode 100644 libvirt-gconfig/tests/test-domain-duplicate.xml

[libvirt] [libvirt-glib 18/23] Add gvir_config_object_get_node_content

2011-10-07 Thread Christophe Fergeau
There will be quite a few getter functions returning a string contained in one of the nodes of a GVirConfigObject, so better to make it a one-liner to achieve this. --- libvirt-gconfig/libvirt-gconfig-domain.c |9 ++--- libvirt-gconfig/libvirt-gconfig-object.c | 12

[libvirt] [libvirt-glib 06/23] Rename gvir_config_domain_new

2011-10-07 Thread Christophe Fergeau
Rename it to gvir_config_domain_new_from_xml since it takes an XML string as input. gvir_config_domain_new will be used to create a new empty domain. --- libvirt-gconfig/libvirt-gconfig-domain.c |2 +- libvirt-gconfig/libvirt-gconfig-domain.h |2 +- libvirt-gconfig/libvirt-gconfig.sym

[libvirt] [libvirt-glib 15/23] Only do XML parsing when creating config objects

2011-10-07 Thread Christophe Fergeau
This commit changes gvir_config_domain_new_from_xml not to operate on an existing object. This makes it possible to call it to create an appropriate xmlNodePtr object which can then be used to construct an object derived from GVirConfigObject. This will also makes it possible to remove

[libvirt] [libvirt-glib 16/23] Remove GError argument from GVirConfigObject::node getter

2011-10-07 Thread Christophe Fergeau
Since this function no longer tries to do XML parsing, there is no error to report. --- libvirt-gconfig/libvirt-gconfig-domain.c |5 ++--- libvirt-gconfig/libvirt-gconfig-object.c |7 +++ libvirt-gconfig/libvirt-gconfig-object.h |2 +- 3 files changed, 6 insertions(+), 8

[libvirt] [libvirt-glib 13/23] Remove GVirConfigObject::docHandle

2011-10-07 Thread Christophe Fergeau
GVirConfigObject also contains an xmlNodePtr which is more useful since it indicates the position of the current config object in the source XML file. Since xmlNode has a 'doc' member, having both an xmlNodePtr and an xmlDocPtr in GVirConfigObject is redundant. ---

[libvirt] [libvirt-glib 09/23] Make the GVirConfigDomain::name property writable

2011-10-07 Thread Christophe Fergeau
--- libvirt-gconfig/libvirt-gconfig-domain.c | 19 ++- 1 files changed, 18 insertions(+), 1 deletions(-) diff --git a/libvirt-gconfig/libvirt-gconfig-domain.c b/libvirt-gconfig/libvirt-gconfig-domain.c index 06fc3fa..00cab80 100644 ---

[libvirt] [libvirt-glib 22/23] Add GVirConfigDomain::memory

2011-10-07 Thread Christophe Fergeau
--- libvirt-gconfig/libvirt-gconfig-domain.c | 29 + libvirt-gconfig/libvirt-gconfig-domain.h |2 + libvirt-gconfig/libvirt-gconfig-object.c | 32 libvirt-gconfig/libvirt-gconfig-object.h |5

[libvirt] [libvirt-glib 19/23] Add gvir_config_object_set_node_content

2011-10-07 Thread Christophe Fergeau
It's used to set the content of a node in a GVirConfigObject to a given value, and will replace any existing node with the same value. --- libvirt-gconfig/libvirt-gconfig-domain.c | 22 ++ libvirt-gconfig/libvirt-gconfig-object.c | 30 ++

[libvirt] [libvirt-glib 23/23] Add GVirConfigDomain::features

2011-10-07 Thread Christophe Fergeau
--- libvirt-gconfig/libvirt-gconfig-domain.c | 71 libvirt-gconfig/libvirt-gconfig-domain.h |4 ++ libvirt-gconfig/libvirt-gconfig.sym|2 + libvirt-gconfig/tests/test-domain-create.c | 12 + libvirt-gconfig/tests/test-domain-parse.c |7

[libvirt] [libvirt-glib 21/23] Validate document in parsing test

2011-10-07 Thread Christophe Fergeau
Add a call to gvir_config_object_validate in test-domain-parse.c However at the moment this call is purely informative since none of the tests is a valid domain XML description. --- libvirt-gconfig/tests/test-domain-parse.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff

[libvirt] [libvirt-glib 11/23] Use gvir_config_object_to_xml

2011-10-07 Thread Christophe Fergeau
s/gvir_config_object_get_doc/gvir_config_object_to_xml/ Prefer gvir_config_object_to_xml over gvir_config_object_get_doc since the latter will be removed soon. --- libvirt-gobject/libvirt-gobject-connection.c |2 +- libvirt-gobject/libvirt-gobject-storage-pool.c |2 +- 2 files changed,

[libvirt] [libvirt-glib 14/23] Remove xml parsing from gvir_config_*_new functions

2011-10-07 Thread Christophe Fergeau
These functions now create empty config objects to be consistent with what gvir_config_domain_new does. --- libvirt-gconfig/libvirt-gconfig-capabilities.c| 10 -- libvirt-gconfig/libvirt-gconfig-capabilities.h|2 +- libvirt-gconfig/libvirt-gconfig-domain-snapshot.c |9

[libvirt] [libvirt-glib 17/23] Remove GVirConfigObject::doc

2011-10-07 Thread Christophe Fergeau
Now that the parsing is done before creating the object, this member is no longer useful. Moreover, it's redundant with the ::node member. Remove it and rely on always having an xmlNodePtr available to represent the config object. --- libvirt-gconfig/libvirt-gconfig-object.c | 30

Re: [libvirt] [PATCH 1/2] xen: add error handling to UUID parsing

2011-10-07 Thread Guido Günther
On Thu, Oct 06, 2011 at 04:33:49PM -0600, Eric Blake wrote: On 10/06/2011 11:36 AM, Guido Günther wrote: These three errors should probably all be changed away from VIR_ERR_INTERNAL_ERROR into something more useful, but I'm not sure whether that would be VIR_ERR_CONF_SYNTAX,

[libvirt] [PATCH] Introduce driver under filesystem to support open-by-handle.

2011-10-07 Thread Harsh Prateek Bora
VirtFS allows the user to choose between local/handle for fs driver. As of now, libvirt hardcode to use local driver only. This patch provides a solution to allow user to choose between local/handle as fs driver. Sample: filesystem type='mount' driver type='handle'/ source

Re: [libvirt] [PATCH 0/5 v2] Improve Ceph Qemu+RBD support

2011-10-07 Thread Wido den Hollander
Hi, On Mon, 2011-09-19 at 21:13 -0700, Sage Weil wrote: The current support for qemu and Ceph RBD (rados block device) has two main deficiencies: authentication doesn't work, and it relies on environment variables (which don't work with latest upstream). This patch set addresses both those

Re: [libvirt] [libvirt-glib 00/24] libvirt-gconfig patches

2011-10-07 Thread Zeeshan Ali (Khattak)
On Fri, Oct 7, 2011 at 12:40 PM, Christophe Fergeau cferg...@redhat.com wrote: Hi, Hello, While writing this code, there were at least 2 questions that arose, some input would be welcome :) * I don't know how to handle XMLs where the same node appears multiple  times (eg name). If it's

Re: [libvirt] [PATCH 0/5 v2] Improve Ceph Qemu+RBD support

2011-10-07 Thread Daniel P. Berrange
On Fri, Oct 07, 2011 at 01:39:50PM +0200, Wido den Hollander wrote: Hi, On Mon, 2011-09-19 at 21:13 -0700, Sage Weil wrote: The current support for qemu and Ceph RBD (rados block device) has two main deficiencies: authentication doesn't work, and it relies on environment variables

[libvirt] [PATCH] snapshot: fix virsh error message typo

2011-10-07 Thread Eric Blake
* tools/virsh.c (cmdSnapshotList): Spell exclusive correctly. --- Pushing under the trivial rule. tools/virsh.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index 48f2b8a..62581f6 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@

Re: [libvirt] [PATCH 2/2] snapshot: simplify redefinition of disk snapshot

2011-10-07 Thread Daniel Veillard
On Thu, Oct 06, 2011 at 05:18:34PM -0600, Eric Blake wrote: Redefining disk-only snapshot xml should work even if the user did not explicitly pass VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY; the flag is only required for conditions where the state subelement is not already present in parsing (that

Re: [libvirt] [PATCH 1/2] snapshot: let virsh edit disk snapshots

2011-10-07 Thread Daniel Veillard
On Thu, Oct 06, 2011 at 05:18:33PM -0600, Eric Blake wrote: It was impossible for 'virsh snapshot-current dom name' to set name as the current snapshot, if name is a disk-only snapshot. Using strstr rather than full-blown xml parsing is safe, since the xml is assumed to be well-formed coming

Re: [libvirt] [PATCH 1/2] snapshot: let virsh edit disk snapshots

2011-10-07 Thread Eric Blake
On 10/07/2011 08:13 AM, Daniel Veillard wrote: On Thu, Oct 06, 2011 at 05:18:33PM -0600, Eric Blake wrote: It was impossible for 'virsh snapshot-current dom name' to set name as the current snapshot, if name is a disk-only snapshot. Using strstr rather than full-blown xml parsing is safe,

[libvirt] [libvirt-tck] Fix labels in SELINUX tests

2011-10-07 Thread Guido Günther
Hi, attached patch is needed to properly skip the SELinux tests if SELinux isn't enabled. Cheers, -- Guido From 8647fef32cdc13636ee86a937f854cdb931added Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= a...@sigxcpu.org Date: Fri, 7 Oct 2011 16:31:42 +0200 Subject: [PATCH] Use SKIP

Re: [libvirt] [libvirt-tck] Fix labels in SELINUX tests

2011-10-07 Thread Eric Blake
On 10/07/2011 08:35 AM, Guido Günther wrote: Hi, attached patch is needed to properly skip the SELinux tests if SELinux isn't enabled. Cheers, -- Guido ACK. -- Eric Blake ebl...@redhat.com+1-801-349-2682 Libvirt virtualization library http://libvirt.org -- libvir-list mailing list

Re: [libvirt] [libvirt-tck] Fix labels in SELINUX tests

2011-10-07 Thread Guido Günther
On Fri, Oct 07, 2011 at 08:51:47AM -0600, Eric Blake wrote: On 10/07/2011 08:35 AM, Guido Günther wrote: Hi, attached patch is needed to properly skip the SELinux tests if SELinux isn't enabled. Cheers, -- Guido ACK. Pushed. Thanks, -- Guido -- libvir-list mailing list

Re: [libvirt] [PATCH] virsh: Update the help information for undefine command.

2011-10-07 Thread Eric Blake
On 10/07/2011 03:34 AM, tangchen wrote: virsh undefine command can now undefine an active guest, but the help information is still the old. This patch modifies it and make it coincident to the manpage of virsh. Signed-off-by: tangchentangc...@cn.fujitsu.com --- tools/virsh.c |6 --

[libvirt] [PATCH 0/7] Update systemtap probing

2011-10-07 Thread Daniel P. Berrange
When looking at the keep alive code I needed an easy way to monitor the RPC messages being sent/received. I toyed with writing a WireShark plugin, but this seemed very hard work. So instead I wrote a handy set of DTrace probes for the RPC layer At the same time I also needed to track a bug in the

[libvirt] [PATCH 3/7] Add virSocketRef API to facilitate dynamic probing

2011-10-07 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com Instead of directly manipulating sock-refs, add a virSocketRef API * src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Add virSocketRef --- src/rpc/virnetsocket.c | 13 +++-- src/rpc/virnetsocket.h |1 + 2 files changed, 12 insertions(+),

[libvirt] [PATCH 2/7] If receiving a stream error, mark EOF on the stream

2011-10-07 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com If we receive an error on the stream, set the EOF marker so that any further (bogus) incoming data is dropped. * src/rpc/virnetclientstream.c: Set EOF on stream --- src/rpc/virnetclientstream.c |3 +++ 1 files changed, 3 insertions(+), 0

[libvirt] [PATCH 6/7] Rewrite all the DTrace/SystemTAP probing

2011-10-07 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The libvirtd daemon had a few crude system tap probes. Some of these were broken during the RPC rewrite. The new modular RPC code is structured in a way that allows much more effective tracing. Instead of trying to hook up the original probes, define a

[libvirt] [PATCH 4/7] Refactor TLS to facilitate dynamic probing

2011-10-07 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com Pull the call to gnutls_x509_crt_get_dn up into a higher function so that the 'dname' variable will be available for probe points * src/rpc/virnettlscontext.c: Pull gnutls_x509_crt_get_dn up one level --- src/rpc/virnettlscontext.c | 34

[libvirt] [PATCH 7/7] Update examples for probing with systemtap

2011-10-07 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com This removes the old example for legacy probes and adds two new scripts demonstrating many of the new probe point facilities. The rpc-monitor.stp script will print out friendly detaisl of all RPC traffic between a libvirt client/server. This is

[libvirt] [PATCH 1/7] Make libvirt.so include the RPC server code

2011-10-07 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com To avoid static linking libvirtd to the RPC server code, which then prevents sane introduction of DTrace probes, put it all in the libvirt.so, and export it * daemon/Makefile.am: Don't link to RPC libraries * src/Makefile.am: Link all RPC libraries to

[libvirt] [PATCH 5/7] Fix missing lock calls on virNetTLSContextRef

2011-10-07 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The virNetTLSContextRef API forgot to acquire/release the lock while changing ctxt-refs * src/rpc/virnettlscontext.c: Add lock calls --- src/rpc/virnettlscontext.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git

Re: [libvirt] [PATCH 0/7] Update systemtap probing

2011-10-07 Thread Eric Blake
On 10/07/2011 09:56 AM, Daniel P. Berrange wrote: When looking at the keep alive code I needed an easy way to monitor the RPC messages being sent/received. I toyed with writing a WireShark plugin, but this seemed very hard work. So instead I wrote a handy set of DTrace probes for the RPC layer

Re: [libvirt] [PATCH 1/7] Make libvirt.so include the RPC server code

2011-10-07 Thread Eric Blake
On 10/07/2011 09:56 AM, Daniel P. Berrange wrote: From: Daniel P. Berrangeberra...@redhat.com To avoid static linking libvirtd to the RPC server code, which then prevents sane introduction of DTrace probes, put it all in the libvirt.so, and export it * daemon/Makefile.am: Don't link to RPC

Re: [libvirt] [PATCH 2/7] If receiving a stream error, mark EOF on the stream

2011-10-07 Thread Eric Blake
On 10/07/2011 09:56 AM, Daniel P. Berrange wrote: From: Daniel P. Berrangeberra...@redhat.com If we receive an error on the stream, set the EOF marker so that any further (bogus) incoming data is dropped. * src/rpc/virnetclientstream.c: Set EOF on stream --- src/rpc/virnetclientstream.c |

Re: [libvirt] [PATCH 3/7] Add virSocketRef API to facilitate dynamic probing

2011-10-07 Thread Eric Blake
On 10/07/2011 09:56 AM, Daniel P. Berrange wrote: From: Daniel P. Berrangeberra...@redhat.com Instead of directly manipulating sock-refs, add a virSocketRef API * src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Add virSocketRef --- src/rpc/virnetsocket.c | 13 +++--

Re: [libvirt] [PATCH 5/7] Fix missing lock calls on virNetTLSContextRef

2011-10-07 Thread Eric Blake
On 10/07/2011 09:56 AM, Daniel P. Berrange wrote: From: Daniel P. Berrangeberra...@redhat.com The virNetTLSContextRef API forgot to acquire/release the lock while changing ctxt-refs * src/rpc/virnettlscontext.c: Add lock calls --- src/rpc/virnettlscontext.c |2 ++ 1 files changed, 2

Re: [libvirt] [PATCH 4/7] Refactor TLS to facilitate dynamic probing

2011-10-07 Thread Eric Blake
On 10/07/2011 09:56 AM, Daniel P. Berrange wrote: From: Daniel P. Berrangeberra...@redhat.com Pull the call to gnutls_x509_crt_get_dn up into a higher function so that the 'dname' variable will be available for probe points * src/rpc/virnettlscontext.c: Pull gnutls_x509_crt_get_dn up one

Re: [libvirt] [PATCH 6/7] Rewrite all the DTrace/SystemTAP probing

2011-10-07 Thread Eric Blake
On 10/07/2011 09:56 AM, Daniel P. Berrange wrote: From: Daniel P. Berrangeberra...@redhat.com The libvirtd daemon had a few crude system tap probes. Some of these were broken during the RPC rewrite. The new modular RPC code is structured in a way that allows much more effective tracing. Instead

Re: [libvirt] [PATCH 7/7] Update examples for probing with systemtap

2011-10-07 Thread Eric Blake
On 10/07/2011 09:56 AM, Daniel P. Berrange wrote: From: Daniel P. Berrangeberra...@redhat.com This removes the old example for legacy probes and adds two new scripts demonstrating many of the new probe point facilities. The rpc-monitor.stp script will print out friendly detaisl of all

[libvirt] [RFC PATCH 0/4] powerpc : Libvirt for the PowerPC platform

2011-10-07 Thread Prerna Saxena
Recent development in KVM for 64-bit Power ISA Book3S machines, allows users to run multiple KVM guest instances on POWER7 and PPC970 processor based systems. Also qemu-system-ppc64 has been enhanced to support a new machine type pseries suitable for Power Book3S machines. This addition

[libvirt] [RFC PATCH 1/4] powerpc: Use Sysfs to gather host info

2011-10-07 Thread Prerna Saxena
Libvirt presently depends on /proc/cpuinfo to gather information about the x86 host. Parsing of /proc/cpuinfo is arch-specific; the information fields are also not consistent. A cleaner way would be to use Sysfs. Both x86 and PowerPC specific information can be obtained from sysfs with different

[libvirt] [RFC PATCH 2/4] powerpc: Add cpu driver for powerpc host

2011-10-07 Thread Prerna Saxena
This part of code primarily compares host and guest CPUs of a given architecture for feature compatibility. x86 makes this choice based on CPUID comparison. Presently the PowerPC code has stubs to just get a 'pseries' guest to boot. It would be augmented going forward, to do a detailed feature

[libvirt] [RFC PATCH 3/4] powerpc: Add support for qemu-system-ppc64 in qemu capabilities

2011-10-07 Thread Prerna Saxena
This patch has a small parser which correctly interprets qemu-system-ppc64 output for a specific query. This code is independent for powerpc and largely does not interfere with x86 implementation. --- src/qemu/qemu_capabilities.c | 64 ++ 1 files

[libvirt] [RFC PATCH 4/4] powerpc: Remove incompatible command line options from qemu startup

2011-10-07 Thread Prerna Saxena
This patch is a hack at the moment and would need code refactoring to split-out the defaults for x86 and powerpc. Libvirt chooses a set of default options such as disk controller, network specific options, etc which are suitable for a x86 host. These defaults are arch specific and hence libvirt

[libvirt] [PATCH 1/2] snapshot: sort snapshot-list --tree

2011-10-07 Thread Eric Blake
Otherwise, the results are not repeatable. * tools/virsh.c (cmdSnapshotList): Print tree in predictable order. --- tools/virsh.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index 9532bc3..20b3dc5 100644 --- a/tools/virsh.c +++

[libvirt] [PATCH 2/2] snapshot: avoid accidental renames with snapshot-edit

2011-10-07 Thread Eric Blake
I was a bit surprised that 'virsh snapshot-edit dom name' silently allowed me to clone things, while still telling me the old name, especially since other commands like 'virsh edit dom' reject rename attempts (*). This fixes things to be more explicit. (*) Technically, 'virsh edit dom' relies on

[libvirt] [PATCH 0/4] snapshot: optimize qemu relationship traversal

2011-10-07 Thread Eric Blake
After working with ESX and VBox, I realized that a tweak to how snapshot relationships are stored would speed things up from O(n^2) to O(n). The hash table must be kept for name lookup, but the speedup comes by tracking relationships with each snapshot rather than crawling the entire hash table

[libvirt] [PATCH 3/4] snapshot: take advantage of new relations

2011-10-07 Thread Eric Blake
Among other improvements, virDomainSnapshotForEachDescendant is changed from iterative O(n^2) to recursive O(n). A bit better than the O(n^3) implementation in virsh snapshot-list! * src/conf/domain_conf.c (virDomainSnapshotObjListNum) (virDomainSnapshotObjListNumFrom)

[libvirt] [PATCH 1/4] snapshot: framework for more efficient relation traversal

2011-10-07 Thread Eric Blake
No one was using virDomainSnapshotHasChildren, but that was an O(n) function. Exposing and tracking a bit more metadata for each snapshot will allow the same query to be made with an O(1) query of the member field. For single snapshot operations (create, delete), callers can be trusted to

[libvirt] [PATCH 2/4] snapshot: track qemu snapshot relations

2011-10-07 Thread Eric Blake
Maintain the parent/child relationships of all qemu snapshots. * src/qemu/qemu_driver.c (qemuDomainSnapshotLoad): Populate relationships after loading. (qemuDomainSnapshotCreateXML): Set relations on creation; tweak redefinition to reuse existing object. (qemuDomainSnapshotReparentChildren,

[libvirt] [PATCH 4/4] snapshot: drop dead parameters

2011-10-07 Thread Eric Blake
The previous optimizations lead to some follow-on cleanups. * src/conf/domain_conf.c (virDomainSnapshotForEachChild) (virDomainSnapshotForEachDescendant): Drop dead parameter. (virDomainSnapshotActOnDescendant) (virDomainSnapshotObjListNumFrom) (virDomainSnapshotObjListGetNamesFrom): Update

Re: [libvirt] [PATCH 0/4] snapshot: optimize qemu relationship traversal

2011-10-07 Thread Eric Blake
On 10/07/2011 06:05 PM, Eric Blake wrote: After working with ESX and VBox, I realized that a tweak to how snapshot relationships are stored would speed things up from O(n^2) to O(n). The hash table must be kept for name lookup, but the speedup comes by tracking relationships with each snapshot

Re: [libvirt] [PATCH] virsh: Update the help information for undefine command.

2011-10-07 Thread tangchen
Hi, Thanks. This is a bit long, so I shortened it to: diff --git a/tools/virsh.c b/tools/virsh.c index 3da8bc5..9532bc3 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -1897,8 +1897,9 @@ cmdDefine(vshControl *ctl, const vshCmd *cmd) * undefine command */ static const vshCmdInfo

[libvirt] [PATCH 0/3] snapshot: another snapshot-list filter

2011-10-07 Thread Eric Blake
Previously, we could filter 'virsh snapshot-list --roots' to show just snapshots lacking parents, which is good for top-down algorithms. But sometimes you want just snapshots lacking children, for bottom-up algorithms - this implements that. Once again, I can only compile-test esx. Also, I

[libvirt] [PATCH 2/3] snapshot: implement LIST_LEAVES flag in qemu

2011-10-07 Thread Eric Blake
With the recent refactoring of qemu snapshot relationships, it is now trivial to filter on leaves. * src/conf/domain_conf.c (virDomainSnapshotObjListCount) (virDomainSnapshotObjListCopyNames): Handle new flag. * src/qemu/qemu_driver.c (qemuDomainSnapshotListNames) (qemuDomainSnapshotNum,

[libvirt] [PATCH 3/3] snapshot: implement LIST_LEAVES flag in esx

2011-10-07 Thread Eric Blake
Relatively straight-forward filtering. * src/esx/esx_vi.h (esxVI_GetNumberOfSnapshotTrees) (esxVI_GetSnapshotTreeNames): Add parameter. * src/esx/esx_vi.c (esxVI_GetNumberOfSnapshotTrees) (esxVI_GetSnapshotTreeNames): Allow leaf filtering. * src/esx/esx_driver.c (esxDomainSnapshotNum)

[libvirt] [PATCH 1/3] snapshot: add API for filtering by leaves

2011-10-07 Thread Eric Blake
Counterpart to --roots. * include/libvirt/libvirt.h.in (VIR_DOMAIN_SNAPSHOT_LIST_LEAVES): New flag. * src/libvirt.c (virDomainSnapshotNum, virDomainSnapshotListNames) (virDomainSnapshotNumChildren) (virDomainSnapshotListChildrenNames): Document it. * tools/virsh.c (cmdSnapshotList): Expose it. *

[libvirt] [PATCH] lxc: fix logic bug

2011-10-07 Thread Eric Blake
Detected by Coverity. We want to increment the size_t counter, not the pointer to the counter. * src/lxc/lxc_controller.c (lxcSetupLoopDevices): Use correct precedence. --- Pushing under the trivial rule. src/lxc/lxc_controller.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-)

[libvirt] [PATCH] qemu: silence Coverity false positive

2011-10-07 Thread Eric Blake
Coverity complained that 4 out of 5 callers to virJSONValueObjectGetBoolean checked for errors. But we documented that we don't care in this case. * src/qemu/qemu_monitor_json.c (qemuMonitorJSONGetBlockInfo): Use ignore_value. --- Pushing under the trivial rule. src/qemu/qemu_monitor_json.c |