From 22a71b0e8ceaef7152007f2d99966a03f60e520e Mon Sep 17 00:00:00 2001 From: grossmj Date: Fri, 6 Apr 2018 13:19:54 +0700 Subject: [PATCH] Fix problem with VM saved stated. --- gns3server/compute/qemu/qemu_vm.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gns3server/compute/qemu/qemu_vm.py b/gns3server/compute/qemu/qemu_vm.py index 834d60d1..ac5b2958 100644 --- a/gns3server/compute/qemu/qemu_vm.py +++ b/gns3server/compute/qemu/qemu_vm.py @@ -1847,6 +1847,8 @@ class QemuVM(BaseNode): disk = os.path.join(self.working_dir, "hd{}_disk.qcow2".format(drive)) else: disk = disk_image + if not os.path.exists(disk): + continue command = [qemu_img_path, "snapshot", "-c", snapshot_name, disk] retcode = yield from self._qemu_img_exec(command) if retcode: @@ -1871,6 +1873,8 @@ class QemuVM(BaseNode): disk = os.path.join(self.working_dir, "hd{}_disk.qcow2".format(drive)) else: disk = disk_image + if not os.path.exists(disk): + continue output = yield from subprocess_check_output(qemu_img_path, "info", "--output=json", disk) json_data = json.loads(output) if "snapshots" in json_data: