1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-01 04:38:12 +00:00

Checks connection failure to Qemu monitor.

This commit is contained in:
Jeremy 2015-01-11 18:24:13 -07:00
parent 14cc6d414f
commit 2ef45781ad
2 changed files with 10 additions and 8 deletions

View File

@ -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))
try:
tn = telnetlib.Telnet(self._monitor_host, self._monitor, timeout=timeout) 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)

View File

@ -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):
""" """