def _disk_resize(self, info, size):
    'Attempts to resize a disk to size\n\n        Attempts to resize a disk by checking the capabilities and\n        preparing the format, then calling disk.api.extend.\n\n        Note: Currently only support disk extend.\n        '
    fmt = info['type']
    pth = info['path']
    if (size and (fmt == 'qcow2') and disk.can_resize_image(pth, size) and disk.is_image_partitionless(pth, use_cow=True)):
        self._disk_qcow2_to_raw(pth)
        fmt = 'raw'
    if size:
        use_cow = (fmt == 'qcow2')
        disk.extend(pth, size, use_cow=use_cow)
    if ((fmt == 'raw') and CONF.use_cow_images):
        self._disk_raw_to_qcow2(pth)
Attempts to resize a disk to size

Attempts to resize a disk by checking the capabilities and
preparing the format, then calling disk.api.extend.

Note: Currently only support disk extend.
def _disk_resize(self, info, size):
    'Attempts to resize a disk to size\n\n        Attempts to resize a disk by checking the capabilities and\n        preparing the format, then calling disk.api.extend.\n\n        Note: Currently only support disk extend.\n        '
    fmt = info['type']
    pth = info['path']
    if (size and (fmt == 'qcow2') and disk.can_resize_image(pth, size) and disk.is_image_partitionless(pth, use_cow=True)):
        self._disk_qcow2_to_raw(pth)
        fmt = 'raw'
    if size:
        use_cow = (fmt == 'qcow2')
        disk.extend(pth, size, use_cow=use_cow)
    if ((fmt == 'raw') and CONF.use_cow_images):
        self._disk_raw_to_qcow2(pth)