diff options
author | Alon Levy <alevy@redhat.com> | 2012-03-04 22:59:47 +0200 |
---|---|---|
committer | Alon Levy <alevy@redhat.com> | 2012-03-04 22:59:47 +0200 |
commit | cf036a452c277599e71875973ccc8be410e26525 (patch) | |
tree | 86677eb2cd6bbbc54c4003d0d3de6549a945c3a4 | |
parent | ce0406e684ce9fec10df412f49ef79d175c8d78a (diff) |
add gui migration count
-rwxr-xr-x | spice_migrate.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/spice_migrate.py b/spice_migrate.py index 548a2df..9f66f17 100755 --- a/spice_migrate.py +++ b/spice_migrate.py @@ -245,6 +245,7 @@ def test_glib_wrap_iter(): class Migrator(object): migration_count = 0 + on_migrate = lambda mig_count: None def __init__(self, log, client, qemu_exec, image, monitor_files, client_count=1, spice_ports=[17000, 17001], migration_port=17002, vdagent=False, @@ -350,6 +351,7 @@ class Migrator(object): which = 0 if new_spice_port == self.spice_ports[0] else 1 self.target = self.start_qemu(which=which, incoming=True) self.migration_count += 1 + self.on_migrate(self.migration_count) def blocking_iterate(self, wait_for_user_input=False): blocker(self._iterate(wait_for_user_input)) @@ -385,6 +387,8 @@ def qmp_gui(args, migrator): migrator.loop(args.sleep*1000) def on_quit(button): mainloop.quit() + def on_migrate(mig_count): + b.set_label("migrated %d" % mig_count) vbox = gtk.VBox() w = gtk.Window() w.add(vbox) @@ -395,6 +399,7 @@ def qmp_gui(args, migrator): vbox.add(b) b.connect("clicked", on_click) w.show_all() + migrator.on_migrate = on_migrate return mainloop def main_gui(args, extra_args, extra_per_vm=([], [])): |