mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +00:00
Release UDP ports when closing a Qemu VM. Fixes #323.
This commit is contained in:
parent
6cd790880c
commit
a6286db7b1
@ -665,11 +665,19 @@ class QemuVM(BaseVM):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
log.debug('QEMU VM "{name}" [{id}] is closing'.format(name=self._name, id=self._id))
|
log.debug('QEMU VM "{name}" [{id}] is closing'.format(name=self._name, id=self._id))
|
||||||
yield from self.stop()
|
|
||||||
if self._console:
|
if self._console:
|
||||||
self._manager.port_manager.release_tcp_port(self._console, self._project)
|
self._manager.port_manager.release_tcp_port(self._console, self._project)
|
||||||
self._console = None
|
self._console = None
|
||||||
|
|
||||||
|
for adapter in self._ethernet_adapters:
|
||||||
|
if adapter is not None:
|
||||||
|
for nio in adapter.ports.values():
|
||||||
|
if nio and isinstance(nio, NIOUDP):
|
||||||
|
self.manager.port_manager.release_udp_port(nio.lport, self._project)
|
||||||
|
|
||||||
|
yield from self.stop()
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def _get_vm_status(self):
|
def _get_vm_status(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user