mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-30 20:28:08 +00:00
Checks connection failure to Qemu monitor.
This commit is contained in:
parent
14cc6d414f
commit
2ef45781ad
@ -911,7 +911,11 @@ class QemuVM(object):
|
|||||||
result = None
|
result = None
|
||||||
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))
|
||||||
tn = telnetlib.Telnet(self._monitor_host, self._monitor, timeout=timeout)
|
try:
|
||||||
|
tn = telnetlib.Telnet(self._monitor_host, self._monitor, timeout=timeout)
|
||||||
|
except OSError as e:
|
||||||
|
log.warn("Could not connect to QEMU monitor: {}".format(e))
|
||||||
|
return result
|
||||||
try:
|
try:
|
||||||
tn.write(command.encode('ascii') + b"\n")
|
tn.write(command.encode('ascii') + b"\n")
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
@ -778,16 +778,14 @@ class VirtualBoxVM(object):
|
|||||||
"--register"]
|
"--register"]
|
||||||
|
|
||||||
result = self._execute("clonevm", args)
|
result = self._execute("clonevm", args)
|
||||||
|
log.debug("cloned VirtualBox VM: {}".format(result))
|
||||||
args = [self._name,
|
|
||||||
"take",
|
|
||||||
"reset"]
|
|
||||||
|
|
||||||
result = self._execute("snapshot", args)
|
|
||||||
|
|
||||||
self._vmname = self._name
|
self._vmname = self._name
|
||||||
self._execute("setextradata", [self._vmname, "GNS3/Clone", "yes"])
|
self._execute("setextradata", [self._vmname, "GNS3/Clone", "yes"])
|
||||||
log.debug("cloned VirtualBox VM: {}".format(result))
|
|
||||||
|
args = [self._name, "take", "reset"]
|
||||||
|
result = self._execute("snapshot", args)
|
||||||
|
log.debug("snapshot reset created: {}".format(result))
|
||||||
|
|
||||||
def _start_remote_console(self):
|
def _start_remote_console(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user