[libvirt] Storage api problem

2008-05-22 Thread sarveswara rao mygapula
Hi, I am just trying to use libvirt storage api from python terminal, and i am getting the following error. >>> import libvirt >>> con = libvirt.open() >>> con.numOfDefinedStoragePools() libvir: Remote error : Broken pipe Traceback (most recent call last): File "", line 1, in File "/usr/lib/

Re: [libvirt] PATCH: Misc fixes to qparams

2008-05-22 Thread Daniel P. Berrange
On Thu, May 22, 2008 at 05:51:56PM +0100, Richard W.M. Jones wrote: > On Thu, May 22, 2008 at 12:49:04AM +0100, Daniel P. Berrange wrote: > > - In the qparam_query_parse() method, after appending each (name,value) > >pair of params, it failed to free the temporary buffers for the > >(name

Re: [libvirt] PATCH: Clean up QEMU driver argv builder

2008-05-22 Thread Daniel P. Berrange
On Thu, May 22, 2008 at 07:00:50PM -0400, Daniel Veillard wrote: > On Thu, May 22, 2008 at 05:34:19PM +0100, Daniel P. Berrange wrote: > > Daniel pointed out that the way we build up the QEMU argv strnig is becoming > > rather unscalable / error prone. This patch refactors it into to use a short >

Re: [libvirt] PATCH: Clean up QEMU driver argv builder

2008-05-22 Thread Daniel Veillard
On Thu, May 22, 2008 at 05:34:19PM +0100, Daniel P. Berrange wrote: > Daniel pointed out that the way we build up the QEMU argv strnig is becoming > rather unscalable / error prone. This patch refactors it into to use a short > macro to do memory allocation/reallocation, which clears it up quite ni

[libvirt] Switch to using lcov for test coverage reports

2008-05-22 Thread Daniel P. Berrange
I got fed up trying to figure out how to fix the coverage reports to merge data from multiple runs correctly, so this patch rips out all our test coverage support. In its place is a makefile rule which just calls out to the lcov program. It requires lcov >= 1.6 since earlier versions were too dum

Re: [libvirt] Compilation error (storageRegister)

2008-05-22 Thread Daniel P. Berrange
On Thu, May 22, 2008 at 10:40:10PM +0200, Stefan de Konink wrote: > Stefan de Konink schreef: > >./configure --prefix=/usr --with-xen --without-sasl --without-avahi > >--without-test --without-libvirtd --sysconfdir=/etc --localstatedir=/var > >--without-qemu --without-storage-lvm --without-storag

Re: [libvirt] Compilation error (storageRegister)

2008-05-22 Thread Stefan de Konink
Stefan de Konink schreef: ./configure --prefix=/usr --with-xen --without-sasl --without-avahi --without-test --without-libvirtd --sysconfdir=/etc --localstatedir=/var --without-qemu --without-storage-lvm --without-storage-iscsi I guess the without-libvirtd 'breaks' it. Stefan -- Libvir-list

[libvirt] Compilation error (storageRegister)

2008-05-22 Thread Stefan de Konink
./configure --prefix=/usr --with-xen --without-sasl --without-avahi --without-test --without-libvirtd --sysconfdir=/etc --localstatedir=/var --without-qemu --without-storage-lvm --without-storage-iscsi gcc -DUSE_READLINE -g -O2 -Wall -Wformat -Wformat-security -Wmissing-prototypes -Wnested-ext

[libvirt] [PATCH] plug two sound-related leaks

2008-05-22 Thread Jim Meyering
This fixes the sole remaining leak exposed by "make check" vs. valgrind. Actually it fixes two leaks, but the duplicate sound string one isn't triggered by the tests. >From 495abbe5adcb27187f4831a67f0821d62f36602e Mon Sep 17 00:00:00 2001 From: Jim Meyering <[EMAIL PROTECTED]> Date: Thu, 22 May 20

[libvirt] How to solve the runtime error: "libvir: Remote error : unknown procedure: 72"?

2008-05-22 Thread Amudhan Gunasekaran
Hi, I am getting the above said runtime error (libvir: Remote error : unknown procedure: 72) when I ran a program using the api virConnectListStoragePools. I googled but I could not get any solution. Please help me solve the issue. Thanks and Regards, Amudhan. -- Libvir-list mailing list Libv

Re: [libvirt] PATCH: Fix a small bug in rpcgen_fix.pl script

2008-05-22 Thread Daniel P. Berrange
On Thu, May 22, 2008 at 06:47:05PM +0100, Richard W.M. Jones wrote: > > There's a warning about type-punning in CVS libvirt. > > We normally rewrite the code generated by glibc rpcgen to avoid these > warnings, but because the variable in question has a name containing > an uppercase letter, and

Re: [libvirt] PATCH [2/2]: Deprecate conn, dom, net fields in struct _virError

2008-05-22 Thread Daniel P. Berrange
ACK. I've just noticed the QEMU driver does ever fill in the dom or net fields at all, and we know the remote driver doesn't either. Dan -- |: Red Hat, Engineering, Boston -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |

Re: [libvirt] PATCH [1/2]: Use internal.h consistently everywhere

2008-05-22 Thread Daniel P. Berrange
On Thu, May 22, 2008 at 06:42:21PM +0100, Richard W.M. Jones wrote: > > One thing to note about this patch is that qemud/internal.h has been > renamed to qemud/qemud.h. ACK, this all looks very sensible. I should never have named that file qemud/internal.h in the first place. Dunno what i was thi

[libvirt] PATCH: Convert buf.c to use memory alloc wrappers

2008-05-22 Thread Daniel P. Berrange
This patch coverts the virBuffer code over to using our internal memory allocation wrappers. It then fixes a bug in xend_internal.c where it was failing to check for allocation failure, although this was technically completely harmless, since the virBuffer routines already protected against this s

[libvirt] PATCH: Fix a small bug in rpcgen_fix.pl script

2008-05-22 Thread Richard W.M. Jones
There's a warning about type-punning in CVS libvirt. We normally rewrite the code generated by glibc rpcgen to avoid these warnings, but because the variable in question has a name containing an uppercase letter, and because the regexp we're using is case-sensitive and only matches lowercase iden

[libvirt] PATCH [2/2]: Deprecate conn, dom, net fields in struct _virError

2008-05-22 Thread Richard W.M. Jones
-- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v Index: include/libvirt/libvirt.h.in ===

[libvirt] PATCH [1/2]: Use internal.h consistently everywhere

2008-05-22 Thread Richard W.M. Jones
One thing to note about this patch is that qemud/internal.h has been renamed to qemud/qemud.h. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats

[libvirt] PATCH [0/2]: Deprecate conn, dom, net virterror fields

2008-05-22 Thread Richard W.M. Jones
This is a pair of patches which deprecate the conn, dom and net fields in the virterror structure. Programs which use these fields will get a warning (if compiled under gcc anyway): foo.c:123: warning: 'dom' is deprecated (declared at /usr/include/libvirt/virterror.h:81) The fields themselves

Re: [libvirt] PATCH: 4/4: Switch many testcases to OOM checking APIs

2008-05-22 Thread Daniel P. Berrange
This switches over a number of the test cases to make use of the new virTestMain() function and thus gain support for allocation checking So you can now actually see some checks when running VIR_TEST_OOM=1 make check Oh, and for added fun you can check if there are any leaks in the cleanu

Re: [libvirt] PATCH: 3/4: Fix some memory allocation bugs

2008-05-22 Thread Daniel P. Berrange
The capabilities.c file was not checking for NULL pointers when cleaning up after some failed allocations, and so deferencing a NULL. The qparams.c file was not calling virRaiseError upon failure so there wasn't any indication of why it failed The qemu_conf.c file was not free'ing the sound card

Re: [libvirt] PATCH: 2/4: Generic test script infrastructure

2008-05-22 Thread Daniel P. Berrange
This patch adds more helper functions to the tests/testutils.c file which make it trivial to verify OOM handling in our test suites. It provides a virtTestMain() function which is the main driver. This is given the original argc, argv and a function callback representing the test suite to run. N

Re: [libvirt] PATCH: Clean up QEMU driver argv builder

2008-05-22 Thread Jim Meyering
"Daniel P. Berrange" <[EMAIL PROTECTED]> wrote: > Daniel pointed out that the way we build up the QEMU argv strnig is becoming > rather unscalable / error prone. This patch refactors it into to use a short > macro to do memory allocation/reallocation, which clears it up quite nicely > > qemu_conf.

Re: [libvirt] PATCH: 1/4: Add OOM hooks to the memory allocator

2008-05-22 Thread Daniel P. Berrange
This patch adds extra code to src/memory.c which allows us to force an OOM condition on specific allocations. This is not code you *ever* want to use in a production build, so its all conditional on TEST_OOM, which is enabled by passing --enable-test-oom to the configure script. The hooks work as

[libvirt] PATCH: 0/4: Add out-of-memory validation to the testsuite

2008-05-22 Thread Daniel P. Berrange
The following series of patches add infrastructure neccessary to let us test OOM handling for any libvirt code using our malloc wrappers. Currently only a few places use this, but as this series will show, it already lets us find several bugs. As we convert more code away from malloc to VIR_MALLOC

Re: [libvirt] Dom0 Interface stats with virDomainInterfaceStats

2008-05-22 Thread Richard W.M. Jones
On Thu, May 22, 2008 at 02:53:31AM +0200, Stefan de Konink wrote: > Would it be possible to enable fetch of the interface stats of the dom0 via > the API? I wonder if you mean remotely? Anyway, it's not possible with libvirt, but in general Linux you can always get the "dom0 network stats" by ju

Re: [libvirt] PATCH: Misc fixes to qparams

2008-05-22 Thread Richard W.M. Jones
On Thu, May 22, 2008 at 12:49:04AM +0100, Daniel P. Berrange wrote: > - In the qparam_query_parse() method, after appending each (name,value) >pair of params, it failed to free the temporary buffers for the >(name,value) pair. > - Did not allow for ';' as a valid query parameter separato

[libvirt] PATCH: Clean up QEMU driver argv builder

2008-05-22 Thread Daniel P. Berrange
Daniel pointed out that the way we build up the QEMU argv strnig is becoming rather unscalable / error prone. This patch refactors it into to use a short macro to do memory allocation/reallocation, which clears it up quite nicely qemu_conf.c | 293 +++-

Re: [libvirt] PATCH: Support initial boot time CPU affinity mask

2008-05-22 Thread Daniel P. Berrange
On Wed, May 21, 2008 at 11:33:33AM -0400, Daniel Veillard wrote: > On Fri, May 16, 2008 at 10:50:20PM +0100, Daniel P. Berrange wrote: > > +/* Extract domain vcpu info */ > > +obj = xmlXPathEval(BAD_CAST "string(/domain/vcpu[1]/@cpuset)", ctxt); > > +if ((obj == NULL) || (obj->type != X

Re: [libvirt] Dom0 Interface stats with virDomainInterfaceStats

2008-05-22 Thread Stefan de Konink
Daniel P. Berrange schreef: On Thu, May 22, 2008 at 04:10:22AM -0400, Daniel Veillard wrote: On Thu, May 22, 2008 at 02:53:31AM +0200, Stefan de Konink wrote: Would it be possible to enable fetch of the interface stats of the dom0 via the API? It sounds a bit Xen specific, but I see no reaso

Re: [libvirt] PATCH: Support vCPU pinning in QEMU driver

2008-05-22 Thread Daniel P. Berrange
On Wed, May 21, 2008 at 10:59:28AM -0400, Daniel Veillard wrote: > On Fri, May 16, 2008 at 10:47:40PM +0100, Daniel P. Berrange wrote: > > KVM added ability to get the thread ID for vCPUs via the monitor > > > > (qemu) info cpus > > * CPU #0: pc=0x0000 thread_id=11463 > > CPU #1: pc=

Re: [libvirt] PATCH: Remove duplicate messages in configure.ac

2008-05-22 Thread Daniel P. Berrange
On Thu, May 22, 2008 at 11:21:30AM +0200, Jim Meyering wrote: > "Daniel P. Berrange" <[EMAIL PROTECTED]> wrote: > > Another configure.ac cleanup, this time removing a bunch of duplicated > > messages printed out by various checks. Applies ontop of the previous > > patch. > ... > > Looks good. Tha

Re: [libvirt] PATCH: Ensure configure.ac is fully quoted

2008-05-22 Thread Daniel P. Berrange
On Thu, May 22, 2008 at 10:54:35AM +0200, Jim Meyering wrote: > "Daniel P. Berrange" <[EMAIL PROTECTED]> wrote: > > As suggested by Jim, this patch goes through the configure script and makes > > sure all args to macros are fully quoted. NB, this applies on top of the > > NUMA/cpu pinning patches I

Re: [libvirt] PATCH: Add NUMA info to QEMU driver

2008-05-22 Thread Daniel P. Berrange
On Tue, May 20, 2008 at 05:01:31PM +0100, Daniel P. Berrange wrote: > On Tue, May 20, 2008 at 02:15:59PM +0200, Jim Meyering wrote: > > "Daniel P. Berrange" <[EMAIL PROTECTED]> wrote: > > > This patch includes NUMA topology info in the QEMU driver capabilities > > > XML output. It also implements t

Re: [libvirt] PATCH: Add NUMA apis to remote driver

2008-05-22 Thread Daniel P. Berrange
On Wed, May 21, 2008 at 05:18:49PM +0200, Jim Meyering wrote: > "Richard W.M. Jones" <[EMAIL PROTECTED]> wrote: > > On Tue, May 20, 2008 at 03:51:53PM +0100, Daniel P. Berrange wrote: > >> +if GLIBC_RPCGEN > >> + mv $@ [EMAIL PROTECTED] > >> + sed -e 's/\t//g' [EMAIL PROTECTED] > $@ > >>

Re: [libvirt] PATCH: Fix some more memory leaks

2008-05-22 Thread Daniel P. Berrange
On Thu, May 22, 2008 at 11:13:31AM +0200, Jim Meyering wrote: > > -if (r == -1) return -1; > > +if (r == -1) { > > +virDomainFree (dom); > > +return -1; > > +} > > +virDomainFree (dom); > > Here, you can call virDomainFree just once, before the "if", regardless. I'

Re: [libvirt] PATCH: Support vCPU pinning in QEMU driver

2008-05-22 Thread Daniel Veillard
On Wed, May 21, 2008 at 04:30:02PM +0100, Daniel P. Berrange wrote: > On Wed, May 21, 2008 at 10:59:28AM -0400, Daniel Veillard wrote: > > On Fri, May 16, 2008 at 10:47:40PM +0100, Daniel P. Berrange wrote: > > > If the KVM instance does not support the 'thread_id' data in 'info cpus', > > > we sim

Re: [libvirt] [PATCH] Domain/Net object cleanups after remote error

2008-05-22 Thread Jim Meyering
"Richard W.M. Jones" <[EMAIL PROTECTED]> wrote: > On Tue, May 20, 2008 at 03:38:01PM +0100, Daniel P. Berrange wrote: >> So I vote for applying all Cole's patches which do indeed fix a number >> of memory leaks. Fixing the daemon to correctly serialize errors with >> a dom/net object can be done l

Re: [libvirt] PATCH: Misc fixes to qparams

2008-05-22 Thread Daniel P. Berrange
On Thu, May 22, 2008 at 08:57:04AM -0400, Daniel Veillard wrote: > On Thu, May 22, 2008 at 12:49:04AM +0100, Daniel P. Berrange wrote: > > I found a couple more small bugs in the qparams code > > > > - In the qparam_query_parse() method, after appending each (name,value) > >pair of params, it

Re: [libvirt] PATCH: Misc fixes to qparams

2008-05-22 Thread Daniel Veillard
On Thu, May 22, 2008 at 12:49:04AM +0100, Daniel P. Berrange wrote: > I found a couple more small bugs in the qparams code > > - In the qparam_query_parse() method, after appending each (name,value) >pair of params, it failed to free the temporary buffers for the >(name,value) pair. > -

Re: [libvirt] Problems in using Storage APIs in libvirt

2008-05-22 Thread Amudhan Gunasekaran
Hi, I have got the problem solved. I could now compile the code using Storage APIs also. But I run them I am getting error message: "libvir: Remote error : unknown procedure: 72" The API I used is: virConnectListStoragePools What is the problem here? How could I solve this. My OS is SLES 10 sp

Re: [libvirt] Problem in attaching a interface to a domain

2008-05-22 Thread Daniel P. Berrange
On Thu, May 22, 2008 at 12:18:18PM +0530, sarveswara rao mygapula wrote: > Hello, > > I am facing problems in creating a network bridge using libvirt. My > requirement is, i need to create a bridge on the host machine. The bridge > shd get ip address from dhcp server(instead of static). I am not g

Re: [libvirt] Dom0 Interface stats with virDomainInterfaceStats

2008-05-22 Thread Daniel P. Berrange
On Thu, May 22, 2008 at 04:10:22AM -0400, Daniel Veillard wrote: > On Thu, May 22, 2008 at 02:53:31AM +0200, Stefan de Konink wrote: > > Would it be possible to enable fetch of the interface stats of the dom0 > > via the API? > > It sounds a bit Xen specific, but I see no reason why this should

Re: [libvirt] PATCH: Ensure configure.ac is fully quoted

2008-05-22 Thread Daniel P. Berrange
On Thu, May 22, 2008 at 10:54:35AM +0200, Jim Meyering wrote: > "Daniel P. Berrange" <[EMAIL PROTECTED]> wrote: > > As suggested by Jim, this patch goes through the configure script and makes > > sure all args to macros are fully quoted. NB, this applies on top of the > > NUMA/cpu pinning patches I

Re: [libvirt] PATCH: Fix some more memory leaks

2008-05-22 Thread Daniel P. Berrange
On Thu, May 22, 2008 at 11:13:31AM +0200, Jim Meyering wrote: > "Daniel P. Berrange" <[EMAIL PROTECTED]> wrote: > > While testing Cole's series of patches I identified a couple more places > > where we leak memory. > > > > In libvirt.c, the default authentication callback uses uninitialized > > dat

Re: [libvirt] PATCH: Misc fixes to qparams

2008-05-22 Thread Jim Meyering
"Daniel P. Berrange" <[EMAIL PROTECTED]> wrote: > I found a couple more small bugs in the qparams code > > - In the qparam_query_parse() method, after appending each (name,value) >pair of params, it failed to free the temporary buffers for the >(name,value) pair. > - Did not allow for ';

Re: [libvirt] PATCH: Remove duplicate messages in configure.ac

2008-05-22 Thread Jim Meyering
"Daniel P. Berrange" <[EMAIL PROTECTED]> wrote: > Another configure.ac cleanup, this time removing a bunch of duplicated > messages printed out by various checks. Applies ontop of the previous > patch. ... Looks good. Thanks! > -...AC_MSG_ERROR(We need mount for FS storage driver) ; fi > +

Re: [libvirt] PATCH: Fix some more memory leaks

2008-05-22 Thread Jim Meyering
"Daniel P. Berrange" <[EMAIL PROTECTED]> wrote: > While testing Cole's series of patches I identified a couple more places > where we leak memory. > > In libvirt.c, the default authentication callback uses uninitialized > data, and indeed strdup()'s it and this is then never released. This > simply

Re: [libvirt] PATCH: Ensure configure.ac is fully quoted

2008-05-22 Thread Jim Meyering
"Daniel P. Berrange" <[EMAIL PROTECTED]> wrote: > As suggested by Jim, this patch goes through the configure script and makes > sure all args to macros are fully quoted. NB, this applies on top of the > NUMA/cpu pinning patches I sent the other day, not CVS. ... Looks fine. Thanks for doing that!

Re: [libvirt] Dom0 Interface stats with virDomainInterfaceStats

2008-05-22 Thread Daniel Veillard
On Thu, May 22, 2008 at 02:53:31AM +0200, Stefan de Konink wrote: > Would it be possible to enable fetch of the interface stats of the dom0 > via the API? It sounds a bit Xen specific, but I see no reason why this should not be allowed. Daniel -- Red Hat Virtualization group http://redhat.co

Re: [libvirt] PATCH: Ensure configure.ac is fully quoted

2008-05-22 Thread Daniel Veillard
On Wed, May 21, 2008 at 11:21:32PM +0100, Daniel P. Berrange wrote: > As suggested by Jim, this patch goes through the configure script and makes > sure all args to macros are fully quoted. NB, this applies on top of the > NUMA/cpu pinning patches I sent the other day, not CVS. Looks fine, +1 D

Re: [libvirt] PATCH: Fix some more memory leaks

2008-05-22 Thread Daniel Veillard
On Wed, May 21, 2008 at 10:21:09PM +0100, Daniel P. Berrange wrote: > > While testing Cole's series of patches I identified a couple more places > where we leak memory. > > In libvirt.c, the default authentication callback uses uninitialized > data, and indeed strdup()'s it and this is then never