mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
Clarify controllers -device string in QEMU driver
The QEMU driver contained code to generate a -device string for piix4-ide, but wasn't using it. This change removes this string generation. It also adds a comment explaining why IDE and FDC controllers don't generate -device strings. The change also generates an error if a sata controller is specified for a QEMU domain, as this isn't supported. * src/qemu/qemu_conf.c: Remove VIR_DOMAIN_CONTROLLER_TYPE_IDE handler in qemuBuildControllerDevStr(). Ignore IDE and FDC controllers. Error if SATA controller is discovered. Add comments.
This commit is contained in:
parent
62a30a496a
commit
09080c38d1
@ -2122,11 +2122,8 @@ qemuBuildControllerDevStr(virDomainControllerDefPtr def)
|
|||||||
virBufferVSprintf(&buf, ",id=scsi%d", def->idx);
|
virBufferVSprintf(&buf, ",id=scsi%d", def->idx);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* We always get an IDE controller, whether we want it or not. */
|
||||||
case VIR_DOMAIN_CONTROLLER_TYPE_IDE:
|
case VIR_DOMAIN_CONTROLLER_TYPE_IDE:
|
||||||
virBufferAddLit(&buf, "piix4-ide");
|
|
||||||
virBufferVSprintf(&buf, ",id=ide%d", def->idx);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -3142,16 +3139,29 @@ int qemudBuildCommandLine(virConnectPtr conn,
|
|||||||
|
|
||||||
if (qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE) {
|
if (qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE) {
|
||||||
for (i = 0 ; i < def->ncontrollers ; i++) {
|
for (i = 0 ; i < def->ncontrollers ; i++) {
|
||||||
char *scsi;
|
virDomainControllerDefPtr cont = def->controllers[i];
|
||||||
if (def->controllers[i]->type != VIR_DOMAIN_CONTROLLER_TYPE_SCSI)
|
|
||||||
|
/* We don't add an explicit IDE or FD controller because the
|
||||||
|
* provided PIIX4 device already includes one. It isn't possible to
|
||||||
|
* remove the PIIX4. */
|
||||||
|
if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_IDE ||
|
||||||
|
cont->type == VIR_DOMAIN_CONTROLLER_TYPE_FDC)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* QEMU doesn't implement a SATA driver */
|
||||||
|
if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_SATA) {
|
||||||
|
qemudReportError(conn, NULL, NULL, VIR_ERR_NO_SUPPORT,
|
||||||
|
"%s", _("SATA is not supported with this QEMU binary"));
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
ADD_ARG_LIT("-device");
|
ADD_ARG_LIT("-device");
|
||||||
|
|
||||||
if (!(scsi = qemuBuildControllerDevStr(def->controllers[i])))
|
char *devstr;
|
||||||
|
if (!(devstr = qemuBuildControllerDevStr(def->controllers[i])))
|
||||||
goto no_memory;
|
goto no_memory;
|
||||||
|
|
||||||
ADD_ARG(scsi);
|
ADD_ARG(devstr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user