mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +00:00
Handle initrd and kernel paths in qemu
This commit is contained in:
parent
00f49e337d
commit
f1503ae655
@ -761,6 +761,29 @@ class QemuVM(object):
|
|||||||
log.debug("Download of {} complete.".format(src))
|
log.debug("Download of {} complete.".format(src))
|
||||||
self.hdb_disk_image = dst
|
self.hdb_disk_image = dst
|
||||||
|
|
||||||
|
if self.initrd != "":
|
||||||
|
_, filename = ntpath.split(self.initrd)
|
||||||
|
src = '{}/{}'.format(self.cloud_path, filename)
|
||||||
|
dst = os.path.join(self.working_dir, filename)
|
||||||
|
if not os.path.isfile(dst):
|
||||||
|
cloud_settings = Config.instance().cloud_settings()
|
||||||
|
provider = get_provider(cloud_settings)
|
||||||
|
log.debug("Downloading file from {} to {}...".format(src, dst))
|
||||||
|
provider.download_file(src, dst)
|
||||||
|
log.debug("Download of {} complete.".format(src))
|
||||||
|
self.initrd = dst
|
||||||
|
if self.kernel_image != "":
|
||||||
|
_, filename = ntpath.split(self.kernel_image)
|
||||||
|
src = '{}/{}'.format(self.cloud_path, filename)
|
||||||
|
dst = os.path.join(self.working_dir, filename)
|
||||||
|
if not os.path.isfile(dst):
|
||||||
|
cloud_settings = Config.instance().cloud_settings()
|
||||||
|
provider = get_provider(cloud_settings)
|
||||||
|
log.debug("Downloading file from {} to {}...".format(src, dst))
|
||||||
|
provider.download_file(src, dst)
|
||||||
|
log.debug("Download of {} complete.".format(src))
|
||||||
|
self.kernel_image = dst
|
||||||
|
|
||||||
self._command = self._build_command()
|
self._command = self._build_command()
|
||||||
try:
|
try:
|
||||||
log.info("starting QEMU: {}".format(self._command))
|
log.info("starting QEMU: {}".format(self._command))
|
||||||
|
Loading…
Reference in New Issue
Block a user