summaryrefslogtreecommitdiff
path: root/virt-manager
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2018-03-12 16:24:28 -0400
committerCole Robinson <crobinso@redhat.com>2018-03-15 21:24:48 -0400
commit7e1cddef18ecae9e392992ecf23712849d6a2cfb (patch)
tree273fd2387ca28cce3fa54324904feca2d8a527b1 /virt-manager
parentb3c69a05a2025119baad075d6397040b455d5bf6 (diff)
downloadvirt-manager-7e1cddef18ecae9e392992ecf23712849d6a2cfb.tar.gz
virt-manager: Add hidden --test-leak-debug option
That enables the pre-existing debug_ref_leaks behavior
Diffstat (limited to 'virt-manager')
-rwxr-xr-xvirt-manager13
1 files changed, 12 insertions, 1 deletions
diff --git a/virt-manager b/virt-manager
index 4db66152..5a22ed49 100755
--- a/virt-manager
+++ b/virt-manager
@@ -81,8 +81,9 @@ def _import_gtk(leftovers):
# This will error if Gtk wasn't correctly initialized
Gtk.init()
-
globals()["Gtk"] = Gtk
+
+ # This ensures we can init gsettings correctly
import virtManager.config
ignore = virtManager.config
except Exception as e:
@@ -147,6 +148,15 @@ def parse_commandline():
# Force disable use of libvirt object events
parser.add_argument("--test-no-events",
help=argparse.SUPPRESS, action="store_true")
+ # Enabling this will tell us, at app exit time, which vmmGObjects were not
+ # garbage collected. This is caused by circular references to other objects,
+ # like a signal that wasn't disconnected. It's not a big deal, but if we
+ # have objects that can be created and destroyed a lot over the course of
+ # the app lifecycle, every non-garbage collected class is a memory leak.
+ # So it's nice to poke at this every now and then and try to track down
+ # what we need to add to class _cleanup handling.
+ parser.add_argument("--test-leak-debug",
+ help=argparse.SUPPRESS, action="store_true")
parser.add_argument("-c", "--connect", dest="uri",
help="Connect to hypervisor at URI", metavar="URI")
@@ -219,6 +229,7 @@ def main():
config = virtManager.config.vmmConfig(
"virt-manager", CLIConfig, options.test_first_run)
+ config.test_leak_debug = options.test_leak_debug
if not util.local_libvirt_version() >= 6000:
# We need this version for threaded virConnect access