The -drive parameter for qemu run requires more flags

To use `-drive` as an analog for `-hda` or `-hdb`, etc. the qemu
docs note that "media" and "index" are required flags. Local
testing shows that drive shows up properly as `/dev/sda` after
this change.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
This commit is contained in:
Phil Estes 2017-04-27 13:33:03 -04:00
parent ed22a11789
commit 5612718b0f
No known key found for this signature in database
GPG Key ID: 0F386284C03A1162

View File

@ -238,7 +238,7 @@ func buildQemuCmdline(config QemuConfig) (QemuConfig, []string) {
}
if config.DiskPath != "" {
qemuArgs = append(qemuArgs, "-drive", "file="+config.DiskPath+",format=qcow2")
qemuArgs = append(qemuArgs, "-drive", "file="+config.DiskPath+",format=qcow2,index=0,media=disk")
}
// Check flags for iso/uefi boot and if so disable kernel boot