mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-29 20:43:48 +02:00
Fixes suspend and resume for Qemu.
This commit is contained in:
parent
f188bc43e1
commit
d87ebb3ed2
@ -537,7 +537,7 @@ class QemuVM(BaseVM):
|
|||||||
if self.is_running():
|
if self.is_running():
|
||||||
|
|
||||||
# resume the VM if it is paused
|
# resume the VM if it is paused
|
||||||
self.resume()
|
yield from self.resume()
|
||||||
return
|
return
|
||||||
|
|
||||||
else:
|
else:
|
||||||
@ -598,7 +598,7 @@ class QemuVM(BaseVM):
|
|||||||
if self.is_running() and self._monitor:
|
if self.is_running() and self._monitor:
|
||||||
log.debug("Execute QEMU monitor command: {}".format(command))
|
log.debug("Execute QEMU monitor command: {}".format(command))
|
||||||
try:
|
try:
|
||||||
reader, writer = yield from asyncio.open_connection("127.0.0.1", self._monitor)
|
reader, writer = yield from asyncio.open_connection(self._monitor_host, self._monitor)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
log.warn("Could not connect to QEMU monitor: {}".format(e))
|
log.warn("Could not connect to QEMU monitor: {}".format(e))
|
||||||
return result
|
return result
|
||||||
@ -616,7 +616,7 @@ class QemuVM(BaseVM):
|
|||||||
break
|
break
|
||||||
for expect in expected:
|
for expect in expected:
|
||||||
if expect in line:
|
if expect in line:
|
||||||
result = line
|
result = line.decode().strip()
|
||||||
break
|
break
|
||||||
except EOFError as e:
|
except EOFError as e:
|
||||||
log.warn("Could not read from QEMU monitor: {}".format(e))
|
log.warn("Could not read from QEMU monitor: {}".format(e))
|
||||||
@ -644,7 +644,7 @@ class QemuVM(BaseVM):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
result = yield from self._control_vm("info status", [b"running", b"paused"])
|
result = yield from self._control_vm("info status", [b"running", b"paused"])
|
||||||
return result
|
return result.rsplit(' ', 1)[1]
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def suspend(self):
|
def suspend(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user