Change in vdsm[master]: Move VolumeMetadata to vsdm.storage
gerrit-hooks has posted comments on this change. Change subject: Move VolumeMetadata to vsdm.storage .. Patch Set 4: * Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6']) -- To view, visit https://gerrit.ovirt.org/57685 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I29e910915680e2f68d25d2a896e5e3c3802e6273 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam LitkeGerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Idan Shaby Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: Move VolumeMetadata to vsdm.storage
gerrit-hooks has posted comments on this change. Change subject: Move VolumeMetadata to vsdm.storage .. Patch Set 5: * Update tracker: IGNORE, no Bug-Url found * Set MODIFIED::IGNORE, no Bug-Url found. -- To view, visit https://gerrit.ovirt.org/57685 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I29e910915680e2f68d25d2a896e5e3c3802e6273 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam LitkeGerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Idan Shaby Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: Move VolumeMetadata to vsdm.storage
Nir Soffer has submitted this change and it was merged. Change subject: Move VolumeMetadata to vsdm.storage .. Move VolumeMetadata to vsdm.storage To avoid circular dependencies and better organize common storage code, move the VolumeMetadata class into the vdsm.storage package. Change-Id: I29e910915680e2f68d25d2a896e5e3c3802e6273 Signed-off-by: Adam LitkeReviewed-on: https://gerrit.ovirt.org/57685 Reviewed-by: Nir Soffer Reviewed-by: Ala Hino Reviewed-by: Freddy Rolland Continuous-Integration: Jenkins CI --- M lib/vdsm/storage/Makefile.am A lib/vdsm/storage/volumemetadata.py M tests/storage_volume_artifacts_test.py M vdsm.spec.in M vdsm/storage/blockVolume.py M vdsm/storage/fileVolume.py M vdsm/storage/sdm/volume_artifacts.py M vdsm/storage/volume.py 8 files changed, 161 insertions(+), 128 deletions(-) Approvals: Nir Soffer: Looks good to me, approved Adam Litke: Verified Jenkins CI: Passed CI tests Freddy Rolland: Looks good to me, but someone else must approve Ala Hino: Looks good to me, but someone else must approve -- To view, visit https://gerrit.ovirt.org/57685 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I29e910915680e2f68d25d2a896e5e3c3802e6273 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam Litke Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Idan Shaby Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: gerrit-hooks ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: Move VolumeMetadata to vsdm.storage
gerrit-hooks has posted comments on this change. Change subject: Move VolumeMetadata to vsdm.storage .. Patch Set 3: * Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6']) -- To view, visit https://gerrit.ovirt.org/57685 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I29e910915680e2f68d25d2a896e5e3c3802e6273 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam LitkeGerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Idan Shaby Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: Move VolumeMetadata to vsdm.storage
Freddy Rolland has posted comments on this change. Change subject: Move VolumeMetadata to vsdm.storage .. Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.ovirt.org/57685 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I29e910915680e2f68d25d2a896e5e3c3802e6273 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam LitkeGerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Idan Shaby Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: Move VolumeMetadata to vsdm.storage
Ala Hino has posted comments on this change. Change subject: Move VolumeMetadata to vsdm.storage .. Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.ovirt.org/57685 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I29e910915680e2f68d25d2a896e5e3c3802e6273 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam LitkeGerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Idan Shaby Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: Move VolumeMetadata to vsdm.storage
Nir Soffer has posted comments on this change. Change subject: Move VolumeMetadata to vsdm.storage .. Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.ovirt.org/57685 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I29e910915680e2f68d25d2a896e5e3c3802e6273 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam LitkeGerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Idan Shaby Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: Move VolumeMetadata to vsdm.storage
gerrit-hooks has posted comments on this change. Change subject: Move VolumeMetadata to vsdm.storage .. Patch Set 2: * Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6']) -- To view, visit https://gerrit.ovirt.org/57685 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I29e910915680e2f68d25d2a896e5e3c3802e6273 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam LitkeGerrit-Reviewer: Ala Hino Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Idan Shaby Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: Move VolumeMetadata to vsdm.storage
Adam Litke has posted comments on this change. Change subject: Move VolumeMetadata to vsdm.storage .. Patch Set 2: Verified+1 -- To view, visit https://gerrit.ovirt.org/57685 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I29e910915680e2f68d25d2a896e5e3c3802e6273 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam LitkeGerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Idan Shaby Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: Move VolumeMetadata to vsdm.storage
gerrit-hooks has posted comments on this change. Change subject: Move VolumeMetadata to vsdm.storage .. Patch Set 1: * Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6']) -- To view, visit https://gerrit.ovirt.org/57685 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I29e910915680e2f68d25d2a896e5e3c3802e6273 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam LitkeGerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: Move VolumeMetadata to vsdm.storage
Adam Litke has uploaded a new change for review. Change subject: Move VolumeMetadata to vsdm.storage .. Move VolumeMetadata to vsdm.storage To avoid circular dependencies and better organize common storage code, move the VolumeMetadata class into the vdsm.storage package. Change-Id: I29e910915680e2f68d25d2a896e5e3c3802e6273 Signed-off-by: Adam Litke--- A lib/vdsm/storage/volumemetadata.py M tests/storage_volume_artifacts_test.py M vdsm/storage/blockVolume.py M vdsm/storage/fileVolume.py M vdsm/storage/sdm/volume_artifacts.py M vdsm/storage/volume.py 6 files changed, 159 insertions(+), 128 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/85/57685/1 diff --git a/lib/vdsm/storage/volumemetadata.py b/lib/vdsm/storage/volumemetadata.py new file mode 100644 index 000..e3b254a --- /dev/null +++ b/lib/vdsm/storage/volumemetadata.py @@ -0,0 +1,147 @@ +# +# Copyright 2016 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Refer to the README and COPYING files for full details of the license +# + +from __future__ import absolute_import + +import logging +import time + +from vdsm.storage import constants +from vdsm.storage import exception + + +class VolumeMetadata(object): + +log = logging.getLogger('Storage.VolumeMetadata') + +def __init__(self, domain, image, puuid, size, format, + type, voltype, disktype, description="", + legality=constants.ILLEGAL_VOL, ctime=None, mtime=None): +assert(isinstance(size, int)) +assert(ctime is None or isinstance(ctime, int)) +assert(mtime is None or isinstance(mtime, int)) + +# Storage domain UUID +self.domain = domain +# Image UUID +self.image = image +# UUID of the parent volume or BLANK_UUID +self.puuid = puuid +# Volume size in sectors +self.size = size +# Format (RAW or COW) +self.format = format +# Allocation policy (PREALLOCATED or SPARSE) +self.type = type +# Relationship to other volumes (LEAF, INTERNAL or SHARED) +self.voltype = voltype +# Intended usage of this volume (unused) +self.disktype = disktype +# Free-form description and may be used to store extra metadata +self.description = description +# Indicates if the volume contents should be considered valid +self.legality = legality +# Volume creation time (in seconds since the epoch) +self.ctime = int(time.time()) if ctime is None else ctime +# Volume modification time (unused and should be zero) +self.mtime = 0 if mtime is None else mtime + +@classmethod +def from_lines(cls, lines): +md = {} +for line in lines: +if line.startswith("EOF"): +break +if '=' not in line: +continue +key, value = line.split('=', 1) +md[key.strip()] = value.strip() + +try: +return cls(domain=md[constants.DOMAIN], + image=md[constants.IMAGE], + puuid=md[constants.PUUID], + size=int(md[constants.SIZE]), + format=md[constants.FORMAT], + type=md[constants.TYPE], + voltype=md[constants.VOLTYPE], + disktype=md[constants.DISKTYPE], + description=md[constants.DESCRIPTION], + legality=md[constants.LEGALITY], + ctime=int(md[constants.CTIME]), + mtime=int(md[constants.MTIME])) +except KeyError as e: +raise exception.MetaDataKeyNotFoundError( +"Missing metadata key: %s: found: %s" % (e, md)) + +@property +def description(self): +return self._description + +@description.setter +def description(self, desc): +self._description = self.validate_description(desc) + +@classmethod +def validate_description(cls, desc): +desc = str(desc) +# We cannot fail when the description is too long, since we must +# support older engine that may send such values, or old