Fix trouble with builtin devices when we free ports

Fix #825
This commit is contained in:
Julien Duponchelle
2016-12-12 19:17:06 +01:00
parent 9872fc09b7
commit d2f0cddbd7
12 changed files with 125 additions and 221 deletions

View File

@ -111,6 +111,10 @@ class EthernetHub(Bridge):
@asyncio.coroutine
def delete(self):
return (yield from self.close())
@asyncio.coroutine
def close(self):
"""
Deletes this hub.
"""
@ -126,6 +130,8 @@ class EthernetHub(Bridge):
log.debug("Could not properly delete Ethernet hub {}".format(self._name))
if self._hypervisor and not self._hypervisor.devices:
yield from self.hypervisor.stop()
self._hypervisor = None
return True
@asyncio.coroutine
def add_nio(self, nio, port_number):