Ayal Baron has posted comments on this change.
Change subject: vm: update volume apparentsize after snapshot ......................................................................
Patch Set 3: (1 inline comment)
.................................................... File vdsm/libvirtvm.py Line 2121: # (the apparentsize is updated as last step in updateDriveParameters) Line 2122: self.stopDisksStatsCollection() Line 2123: Line 2124: try: Line 2125: while True: The while loop here is just complicating things. First, there are at most 2 runs. Second, the only common denominator between the two runs is a single line - snapshotCreateXML.
How about removing it and doing something like (less code, less indentation and less complexity imo):
try: try: self._dom.snapshotCreateXML(snapxml, snapFlags) except Exception as e: # try again without the VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE flag. # At the moment libvirt is returning two generic errors # (INTERNAL_ERROR, ARGUMENT_UNSUPPORTED) which are too # broad to be caught (BZ#845635). snapFlags &= (~libvirt.VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE) # Here we don't need a full stacktrace (exc_info) but # it's still interesting knowing what was the error self.log.debug("Snapshot failed using the quiesce flag, trying " "again without it (%s)", e) try: self._dom.snapshotCreateXML(snapxml, snapFlags) except Exception as e: self.log.error("Unable to take snapshot", exc_info=True) return errCode['snapshotErr']
# Update the drive information for drive in newDrives.values(): self.updateDriveParameters(drive)
finally: self.startDisksStatsCollection() Line 2126: try: Line 2127: self._dom.snapshotCreateXML(snapxml, snapFlags) Line 2128: except Exception as e: Line 2129: # If we used VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE and the
-- To view, visit http://gerrit.ovirt.org/13346 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I472c2931551643914e6a09b54d3d96f371f34864 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server