Prioritize the config disk over HD-D for Qemu VMs.

Fixes https://github.com/GNS3/gns3-gui/issues/3036
This commit is contained in:
grossmj 2020-08-18 10:54:11 +09:30
parent a2e884e315
commit c12b675691

View File

@ -1811,6 +1811,10 @@ class QemuVM(BaseNode):
drives = ["a", "b", "c", "d"] drives = ["a", "b", "c", "d"]
for disk_index, drive in enumerate(drives): for disk_index, drive in enumerate(drives):
# prioritize config disk over harddisk d
if drive == 'd' and self._create_config_disk:
continue
disk_image = getattr(self, "_hd{}_disk_image".format(drive)) disk_image = getattr(self, "_hd{}_disk_image".format(drive))
if not disk_image: if not disk_image:
continue continue
@ -1876,9 +1880,6 @@ class QemuVM(BaseNode):
# config disk # config disk
disk_image = getattr(self, "config_disk_image") disk_image = getattr(self, "config_disk_image")
if disk_image and self._create_config_disk: if disk_image and self._create_config_disk:
if getattr(self, "_hdd_disk_image"):
log.warning("Config disk: blocked by disk image 'hdd'")
else:
disk_name = getattr(self, "config_disk_name") disk_name = getattr(self, "config_disk_name")
disk = os.path.join(self.working_dir, disk_name) disk = os.path.join(self.working_dir, disk_name)
if self.hdd_disk_interface == "none": if self.hdd_disk_interface == "none":