[libvirt] Problem in attaching a interface to a domain

2008-05-22 Thread sarveswara rao mygapula
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 getting what exactly the xml format that virsh is looking for? I am using the

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

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

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

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! I

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 disables

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 ';' as a

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 data, and indeed

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 sent the

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 not

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

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. - Did

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 simply

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 later

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've changed this

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] $@ +endif I guess

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 the free

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. Thanks! Ok,

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:

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

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 !=

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 separator

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 just

[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

[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] 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

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.c | 293

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.

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: 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

[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

[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

[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: 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

[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

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

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: 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

[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

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 --

[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

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

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