mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
qemu: command: Don't generate disk drive alias manually for floppies
qemuBulildFloppyCommandLineOptions built its own version of the -drive alias. Replace it by qemuAliasDiskDriveFromDisk. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
35582d1125
commit
6236b61443
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user