[virt-tools-list] [virt-manager PATCH 1/2] addhardware: Add support for disk discard option

Lin Ma lma at suse.com
Wed Sep 5 08:15:07 UTC 2018


Complete this part of feature for commit d13b793b.

Signed-off-by: Lin Ma <lma at suse.com>
---
 virtManager/addhardware.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index 2981e465..87b0d918 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -1273,6 +1273,8 @@ class vmmAddHardware(vmmGObjectUI):
             self.widget("storage-devtype"))
         cache = uiutil.get_list_selection(
             self.widget("storage-cache"))
+        discard = uiutil.get_list_selection(
+            self.widget("storage-discard"))
 
         controller_model = None
         if (bus == "scsi" and
@@ -1298,6 +1300,9 @@ class vmmAddHardware(vmmGObjectUI):
             if cache:
                 disk.driver_cache = cache
 
+            if discard:
+                disk.driver_discard = discard
+
             # Generate target
             disks = (self.vm.xmlobj.devices.disk +
                      self.vm.get_xmlobj(inactive=True).devices.disk)
-- 
2.15.1




More information about the virt-tools-list mailing list