1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
# HG changeset patch
# User Cole Robinson <crobinso@redhat.com>
# Date 1237844305 14400
# Node ID c0da7f8bb4be5ca9ace313b5e94c002248088081
# Parent 8077dae2ea80d56914648d7508e9fcbea0690563
Pull necessary info from vm object when building migrate list.
diff -r 8077dae2ea80 -r c0da7f8bb4be src/virtManager/details.py
--- a/src/virtManager/details.py Fri Mar 13 14:37:57 2009 -0400
+++ b/src/virtManager/details.py Mon Mar 23 17:38:25 2009 -0400
@@ -727,7 +727,8 @@
def set_migrate_menu(self):
menu = self.window.get_widget("details-menu-migrate_menu")
- self.engine.populate_migrate_menu(menu, self.control_vm_migrate)
+ self.engine.populate_migrate_menu(menu, self.control_vm_migrate,
+ self.vm)
def set_pause_widget_states(self, state):
try:
diff -r 8077dae2ea80 -r c0da7f8bb4be src/virtManager/engine.py
--- a/src/virtManager/engine.py Fri Mar 13 14:37:57 2009 -0400
+++ b/src/virtManager/engine.py Mon Mar 23 17:38:25 2009 -0400
@@ -574,8 +574,8 @@
migrate_progress.set_title(" ")
return migrate_progress
- def populate_migrate_menu(self, menu, migrate_func):
- conns = self.get_available_migrate_hostnames()
+ def populate_migrate_menu(self, menu, migrate_func, vm):
+ conns = self.get_available_migrate_hostnames(vm)
# Clear menu
for item in menu:
@@ -597,9 +597,9 @@
mitem.show()
menu.add(mitem)
- def get_available_migrate_hostnames(self):
- driver = self.windowManager.current_connection().get_driver()
- uri = self.windowManager.current_connection().get_uri()
+ def get_available_migrate_hostnames(self, vm):
+ driver = vm.get_connection().get_driver()
+ uri = vm.get_connection().get_uri()
available_migrate_hostnames = {}
# Returns list of lists of the form
diff -r 8077dae2ea80 -r c0da7f8bb4be src/virtManager/manager.py
--- a/src/virtManager/manager.py Fri Mar 13 14:37:57 2009 -0400
+++ b/src/virtManager/manager.py Mon Mar 23 17:38:25 2009 -0400
@@ -1124,7 +1124,12 @@
vm.get_uuid(), hostname)
def set_migrate_submenu(self, src):
- self.engine.populate_migrate_menu(self.vmmenumigrate, self.migrate)
+ vm = self.current_vm()
+ if not vm:
+ return
+
+ self.engine.populate_migrate_menu(self.vmmenumigrate, self.migrate,
+ vm)
def _add_connection(self, engine, conn):
conn.connect("vm-added", self.vm_added)
|