Re: [Libvir] Please check my autoconf libvirt.m4

2007-05-23 Thread Richard W.M. Jones
Thanks Jim, Dan. Discussing this has clarified my thinking on this a lot. Originally I wanted to test whether a particular instance of libvirt had support for the remote driver. Since the drivers don't usually export symbols directly from the library, it seemed that what I needed was a versi

Re: [Libvir] Please check my autoconf libvirt.m4

2007-05-23 Thread Jim Meyering
"Richard W.M. Jones" <[EMAIL PROTECTED]> wrote: > Attached is an autoconf snippet which allows you to check that the > libvirt library is installed (not necessarily development headers > though) and check the version number. > > If any autoconf experts (hello, Mark) would like to check it makes > s

Re: [Libvir] Please check my autoconf libvirt.m4

2007-05-23 Thread Daniel P. Berrange
On Wed, May 23, 2007 at 07:13:05PM +0100, Richard W.M. Jones wrote: > Daniel P. Berrange wrote: > >On Wed, May 23, 2007 at 06:31:19PM +0100, Richard W.M. Jones wrote: > >>Richard W.M. Jones wrote: > >>>Attached is an autoconf snippet which allows you to check that the > >>>libvirt library is insta

Re: [Libvir] Please check my autoconf libvirt.m4

2007-05-23 Thread Richard W.M. Jones
Daniel P. Berrange wrote: On Wed, May 23, 2007 at 06:31:19PM +0100, Richard W.M. Jones wrote: Richard W.M. Jones wrote: Attached is an autoconf snippet which allows you to check that the libvirt library is installed (not necessarily development headers though) and check the version number. I

Re: [Libvir] Please check my autoconf libvirt.m4

2007-05-23 Thread Daniel P. Berrange
On Wed, May 23, 2007 at 06:31:19PM +0100, Richard W.M. Jones wrote: > Richard W.M. Jones wrote: > >Attached is an autoconf snippet which allows you to check that the > >libvirt library is installed (not necessarily development headers > >though) and check the version number. > > > >If any autocon

Re: [Libvir] Please check my autoconf libvirt.m4

2007-05-23 Thread Richard W.M. Jones
Richard W.M. Jones wrote: Attached is an autoconf snippet which allows you to check that the libvirt library is installed (not necessarily development headers though) and check the version number. If any autoconf experts (hello, Mark) would like to check it makes sense, that'd be great. I s

[Libvir] Please check my autoconf libvirt.m4

2007-05-23 Thread Richard W.M. Jones
Attached is an autoconf snippet which allows you to check that the libvirt library is installed (not necessarily development headers though) and check the version number. If any autoconf experts (hello, Mark) would like to check it makes sense, that'd be great. Rich. -- Emerging Technologie

Re: [Libvir] [PATCH] Add Python binding for virGetVersion

2007-05-23 Thread Richard W.M. Jones
Richard W.M. Jones wrote: Daniel P. Berrange wrote: On Wed, May 23, 2007 at 03:58:02PM +0100, Richard W.M. Jones wrote: This patch adds a Python binding for the virGetVersion call (called libvirt.getVersion). Looks good to me. Actually, it contains a subtle error. Improved patch coming up

Re: [Libvir] [PATCH] Add Python binding for virGetVersion

2007-05-23 Thread Richard W.M. Jones
Daniel P. Berrange wrote: On Wed, May 23, 2007 at 03:58:02PM +0100, Richard W.M. Jones wrote: This patch adds a Python binding for the virGetVersion call (called libvirt.getVersion). Looks good to me. Actually, it contains a subtle error. Improved patch coming up ... Rich. -- Emerging Tec

Re: [Libvir] [PATCH] Add Python binding for virGetVersion

2007-05-23 Thread Daniel P. Berrange
On Wed, May 23, 2007 at 03:58:02PM +0100, Richard W.M. Jones wrote: > This patch adds a Python binding for the virGetVersion call (called > libvirt.getVersion). Looks good to me. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: ht

Re: [Libvir] [PATCH] Device attach/detach on virsh(XML version)

2007-05-23 Thread Richard W.M. Jones
Masayuki: I have applied this patch to CVS. Thanks for your contribution to libvirt. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in E

[Libvir] [PATCH] Add Python binding for virGetVersion

2007-05-23 Thread Richard W.M. Jones
This patch adds a Python binding for the virGetVersion call (called libvirt.getVersion). $ python Python 2.4.4 (#1, Oct 23 2006, 13:58:18) [GCC 4.1.1 20061011 (Red Hat 4.1.1-30)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import libvirt; >>> libvirt.getV

Re: [Libvir] Question on acquiring cpuTime in struct _virDomainInfo

2007-05-23 Thread Daniel P. Berrange
On Wed, May 23, 2007 at 02:35:47PM +0200, Jan Michael wrote: > In the described stress situation it tooks about an average of 4 > seconds to make the following to function calls, which provide me the > cpuTime of a domain > > dom_old = virDomainLookupByID(conn_old, listOfDomains[i]

Re: [Libvir] Question on acquiring cpuTime in struct _virDomainInfo

2007-05-23 Thread Jan Michael
Hi Daniel, thanks for confirming that I'm on the right way. But I still experience problems with a heavily stressed node. Let me first explain my current node setup: release: 2.6.18-1.2835.slc4xen version: #1 SMP Wed Nov 29 21:05:58 CET 2006

Re: [Libvir] [PATCH] Device attach/detach on virsh(XML version)

2007-05-23 Thread Richard W.M. Jones
OK, here we go ... Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903 Index: src/

Re: [Libvir] [PATCH] Device attach/detach on virsh(XML version)

2007-05-23 Thread Mark McLoughlin
On Wed, 2007-05-23 at 17:52 +0900, Atsushi SAKAI wrote: > Hi, > > I also agree garbage collection. > Anyway, this kind of problem should be checked by valgrind. The only way to test code paths like this is to set up a test harness which will re-run the code over and over, with a malloc()

Re: [Libvir] [PATCH] Device attach/detach on virsh(XML version)

2007-05-23 Thread Mark McLoughlin
On Wed, 2007-05-23 at 09:51 +0100, Richard W.M. Jones wrote: > +oldbuffer = buffer; > +buffer = realloc (buffer, len+1); > +if (buffer == NULL) goto out_of_memory; Missed it here too. Cheers, Mark. -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mai

Re: [Libvir] [PATCH] Device attach/detach on virsh(XML version)

2007-05-23 Thread Mark McLoughlin
Hi Rich, On Tue, 2007-05-22 at 15:10 +0100, Richard W.M. Jones wrote: > +static char * > +readFile (vshControl *ctl, const char *filename) > +{ > +char *buffer = NULL, *oldbuffer; > +int len = 0, fd, r; > +char b[1024]; > + > +fd = open (filename, O_RDONLY); > +if (fd == -1) {

Re: [Libvir] [PATCH] Device attach/detach on virsh(XML version)

2007-05-23 Thread Atsushi SAKAI
Hi, I also agree garbage collection. Anyway, this kind of problem should be checked by valgrind. Thanks Atsushi SAKAI "Richard W.M. Jones" <[EMAIL PROTECTED]> wrote: > Mark McLoughlin wrote: > > On Tue, 2007-05-22 at 15:16 +0100, Richard W.M. Jones wrote: > >> Richard W.M. Jones wrote: > >>>

Re: [Libvir] [PATCH] Device attach/detach on virsh(XML version)

2007-05-23 Thread Richard W.M. Jones
OK, here we go with an updated patch. I think this should go in. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales unde

Re: [Libvir] [PATCH] Device attach/detach on virsh(XML version)

2007-05-23 Thread Richard W.M. Jones
Mark McLoughlin wrote: On Tue, 2007-05-22 at 15:16 +0100, Richard W.M. Jones wrote: Richard W.M. Jones wrote: +buffer = realloc (buffer, len+1); +if (buffer == NULL) goto out_of_memory; Note, if realloc() fails, the original buffer isn't freed. So, you want to make sure you fr

Re: [Libvir] [PATCH] Device attach/detach on virsh(XML version)

2007-05-23 Thread Mark McLoughlin
On Tue, 2007-05-22 at 15:16 +0100, Richard W.M. Jones wrote: > Richard W.M. Jones wrote: > > +buffer = realloc (buffer, len+1); > > +if (buffer == NULL) goto out_of_memory; Note, if realloc() fails, the original buffer isn't freed. So, you want to make sure you free the original on