raiseQemuError("Could not create {} disk image: qemu-img returned with {}".format(disk_name,
retcode))
log.info("{} returned with {}".format(qemu_img_path,retcode))
retcode=yield fromself._qemu_img_exec(command)
ifretcode:
stdout=self.read_qemu_img_stdout()
raiseQemuError("Could not create '{}' disk image: qemu-img returned with {}\n{}".format(disk_name,
retcode,
stdout))
except(OSError,subprocess.SubprocessError)ase:
raiseQemuError("Could not create {} disk image: {}".format(disk_name,e))
stdout=self.read_qemu_img_stdout()
raiseQemuError("Could not create '{}' disk image: {}\n{}".format(disk_name,e,stdout))
else:
# The disk exists we check if the clone work
# The disk exists we check if the clone works
try:
qcow2=Qcow2(disk)
yield fromqcow2.rebase(qemu_img_path,disk_image)
except(Qcow2Error,OSError)ase:
raiseQemuError("Could not use qcow2 disk image {} for {}{}".format(disk_image,disk_name,e))
raiseQemuError("Could not use qcow2 disk image '{}' for {}{}".format(disk_image,disk_name,e))
else:
disk=disk_image
@ -1557,7 +1603,9 @@ class QemuVM(BaseNode):
return[]
iflen(os.environ.get("DISPLAY",""))>0:
return[]
return["-nographic"]
if"-nographic"notinself._options:
return["-nographic"]
return[]
def_run_with_kvm(self,qemu_path,options):
"""
@ -1576,7 +1624,10 @@ class QemuVM(BaseNode):
returnFalse
ifnotos.path.exists("/dev/kvm"):
raiseQemuError("KVM acceleration cannot be used (/dev/kvm doesn't exist). You can turn off KVM support in the gns3_server.conf by adding enable_kvm = false to the [Qemu] section.")
raiseQemuError("KVM acceleration cannot be used (/dev/kvm doesn't exist). You can turn off KVM support in the gns3_server.conf by adding enable_kvm = false to the [Qemu] section.")
raiseVMwareError("Attachment ({}) already configured on network adapter {}. "
"Please remove it or allow GNS3 to use any adapter.".format(self._vmx_pairs[connection_type],
adapter_number))
ifnotself._use_any_adapter:
raiseVMwareError("Attachment '{attachment}' is already configured on network adapter {adapter_number}. "
"Please remove it or allow VMware VM '{name}' to use any adapter.".format(attachment=self._vmx_pairs[connection_type],
adapter_number=adapter_number,
name=self.name))
elifself.is_running():
raiseVMwareError("Attachment '{attachment}' is configured on network adapter {adapter_number}. "
"Please stop VMware VM '{name}' to link to this adapter and allow GNS3 to change the attachment type.".format(attachment=self._vmx_pairs[connection_type],