Richard W.M. Jones
2017-Mar-16 21:57 UTC
[Libguestfs] [PATCH 1/2] p2v: Free config struct before exit.
Memory leak found by valgrind. --- p2v/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/p2v/main.c b/p2v/main.c index e1a7550..7f1e1c0 100644 --- a/p2v/main.c +++ b/p2v/main.c @@ -260,6 +260,7 @@ main (int argc, char *argv[]) } guestfs_int_free_string_list (cmdline); + free_config (config); exit (EXIT_SUCCESS); } -- 2.10.2
Richard W.M. Jones
2017-Mar-16 21:57 UTC
[Libguestfs] [PATCH 2/2] p2v: Enable check-valgrind in this directory.
A couple of valgrind suppressions are required to work around memory leaks in Gtk. --- p2v/Makefile.am | 3 +++ p2v/test-virt-p2v-cmdline.sh | 2 +- p2v/test-virt-p2v-nbdkit.sh | 2 +- p2v/test-virt-p2v.sh | 2 +- valgrind-suppressions | 15 +++++++++++++++ 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/p2v/Makefile.am b/p2v/Makefile.am index 9751a07..0b8c1c6 100644 --- a/p2v/Makefile.am +++ b/p2v/Makefile.am @@ -260,6 +260,9 @@ TESTS += \ $(SLOW_TESTS) endif ENABLE_APPLIANCE +check-valgrind: + make VG="@VG@" check + SLOW_TESTS = \ test-virt-p2v-pxe.sh diff --git a/p2v/test-virt-p2v-cmdline.sh b/p2v/test-virt-p2v-cmdline.sh index 1584381..770b7a8 100755 --- a/p2v/test-virt-p2v-cmdline.sh +++ b/p2v/test-virt-p2v-cmdline.sh @@ -27,7 +27,7 @@ out=test-virt-p2v-cmdline.out rm -f $out # The Linux kernel command line. -virt-p2v --cmdline='p2v.server=localhost p2v.port=123 p2v.username=user p2v.password=secret p2v.skip_test_connection p2v.name=test p2v.vcpus=4 p2v.memory=1G p2v.disks=sda,sdb,sdc p2v.removable=sdd p2v.interfaces=eth0,eth1 p2v.o=local p2v.oa=sparse p2v.oc=qemu:///session p2v.of=raw p2v.os=/var/tmp p2v.network=em1:wired,other p2v.dump_config_and_exit' > $out +$VG virt-p2v --cmdline='p2v.server=localhost p2v.port=123 p2v.username=user p2v.password=secret p2v.skip_test_connection p2v.name=test p2v.vcpus=4 p2v.memory=1G p2v.disks=sda,sdb,sdc p2v.removable=sdd p2v.interfaces=eth0,eth1 p2v.o=local p2v.oa=sparse p2v.oc=qemu:///session p2v.of=raw p2v.os=/var/tmp p2v.network=em1:wired,other p2v.dump_config_and_exit' > $out # For debugging purposes. cat $out diff --git a/p2v/test-virt-p2v-nbdkit.sh b/p2v/test-virt-p2v-nbdkit.sh index 08e223b..2f5ee62 100755 --- a/p2v/test-virt-p2v-nbdkit.sh +++ b/p2v/test-virt-p2v-nbdkit.sh @@ -51,7 +51,7 @@ export PATH=$d:$PATH cmdline="p2v.server=localhost p2v.name=windows p2v.disks=$f1,$f2 p2v.o=local p2v.os=$(pwd)/$d p2v.network=em1:wired,other p2v.post=" # Only use nbdkit, disable qemu-nbd. -virt-p2v --cmdline="$cmdline" --nbd=nbdkit,nbdkit-no-sa +$VG virt-p2v --cmdline="$cmdline" --nbd=nbdkit,nbdkit-no-sa # Test the libvirt XML metadata and a disk was created. test -f $d/windows.xml diff --git a/p2v/test-virt-p2v.sh b/p2v/test-virt-p2v.sh index 3642dc0..b9c5397 100755 --- a/p2v/test-virt-p2v.sh +++ b/p2v/test-virt-p2v.sh @@ -49,7 +49,7 @@ export PATH=$d:$PATH # The Linux kernel command line. cmdline="p2v.server=localhost p2v.name=windows p2v.disks=$f1,$f2 p2v.o=local p2v.os=$(pwd)/$d p2v.network=em1:wired,other p2v.post=" -virt-p2v --cmdline="$cmdline" +$VG virt-p2v --cmdline="$cmdline" # Test the libvirt XML metadata and a disk was created. test -f $d/windows.xml diff --git a/valgrind-suppressions b/valgrind-suppressions index c2fa979..0448b9c 100644 --- a/valgrind-suppressions +++ b/valgrind-suppressions @@ -327,6 +327,21 @@ fun:file_apprentice } +# Gtk +{ + gtk_leak + Memcheck:Leak + ... + fun:gtk_init_check +} + +{ + gtk_leak_2 + Memcheck:Leak + ... + fun:gdk_display_manager_get +} + # Perl # note: Perl leaks memory by design, this just suppresses them. { -- 2.10.2
Seemingly Similar Threads
- [p2v PATCH 00/11] Expose virt-v2v's "-oo"; re-enable openstack
- [p2v PATCH 02/11] Introduce "p2v.output.misc" for passing "-oo" options to virt-v2v
- p2v: Various cleanups.
- [PATCH 0/6] p2v: start making it independent
- [PATCH 0/4] Various p2v fixes and features