Change in vdsm[master]: Fix a reference before assignment bug in Hsm.py

nsoffer at redhat.com nsoffer at redhat.com
Wed Mar 26 14:03:45 UTC 2014


Nir Soffer has posted comments on this change.

Change subject: Fix a reference before assignment bug in Hsm.py
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.ovirt.org/#/c/26109/1/vdsm/storage/hsm.py
File vdsm/storage/hsm.py:

Line 3251:             imgVolumesInfo.append(volInfo)
Line 3252:             if volUUID == leafUUID:
Line 3253:                 leafInfo = volInfo
Line 3254:             else:
Line 3255:                 leafInfo = None
This seem to work for scale team, but I'm not sure it is the correct solution.

When vm.py calls this, it set drive['volumeInfo'] to leafInfo, see clientIF.py line 256.  Later, code in vm.py access drive.volumeInfo, and expect there a dictionary. This code wil crash when finding there None instead. It seems that currently vm.py does not access this field for disks, but this may change later; this "fix" may be a quiet bug waiting to hit us in the future.

To fix this we must understad why volUUID is not equal ot leafUUID. How can we have an image without a leaf volume?
Line 3256: 
Line 3257:         return {'path': leafPath, 'info': leafInfo,
Line 3258:                 'imgVolumesInfo': imgVolumesInfo}
Line 3259: 


-- 
To view, visit http://gerrit.ovirt.org/26109
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2c523a573dd824e85a44f2d531f52ee5f905fe85
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list