Francesco Romani has posted comments on this change. Change subject: v2v: add volume size to disk info ......................................................................
Patch Set 1: Code-Review-1 (1 comment) I'm fine with the idea (I don't see any drawback), I'm not convinced about the usage of storageVolLookupByPath. -1 for visibility. http://gerrit.ovirt.org/#/c/36263/1/vdsm/v2v.py File vdsm/v2v.py: Line 110: source = disk.find('./source/[@file]') Line 111: if source is not None: Line 112: d['alias'] = source.get('file') Line 113: vol = conn.storageVolLookupByPath(source.get('file')) Line 114: if vol is not None and vol.info() is not None: standard practice in libvirt python bindings is to raise libvirtError if the corresponding C API returns NULL. Unless you have actually got this API return None, please just catch libvirtError (same for the returned object). So: try: vol = conn.storageVolLookupByPath(source.get('file')) d['truesize'] = str(vol.info()[1]) except libvirt.libvirtError: # do whatever you need to, even just 'pass' Line 115: d['truesize'] = str(vol.info()[1]) Line 116: params['disks'].append(d) Line 117: Line 118: -- To view, visit http://gerrit.ovirt.org/36263 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic7e9ba73514292cc2bb4a025d286e2c732e88a75 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Shahar Havivi <[email protected]> Gerrit-Reviewer: Francesco Romani <[email protected]> Gerrit-Reviewer: Shahar Havivi <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
