VirtualDisk: Add cache modes 'directsync' and 'unsafe' (bz 844907)

This commit is contained in:
Cole Robinson 2013-09-30 13:56:42 -04:00
parent 9de21be907
commit ccb96e9e4a
2 changed files with 4 additions and 3 deletions

View File

@ -358,13 +358,12 @@ def build_cache_combo(vm, combo):
model = Gtk.ListStore(str, str)
combo.set_model(model)
set_combo_text_column(combo, 1)
model.set_sort_column_id(0, Gtk.SortType.ASCENDING)
combo.set_active(-1)
for m in virtinst.VirtualDisk.cache_types:
model.append([m, m])
model.append([None, "default"])
model.insert(0, [None, "default"])
combo.set_active(len(model) - 1)

View File

@ -163,8 +163,10 @@ class VirtualDisk(VirtualDevice):
CACHE_MODE_NONE = "none"
CACHE_MODE_WRITETHROUGH = "writethrough"
CACHE_MODE_WRITEBACK = "writeback"
CACHE_MODE_DIRECTSYNC = "directsync"
CACHE_MODE_UNSAFE = "unsafe"
cache_types = [CACHE_MODE_NONE, CACHE_MODE_WRITETHROUGH,
CACHE_MODE_WRITEBACK]
CACHE_MODE_WRITEBACK, CACHE_MODE_DIRECTSYNC, CACHE_MODE_UNSAFE]
DEVICE_DISK = "disk"
DEVICE_LUN = "lun"