[libvirt] [PATCH] Fix small memory leaks in config parsing related functions

2011-04-24 Thread Matthias Bolte
Found by 'make -C tests valgrind'. xen_xm.c: Dummy allocation via virDomainChrDefNew is directly overwritten and lost. Free 'script' in success path too. vmx.c: Free virtualDev_string in success path too. domain_conf.c: Free compression in success path too. --- src/conf/domain_conf.c |1 +

Re: [libvirt] [PATCH] util: warn when passing a non-pointer to VIR_FREE

2011-04-24 Thread Matthias Bolte
2011/4/23 Eric Blake : > On 04/22/2011 12:21 PM, Christophe Fergeau wrote: >> There were recently some bugs where VIR_FREE was called with an >> int parameter. Try to affect the value passed to VIR_FREE to >> a const void* so that the compiler gets a chance to emit a warning >> if we didn't pass a

Re: [libvirt] [PATCHv2] threads: add one-time initialization support

2011-04-24 Thread Matthias Bolte
2011/4/23 Eric Blake : > mingw lacks the counterpart to PTHREAD_MUTEX_INITIALIZER, so the > best we can do is portably expose once-only runtime initialization. > > * src/util/threads.h (virOnceControlPtr): New opaque type. > (virOnceFunc): New callback type. > (virOnce): New prototype. > * src/util

[libvirt] [PATCH] Move call to virReportOOMError into virFileBuildPath

2011-04-24 Thread Matthias Bolte
Suggested by Daniel P. Berrange --- src/conf/nwfilter_conf.c |5 + src/conf/storage_conf.c |7 +-- src/util/util.c |2 ++ src/xen/xen_inotify.c|1 - src/xen/xm_internal.c|5 + 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/conf

Re: [libvirt] [PATCH] esx: Move CURL handling code to it's own type

2011-04-24 Thread Matthias Bolte
2011/4/22 Eric Blake : > On 04/10/2011 07:39 AM, Matthias Bolte wrote: >> --- >>  src/esx/esx_driver.c |    4 +- >>  src/esx/esx_vi.c     |  348 >> ++ >>  src/esx/esx_vi.h     |   29 +++- >>  3 files changed, 205 insertions(+), 176 deletions(-) >> >>

[libvirt] [PATCH 18/22] remote generator, client: Handle functions with multiple return values

2011-04-24 Thread Matthias Bolte
--- daemon/remote_generator.pl| 63 +++--- src/remote/remote_client_bodies.c | 257 ++- src/remote/remote_driver.c| 266 - 3 files changed, 296 insertions(+), 290 deletions(-) diff --git a/daemon/remote_ge

[libvirt] [PATCH 22/22] remote generator, client: Handle arguments with limited length

2011-04-24 Thread Matthias Bolte
This adds length checks to all affected functions. --- daemon/remote_generator.pl| 49 ++-- src/remote/remote_client_bodies.c | 267 ++--- src/remote/remote_driver.c| 227 --- 3 files changed, 287 insertions(+), 25

[libvirt] [PATCH 13/22] remote generator, daemon: Handle functions with multiple return values

2011-04-24 Thread Matthias Bolte
Once again rename members in the XDR definitions to avoid special case code in the generator. --- daemon/remote.c | 334 --- daemon/remote_dispatch_bodies.c | 322 - daemon/remote_generator.pl | 80 +++

[libvirt] [PATCH 09/22] remote generator, daemon: Handle functions that return lists

2011-04-24 Thread Matthias Bolte
--- daemon/remote.c | 701 --- daemon/remote_dispatch_bodies.c | 681 +- daemon/remote_generator.pl | 111 +- 3 files changed, 758 insertions(+), 735 deletions(-) diff --git a/daemon/remote.c b/dae

[libvirt] [PATCH 10/22] remote generator: Refactor duplicate code

2011-04-24 Thread Matthias Bolte
--- daemon/remote_generator.pl | 168 +--- 1 files changed, 18 insertions(+), 150 deletions(-) diff --git a/daemon/remote_generator.pl b/daemon/remote_generator.pl index e9a60bc..585cf67 100755 --- a/daemon/remote_generator.pl +++ b/daemon/remote_generator

[libvirt] [PATCH 20/22] remote: Refactor remote*Open and remote*Close functions

2011-04-24 Thread Matthias Bolte
Add generic versions of the open and close functions and call them. --- src/remote/remote_driver.c | 347 +++- 1 files changed, 51 insertions(+), 296 deletions(-) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 8dc71d6..777a7bf 1

[libvirt] [PATCH 04/22] remote generator, daemon: Change capitalization of some words

2011-04-24 Thread Matthias Bolte
Again this will simplify the generator, due to less special case handling. --- daemon/remote.c | 64 +- daemon/remote_dispatch_bodies.c | 64 +- daemon/remote_dispatch_prototypes.h | 64 +- daemon/remote_dispatch_table.h

[libvirt] [PATCH 11/22] remote generator, daemon: Handle the CPU functions

2011-04-24 Thread Matthias Bolte
They require additional special cases. --- daemon/remote.c | 64 --- daemon/remote_dispatch_bodies.c | 62 -- daemon/remote_dispatch_prototypes.h |6 ++-- daemon/remote_dispatch_table.h | 12 +++-

[libvirt] [PATCH 19/22] remote generator, client: Handle functions with optional return values

2011-04-24 Thread Matthias Bolte
--- daemon/remote_generator.pl| 44 - src/remote/remote_client_bodies.c | 129 +++-- src/remote/remote_driver.c| 128 3 files changed, 152 insertions(+), 149 deletions(-) diff --git a/daemon/remot

[libvirt] [PATCH 03/22] remote: Replace 'domain' with 'dom' in the XDR protocol

2011-04-24 Thread Matthias Bolte
This simplifies the remote protocol code generator. Also rename 'ret' to 'result' to resolve a naming conflict in the generator. --- daemon/remote.c | 22 +++--- daemon/remote_dispatch_bodies.c |4 ++-- daemon/remote_generator.pl |2 +- src/remote/qe

[libvirt] [PATCH 14/22] remote generator: Reorder into prepare and print section

2011-04-24 Thread Matthias Bolte
--- daemon/remote_generator.pl | 54 --- 1 files changed, 30 insertions(+), 24 deletions(-) diff --git a/daemon/remote_generator.pl b/daemon/remote_generator.pl index 1aaeaae..9fa3caa 100755 --- a/daemon/remote_generator.pl +++ b/daemon/remote_generator.p

[libvirt] [PATCH 08/22] remote: Rename 'nameslen' to the common 'maxnames'

2011-04-24 Thread Matthias Bolte
Avoids special case handling in the remote generator. --- daemon/remote.c |8 src/remote/remote_driver.c | 12 ++-- src/remote/remote_protocol.c |2 +- src/remote/remote_protocol.h |2 +- src/remote/remote_protocol.x |2 +- src/remote_protocol-stru

[libvirt] [PATCH 07/22] remote generator, daemon: Handle functions with optional arguments

2011-04-24 Thread Matthias Bolte
--- daemon/remote.c | 130 - daemon/remote_dispatch_bodies.c | 136 +- daemon/remote_generator.pl | 21 +-- 3 files changed, 148 insertions(+), 139 deletions(-) diff --git a/daemon/remote.c b/daem

[libvirt] [PATCH 01/22] remote generator: Replace tabs with spaces and rename file

2011-04-24 Thread Matthias Bolte
No functional change included, just a whitespace change. --- daemon/Makefile.am | 34 +++--- daemon/qemu_dispatch_args.h |2 +- daemon/qemu_dispatch_prototypes.h |2 +- daemon/qemu_dispatch_ret.h |2 +- daemon/qemu_dispatch_table.h|2 +-

[libvirt] [PATCH 12/22] remote generator, daemon: Combine multiple ifs in the generated code

2011-04-24 Thread Matthias Bolte
--- daemon/remote_dispatch_bodies.c | 66 +++--- daemon/remote_generator.pl | 28 ++-- 2 files changed, 50 insertions(+), 44 deletions(-) diff --git a/daemon/remote_dispatch_bodies.c b/daemon/remote_dispatch_bodies.c index 89f0bc4..50432f9 1006

[libvirt] [PATCH 00/22] Extend remote generator to generate function bodies too

2011-04-24 Thread Matthias Bolte
Richard W.M. Jones suggested [1] that the code that directly deals with the XDR protocol should be generated. The remote_generate_stubs.pl script already generates all the headers, just the bodies in the daemon and remote driver are manually written. But most of the functions just follow simple pat

[libvirt] [PATCH] Make sure DNSMASQ_STATE_DIR exists

2011-04-24 Thread Guido Günther
Hi, otherwise the directory returned by networkDnsmasqLeaseFileName will not be created if ipdef->nhosts == 0 in networkBuildDnsmasqArgv. O.k. to apply? Cheers, -- Guido --- src/network/bridge_driver.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/src/network/