Share the list of all disk image formats

(crobinso: Fix some trailing whitespace)
This commit is contained in:
Cédric Bosdonnat 2014-01-24 11:40:09 +01:00 committed by Cole Robinson
parent 796ddd966a
commit beab40e3b1
3 changed files with 7 additions and 7 deletions

View File

@ -24,7 +24,7 @@ from gi.repository import Gtk
from gi.repository import GObject from gi.repository import GObject
# pylint: enable=E0611 # pylint: enable=E0611
from virtinst import VirtualFilesystem from virtinst import VirtualFilesystem, StorageVolume
from virtinst import util from virtinst import util
from virtManager import uihelpers from virtManager import uihelpers
from virtManager.baseclass import vmmGObjectUI from virtManager.baseclass import vmmGObjectUI
@ -122,7 +122,7 @@ class vmmFSDetails(vmmGObjectUI):
simple_store_set("fs-driver-combo", [VirtualFilesystem.DRIVER_LOOP, simple_store_set("fs-driver-combo", [VirtualFilesystem.DRIVER_LOOP,
VirtualFilesystem.DRIVER_NBD, VirtualFilesystem.DRIVER_NBD,
VirtualFilesystem.DRIVER_DEFAULT]) VirtualFilesystem.DRIVER_DEFAULT])
simple_store_set("fs-format-combo", VirtualFilesystem.NBD_FORMATS) simple_store_set("fs-format-combo", StorageVolume.ALL_FORMATS),
simple_store_set("fs-wrpolicy-combo", VirtualFilesystem.WRPOLICIES) simple_store_set("fs-wrpolicy-combo", VirtualFilesystem.WRPOLICIES)
self.show_pair_combo("fs-type", self.conn.is_openvz() or self.conn.is_lxc()) self.show_pair_combo("fs-type", self.conn.is_openvz() or self.conn.is_lxc())
self.show_check_button("fs-readonly", self.show_check_button("fs-readonly",

View File

@ -51,9 +51,6 @@ class VirtualFilesystem(VirtualDevice):
DRIVER_DEFAULT = "default" DRIVER_DEFAULT = "default"
DRIVERS = [DRIVER_PATH, DRIVER_HANDLE, DRIVER_LOOP, DRIVER_NBD, DRIVER_DEFAULT] DRIVERS = [DRIVER_PATH, DRIVER_HANDLE, DRIVER_LOOP, DRIVER_NBD, DRIVER_DEFAULT]
NBD_FORMATS = ["raw", "bochs", "cloop", "cow", "dmg", "iso", "qcow",
"qcow2", "qed", "vmdk", "vpc", "fat", "vhd", "vdi"]
@staticmethod @staticmethod
def type_to_source_prop(fs_type): def type_to_source_prop(fs_type):
""" """

View File

@ -460,6 +460,10 @@ class StorageVolume(_StorageObject):
""" """
Base class for building and installing libvirt storage volume xml Base class for building and installing libvirt storage volume xml
""" """
ALL_FORMATS = ["raw", "bochs", "cloop", "cow", "dmg", "iso", "qcow",
"qcow2", "qed", "vmdk", "vpc", "fat", "vhd", "vdi"]
@staticmethod @staticmethod
def find_free_name(pool_object, basename, **kwargs): def find_free_name(pool_object, basename, **kwargs):
""" """
@ -608,8 +612,7 @@ class StorageVolume(_StorageObject):
def list_formats(self): def list_formats(self):
if self.file_type == self.TYPE_FILE: if self.file_type == self.TYPE_FILE:
return ["raw", "bochs", "cloop", "cow", "dmg", "iso", "qcow", return ALL_FORMATS
"qcow2", "qed", "vmdk", "vpc", "vdi"]
return [] return []
def list_create_formats(self): def list_create_formats(self):