qemuBulildFloppyCommandLineOptions built it's own version of the -drive alias. Replace it by qemuAliasDiskDriveFromDisk. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/qemu/qemu_command.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 48e463c3c9..f756cc7112 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2150,12 +2150,17 @@ qemuBuildFloppyCommandLineOptions(virCommandPtr cmd, virBuffer fdc_opts = VIR_BUFFER_INITIALIZER; char *fdc_opts_str = NULL; char *optstr; + char *backendAlias = NULL; + int ret = -1; - if (virAsprintf(&optstr, "drive%c=drive-%s", - disk->info.addr.drive.unit ? 'B' : 'A', - disk->info.alias) < 0) + if (!(backendAlias = qemuAliasDiskDriveFromDisk(disk))) return -1; + if (virAsprintf(&optstr, "drive%c=%s", + disk->info.addr.drive.unit ? 'B' : 'A', + backendAlias) < 0) + goto cleanup; + if (!qemuDomainNeedsFDC(def)) { virCommandAddArg(cmd, "-global"); virCommandAddArgFormat(cmd, "isa-fdc.%s", optstr); @@ -2169,7 +2174,7 @@ qemuBuildFloppyCommandLineOptions(virCommandPtr cmd, disk->info.addr.drive.unit ? 'B' : 'A', bootindex) < 0) - return -1; + goto cleanup; if (!qemuDomainNeedsFDC(def)) { virCommandAddArg(cmd, "-global"); @@ -2188,7 +2193,11 @@ qemuBuildFloppyCommandLineOptions(virCommandPtr cmd, VIR_FREE(fdc_opts_str); } - return 0; + ret = 0; + + cleanup: + VIR_FREE(backendAlias); + return ret; } -- 2.16.2 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list