提交 5775089e 编写于 作者: J John Ferlan

qemu: Introduce qemuDomainDeviceDefValidateControllerSATA

Move the SATA controller check from command line building to
controller def validation. This includes copying the SATA
skip check found in qemuBuildSkipController.
上级 7de841cc
......@@ -2693,12 +2693,6 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
break;
case VIR_DOMAIN_CONTROLLER_TYPE_SATA:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_AHCI)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("SATA is not supported with this "
"QEMU binary"));
goto error;
}
virBufferAsprintf(&buf, "ahci,id=%s", def->info.alias);
break;
......
......@@ -4386,6 +4386,24 @@ qemuDomainDeviceDefValidateControllerPCI(const virDomainControllerDef *controlle
}
static int
qemuDomainDeviceDefValidateControllerSATA(const virDomainControllerDef *controller,
const virDomainDef *def,
virQEMUCapsPtr qemuCaps)
{
/* first SATA controller on Q35 machines is implicit */
if (controller->idx == 0 && qemuDomainIsQ35(def))
return 0;
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_AHCI)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("SATA is not supported with this QEMU binary"));
return -1;
}
return 0;
}
static int
qemuDomainDeviceDefValidateController(const virDomainControllerDef *controller,
const virDomainDef *def,
......@@ -4418,8 +4436,12 @@ qemuDomainDeviceDefValidateController(const virDomainControllerDef *controller,
qemuCaps);
break;
case VIR_DOMAIN_CONTROLLER_TYPE_FDC:
case VIR_DOMAIN_CONTROLLER_TYPE_SATA:
ret = qemuDomainDeviceDefValidateControllerSATA(controller, def,
qemuCaps);
break;
case VIR_DOMAIN_CONTROLLER_TYPE_FDC:
case VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL:
case VIR_DOMAIN_CONTROLLER_TYPE_CCID:
case VIR_DOMAIN_CONTROLLER_TYPE_USB:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册