- return disk_path
+ if driver is not None:
+ format = driver.get('type')
+ # This is a legacy quirk of libvirt/xen. Everything else should
+ # report the on-disk format in type.
+ if format == 'aio':
+ format = 'raw'
+ else:
+ format = None
+ return (disk_path, format)
QEMU is running guest so I'm not sure we can be on case where format is None or if we are we should to stop process.
What about:
- return disk_path
+ if driver is None:
+ raise RuntimeError("Can't retrieve disk driver from guest's domain XML")
+ format = driver.get('type')
+ if format == 'aio':
+ # This is a legacy quirk of libvirt/xen. Everything else should
+ # report the on-disk format in type.
+ format = 'raw'
+ return (disk_path, format)
- return disk_path
+ if driver is not None:
+ format = driver.get('type')
+ # This is a legacy quirk of libvirt/xen. Everything else should
+ # report the on-disk format in type.
+ if format == 'aio':
+ format = 'raw'
+ else:
+ format = None
+ return (disk_path, format)
QEMU is running guest so I'm not sure we can be on case where format is None or if we are we should to stop process.
What about:
- return disk_path
+ if driver is None:
+ raise RuntimeError("Can't retrieve disk driver from guest's domain XML")
+ format = driver.get('type')
+ if format == 'aio':
+ # This is a legacy quirk of libvirt/xen. Everything else should
+ # report the on-disk format in type.
+ format = 'raw'
+ return (disk_path, format)