
On 1 Jan 2020, at 11:54, Pavel Bar <pbar@redhat.com> wrote:
Hi, Can someone please point me to a relevant person?
it hasn’t been touched much since it’s initial contribution 7 years ago. I’d say it’s in a collective Storage team ownership:)
It looks like there is a potential issue with "getImageSize()" function there: 'image_bytes' might be referenced before assignment. There is also a suspicion that this code is not used at all, so instead of fixing it might be a good idea to just delete it.
it’s hard to find out if anyone uses the hook or not.If you’re unsure I suggest to just fix it. or ignore...
See the code below: def getImageSize(disk_image, driver_type): ''' Obtain qcow2 image size in GiBs ''' if driver_type == 'block': dev_buffer = ' ' * 8 with open(disk_image) as device: dev_buffer = fcntl.ioctl(device.fileno(), BLKGETSIZE64, dev_buffer) image_bytes = struct.unpack(FORMAT, dev_buffer)[0] elif driver_type == 'file': image_bytes = os.stat(disk_image).st_size return float(image_bytes / GIB)
Thank you in advance!
Pavel _______________________________________________ Devel mailing list -- devel@ovirt.org To unsubscribe send an email to devel-leave@ovirt.org Privacy Statement: https://www.ovirt.org/site/privacy-policy/ oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/ List Archives: https://lists.ovirt.org/archives/list/devel@ovirt.org/message/YXCYK3SMVTGWYF...