提交 bb725ac1 编写于 作者: L Li Zhang 提交者: Eric Blake

Assign spapr-vio bus address to ibmvscsi controller

For pseries guest, the default controller model is
ibmvscsi controller, this controller only can work
on spapr-vio address.

This patch is to assign spapr-vio address type to
ibmvscsi controller and correct vscsi test case.
Signed-off-by: NLi Zhang <zhlcindy@linux.vnet.ibm.com>
上级 b8012ce9
......@@ -779,6 +779,7 @@ qemuAssignSpaprVIOAddress(virDomainDefPtr def, virDomainDeviceInfoPtr info,
int qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def)
{
int i, rc;
int model;
/* Default values match QEMU. See spapr_(llan|vscsi|vty).c */
......@@ -790,10 +791,18 @@ int qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def)
}
for (i = 0 ; i < def->ncontrollers; i++) {
rc = qemuAssignSpaprVIOAddress(def, &def->controllers[i]->info,
0x2000ul);
if (rc)
return rc;
model = def->controllers[i]->model;
if (model == -1 &&
def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI)
model = qemuDefaultScsiControllerModel(def);
if (model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI &&
def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI) {
def->controllers[i]->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO;
rc = qemuAssignSpaprVIOAddress(def, &def->controllers[i]->info,
0x2000ul);
if (rc)
return rc;
}
}
for (i = 0 ; i < def->nserials; i++) {
......
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M \
pc -m 214 -smp 1 -nographic -nodefconfig -nodefaults -monitor \
unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -device spapr-vscsi,id=scsi0,\
bus=pci.0,addr=0x3 -drive file=/dev/HostVG/QEMUGuest1,if=none,\
reg=0x2000 -drive file=/dev/HostVG/QEMUGuest1,if=none,\
id=drive-ide0-0-0 -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
-drive file=/tmp/scsidisk.img,if=none,id=drive-scsi0-0-3-0 \
-device scsi-disk,bus=scsi0.0,channel=0,scsi-id=3,lun=0,drive=drive-scsi0-0-3-0,id=scsi0-0-3-0 \
-usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
-usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册