addhardware: Add support for disk discard option

Complete this part of feature for commit d13b793b.

Signed-off-by: Lin Ma <lma@suse.com>
This commit is contained in:
Lin Ma 2018-09-05 16:15:07 +08:00 committed by Cole Robinson
parent 242844fefa
commit a919a1ae4e

View File

@ -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
@ -1297,6 +1299,8 @@ class vmmAddHardware(vmmGObjectUI):
disk.bus = bus
if cache:
disk.driver_cache = cache
if discard:
disk.driver_discard = discard
# Generate target
disks = (self.vm.xmlobj.devices.disk +