mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-11 05:17:59 +03:00
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:
parent
6a9aa6827b
commit
bd0bcba0b5
@ -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
|
||||
|
@ -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[:]
|
||||
|
Loading…
Reference in New Issue
Block a user