mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-04 20:15:19 +00:00
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: Li Zhang <zhlcindy@linux.vnet.ibm.com>
(cherry picked from commit bb725ac1fa
)
This commit is contained in:
parent
856a23c2bc
commit
d8a1c6b70c
@ -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++) {
|
||||
|
@ -1,8 +1,8 @@
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user