Add util for disk type retrieval
blueprint snapshots-for-everyone Add libvirt.utils.get_disk_type that retrieves format for given file. Format can be raw, qcow2, or lvm. Change-Id: I33898983cfa15db6b2654648ce32f72b6dd920cb
This commit is contained in:
@@ -21,6 +21,7 @@ import StringIO
|
||||
files = {}
|
||||
disk_sizes = {}
|
||||
disk_backing_files = {}
|
||||
disk_type = "qcow2"
|
||||
|
||||
|
||||
def get_iscsi_initiator():
|
||||
@@ -39,6 +40,10 @@ def get_disk_backing_file(path):
|
||||
return disk_backing_files.get(path, None)
|
||||
|
||||
|
||||
def get_disk_type(path):
|
||||
return disk_type
|
||||
|
||||
|
||||
def copy_image(src, dest):
|
||||
pass
|
||||
|
||||
|
||||
@@ -1162,6 +1162,7 @@ class LibvirtConnTestCase(test.TestCase):
|
||||
libvirt_driver.LibvirtDriver._conn.lookupByName = self.fake_lookup
|
||||
self.mox.StubOutWithMock(libvirt_driver.utils, 'execute')
|
||||
libvirt_driver.utils.execute = self.fake_execute
|
||||
self.stubs.Set(libvirt_driver.libvirt_utils, 'disk_type', 'raw')
|
||||
|
||||
self.mox.ReplayAll()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user