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

[virt-tools-list] [PATCH] virt-manager:Add spapr-vscsi disk type for pseries guest.



This patch adds spapr-vscsi disk type on disk GUI page.
It provides an options to user to select the scsi disk 
which is based on spapr-vio address type for pseries guest.

Signed-off-by: Li Zhang <zhlcindy linux vnet ibm com>
---
 src/virtManager/details.py |    6 ++++++
 src/virtManager/domain.py  |    7 ++++++-
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/src/virtManager/details.py b/src/virtManager/details.py
index 55ea957..3ef6713 100644
--- a/src/virtManager/details.py
+++ b/src/virtManager/details.py
@@ -157,6 +157,9 @@ def prettyify_disk_bus(bus):
     if bus == "virtio":
         return "VirtIO"
 
+    if bus == "spapr-vscsi":
+        return  "sPAPR-vSCSI"
+
     return bus
 
 def prettyify_disk(devtype, bus, idx):
@@ -3279,6 +3282,9 @@ class vmmDetails(vmmGObjectUI):
             if self.vm.get_hv_type() in ["kvm", "test"]:
                 buses.append(["sata", "SATA"])
                 buses.append(["virtio", "Virtio"])
+            if (self.vm.get_hv_type() == "kvm" and
+                    self.vm.get_machtype() == "pseries"):
+                buses.append(["spapr-vscsi", "sPAPR-vSCSI"])
             if self.vm.conn.is_xen() or self.vm.get_hv_type() == "test":
                 buses.append(["xen", "Xen"])
 
diff --git a/src/virtManager/domain.py b/src/virtManager/domain.py
index 7f382e0..911a210 100644
--- a/src/virtManager/domain.py
+++ b/src/virtManager/domain.py
@@ -581,13 +581,18 @@ class vmmDomain(vmmLibvirtObject):
         def change(editdev):
             oldprefix = editdev.get_target_prefix()[0]
             oldbus = editdev.bus
-            editdev.bus = newval
 
             if oldbus == newval:
                 return
 
             editdev.address.clear()
 
+            if newval == "spapr-vscsi":
+                editdev.bus = "scsi"
+                editdev.set_address("spapr-vio")
+            else:
+                editdev.bus = newval
+
             if oldprefix == editdev.get_target_prefix()[0]:
                 return
 
-- 
1.7.5.4


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