[libvirt] [PATCHv4] python: Avoid memory leaks on libvirt_virNodeGetMemoryStats

2012-03-20 Thread Alex Jia
Detected by valgrind. Leaks are introduced in commit 17c7795. * python/libvirt-override.c (libvirt_virNodeGetMemoryStats): fix memory leaks and improve codes return value. For details, please see the following link: RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=770944 Signed-off-by: Alex

Re: [libvirt] [PATCH] python: make virDomainSetSchedulerParameters accpet integer argument

2012-03-20 Thread Guannan Ren
On 03/20/2012 02:11 AM, Eric Blake wrote: On 03/19/2012 12:03 PM, Eric Blake wrote: Why are you doing this for just VIR_TYPED_PARAM_ULLONG? I argue that we should be doing it for all of the integral conversions. In fact, I'd argue that we want new helper functions in typewrappers.c, as

Re: [libvirt] sysctl variables, FreeBSD

2012-03-20 Thread Daniel P. Berrange
On Mon, Mar 19, 2012 at 10:19:55PM -0700, Jason Helfman wrote: Is there a method that can be used to remove the sysctl tuning for FreeBSD in the pipeline? Here are the current patches I have, but would like to remove: http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/libvirt/files/ The

Re: [libvirt] [PATCH v4] python: add virDomainGetCPUStats python binding API

2012-03-20 Thread Eric Blake
On 03/19/2012 10:34 PM, Guannan Ren wrote: dom.getCPUStats(True, 0) [{'cpu_time': 24699446159L, 'system_time': 1087000L, 'user_time': 95000L}] dom.getCPUStats(False, 0) [{'cpu_time': 8535292289L}, {'cpu_time': 1005395355L}, {'cpu_time': 9351766377L},

Re: [libvirt] [PATCHv4] python: Avoid memory leaks on libvirt_virNodeGetMemoryStats

2012-03-20 Thread Eric Blake
On 03/20/2012 01:14 AM, Alex Jia wrote: Detected by valgrind. Leaks are introduced in commit 17c7795. * python/libvirt-override.c (libvirt_virNodeGetMemoryStats): fix memory leaks and improve codes return value. For details, please see the following link: RHBZ:

Re: [libvirt] [PATCH v4] python: add virDomainGetCPUStats python binding API

2012-03-20 Thread Guannan Ren
On 03/20/2012 11:42 PM, Eric Blake wrote: On 03/19/2012 10:34 PM, Guannan Ren wrote: dom.getCPUStats(True, 0) [{'cpu_time': 24699446159L, 'system_time': 1087000L, 'user_time': 95000L}] dom.getCPUStats(False, 0) [{'cpu_time': 8535292289L}, {'cpu_time':

[libvirt] [PATCH 03/14] s/xmlURIPtr/virURIPtr/ in virURIFormat impl

2012-03-20 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The parameter in the virURIFormat impl mistakenly used the xmlURIPtr type, instead of virURIPtr. Since they will soon cease to be identical, this needs fixing --- src/util/viruri.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff

[libvirt] [PATCH 02/14] Use virURIFree instead of xmlFreeURI

2012-03-20 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com Since we defined a custom virURIPtr type, we should use a virURIFree method instead of assuming it will always be a typedef for xmlURIPtr * src/util/viruri.c, src/util/viruri.h, src/libvirt_private.syms: Add a virURIFree method * src/datatypes.c,

[libvirt] [PATCH 04/14] Centralize error reporting for URI parsing/formatting problems

2012-03-20 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com Move error reporting out of the callers, into virURIParse and virURIFormat, to get consistency. * include/libvirt/virterror.h, src/util/virterror.c: Add VIR_FROM_URI * src/util/viruri.c, src/util/viruri.h: Add error reporting * src/esx/esx_driver.c,

[libvirt] [PATCH 06/14] Store parsed query parameters directly in the virURIPtr struct

2012-03-20 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com Avoid the need for each driver to parse query parameters itself by storing them directly in the virURIPtr struct. The parsing code is a copy of that from src/util/qparams.c The latter will be removed in a later patch * src/util/viruri.h: Add query

[libvirt] [PATCH 07/14] Convert drivers over to use virURIPtr for query params

2012-03-20 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com Convert drivers currently using the qparams APIs, to instead use the virURIPtr query parameters directly. * src/esx/esx_util.c, src/hyperv/hyperv_util.c, src/remote/remote_driver.c, src/xenapi/xenapi_utils.c: Remove use of qparams *

[libvirt] [PATCH 09/14] Rename src/util/authhelper.[ch] to src/util/virauth.[ch]

2012-03-20 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com To follow latest naming conventions, rename src/util/authhelper.[ch] to src/util/virauth.[ch]. * src/util/authhelper.[ch]: Rename to src/util/virauth.[ch] * src/esx/esx_driver.c, src/hyperv/hyperv_driver.c, src/phyp/phyp_driver.c,

[libvirt] [PATCH 14/14] Lookup auth credentials in config file before prompting

2012-03-20 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com When SASL requests auth credentials, try to look them up in the config file first. If any are found, remove them from the list that the user is prompted for --- src/esx/esx_driver.c | 58 +- src/hyperv/hyperv_driver.c |4 +-

[libvirt] [PATCH 12/14] Add APIs for handling lookup of auth credentials from config file

2012-03-20 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com This defines the format for the auth credential config file and provides APIs to access the data. The config file contains one or more named 'credential' sets [credentials-$NAME] credname1=value1 credname2=value2 eg [credentials-test]

[libvirt] [PATCH 10/14] Rename virRequest{Username, Password} to virAuthGet{Username, Password}

2012-03-20 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com Ensure that the functions in virauth.h have names matching the file prefix, by renaming virRequest{Username,Password} to virAuthGet{Username,Password} --- src/esx/esx_driver.c |8 src/hyperv/hyperv_driver.c |4 ++--

[libvirt] [PATCH 00/14] Support reading auth credentials from a config file

2012-03-20 Thread Daniel P. Berrange
When connecting to a remote libvirtd, or hypervisor that requires authentication we have callbacks which can be used to prompt for various credentials. This is tedious if you are looking to automate stuff though. While we could let each application implement a custom auth callback for fetching

[libvirt] [PATCH 01/14] Add test case for virURIPtr classs

2012-03-20 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com To ensure we properly escape unescape IPv6 numeric addresses, add a test case * tests/Makefile.am, tests/viruritest.c: URI parsing test --- tests/Makefile.am |7 ++- tests/viruritest.c | 139

[libvirt] [PATCH 05/14] Use a libvirt custom struct for virURIPtr

2012-03-20 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com Instead of just typedef'ing the xmlURIPtr struct for virURIPtr, use a custom libvirt struct. This allows us to fix various problems with libxml2. This initially just fixes the query vs query_raw handling problems. --- src/esx/esx_util.c |4

[libvirt] [PATCH 08/14] Add a virKeyfilePtr object for parsing '.ini' files

2012-03-20 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The '.ini' file format is a useful alternative to the existing config file style, when you need to have config files which are hashes of hashes. The 'virKeyFilePtr' object provides a way to parse these file types. * src/Makefile.am,

[libvirt] [PATCH 11/14] Add helper API for finding auth file path

2012-03-20 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com * src/util/virauth.c, src/util/virauth.h: Add virAuthGetConfigFilePath * include/libvirt/virterror.h, src/util/virterror.c: Add VIR_FROM_AUTH error domain --- include/libvirt/virterror.h |1 + src/libvirt_private.syms|1 +

[libvirt] [PATCH 13/14] Refactor code prompting for SASL credentials

2012-03-20 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com SASL may prompt for credentials after either a 'start' or 'step' invocation. In both cases the code to handle this is the same. Refactor this code into a separate method to reduce the duplication, since the complexity is about to grow *

Re: [libvirt] Modern CPU models cannot be used with libvirt

2012-03-20 Thread Eduardo Habkost
I added a summary of the changes I am planning, at: http://wiki.qemu.org/Features/CPUModels#Current_Issues_and_proposed_changes I'm sure I forgot lots of details, so feel free to send me questions and suggestions, or even edit the wiki page directly. On Fri, Mar 09, 2012 at 05:56:52PM -0300,

[libvirt] [RFC][PATCH] nwfilter: Add support for ipset

2012-03-20 Thread Stefan Berger
Sending this as an RFC for now... This patch adds support for the recent ipset iptables extension to libvirt's nwfilter subsystem. Ipset allows to maintain 'sets' of IP addresses, ports and other packet parameters and allows for faster lookup and ('chunked') rule evaluation to achieve higher

Re: [libvirt] Unknown KVM internal error on 3.2.1

2012-03-20 Thread Doug Goldstein
On Wed, Mar 7, 2012 at 8:19 AM, Avi Kivity a...@redhat.com wrote: On 03/07/2012 01:00 PM, Gleb Natapov wrote: KVM internal error. Suberror: 1 emulation failure EAX=8004003b EBX=38d54633 ECX=c0460a7e EDX=8005003b ESI=e49329a8 EDI=f7c98d60 EBP=0286 ESP=f7fecf68 EIP=f91d1778

[libvirt] [PATCH] atomic snapshots, round 3

2012-03-20 Thread Eric Blake
Depends on round 2 being applied first: https://www.redhat.com/archives/libvir-list/2012-March/msg00761.html This is the next part of my overall RFC: https://www.redhat.com/archives/libvir-list/2012-March/msg00578.html Eric Blake (1): snapshot: improve qemu handling of reused snapshot targets

[libvirt] [PATCH] snapshot: improve qemu handling of reused snapshot targets

2012-03-20 Thread Eric Blake
The oVirt developers have stated that the real reasons they want to have qemu reuse existing volumes when creating a snapshot are: 1. the management framework is set up so that creation has to be done from a central node for proper resource tracking, and having libvirt and/or qemu create things

Re: [libvirt] [PATCH 1/5] qemu: Add support for domain cleanup callbacks

2012-03-20 Thread Eric Blake
On 03/19/2012 10:18 AM, Jiri Denemark wrote: Add support for registering cleanup callbacks to be run when a domain transitions to shutoff state. --- src/qemu/qemu_domain.c | 73 +++ src/qemu/qemu_domain.h | 15 +

Re: [libvirt] [PATCH 2/5] qemu: Avoid dangling migration-in job on shutoff domains

2012-03-20 Thread Eric Blake
On 03/19/2012 10:18 AM, Jiri Denemark wrote: Destination daemon should not rely on the client or source daemon (depending on the type of migration) to call Finish when migration fails, because the client may crash before it can do so. The domain prepared for incoming migration is set to be

Re: [libvirt] [PATCH 3/5] qemu: Add connection close callbacks

2012-03-20 Thread Eric Blake
On 03/19/2012 10:18 AM, Jiri Denemark wrote: Add support for registering arbitrary callback to be called for a domain when a connection gets closed. --- src/qemu/qemu_conf.c | 172 src/qemu/qemu_conf.h | 27

Re: [libvirt] [PATCH 4/5] qemu: Make autodestroy utilize connection close callbacks

2012-03-20 Thread Eric Blake
On 03/19/2012 10:18 AM, Jiri Denemark wrote: --- src/qemu/qemu_conf.h|5 -- src/qemu/qemu_driver.c |5 -- src/qemu/qemu_process.c | 107 ++ 3 files changed, 24 insertions(+), 93 deletions(-) Good! I was thinking about this very

Re: [libvirt] [PATCH 5/5] qemu: Avoid dangling migration-out job when client dies

2012-03-20 Thread Eric Blake
On 03/19/2012 10:19 AM, Jiri Denemark wrote: When a client which started non-p2p migration dies in a bad time, the source libvirtd never clears the migration job and almost nothing can be done with the domain without restarting the daemon. This patch makes use of connection close callbacks and

[libvirt] [PATCH] python: always include config.h first

2012-03-20 Thread Eric Blake
On RHEL 5.7, I got this compilation failure: In file included from /usr/include/python2.4/pyport.h:98, from /usr/include/python2.4/Python.h:55, from libvirt.c:3: ../gnulib/lib/time.h:468: error: expected ';', ',' or ')' before '__timer' Turns out that our

[libvirt] [PATCH] build: drop a painfully long gnulib test

2012-03-20 Thread Eric Blake
On machines with massive amounts of CPUs, the gnulib 'test-lock' could take minutes, or even appear to deadlock, because of timing interactions between multiple cores. See https://bugzilla.redhat.com/show_bug.cgi?id=797284. For precedence, note that iwhd has done the same:

Re: [libvirt] [libvirt-glib] Remove unneeded call in libvirt-gconfig test

2012-03-20 Thread Zeeshan Ali (Khattak)
On Fri, Mar 16, 2012 at 6:43 PM, Christophe Fergeau cferg...@redhat.com wrote: Because of a copy and paste error, the test program is making an unneeded call to gvir_config_domain_channel_set_target_type when setting up its USB redirection device. ACK :) -- Regards, Zeeshan Ali (Khattak)

Re: [libvirt] [PATCH libvirt-glib] Fix generation of docs in a VPATH builder

2012-03-20 Thread Zeeshan Ali (Khattak)
On Wed, Mar 7, 2012 at 1:14 PM, Daniel P. Berrange berra...@redhat.com wrote: From: Daniel P. Berrange berra...@redhat.com The DOC_SOURCE_DIR variable was missing the $(top_srcdir) variable so it could not find the source files when run from a VPATH build. Empirically the previous comment