Sergey Gotliv has posted comments on this change.
Change subject: vm: Fix attribute error when accessing drive in sampling method
......................................................................
Patch Set 1: Code-Review-1
(1 comment)
Sorry, I changed my mind either, please see my 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':
This is not the right place to do that change. It should be in ctor of the Drive.
Let's follow the hotplugDisk flow.
Engine sends to VDSM the map with all disk params including format:
drive.put(VdsProperties.Format, diskImage.getVolumeFormat().toString().toLowerCase());
VDSM in vm.py hotplugDisk() creating a Drive which later added to the disk device list of
the VM:
drive = Drive(self.conf, self.log, **diskParams),
but I don't see that __init__ of Drive does something with the format.
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 <nsoffer(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Sergey Gotliv <sgotliv(a)redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-HasComments: Yes