[PATCHv2 1/1] Assign spapr-vio address type to ibmvscsi controller

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Signed-off-by: Li Zhang <zhlcindy@xxxxxxxxxxxxxxxxxx>
---
 src/qemu/qemu_command.c |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 117542f..2c6495a 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -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,17 @@ int qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def)
     }
 
     for (i = 0 ; i < def->ncontrollers; i++) {
-        rc = qemuAssignSpaprVIOAddress(def, &def->controllers[i]->info,
+        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]->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO;
+            rc = qemuAssignSpaprVIOAddress(def, &def->controllers[i]->info,
                                        0x2000ul);
-        if (rc)
-            return rc;
+            if (rc)
+                return rc;
+        }
     }
 
     for (i = 0 ; i < def->nserials; i++) {
-- 
1.7.9.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]