Create util for root device path retrieval

blueprint snapshots-for-everyone

Create libvirt.utils.find_disk(virt_dom) function.
This function will retrieve disk path from instance configuration.
Will return path both for file and device backed instance root devices.
Will throw error in case, when device can't be found.

Change-Id: I612a19221c6ff78079ab53a8d77295c555514c77
This commit is contained in:
Boris Filippov
2012-09-26 02:53:33 +04:00
parent 3cb3db034d
commit c96c4df3e6
3 changed files with 22 additions and 4 deletions

View File

@@ -98,6 +98,10 @@ def file_open(path, mode=None):
return File(path, mode)
def find_disk(virt_dom):
return "some/path"
def load_file(path):
if os.path.exists(path):
with open(path, 'r') as fp: