diff --git a/AUTHORS b/AUTHORS index 09ea56d69..7af5b860d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -159,6 +159,7 @@ Further patches have been submitted by: Ken ICHIKAWA Tom Lanyon Eric Blake + Gene Czarcinski <...send a patch & get your name here...> diff --git a/tests/testdriver.xml b/tests/testdriver.xml index a150e9d80..66ebb7700 100644 --- a/tests/testdriver.xml +++ b/tests/testdriver.xml @@ -141,6 +141,131 @@ + + net0 + 591d28b3-25fd-21f5-ac71-e1877d787945 + + + + + net6 + e08c0cc3-b892-b53b-c41d-c4f526291be9 + + + + + + + + + + + + + + + + + net7 + 41b4afe4-87bb-8087-6724-5e208a2d483a + + + + + + + + + + + + + + + + + + + + + + + + + net8 + f9c6675f-98f8-ce75-b39a-02c1d23081e0 + + + + + + + + + + + + + + + + + + + + + + net9 + 327b43c5-6900-2e2c-7f14-e1a29bb2c9f5 + + + + + + + + + + + + + + + + + + + + + net91 + c1621b18-797c-e2cb-71f6-21ca120e51cc + + + + + + + + + net92 + bf2e337c-ee12-a1d5-4c14-7185191fe00b + + + + + + + + net93 + f117daa4-5aaf-43d9-3c09-d9e522e5a1df + + + + + + + + default-pool 35bb2ad9-388a-cdfe-461a-b8907f6e53fe diff --git a/ui/vmm-host.ui b/ui/vmm-host.ui index 5334f0776..aca4cb73f 100644 --- a/ui/vmm-host.ui +++ b/ui/vmm-host.ui @@ -1,6 +1,7 @@ + True @@ -328,7 +329,6 @@ True False True - 0.5 True @@ -495,9 +495,6 @@ True True False - - - @@ -515,177 +512,320 @@ True False - 20 + 10 - + True False - 0 - none + 0 - + True False - 6 - 4 - 2 - 6 - 5 + 0 + none - + True False - 0 - Name: - - - GTK_FILL - - - - - - True - False - 0 - Device: - - - 1 - 2 - GTK_FILL - - - - - - True - False - 0 - State: - - - 2 - 3 - GTK_FILL - - - - - - True - False - 3 + 6 + 7 + 2 + 6 + 5 - - True - False - gtk-missing-image - - - False - True - 0 - - - - + True False 0 - Running + Name: - True - True - 1 + GTK_FILL + + + + + + True + False + 0 + Device: + + + 1 + 2 + GTK_FILL + + + + + + True + False + 0 + State: + + + 2 + 3 + GTK_FILL + + + + + + True + False + 3 + + + True + False + gtk-missing-image + + + False + True + 0 + + + + + True + False + 0 + Running + + + True + True + 1 + + + + + 1 + 2 + 2 + 3 + GTK_FILL + + + + + + True + False + 0 + A_utostart: + True + net-autostart + + + 3 + 4 + GTK_FILL + + + + + + Some Label + True + True + False + True + True + + + + 1 + 2 + 3 + 4 + GTK_FILL + + + + + + True + False + 0 + label + True + + + 1 + 2 + + + + + + True + False + 0 + label + True + + + 1 + 2 + 1 + 2 + + + + + + True + False + 0 + DNS Domain Name: + True + + + 4 + 5 + GTK_FILL + + + + + + True + False + 0 + IPv4 Forwarding: + + + 5 + 6 + GTK_FILL + + + + + + True + False + 0 + + + 1 + 2 + 4 + 5 + + + + + + True + False + 3 + + + True + False + gtk-missing-image + + + False + False + 0 + + + + + True + False + 0 + NAT to any device + + + True + True + 1 + + + + + 1 + 2 + 5 + 6 + GTK_FILL + + + + + + True + False + 0 + IPv6 Forwarding: + + + 6 + 7 + GTK_FILL + + + + + + True + False + 3 + + + True + False + gtk-missing-image + + + False + False + 0 + + + + + True + False + 0 + Routed + + + True + True + 1 + + + + + 1 + 2 + 6 + 7 + GTK_FILL + - - 1 - 2 - 2 - 3 - GTK_FILL - - - - + + True False 0 - A_utostart: - True - net-autostart + <b>Basic details</b> + True - - 3 - 4 - GTK_FILL - - - - - Some Label - True - True - False - True - 0.5 - True - - - - 1 - 2 - 3 - 4 - GTK_FILL - - - - - - True - False - 0 - label - True - - - 1 - 2 - - - - - - True - False - 0 - label - True - - - 1 - 2 - 1 - 2 - - - - - - - - True - False - 0 - <b>Basic details</b> - True @@ -696,177 +836,310 @@ - + True False - 0 - none - + True False - 6 - 4 - 2 - 6 - 5 + 0 + none - + True False - 0 - Network: - - - GTK_FILL - - - - - - True - False - 0 - DHCP start: - - - 1 - 2 - GTK_FILL - - - - - - True - False - 0 - DHCP end: - - - 2 - 3 - GTK_FILL - - - - - - True - False - 0 - Forwarding: - - - 3 - 4 - GTK_FILL - - - - - - True - False - 3 + 6 + 4 + 2 + 6 + 5 - - True - False - gtk-missing-image - - - False - False - 0 - - - - + True False 0 - NAT to any physical device + Network: - False - False - 1 + GTK_FILL + + + + + + True + False + 0 + DHCP start: + + + 1 + 2 + GTK_FILL + + + + + + True + False + 0 + DHCP end: + + + 2 + 3 + GTK_FILL + + + + + + True + False + 0 + label + True + + + 1 + 2 + GTK_FILL + + + + + True + False + 0 + label + True + + + 1 + 2 + 1 + 2 + GTK_FILL + + + + + True + False + 0 + label + True + + + 1 + 2 + 2 + 3 + GTK_FILL + + + + + True + False + 0 + Route-Via: + + + 3 + 4 + + + + + True + False + 0 + <network-addr> via <gateway-addr> + + + 1 + 2 + 3 + 4 + GTK_FILL - - 1 - 2 - 3 - 4 - GTK_FILL - GTK_FILL - - - + + True False - 0 - label - True + <b>IPv4 configuration</b> + True - - 1 - 2 - GTK_FILL - - - - True - False - 0 - label - True - - - 1 - 2 - 1 - 2 - GTK_FILL - - - - - True - False - 0 - label - True - - - 1 - 2 - 2 - 3 - GTK_FILL - - - - - - - True - False - <b>IPv4 configuration</b> - True - True + False True 1 + + + True + False + + + True + False + 0 + none + + + True + False + 6 + 4 + 2 + 6 + 5 + + + True + False + 0 + Network: + + + GTK_FILL + + + + + + True + False + 0 + DHCP start: + + + 1 + 2 + GTK_FILL + + + + + + True + False + 0 + DHCP end: + + + 2 + 3 + GTK_FILL + + + + + + True + False + 0 + Route-Via: + + + 3 + 4 + GTK_FILL + + + + + + True + False + 0 + label + True + + + 1 + 2 + GTK_FILL + + + + + True + False + 0 + label + True + + + 1 + 2 + 1 + 2 + GTK_FILL + + + + + True + False + 0 + label + True + + + 1 + 2 + 2 + 3 + GTK_FILL + + + + + True + False + 0 + <network-addr> via <gateway-addr> + True + + + 1 + 2 + 3 + 4 + GTK_FILL + + + + + + + True + False + <b>IPv6 configuration</b> + True + + + + + + + False + True + 2 + + True @@ -875,7 +1148,7 @@ False True - 2 + 3 @@ -1100,9 +1373,6 @@ True True False - - - @@ -1284,7 +1554,6 @@ True False True - 0.5 True @@ -1383,9 +1652,6 @@ True True - - - @@ -1653,9 +1919,6 @@ True True False - - - @@ -2073,9 +2336,6 @@ True True - - - diff --git a/virtManager/createnet.py b/virtManager/createnet.py index 79dd2490d..846cfbfb0 100644 --- a/virtManager/createnet.py +++ b/virtManager/createnet.py @@ -21,7 +21,7 @@ import logging import re -from IPy import IP +import ipaddr from gi.repository import Gtk from gi.repository import Gdk @@ -153,7 +153,7 @@ class vmmCreateNetwork(vmmGObjectUI): src.modify_text(Gtk.StateType.NORMAL, black) # No IP specified or invalid IP - if ip is None or ip.version() != 4: + if ip is None or ip.version != 4: src.modify_base(Gtk.StateType.NORMAL, red) self.widget("net-info-netmask").set_text("") self.widget("net-info-broadcast").set_text("") @@ -162,26 +162,25 @@ class vmmCreateNetwork(vmmGObjectUI): self.widget("net-info-type").set_text("") return + # FIXME: handle other networks and not just private? # We've got a valid IP - if ip.len() < 4 or ip.iptype() != "PRIVATE": - src.modify_base(Gtk.StateType.NORMAL, red) + if ip.numhosts < 16 or not ip.is_private: + src.modify_base(gtk.STATE_NORMAL, red) else: src.modify_base(Gtk.StateType.NORMAL, green) - self.widget("net-info-netmask").set_text(str(ip.netmask())) - self.widget("net-info-broadcast").set_text(str(ip.broadcast())) + self.widget("net-info-netmask").set_text(str(ip.netmask)) + self.widget("net-info-broadcast").set_text(str(ip.broadcast)) - if ip.len() <= 1: + if ip.prefixlen == 32: self.widget("net-info-gateway").set_text("") else: - self.widget("net-info-gateway").set_text(str(ip[1])) + self.widget("net-info-gateway").set_text(str(ip.network + 1)) self.widget("net-info-size").set_text(_("%d addresses") % - (ip.len())) + (ip.numhosts)) - if ip.iptype() == "PUBLIC": - self.widget("net-info-type").set_text(_("Public")) - elif ip.iptype() == "PRIVATE": + if ip.is_private: self.widget("net-info-type").set_text(_("Private")) - elif ip.iptype() == "RESERVED": + elif ip.is_reserved: self.widget("net-info-type").set_text(_("Reserved")) else: self.widget("net-info-type").set_text(_("Other")) @@ -192,8 +191,8 @@ class vmmCreateNetwork(vmmGObjectUI): self.widget("net-dhcp-end").set_sensitive(val) def change_dhcp_start(self, src): - end = self.get_config_dhcp_start() - self.change_dhcp(src, end) + start = self.get_config_dhcp_start() + self.change_dhcp(src, start) def change_dhcp_end(self, src): end = self.get_config_dhcp_end() @@ -222,18 +221,18 @@ class vmmCreateNetwork(vmmGObjectUI): def get_config_ip4(self): try: - return IP(self.widget("net-network").get_text()) + return ipaddr.IPNetwork(self.widget("net-network").get_text()) except: return None def get_config_dhcp_start(self): try: - return IP(self.widget("net-dhcp-start").get_text()) + return ipaddr.IPNetwork(self.widget("net-dhcp-start").get_text()) except: return None def get_config_dhcp_end(self): try: - return IP(self.widget("net-dhcp-end").get_text()) + return ipaddr.IPNetwork(self.widget("net-dhcp-end").get_text()) except: return None @@ -260,16 +259,16 @@ class vmmCreateNetwork(vmmGObjectUI): ip = self.get_config_ip4() self.widget("summary-ip4-network").set_text(str(ip)) - self.widget("summary-ip4-gateway").set_text(str(ip[1])) - self.widget("summary-ip4-netmask").set_text(str(ip.netmask())) + self.widget("summary-ip4-gateway").set_text(str(ip.network + 1)) + self.widget("summary-ip4-netmask").set_text(str(ip.netmask)) self.widget("label-dhcp-end").set_property("visible", dodhcp) self.widget("summary-dhcp-end").set_property("visible", dodhcp) if dodhcp: start = self.get_config_dhcp_start() end = self.get_config_dhcp_end() - self.widget("summary-dhcp-start").set_text(str(start)) - self.widget("summary-dhcp-end").set_text(str(end)) + self.widget("summary-dhcp-start").set_text(str(start.network)) + self.widget("summary-dhcp-end").set_text(str(end.network)) self.widget("label-dhcp-start").set_text(_("Start address:")) self.widget("label-dhcp-end").show() self.widget("summary-dhcp-end").show() @@ -284,13 +283,13 @@ class vmmCreateNetwork(vmmGObjectUI): def populate_dhcp(self): ip = self.get_config_ip4() - start = int(ip.len() / 2) - end = ip.len() - 2 + start = int(ip.numhosts / 2) + end = int(ip.numhosts - 2) if self.widget("net-dhcp-start").get_text() == "": - self.widget("net-dhcp-start").set_text(str(ip[start])) + self.widget("net-dhcp-start").set_text(str(ip.network + start)) if self.widget("net-dhcp-end").get_text() == "": - self.widget("net-dhcp-end").set_text(str(ip[end])) + self.widget("net-dhcp-end").set_text(str(ip.network + end)) def page_changed(self, ignore1, ignore2, page_number): if page_number == PAGE_NAME: @@ -331,13 +330,13 @@ class vmmCreateNetwork(vmmGObjectUI): else: xml += " \n" % mode - xml += " \n" % (str(ip[1]), - str(ip.netmask())) + xml += " \n" % (str(ip.network + 1), + str(ip.netmask)) if self.get_config_dhcp_enable(): xml += " \n" - xml += " \n" % (str(start), - str(end)) + xml += " \n" % (str(start.network), + str(end.network)) xml += " \n" xml += " \n" @@ -372,15 +371,15 @@ class vmmCreateNetwork(vmmGObjectUI): return self.err.val_err(_("Invalid Network Address"), _("The network address could not be understood")) - if ip.version() != 4: + if ip.version != 4: return self.err.val_err(_("Invalid Network Address"), _("The network must be an IPv4 address")) - if ip.len() < 4: + if ip.numhosts < 16: return self.err.val_err(_("Invalid Network Address"), - _("The network prefix must be at least /4 (16 addresses)")) + _("The network prefix must be at least /28 (16 addresses)")) - if ip.iptype() != "PRIVATE": + if not ip.is_private: res = self.err.yes_no(_("Check Network Address"), _("The network should normally use a private IPv4 " "address. Use this non-private address anyway?")) diff --git a/virtManager/host.py b/virtManager/host.py index ff50f8273..690af0713 100644 --- a/virtManager/host.py +++ b/virtManager/host.py @@ -508,7 +508,14 @@ class vmmHost(vmmGObjectUI): return self.widget("network-pages").set_current_page(0) - net = self.conn.get_net(selected[0].get_value(selected[1], 0)) + try: + net = self.conn.get_net(selected[0].get_value(selected[1], 0)) + except KeyError: + self.widget("net-apply").set_sensitive(False) + return + except Exception, e: + logging.exception(e) + self.set_net_error_page(_("Error selecting network: %s") % e) try: self.populate_net_state(net) @@ -523,6 +530,11 @@ class vmmHost(vmmGObjectUI): self.widget("net-details").set_sensitive(True) self.widget("net-name").set_text(net.get_name()) + dns_name = net.get_name_domain() + if dns_name: + self.widget("net-name-domain").set_text(dns_name) + else: + self.widget("net-name-domain").set_text("") dev = active and net.get_bridge_device() or "" state = active and _("Active") or _("Inactive") @@ -544,24 +556,76 @@ class vmmHost(vmmGObjectUI): self.widget("net-autostart").set_active(autostart) self.widget("net-autostart").set_label(autolabel) - network = net.get_ipv4_network() + ######### IPv4 ######### + result = net.get_ipv4_network() + network = result[0] + dhcp = result[1] + route = result[2] + if network: + self.widget("net-frame-ip4").show() + else: + self.widget("net-frame-ip4").hide() self.widget("net-ip4-network").set_text(str(network)) - dhcp = net.get_ipv4_dhcp_range() start = dhcp and str(dhcp[0]) or _("Disabled") end = dhcp and str(dhcp[1]) or _("Disabled") self.widget("net-ip4-dhcp-start").set_text(start) self.widget("net-ip4-dhcp-end").set_text(end) + if route and route[0] and route[1]: + routeVia = str(route[0]) + " via " + str(route[1]) + self.widget("net-ip4-route-label").show() + else: + routeVia = _("") + self.widget("net-ip4-route-label").hide() + self.widget("net-ip4-route-via").set_text(routeVia) forward, ignore = net.get_ipv4_forward() iconsize = Gtk.IconSize.MENU icon = forward and Gtk.STOCK_CONNECT or Gtk.STOCK_DISCONNECT - self.widget("net-ip4-forwarding-icon").set_from_stock(icon, iconsize) - forward_str = net.pretty_forward_mode() self.widget("net-ip4-forwarding").set_text(forward_str) + ######### IPv6 ######### + result = net.get_ipv6_network() + network = result[0] + dhcp = result[1] + route = result[2] + if network: + self.widget("net-frame-ip6").show() + iconsize = Gtk.IconSize.MENU + icon = Gtk.STOCK_CONNECT + self.widget("net-ip6-forwarding-icon").set_from_stock(icon, iconsize) + self.widget("net-ip6-forwarding").set_text(_("Routed network")) + else: + self.widget("net-frame-ip6").hide() + iconsize = Gtk.IconSize.MENU + icon = Gtk.STOCK_DISCONNECT + self.widget("net-ip6-forwarding-icon").set_from_stock(icon, iconsize) + ipv6 = net.get_ipv6_route() + if ipv6: + self.widget("net-ip6-forwarding").set_text( + _("Isolated network, internal and host routing only")) + elif ipv6 == 'yes': + self.widget("net-ip6-forwarding").set_text( + _("Isolated network, internal routing only")) + else: + self.widget("net-ip6-forwarding").set_text( + _("Isolated network, routing disabled")) + self.widget("net-ip6-network").set_text(str(network)) + + start = dhcp and str(dhcp[0]) or _("Disabled") + end = dhcp and str(dhcp[1]) or _("Disabled") + self.widget("net-ip6-dhcp-start").set_text(start) + self.widget("net-ip6-dhcp-end").set_text(end) + if route and route[0] and route[1]: + routeVia = str(route[0]) + " via " + str(route[1]) + self.widget("net-ip6-route-label").show() + else: + routeVia = "" + self.widget("net-ip6-route-label").hide() + self.widget("net-ip6-route-via").set_text(routeVia) + def reset_net_state(self): self.widget("net-details").set_sensitive(False) @@ -579,10 +643,19 @@ class vmmHost(vmmGObjectUI): self.widget("net-ip4-network").set_text("") self.widget("net-ip4-dhcp-start").set_text("") self.widget("net-ip4-dhcp-end").set_text("") + self.widget("net-ip4-route-label").hide() + self.widget("net-ip4-route-via").set_text("") self.widget("net-ip4-forwarding-icon").set_from_stock( Gtk.STOCK_DISCONNECT, Gtk.IconSize.MENU) self.widget("net-ip4-forwarding").set_text( - _("Isolated virtual network")) + _("Isolated network")) + self.widget("net-ip6-network").set_text("") + self.widget("net-ip6-dhcp-start").set_text("") + self.widget("net-ip6-dhcp-end").set_text("") + self.widget("net-ip6-route-label").hide() + self.widget("net-ip6-route-via").set_text("") + self.widget("net-ip6-forwarding").set_text( + _("Isolated network")) self.widget("net-apply").set_sensitive(False) def repopulate_networks(self, src_ignore, uuid_ignore): diff --git a/virtManager/network.py b/virtManager/network.py index 13a16e337..a28bdb6f8 100644 --- a/virtManager/network.py +++ b/virtManager/network.py @@ -18,9 +18,9 @@ # MA 02110-1301 USA. # -from IPy import IP - from virtManager import util +import ipaddr +import libxml2 from virtManager.libvirtobject import vmmLibvirtObject class vmmNetwork(vmmLibvirtObject): @@ -43,7 +43,7 @@ class vmmNetwork(vmmLibvirtObject): else: desc = "%s network" % forward.capitalize() else: - desc = _("Isolated network") + desc = _("Isolated network, internal and host routing only") return desc @@ -97,27 +97,137 @@ class vmmNetwork(vmmLibvirtObject): return self.net.autostart() def get_ipv4_network(self): + doc = None + ret = None + goodNode = None + dhcpstart = None + dhcpend = None + routeAddr = None + routeVia = None xml = self.get_xml() - if util.xpath(xml, "/network/ip") is None: - return None - addrStr = util.xpath(xml, "/network/ip/@address") - netmaskStr = util.xpath(xml, "/network/ip/@netmask") - prefix = util.xpath(xml, "/network/ip/@prefix") + doc = libxml2.parseDoc(xml) + nodes = doc.xpathEval('//ip') + for node in nodes: + family = node.xpathEval('string(./@family)') + if not family or family == 'ipv4': + dhcp = node.xpathEval('string(./dhcp)') + if dhcp: + dhcpstart = node.xpathEval('string(./dhcp/range[1]/@start)') + dhcpend = node.xpathEval('string(./dhcp/range[1]/@end)') + goodNode = node + break - if prefix: - prefix = int(prefix) - binstr = ((prefix * "1") + ((32 - prefix) * "0")) - netmaskStr = str(IP(int(binstr, base=2))) + for node in nodes: + family = node.xpathEval('string(./@family)') + if not family or family == 'ipv4': + routeVia = node.xpathEval('string(./@via)') + if routeVia: + routeAddr = node.xpathEval('string(./@address)') + break; - if netmaskStr: - netmask = IP(netmaskStr) - gateway = IP(addrStr) - network = IP(gateway.int() & netmask.int()) - ret = IP(str(network) + "/" + netmaskStr) + if goodNode == None: + for node in nodes: + family = node.xpathEval('string(./@family)') + if not family or family == 'ipv4': + tmp = node.xpathEval('string(./@via)') + if tmp: + continue + goodNode = node; + break + + if goodNode: + addrStr = goodNode.xpathEval('string(./@address)') + netmaskStr = goodNode.xpathEval('string(./@netmask)') + prefix = goodNode.xpathEval('string(./@prefix)') + if prefix: + prefix = int(prefix) + ret = str(ipaddr.IPNetwork(str(addrStr) + "/" + str(prefix)).masked()) + elif netmaskStr: + netmask = ipaddr.IPAddress(netmaskStr) + network = ipaddr.IPAddress(addrStr) + ret = str(ipaddr.IPNetwork(str(network) + "/" + str(netmask)).masked()) + else: + ret = str(ipaddr.IPNetwork(str(addrStr))) + if doc: + doc.freeDoc() + if dhcpstart and dhcpend: + dhcp = [str(ipaddr.IPAddress(dhcpstart)), str(ipaddr.IPAddress(dhcpend))] else: - ret = IP(str(addrStr)) + dhcp = None + if routeAddr and routeVia: + route = [str(ipaddr.IPAddress(routeAddr)), str(ipaddr.IPAddress(routeVia))] + else: + route = None + return [ret, dhcp, route] - return ret + def get_ipv6_network(self): + doc = None + ret = None + goodNode = None + dhcpstart = None + dhcpend = None + routeAddr = None + routeVia = None + xml = self.get_xml() + doc = libxml2.parseDoc(xml) + nodes = doc.xpathEval('//ip') + for node in nodes: + family = node.xpathEval('string(./@family)') + if family and family == 'ipv6': + dhcp = node.xpathEval('string(./dhcp)') + if dhcp: + dhcpstart = node.xpathEval('string(./dhcp/range[1]/@start)') + dhcpend = node.xpathEval('string(./dhcp/range[1]/@end)') + goodNode = node + break + + for node in nodes: + family = node.xpathEval('string(./@family)') + if family and family == 'ipv6': + routeVia = node.xpathEval('string(./@via)') + if routeVia: + routeAddr = node.xpathEval('string(./@address)') + break; + + if goodNode == None: + for node in nodes: + family = node.xpathEval('string(./@family)') + if family and family == 'ipv6': + tmp = node.xpathEval('string(./@via)') + if tmp: + continue + goodNode = node; + break + + if goodNode: + addrStr = goodNode.xpathEval('string(./@address)') + prefix = goodNode.xpathEval('string(./@prefix)') + if prefix: + prefix = int(prefix) + ret = str(ipaddr.IPNetwork(str(addrStr) + "/" + str(prefix)).masked()) + else: + ret = str(ipaddr.IPNetwork(str(addrStr))) + if doc: + doc.freeDoc() + if dhcpstart and dhcpend: + dhcp = [str(ipaddr.IPAddress(dhcpstart)), str(ipaddr.IPAddress(dhcpend))] + else: + dhcp = None + if routeAddr and routeVia: + route = [str(ipaddr.IPAddress(routeAddr)), str(ipaddr.IPAddress(routeVia))] + else: + route = None + return [ret, dhcp, route] + + def get_name_domain(self): + xml = self.get_xml() + name_domain = util.xpath(xml, "/network/domain/@name") + return name_domain + + def get_ipv6_route(self): + xml = self.get_xml() + ipv6_route = util.xpath(xml, "/network/@ipv6") + return ipv6_route def get_ipv4_forward(self): xml = self.get_xml() @@ -125,15 +235,6 @@ class vmmNetwork(vmmLibvirtObject): forwardDev = util.xpath(xml, "/network/forward/@dev") return [fw, forwardDev] - def get_ipv4_dhcp_range(self): - xml = self.get_xml() - dhcpstart = util.xpath(xml, "/network/ip/dhcp/range[1]/@start") - dhcpend = util.xpath(xml, "/network/ip/dhcp/range[1]/@end") - if not dhcpstart or not dhcpend: - return None - - return [IP(dhcpstart), IP(dhcpend)] - def pretty_forward_mode(self): forward, forwardDev = self.get_ipv4_forward() return vmmNetwork.pretty_desc(forward, forwardDev)