Libvirt provides a portable, long term stable C API for managing the virtualization technologies provided by many operating systems. It includes support for QEMU, KVM, Xen, LXC, bhyve, Virtuozzo, VMware vCenter and ESX, VMware Desktop, Hyper-V, VirtualBox and the POWER Hypervisor.
Go to file
Alex Jia 9707c2a8bc virsh: plug memory leak on cmdDomblklist
Detected by valgrind. Leak introduced in commit 88a993b:

* tools/virsh.c: fix memory leak on cmdDomblklist.

* how to reproduce?
  % valgrind -v --leak-check=full virsh domblklist <domain name>

* actual valgrind result:

==6573== 1,836 bytes in 1 blocks are definitely lost in loss record 110 of 124
==6573==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==6573==    by 0x330D71497D: xdr_string (in /lib64/libc-2.12.so)
==6573==    by 0x4D26CED: xdr_remote_nonnull_string (remote_protocol.c:30)
==6573==    by 0x4D28138: xdr_remote_domain_get_xml_desc_ret (remote_protocol.c:1418)
==6573==    by 0x4D3C0C2: virNetMessageDecodePayload (virnetmessage.c:382)
==6573==    by 0x4D3279F: virNetClientProgramCall (virnetclientprogram.c:382)
==6573==    by 0x4D0D50B: callWithFD (remote_driver.c:4339)
==6573==    by 0x4D0D5AB: call (remote_driver.c:4360)
==6573==    by 0x4D16EAF: remoteDomainGetXMLDesc (remote_client_bodies.h:861)
==6573==    by 0x4CF9F4F: virDomainGetXMLDesc (libvirt.c:4098)
==6573==    by 0x4154D9: cmdDomblklist (virsh.c:1722)
==6573==    by 0x4149E2: vshCommandRun (virsh.c:16365)
==6573==
==6573== 46,009 (352 direct, 45,657 indirect) bytes in 1 blocks are definitely lost in loss record 123 of 124
==6573==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==6573==    by 0x3318286DC6: xmlXPathNewContext (in /usr/lib64/libxml2.so.2.7.6)
==6573==    by 0x4C79AE2: virXMLParseHelper (xml.c:779)
==6573==    by 0x415512: cmdDomblklist (virsh.c:1726)
==6573==    by 0x4149E2: vshCommandRun (virsh.c:16365)
==6573==    by 0x427743: main (virsh.c:17867)
==6573==
==6573== LEAK SUMMARY:
==6573==    definitely lost: 2,188 bytes in 2 blocks
==6573==    indirectly lost: 45,657 bytes in 332 blocks
==6573==      possibly lost: 0 bytes in 0 blocks
==6573==    still reachable: 128,034 bytes in 1,364 blocks
==6573==         suppressed: 0 bytes in 0 blocks

Signed-off-by: Alex Jia <ajia@redhat.com>
2011-12-09 10:36:30 -07:00
.gnulib@6b93d00f54 build: update to latest gnulib 2011-12-01 14:12:59 -07:00
daemon maint: fix improper use of 'an' 2011-12-03 17:11:56 -07:00
docs Add ppc64 specific definitions to domain.rng 2011-12-08 08:39:26 -05:00
examples examples: Update event tests for shutdown event 2011-12-05 17:35:29 +01:00
gnulib build: update to latest gnulib 2011-12-01 14:12:59 -07:00
include qemu: Rework handling of shutdown event 2011-12-05 14:14:31 +01:00
m4 build: reduce warnings from older gcc 2011-12-05 10:14:55 -07:00
po Release of libvirt-0.9.8 2011-12-08 15:13:50 +08:00
python python: Expose binding for virNodeGetMemoryStats() 2011-12-05 12:22:33 +01:00
src fix error when parsing ppc64 models on x86 host 2011-12-09 12:18:58 -05:00
tests Modify the tests/nodeinfotest.c to use sysfs in addition 2011-12-08 08:39:26 -05:00
tools virsh: plug memory leak on cmdDomblklist 2011-12-09 10:36:30 -07:00
.dir-locals.el maint: let emacs avoid tabs in rng files 2011-08-13 08:56:26 -06:00
.gitignore Define keepalive protocol 2011-11-24 11:44:08 +01:00
.gitmodules make .gnulib a submodule 2009-07-08 16:17:51 +02:00
.mailmap maint: use mailmap, not AUTHORS, for secondary addresses 2011-11-11 08:56:19 -07:00
AUTHORS maint: move my name to commiters 2011-12-08 11:20:51 +01:00
autobuild.sh spec: mingw cleanups 2011-10-13 09:21:02 -06:00
autogen.sh build: allow for local gnulib diffs 2011-11-09 09:03:33 -07:00
bootstrap build: fix compilation on mingw64 2011-08-19 07:20:10 -06:00
bootstrap.conf maint: allow bootstrap in a sandbox 2011-12-08 14:37:15 -07:00
cfg.mk build: update to latest gnulib 2011-12-01 14:12:59 -07:00
ChangeLog-old generate ChangeLog from git logs into distribution tarball 2009-07-08 16:17:51 +02:00
configure.ac Release of libvirt-0.9.8 2011-12-08 15:13:50 +08:00
COPYING.LIB remove all trailing blank lines 2009-07-16 15:06:42 +02:00
HACKING Document STREQ_NULLABLE and STRNEQ_NULLABLE 2011-10-06 16:50:38 +02:00
libvirt.pc.in * libvirt.pc.in: applied patch from Daniel Berrange to fix --cflags 2006-03-24 13:18:12 +00:00
libvirt.spec.in spec: fix logic bug in deciding to turn on cgconfig 2011-12-08 13:52:54 -07:00
Makefile.am maint: add missing copyright notices 2011-07-28 15:01:17 -06:00
Makefile.nonreentrant Ban use of all inet_* functions 2010-10-22 11:59:23 +01:00
mingw32-libvirt.spec.in spec: make it easier to autoreconf when building rpm 2011-12-08 09:49:50 -07:00
README Correct typos in the documentation (Atsushi SAKAI) 2008-01-24 10:15:13 +00:00
README-hacking maint: relax git minimum version 2010-02-24 14:29:27 -05:00
TODO Update todo list file to point at bugzilla/website 2010-10-13 16:45:26 +01:00

         LibVirt : simple API for virtualization

  Libvirt is a C toolkit to interact with the virtualization capabilities
of recent versions of Linux (and other OSes). It is free software
available under the GNU Lesser General Public License. Virtualization of
the Linux Operating System means the ability to run multiple instances of
Operating Systems concurrently on a single hardware system where the basic
resources are driven by a Linux instance. The library aim at providing
long term stable C API initially for the Xen paravirtualization but
should be able to integrate other virtualization mechanisms if needed.

Daniel Veillard <veillard@redhat.com>