提交 3482191d 编写于 作者: P Paolo Bonzini 提交者: Osier Yang

qemu: add ibmvscsi controller model

KVM will be able to use a PCI SCSI controller even on POWER.  Let
the user specify the vSCSI controller by other means than a default.

After this patch, the QEMU driver will actually look at the model
and reject anything but auto, lsilogic and ibmvscsi.
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NOsier Yang <jyang@redhat.com>
上级 4cc4b62e
......@@ -1657,8 +1657,8 @@
attributes <code>ports</code> and <code>vectors</code>, which
control how many devices can be connected through the
controller. A "scsi" controller has an optional
attribute <code>model</code>, which is one of "auto",
"buslogic", "lsilogic", "lsias1068", or "vmpvscsi".
attribute <code>model</code>, which is one of "auto", "buslogic",
"ibmvscsi", "lsilogic", "lsias1068", or "vmpvscsi".
A "usb" controller has an optional attribute <code>model</code>,
which is one of "piix3-uhci", "piix4-uhci", "ehci",
"ich9-ehci1", "ich9-uhci1", "ich9-uhci2", "ich9-uhci3",
......
......@@ -1120,6 +1120,7 @@
<value>lsilogic</value>
<value>lsisas1068</value>
<value>vmpvscsi</value>
<value>ibmvscsi</value>
<value>piix3-uhci</value>
<value>piix4-uhci</value>
<value>ehci</value>
......
......@@ -238,7 +238,8 @@ VIR_ENUM_IMPL(virDomainControllerModelSCSI, VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LAS
"buslogic",
"lsilogic",
"lsisas1068",
"vmpvscsi")
"vmpvscsi",
"ibmvscsi");
VIR_ENUM_IMPL(virDomainControllerModelUSB, VIR_DOMAIN_CONTROLLER_MODEL_USB_LAST,
"piix3-uhci",
......
......@@ -452,6 +452,7 @@ enum virDomainControllerModelSCSI {
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC,
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1068,
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VMPVSCSI,
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI,
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LAST
};
......
......@@ -461,6 +461,15 @@ static int qemuAssignDeviceDiskAliasFixed(virDomainDiskDefPtr disk)
return 0;
}
static int
qemuDefaultScsiControllerModel(virDomainDefPtr def) {
if (STREQ(def->os.arch, "ppc64") &&
STREQ(def->os.machine, "pseries")) {
return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI;
} else {
return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC;
}
}
/* Our custom -drive naming scheme used with id= */
static int qemuAssignDeviceDiskAliasCustom(virDomainDiskDefPtr disk)
......@@ -2356,14 +2365,26 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef,
int *nusbcontroller)
{
virBuffer buf = VIR_BUFFER_INITIALIZER;
int model;
switch (def->type) {
case VIR_DOMAIN_CONTROLLER_TYPE_SCSI:
if (STREQ(domainDef->os.arch, "ppc64") &&
STREQ(domainDef->os.machine, "pseries")) {
virBufferAddLit(&buf, "spapr-vscsi");
} else {
model = def->model;
if (model == -1 ||
model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_AUTO) {
model = qemuDefaultScsiControllerModel(domainDef);
}
switch (model) {
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC:
virBufferAddLit(&buf, "lsi");
break;
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI:
virBufferAddLit(&buf, "spapr-vscsi");
break;
default:
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported controller model: %s"),
virDomainControllerModelSCSITypeToString(def->model));
}
virBufferAsprintf(&buf, ",id=scsi%d", def->idx);
break;
......
......@@ -490,7 +490,8 @@ VIR_ENUM_IMPL(virVMXControllerModelSCSI, VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LAST,
"buslogic",
"lsilogic",
"lsisas1068",
"pvscsi");
"pvscsi",
"UNUSED ibmvscsi");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册