Nir Soffer has posted comments on this change.

Change subject: vm: Fix attribute error when accessing drive in sampling method
......................................................................


Patch Set 1:

(1 comment)

....................................................
File vdsm/vm.py
Line 506:             return
Line 507: 
Line 508:         for vmDrive in self._vm._devices[DISK_DEVICES]:
Line 509:             # Note: drive may not have a format attribute during 
migration
Line 510:             if not vmDrive.blockDev or getattr(vmDrive, 'format', 
None) != 'cow':
Drive.__init__ invokes VmDevice.__init__(self, conf, log, **kwargs), which is 
Device.__init__ (because VmDevice did not override it):


    def __init__(self, conf, log, **kwargs):
        for attr, value in kwargs.iteritems():
            try:
                setattr(self, attr, value)
            except AttributeError:
                # skip read-only properties
                pass

So if we get a format argument in kwargs, we will have format attribute. The 
problem is what happen when we don't get a format parameter.
Line 511:                 continue
Line 512: 
Line 513:             capacity, alloc, physical = \
Line 514:                 self._vm._dom.blockInfo(vmDrive.path, 0)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia50e8af94b9c9b54332066a3f30999ce73e7a56f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimo...@redhat.com>
Gerrit-Reviewer: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: Sergey Gotliv <sgot...@redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeen...@redhat.com>
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to