6161DEFAULT_DIR_TARGET_BASE = "/var/lib/libvirt/images/"
6262DEFAULT_SCSI_TARGET = "/dev/disk/by-path"
6363
64+ # Pulled from libvirt, used for building on older versions
65+ VIR_STORAGE_VOL_FILE = 0
66+ VIR_STORAGE_VOL_BLOCK = 1
67+
6468def is_create_vol_from_supported (conn ):
6569 return support .check_pool_support (conn ,
6670 support .SUPPORT_STORAGE_CREATEVOLFROM )
@@ -1222,7 +1226,7 @@ class FileVolume(StorageVolume):
12221226 """
12231227 Build and install xml for use on pools which use file based storage
12241228 """
1225- _file_type = libvirt . VIR_STORAGE_VOL_FILE
1229+ _file_type = VIR_STORAGE_VOL_FILE
12261230
12271231 formats = ["raw" , "bochs" , "cloop" , "cow" , "dmg" , "iso" , "qcow" ,\
12281232 "qcow2" , "vmdk" , "vpc" ]
@@ -1251,6 +1255,7 @@ class DiskVolume(StorageVolume):
12511255 """
12521256 Build and install xml volumes for use on physical disk pools
12531257 """
1258+ _file_type = VIR_STORAGE_VOL_BLOCK
12541259
12551260 # Register applicable property methods from parent class
12561261 perms = property (StorageObject .get_perms , StorageObject .set_perms )
@@ -1273,7 +1278,7 @@ class LogicalVolume(StorageVolume):
12731278 """
12741279 Build and install logical volumes for lvm pools
12751280 """
1276- _file_type = libvirt . VIR_STORAGE_VOL_BLOCK
1281+ _file_type = VIR_STORAGE_VOL_BLOCK
12771282
12781283 # Register applicable property methods from parent class
12791284 perms = property (StorageObject .get_perms , StorageObject .set_perms )
@@ -1329,7 +1334,7 @@ def get_xml_config(self):
13291334# """
13301335# Build and install xml for use on iSCSI device pools
13311336# """
1332- # _file_type = libvirt.VIR_STORAGE_VOL_FILE
1337+ # _file_type = VIR_STORAGE_VOL_BLOCK
13331338#
13341339# def __init__(self, *args, **kwargs):
13351340# raise NotImplementedError
0 commit comments