mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-04-26 07:04:42 +00:00
Separate isa-fdc options generation
For the implicit controller, we set them via -global. Separating them will allow reuse for explicit fdc controller as well. No functional impact apart from one extra allocation.
This commit is contained in:
parent
b792834a41
commit
4ef21ec192
@ -9784,18 +9784,25 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|||||||
|
|
||||||
if (withDeviceArg) {
|
if (withDeviceArg) {
|
||||||
if (disk->bus == VIR_DOMAIN_DISK_BUS_FDC) {
|
if (disk->bus == VIR_DOMAIN_DISK_BUS_FDC) {
|
||||||
|
if (virAsprintf(&optstr, "drive%c=drive-%s",
|
||||||
|
disk->info.addr.drive.unit ? 'B' : 'A',
|
||||||
|
disk->info.alias) < 0)
|
||||||
|
goto error;
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-global");
|
virCommandAddArg(cmd, "-global");
|
||||||
virCommandAddArgFormat(cmd, "isa-fdc.drive%c=drive-%s",
|
virCommandAddArgFormat(cmd, "isa-fdc.%s", optstr);
|
||||||
disk->info.addr.drive.unit
|
VIR_FREE(optstr);
|
||||||
? 'B' : 'A',
|
|
||||||
disk->info.alias);
|
|
||||||
|
|
||||||
if (bootindex) {
|
if (bootindex) {
|
||||||
|
if (virAsprintf(&optstr, "bootindex%c=%d",
|
||||||
|
disk->info.addr.drive.unit
|
||||||
|
? 'B' : 'A',
|
||||||
|
bootindex) < 0)
|
||||||
|
goto error;
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-global");
|
virCommandAddArg(cmd, "-global");
|
||||||
virCommandAddArgFormat(cmd, "isa-fdc.bootindex%c=%d",
|
virCommandAddArgFormat(cmd, "isa-fdc.%s", optstr);
|
||||||
disk->info.addr.drive.unit
|
VIR_FREE(optstr);
|
||||||
? 'B' : 'A',
|
|
||||||
bootindex);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
virCommandAddArg(cmd, "-device");
|
virCommandAddArg(cmd, "-device");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user