From 21d090d6fad95aa61062b2a29aef81c82bcf1db8 Mon Sep 17 00:00:00 2001 From: "Hugh O. Brock" Date: Wed, 25 Apr 2007 17:51:42 -0400 Subject: [PATCH] Fix NIC naming, make MAC address copy-and-pastable again --- src/virtManager/details.py | 7 +-- src/virtManager/domain.py | 7 +-- src/vmm-details.glade | 113 ++++++++----------------------------- 3 files changed, 30 insertions(+), 97 deletions(-) diff --git a/src/virtManager/details.py b/src/virtManager/details.py index aa9829b0c..fbd6f5d67 100644 --- a/src/virtManager/details.py +++ b/src/virtManager/details.py @@ -415,7 +415,6 @@ class vmmDetails(gobject.GObject): self.window.get_widget("network-source-device").set_text(netinfo[1]) else: self.window.get_widget("network-source-device").set_text("-") - self.window.get_widget("network-target-device").set_text(netinfo[2]) self.window.get_widget("network-mac-address").set_text(netinfo[3]) def config_vcpus_changed(self, src): @@ -427,8 +426,6 @@ class vmmDetails(gobject.GObject): self.vm.set_vcpu_count(vcpus) self.window.get_widget("config-vcpus-apply").set_sensitive(False) - - def config_memory_changed(self, src): self.window.get_widget("config-memory-apply").set_sensitive(True) @@ -541,13 +538,13 @@ class vmmDetails(gobject.GObject): row[3] = nic missing = False - # Insert poisition is at end.... + # Insert position is at end.... # XXX until we add support for Mice, etc insertAt = insertAt + 1 # Add in row if missing: - hw_list_model.insert(insertAt, ["NIC %s" % nic[2], self.pixbuf_nic, VMM_HW_NIC, nic]) + hw_list_model.insert(insertAt, ["NIC #%d" % len(currentNICs), self.pixbuf_nic, VMM_HW_NIC, nic]) # Now remove any no longer current devs devs = range(len(hw_list_model)) diff --git a/src/virtManager/domain.py b/src/virtManager/domain.py index d557c45a4..82f9adc88 100644 --- a/src/virtManager/domain.py +++ b/src/virtManager/domain.py @@ -497,13 +497,11 @@ class vmmDomain(gobject.GObject): try: ret = ctx.xpathEval("/domain/devices/interface") - n = 0 for node in ret: type = node.prop("type") devmac = None source = None - target = "eth%d" % n - n = n + 1 + target = None for child in node.children: if child.name == "source": if type == "bridge": @@ -518,7 +516,8 @@ class vmmDomain(gobject.GObject): source = None elif child.name == "mac": devmac = child.prop("address") - + elif child.name == "target": + target = child.prop("dev") # XXX Hack - ignore devs without a MAC, since we # need mac for uniqueness. Some reason XenD doesn't # always complete kill the NIC record diff --git a/src/vmm-details.glade b/src/vmm-details.glade index 28a66ede3..f3db5d441 100644 --- a/src/vmm-details.glade +++ b/src/vmm-details.glade @@ -2341,7 +2341,7 @@ 3 True - 4 + 3 2 False 3 @@ -2425,36 +2425,8 @@ 0 1 - 3 - 4 - fill - - - - - - - True - label396 - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 3 - 4 + 2 + 3 fill @@ -2488,62 +2460,6 @@ - - - True - Target device: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - label399 - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 2 - 3 - fill - - - - True @@ -2571,6 +2487,27 @@ + + + + True + True + False + True + 0 + + True + + False + + + 1 + 2 + 2 + 3 + + + @@ -2658,7 +2595,7 @@ True - <b>Tip:</b> 'source' refers to information seen from the host OS, while 'target' refers to information seen from the guest OS + <b>Tip:</b> 'Source device' refers to the name of the device as seen from the host OS. False True GTK_JUSTIFY_LEFT