createinterface: Fix 'copy child protocol' behavior (bug 1122743)

We should only copy the inactive protocol XML, which lists things
like dhcp, vs the running XML, which is the same format as static
addressing.
This commit is contained in:
Cole Robinson 2014-09-21 15:02:27 -04:00
parent 6a9aa6827b
commit bd0bcba0b5
2 changed files with 10 additions and 5 deletions

View File

@ -789,9 +789,14 @@ class vmmCreateInterface(vmmGObjectUI):
ipv6 = None
if not is_manual:
if copy_row[1] and copy_row[2]:
copy_name = copy_row[1].get_name()
proto_xml = copy_row[1].get_protocol_xml()
copy_vmmiface = copy_row[1]
copy_cancopy = copy_row[2]
if copy_vmmiface and copy_cancopy:
copy_name = copy_vmmiface.get_name()
# We always want the inactive protocol XML, which
# will list the on disk config, not the run time config,
# which doesn't list DHCP
proto_xml = copy_vmmiface.get_protocol_xml(inactive=True)
else:
# Build IPv4 Info

View File

@ -157,5 +157,5 @@ class vmmInterface(vmmLibvirtObject):
return []
return [proto.dhcp, proto.autoconf, ips]
def get_protocol_xml(self):
return self.get_xmlobj().protocols[:]
def get_protocol_xml(self, inactive=False):
return self.get_xmlobj(inactive=inactive).protocols[:]