mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-14 12:29:02 +00:00
Fix problem with VM saved stated.
This commit is contained in:
parent
7622c10cc9
commit
22a71b0e8c
@ -1847,6 +1847,8 @@ class QemuVM(BaseNode):
|
|||||||
disk = os.path.join(self.working_dir, "hd{}_disk.qcow2".format(drive))
|
disk = os.path.join(self.working_dir, "hd{}_disk.qcow2".format(drive))
|
||||||
else:
|
else:
|
||||||
disk = disk_image
|
disk = disk_image
|
||||||
|
if not os.path.exists(disk):
|
||||||
|
continue
|
||||||
command = [qemu_img_path, "snapshot", "-c", snapshot_name, disk]
|
command = [qemu_img_path, "snapshot", "-c", snapshot_name, disk]
|
||||||
retcode = yield from self._qemu_img_exec(command)
|
retcode = yield from self._qemu_img_exec(command)
|
||||||
if retcode:
|
if retcode:
|
||||||
@ -1871,6 +1873,8 @@ class QemuVM(BaseNode):
|
|||||||
disk = os.path.join(self.working_dir, "hd{}_disk.qcow2".format(drive))
|
disk = os.path.join(self.working_dir, "hd{}_disk.qcow2".format(drive))
|
||||||
else:
|
else:
|
||||||
disk = disk_image
|
disk = disk_image
|
||||||
|
if not os.path.exists(disk):
|
||||||
|
continue
|
||||||
output = yield from subprocess_check_output(qemu_img_path, "info", "--output=json", disk)
|
output = yield from subprocess_check_output(qemu_img_path, "info", "--output=json", disk)
|
||||||
json_data = json.loads(output)
|
json_data = json.loads(output)
|
||||||
if "snapshots" in json_data:
|
if "snapshots" in json_data:
|
||||||
|
Loading…
Reference in New Issue
Block a user