Re: [libvirt] [PATCH 00/12] Domain Events - Round 2

2008-10-17 Thread Daniel P. Berrange
On Fri, Oct 17, 2008 at 11:51:51AM -0400, Ben Guthro wrote: > The following patch series implements the Events API discussed here > previously in this thread: > http://www.redhat.com/archives/libvir-list/2008-September/msg00321.html and > http://www.redhat.com/archives/libvir-list/2008-October/msg

[libvirt] Re: [PATCH 12/12] Domain Events - python

2008-10-17 Thread Ben Guthro
Add functions to be ignored, to prevent rpm build failures generator.py |3 +++ 1 file changed, 3 insertions(+) diff --git a/python/generator.py b/python/generator.py index c706b19..ca83eaf 100755 --- a/python/generator.py +++ b/python/generator.py @@ -332,6 +332,9 @@ skip_function = ( '

[libvirt] Re: [PATCH 11/12] Domain Events - test harness

2008-10-17 Thread Ben Guthro
Test app, and infrastructure changes for an example dir Makefile.am |2 configure.in |3 examples/domain-events/events-c/Makefile.am |5 examples/domain-events/events-c/event-test.c | 214 +++ l

[libvirt] Re: [PATCH 10/12] Domain Events - test driver

2008-10-17 Thread Ben Guthro
Minor changes to test driver structure to prevent compile errors test.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test.c b/src/test.c index aab74e4..9f40576 100644 --- a/src/test.c +++ b/src/test.c @@ -1552,6 +1552,9 @@ static virDriver testDriver = { NULL, /* domainMemory

[libvirt] Re: [PATCH 09/12] Domain Events - openvz driver

2008-10-17 Thread Ben Guthro
Minor changes to openvz driver structure to prevent compile errors openvz_driver.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/src/openvz_driver.c b/src/openvz_driver.c index b82d0df..56dfea1 100644 --- a/src/openvz_driver.c +++ b/src/openvz_driver.c @@ -1012,6 +1012,9 @@ static vir

[libvirt] Re: [PATCH 08/12] Domain Events - lxc driver

2008-10-17 Thread Ben Guthro
Minor changes to LXC driver structure to prevent compile errors lxc_driver.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lxc_driver.c b/src/lxc_driver.c index c598d1d..56e68fc 100644 --- a/src/lxc_driver.c +++ b/src/lxc_driver.c @@ -1278,6 +1278,9 @@ static virDriver lxcDriver =

[libvirt] Re: [PATCH 06/12] Domain Events - qemu driver

2008-10-17 Thread Ben Guthro
Register for, and dispatch domain event callbacks qemu_conf.h |3 ++ qemu_driver.c | 76 -- 2 files changed, 77 insertions(+), 2 deletions(-) diff --git a/src/qemu_conf.h b/src/qemu_conf.h index cfd7d35..d06c4d7 100644 --- a/src/q

[libvirt] Re: [PATCH 07/12] Domain Events - remote driver

2008-10-17 Thread Ben Guthro
Deliver local callbacks in response to remote events remote_internal.c | 255 -- 1 file changed, 248 insertions(+), 7 deletions(-) diff --git a/src/remote_internal.c b/src/remote_internal.c index 35b7b4b..13537f7 100644 --- a/src/remote_interna

[libvirt] Re: [PATCH 05/12] Domain Events - Driver API

2008-10-17 Thread Ben Guthro
Additions to the driver API driver.h | 19 +++ 1 file changed, 19 insertions(+) diff --git a/src/driver.h b/src/driver.h index 0540f80..c88dea8 100644 --- a/src/driver.h +++ b/src/driver.h @@ -280,6 +280,22 @@ typedef unsigned long long (*virDrvNodeGetFreeMemory)

[libvirt] Re: [PATCH 04/12] Domain Events - rpc changes

2008-10-17 Thread Ben Guthro
Changes to the RPC protocol remote_dispatch_localvars.h |3 +++ remote_dispatch_proc_switch.h | 18 ++ remote_dispatch_prototypes.h |3 +++ remote_protocol.c | 35 +++ remote_protocol.h | 28 +

[libvirt] Re: [PATCH 02/12] Domain Events - Internal API

2008-10-17 Thread Ben Guthro
This patch -Removes EventImpl from being a private function -Introduces the virDomainEventCallbackListPtr, and virDomainEventQueuePtr objects proxy/Makefile.am |1 src/event.c | 12 +- src/event.h | 37 --- src/internal.h| 63 ++

[libvirt] Re: [PATCH 03/12] Domain Events - daemon changes

2008-10-17 Thread Ben Guthro
This code changes the daemaon to: use the pulic def of virEventRegisterImpl Add functionality to dispatch events to connected remote drivers qemud.c | 28 --- qemud.h | 14 + remote.c | 158 +++ 3 files changed, 19

[libvirt] Re: [PATCH 01/12] Domain Events - Public API

2008-10-17 Thread Ben Guthro
This patch does the following: -implements the Event register/deregister code -Adds some callback lists, and queue functions used by drivers -Move EventImpl definitions into the public include/libvirt/libvirt.h| 59 + include/libvirt/libvirt.h.in | 59 + src/libv

[libvirt] [PATCH 00/12] Domain Events - Round 2

2008-10-17 Thread Ben Guthro
The following patch series implements the Events API discussed here previously in this thread: http://www.redhat.com/archives/libvir-list/2008-September/msg00321.html and http://www.redhat.com/archives/libvir-list/2008-October/msg00245.html By Daniel B's advice - I have broken this patch into the

Re: [libvirt] PATCH: 4/5: Locking in the LXC driver

2008-10-17 Thread Dan Smith
DB> You didn't read the previous mail in this sequence :-P Indeed. The temperamental mail servers have only graced me with 1, 4, and 5 so far. I should have checked the archives. Aside from the other issue, I'm fine with the patch :) Thanks! -- Dan Smith IBM Linux Technology Center Open Hype

Re: [libvirt] PATCH: 4/5: Locking in the LXC driver

2008-10-17 Thread Daniel P. Berrange
On Fri, Oct 17, 2008 at 07:53:06AM -0700, Dan Smith wrote: > DB> @@ -104,8 +117,12 @@ static virDomainPtr lxcDomainLookupByID( > DB> int id) > DB> { > DB> lxc_driver_t *driver = (lxc_driver_t *)conn->privateData; > DB> -virDomainObjPtr vm = virDoma

Re: [libvirt] PATCH: 4/5: Locking in the LXC driver

2008-10-17 Thread Dan Smith
DB> @@ -104,8 +117,12 @@ static virDomainPtr lxcDomainLookupByID( DB> int id) DB> { DB> lxc_driver_t *driver = (lxc_driver_t *)conn->privateData; DB> -virDomainObjPtr vm = virDomainFindByID(&driver->domains, id); DB> +virDomainObjPtr vm; DB>

Re: [libvirt] Question about supporting other hypervisor

2008-10-17 Thread Dan Smith
DV> The question really is is it a good interface ? In theory it DV> sounds like it could help us, but I wonder how that actually works DV> in practice. In practice, it's almost impossible to write a client that works with a given provider model (at more than a very basic level) without any a prio

[libvirt] [PATCH/RFC] qemu/kvm: allow to hot remove scsi/virtio disks

2008-10-17 Thread Guido Günther
On Fri, Oct 17, 2008 at 02:37:17PM +0200, Daniel Veillard wrote: [..snip..] > Looks fine, i just removed a couple of extra spaces at end of line > before commiting :-) Thanks a lot for applying this so quickly! Attached is a patch that allows for unplugging of disks. To do that I added a token t

Re: [libvirt] Question about supporting other hypervisor

2008-10-17 Thread Daniel P. Berrange
On Fri, Oct 17, 2008 at 04:06:12PM +0200, Daniel Veillard wrote: > On Fri, Oct 17, 2008 at 10:42:25AM +0100, Daniel P. Berrange wrote: > > > As a CIM Provider, libvirt-cim is going on. > > > But for CIM Client, Is not going on. > > > > > > Is there any reason for not supporting CIM on libvirt driv

Re: [libvirt] PATCH: 5/5: Locking for the virNetworkObjPtr instances

2008-10-17 Thread Daniel P. Berrange
This implements locking in the virNetworkObjPtr objects. This follows exactly the same model as the virDomainObjPtr locking. There still needs to be code in the network driver itself to make use of this locking, so this patch is a work in progress Daniel diff --git a/src/network_conf.c b/src/n

Re: [libvirt] Question about supporting other hypervisor

2008-10-17 Thread Daniel Veillard
On Fri, Oct 17, 2008 at 10:42:25AM +0100, Daniel P. Berrange wrote: > On Fri, Oct 17, 2008 at 09:38:35AM +0900, Atsushi SAKAI wrote: > > Hello, hi Atsushi, > > I have a simple question raised yesterday. I got your question spinning on the back of my head since this morning, but it's really h

Re: [libvirt] PATCH: 4/5: Locking in the LXC driver

2008-10-17 Thread Daniel P. Berrange
This implements the same logic as described for the QEMU driver, in the LXC driver & its API calls. The concurrency on this is already very good, since the LXC driver has no long running code by virtue of not having a 'monitor' console to interact with. Daniel diff --git a/src/lxc_conf.h b/src/l

Re: [libvirt] PATCH 2/4: implement getVersion method for openvz

2008-10-17 Thread Jim Meyering
"Daniel P. Berrange" <[EMAIL PROTECTED]> wrote: > This patch implements the getVersion driver method for openvz to report > the version number of vzctl. This is needed in the next patch to determine > if we have builtin support for bridges ... > diff -r 524f426a413d src/openvz_conf.c ACK -- Libvi

Re: [libvirt] PATCH: 3/5: Locking in the QEMU driver

2008-10-17 Thread Daniel P. Berrange
This patch makes use of the virDomainObjPtr locking infrastructure to provide thread safety in the QEMU driver. The QEMU driver itself gains a global lock. The idea is this lock is only held for short periods of time - typically only while obtaining a virDomainObjPtr instance. The main limitation

Re: [libvirt] PATCH 3/4: SUpport bridge config for openvz

2008-10-17 Thread Jim Meyering
"Daniel P. Berrange" <[EMAIL PROTECTED]> wrote: > This implements support for bridge configs in openvz following the rules > set out in > > http://wiki.openvz.org/Virtual_Ethernet_device#Making_a_bridged_veth-device_persistent > > This simply requires that the admin has created /etc/vz/vznetctl.con

Re: [libvirt] PATCH: 2/5: Locking on virDomainObjPtr objects

2008-10-17 Thread Daniel P. Berrange
This patch provides for locking of the virDomainObjPtr instances on a per object level, and defines locking semantics of the various API calls that use these objects. Since this locking only covers the individual objects, it is expected that the driver provide a higher level of locking around arr

Re: [libvirt] PATCH: 1/5: Don't pass driver object to QEMU monitor API

2008-10-17 Thread Daniel P. Berrange
We don't want to hold a lock on the driver object for the duration of each monitor call, and indeed we should not even need to use it. So this patch stops passing the driver object to the QEMU monitor API We're basically changing static int qemudMonitorCommand (const struct qemud_driver *driver,

[libvirt] PATCH: 0/5: Experimental patches for driver thread safety

2008-10-17 Thread Daniel P. Berrange
The following series of 5 patches implement basic thread safety for the QEMU, LXC and Network drivers. It does not address the OpenVZ or Test driver yet. The Xen driver is totally stateless so does not require changes - though I do need to verify there's no 'static' variables that are used in an un

Re: [libvirt] [PATCH/RFC] qemu: persist hotadd devices

2008-10-17 Thread Daniel Veillard
On Fri, Oct 17, 2008 at 10:58:32AM +0100, Daniel P. Berrange wrote: > On Fri, Oct 17, 2008 at 09:50:35AM +0200, Guido G?nther wrote: > > Hi, > > currently devices added via qemudDomainAttachDevice don't ever get > > written out into the xml domain definition. Is this intentional? > > Yes, because

Re: [libvirt] [PATCH] qemu/kvm: allow to hotadd scsi/virtio disks

2008-10-17 Thread Daniel Veillard
On Fri, Oct 17, 2008 at 12:41:14PM +0200, Guido Günther wrote: > On Fri, Oct 17, 2008 at 11:05:50AM +0100, Daniel P. Berrange wrote: > > On Fri, Oct 17, 2008 at 09:48:58AM +0200, Guido G?nther wrote: > > > Hi, > > > recent kvm allows to hot add scsi/virtio disks, it uses pci hotplugging > > > for t

Re: [libvirt] PATCH: Adjust way RPC calls are dispatched in libvirtd

2008-10-17 Thread Daniel Veillard
On Fri, Oct 17, 2008 at 11:39:40AM +0100, Daniel P. Berrange wrote: > Looking at the libvirtd objects with pfunct I knoticed that the method > remoteDispatchClientRequest in remote.c was unusually large > > size: 11497, variables: 169, inline expansions: 159 (5144 bytes) > > Listing variables p

[libvirt] [PATCH] Makefile.maint (sync-vcs-ignore-files): avoid risk of abuse

2008-10-17 Thread Jim Meyering
As I wrote the original version of that rule, I realized that running it in the presence of a maliciously named sub-directory containing a .cvsignore file could result in arbitrary damage. This fixes it at the expense of embedding a Perl script in the Makefile. Rather ugly, when you take into acc

Re: [libvirt] PATCH: Remove linked list of clients in favour of an array

2008-10-17 Thread Daniel Veillard
On Fri, Oct 17, 2008 at 11:51:42AM +0100, Daniel P. Berrange wrote: > More preparation for multi-thread support, this time in the libvirtd > daemon. This removes the embedded linked list of 'struct qemud_client' > and replaces it with an explicit array of pointers of client objects. > This makes pe

Re: [libvirt] PATCH: 2/2: Make threading level configurable

2008-10-17 Thread Daniel P. Berrange
This patch adds 3 new configuration variables to allow the number of threads to be tuned, and also to limit the number of server connections from clients. # The maximum number of concurrent client connections to allow # over all sockets combined. # max_clients = 20 # The minimum limit sets the n

[libvirt] PATCH: 0/2: Multi-thread support for libvirtd daemon

2008-10-17 Thread Daniel P. Berrange
These two patches add support for making the libvirtd daemon multithreaded in its dispatch of client requests. Any single client still has all its requests serialized - since a virConnectPtr instance is only allowed to be used from a single thread. Multiple clients though can now be processed in pa

Re: [libvirt] PATCH: Adjust way RPC calls are dispatched in libvirtd

2008-10-17 Thread Richard W.M. Jones
On Fri, Oct 17, 2008 at 12:08:59PM +0100, Daniel P. Berrange wrote: > Yeah, I'd hope it would, but it doesn't appear to actually do that > in practice, though I could be mis-reading the asm output. Bug in GCC! Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones

Re: [libvirt] PATCH: Adjust way RPC calls are dispatched in libvirtd

2008-10-17 Thread Daniel P. Berrange
On Fri, Oct 17, 2008 at 12:01:36PM +0100, Richard W.M. Jones wrote: > On Fri, Oct 17, 2008 at 11:39:40AM +0100, Daniel P. Berrange wrote: > > Looking at the libvirtd objects with pfunct I knoticed that the method > > remoteDispatchClientRequest in remote.c was unusually large > > > > size: 11497

Re: [libvirt] PATCH: Adjust way RPC calls are dispatched in libvirtd

2008-10-17 Thread Richard W.M. Jones
On Fri, Oct 17, 2008 at 11:39:40AM +0100, Daniel P. Berrange wrote: > Looking at the libvirtd objects with pfunct I knoticed that the method > remoteDispatchClientRequest in remote.c was unusually large > > size: 11497, variables: 169, inline expansions: 159 (5144 bytes) > > Listing variables p

[libvirt] PATCH: Remove linked list of clients in favour of an array

2008-10-17 Thread Daniel P. Berrange
More preparation for multi-thread support, this time in the libvirtd daemon. This removes the embedded linked list of 'struct qemud_client' and replaces it with an explicit array of pointers of client objects. This makes per-client locking more practical in a patch to follow. This touches suprising

[libvirt] [PATCH] minor usb masstorage hotadd cleanup

2008-10-17 Thread Guido Günther
Hi, this just brings qemudDomainAttachUsbMassstorageDevice in line with the rest of the code: * don't allow to add the same target device name more than once * escape paths for qemu's monitor command Cheers, -- Guido >From e8a83a21642c78f22c80750b280c67fb9a7e0c06 Mon Sep 17 00:00:00 2001 From: G

Re: [libvirt] [PATCH] qemu/kvm: allow to hotadd scsi/virtio disks

2008-10-17 Thread Guido Günther
On Fri, Oct 17, 2008 at 11:05:50AM +0100, Daniel P. Berrange wrote: > On Fri, Oct 17, 2008 at 09:48:58AM +0200, Guido G?nther wrote: > > Hi, > > recent kvm allows to hot add scsi/virtio disks, it uses pci hotplugging > > for that. Attached patch adds support for this to libvirt. > > Great, I didn'

Re: [libvirt] [PATCH] qemu/kvm: allow to hotadd scsi/virtio disks

2008-10-17 Thread Daniel P. Berrange
On Fri, Oct 17, 2008 at 09:48:58AM +0200, Guido G?nther wrote: > Hi, > recent kvm allows to hot add scsi/virtio disks, it uses pci hotplugging > for that. Attached patch adds support for this to libvirt. Great, I didn't know SCSI allowed hotplug in QEMU. ACK to the patch. Daniel -- |: Red Hat,

Re: [libvirt] Re: [PATCH] Add .gitignore files

2008-10-17 Thread Jim Meyering
Jim Meyering <[EMAIL PROTECTED]> wrote: > James Morris <[EMAIL PROTECTED]> wrote: >> I haven't seen these patches go in upstream. Any chance of having them >> committed so I don't have to carry them locally ? > > If they can be automatically generated from the .cvsignore ones, then how > about ad

Re: [libvirt] [PATCH/RFC] qemu: persist hotadd devices

2008-10-17 Thread Daniel P. Berrange
On Fri, Oct 17, 2008 at 09:50:35AM +0200, Guido G?nther wrote: > Hi, > currently devices added via qemudDomainAttachDevice don't ever get > written out into the xml domain definition. Is this intentional? Yes, because it allows mgmt app to decide whether they want the device to be persist, or tra

Re: [libvirt] [PATCH] Couple of patches to fix remote connections from Windows

2008-10-17 Thread Daniel Veillard
On Tue, Oct 14, 2008 at 04:25:38PM +0100, Richard W.M. Jones wrote: > There's a mistake in the way drivers are registered which means that > if libvirt is configured with the remote driver but without libvirtd, > then the remote driver is compiled in but not registered, which means > it doesn't wor

Re: [libvirt] Question about supporting other hypervisor

2008-10-17 Thread Daniel P. Berrange
On Fri, Oct 17, 2008 at 09:38:35AM +0900, Atsushi SAKAI wrote: > Hello, > > I have a simple question raised yesterday. > > CIM(Common Information Model) is a kind of good I/F > (to support VMware, Hyper-V and other platform). > > As a CIM Provider, libvirt-cim is going on. > But for CIM Client,

Re: [libvirt] Re: [PATCH 3/3] qemu: fix block stats for virtio and scsi

2008-10-17 Thread Daniel Veillard
On Thu, Oct 16, 2008 at 05:29:58PM +0200, Guido Günther wrote: > On Tue, Oct 14, 2008 at 09:29:38AM -0400, Cole Robinson wrote: > > Guido Günther wrote: > > > On Fri, Oct 10, 2008 at 06:05:37PM +0100, Daniel P. Berrange wrote: > > >> Sorry to mess up your patch, but I just committed the code to tur

Re: [libvirt] [PATCH 2/3] qemu: fix block stats for virtio and scsi

2008-10-17 Thread Daniel Veillard
On Fri, Oct 10, 2008 at 05:27:24PM +0200, Guido Günther wrote: > Hi, > qemuDiskDeviceName treat's all IDE and SCSI devices as cdroms, make it > also handle disks. Make funcion arguments const. Applied too to CVS, thanks ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit ht

Re: [libvirt] [PATCH 1/3] qemu: fix block stats for virtio and scsi

2008-10-17 Thread Daniel Veillard
On Fri, Oct 10, 2008 at 05:25:28PM +0200, Guido Günther wrote: > Hi, > 0 looks like a valid index as returned by virDiskNameToIndex, so we > should accept it. Also the disk argument can be const. Okidoc, applied, thanks ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit ht

[libvirt] [PATCH/RFC] qemu: persist hotadd devices

2008-10-17 Thread Guido Günther
Hi, currently devices added via qemudDomainAttachDevice don't ever get written out into the xml domain definition. Is this intentional? Attached patch calls virDomainSaveConfig to fix this. -- Guido >From 42142a2ecb04a26f867d030fb986fcee2b7a05b9 Mon Sep 17 00:00:00 2001 From: Guido Guenther <[EMAI

[libvirt] [PATCH] qemu/kvm: allow to hotadd scsi/virtio disks

2008-10-17 Thread Guido Günther
Hi, recent kvm allows to hot add scsi/virtio disks, it uses pci hotplugging for that. Attached patch adds support for this to libvirt. -- Guido >From 56d179adeb04d47ef8f3557702948976e3b5cbea Mon Sep 17 00:00:00 2001 From: Guido Guenther <[EMAIL PROTECTED]> Date: Thu, 16 Oct 2008 18:15:04 +0200 Sub