qubes/vm: fix network attach/detach

This commit is contained in:
Marek Marczykowski-Górecki 2016-05-20 02:56:05 +02:00 committed by Wojtek Porczyk
parent 3b407eb79e
commit b24ab45d00

View File

@ -202,8 +202,9 @@ class NetVMMixin(qubes.events.Emitter):
self.log.info('Starting NetVM ({0})'.format(self.netvm.name))
self.netvm.start()
self.libvirt_domain.attachDevice(lxml.etree.ElementTree(
self.lvxml_net_dev(self.ip, self.mac, self.netvm)).tostring())
self.libvirt_domain.attachDevice(
lxml.etree.tostring(lxml.etree.ElementTree(
self.lvxml_net_dev(self.ip, self.mac, self.netvm))))
def detach_network(self):
@ -213,8 +214,9 @@ class NetVMMixin(qubes.events.Emitter):
raise qubes.exc.QubesVMNotRunningError(self)
assert self.netvm is not None
self.libvirt_domain.detachDevice(lxml.etree.ElementTree(
self.lvxml_net_dev(self.ip, self.mac, self.netvm)).tostring())
self.libvirt_domain.detachDevice(
lxml.etree.tostring(lxml.etree.ElementTree(
self.lvxml_net_dev(self.ip, self.mac, self.netvm))))
def is_networked(self):