Change in vdsm[master]: hsm: deleteImage fails because of wrong dictionary use

2013-09-17 Thread abaron
Ayal Baron has posted comments on this change.

Change subject: hsm: deleteImage fails because of wrong dictionary use
..


Patch Set 4: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com
Gerrit-Reviewer: Eduardo ewars...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: hsm: deleteImage fails because of wrong dictionary use

2013-09-17 Thread danken
Dan Kenigsberg has submitted this change and it was merged.

Change subject: hsm: deleteImage fails because of wrong dictionary use
..


hsm: deleteImage fails because of wrong dictionary use

also, get fake template params before deleting the template.

Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=964649
Signed-off-by: Yeela Kaplan ykap...@redhat.com
Reviewed-on: http://gerrit.ovirt.org/17383
Reviewed-by: Ayal Baron aba...@redhat.com
---
M vdsm/storage/hsm.py
M vdsm/storage/sd.py
2 files changed, 13 insertions(+), 16 deletions(-)

Approvals:
  Ayal Baron: Looks good to me, approved
  Yeela Kaplan: Verified



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com
Gerrit-Reviewer: Eduardo ewars...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: oVirt Jenkins CI Server
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: hsm: deleteImage fails because of wrong dictionary use

2013-09-16 Thread ykaplan
Yeela Kaplan has posted comments on this change.

Change subject: hsm: deleteImage fails because of wrong dictionary use
..


Patch Set 3: Verified+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com
Gerrit-Reviewer: Eduardo ewars...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: hsm: deleteImage fails because of wrong dictionary use

2013-09-16 Thread ykaplan
Yeela Kaplan has posted comments on this change.

Change subject: hsm: deleteImage fails because of wrong dictionary use
..


Patch Set 4: Verified+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com
Gerrit-Reviewer: Eduardo ewars...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: hsm: deleteImage fails because of wrong dictionary use

2013-09-16 Thread oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.

Change subject: hsm: deleteImage fails because of wrong dictionary use
..


Patch Set 4:

Build Successful 

http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/4482/ : SUCCESS

http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/4401/ : SUCCESS

http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/3585/ : SUCCESS

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com
Gerrit-Reviewer: Eduardo ewars...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: hsm: deleteImage fails because of wrong dictionary use

2013-09-01 Thread abaron
Ayal Baron has posted comments on this change.

Change subject: hsm: deleteImage fails because of wrong dictionary use
..


Patch Set 3: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com
Gerrit-Reviewer: Eduardo ewars...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: hsm: deleteImage fails because of wrong dictionary use

2013-08-26 Thread oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.

Change subject: hsm: deleteImage fails because of wrong dictionary use
..


Patch Set 3:

Build Successful 

http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/4140/ : SUCCESS

http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/3245/ : SUCCESS

http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/4061/ : SUCCESS

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com
Gerrit-Reviewer: Eduardo ewars...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: hsm: deleteImage fails because of wrong dictionary use

2013-08-26 Thread fsimonce
Federico Simoncelli has posted comments on this change.

Change subject: hsm: deleteImage fails because of wrong dictionary use
..


Patch Set 3: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com
Gerrit-Reviewer: Eduardo ewars...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: hsm: deleteImage fails because of wrong dictionary use

2013-08-25 Thread oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.

Change subject: hsm: deleteImage fails because of wrong dictionary use
..


Patch Set 2: Verified-1

Build Failed 

http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/4135/ : FAILURE

http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/3240/ : FAILURE

http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/4056/ : SUCCESS

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com
Gerrit-Reviewer: Eduardo ewars...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: hsm: deleteImage fails because of wrong dictionary use

2013-08-20 Thread ewarszaw
Eduardo has posted comments on this change.

Change subject: hsm: deleteImage fails because of wrong dictionary use
..


Patch Set 1:

(2 comments)


File vdsm/storage/hsm.py
Line 1525: # hence no need to create fake template if postZero is 
true.
Line 1526: self._spmSchedule(spUUID, zeroImage_%s % imgUUID, 
dom.zeroImage,
Line 1527:   sdUUID, imgUUID, volsByImg)
Line 1528: else:
Line 1529: dom.deleteImage(sdUUID, imgUUID, volsByImg)
We want to avoid _reading_ this metadata.
We need to write it anyway using the more standard methods.
This is for backward compatibility and makes easier to get rid from the 
irrelevant fake volume concept at all.
Line 1530: # This is a hack to keep the interface consistent
Line 1531: # We currently have race conditions in delete image, to 
quickly fix
Line 1532: # this we delete images in the synchronous state. This 
only works
Line 1533: # because Engine does not send two requests at a time. 
This hack is


Line 1536: # an eliminate all race conditions
Line 1537: if needFake:
Line 1538: img = 
image.Image(os.path.join(self.storage_repository,
Line 1539:spUUID))
Line 1540: tName = volsByImg.keys()[0]
As said above the issue is that is a must, for BC, to _write_ the MD but we 
want this code to be independent to the MD content, avoiding to read it.
Line 1541: tParams = dom.produceVolume(imgUUID, 
tName).getVolumeParams()
Line 1542: img.createFakeTemplate(sdUUID=sdUUID, 
volParams=tParams)
Line 1543: self._spmSchedule(spUUID, deleteImage_%s % imgUUID, 
lambda: True)
Line 1544: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com
Gerrit-Reviewer: Eduardo ewars...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: hsm: deleteImage fails because of wrong dictionary use

2013-08-19 Thread ykaplan
Yeela Kaplan has posted comments on this change.

Change subject: hsm: deleteImage fails because of wrong dictionary use
..


Patch Set 1: Verified+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com
Gerrit-Reviewer: Eduardo ewars...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: hsm: deleteImage fails because of wrong dictionary use

2013-08-19 Thread fsimonce
Federico Simoncelli has posted comments on this change.

Change subject: hsm: deleteImage fails because of wrong dictionary use
..


Patch Set 1: Code-Review-1

(2 comments)


File vdsm/storage/hsm.py
Line 1525: # hence no need to create fake template if postZero is 
true.
Line 1526: self._spmSchedule(spUUID, zeroImage_%s % imgUUID, 
dom.zeroImage,
Line 1527:   sdUUID, imgUUID, volsByImg)
Line 1528: else:
Line 1529: dom.deleteImage(sdUUID, imgUUID, volsByImg)
Do we want to optimize in case the image is already a fake template? 

 vol.getLegality() == volume.FAKE_VOL

In such case we can avoid to delete and recreate another fake volume.
Line 1530: # This is a hack to keep the interface consistent
Line 1531: # We currently have race conditions in delete image, to 
quickly fix
Line 1532: # this we delete images in the synchronous state. This 
only works
Line 1533: # because Engine does not send two requests at a time. 
This hack is


Line 1536: # an eliminate all race conditions
Line 1537: if needFake:
Line 1538: img = 
image.Image(os.path.join(self.storage_repository,
Line 1539:spUUID))
Line 1540: tName = volsByImg.keys()[0]
This might work but it's potentially wrong.
It works only because you have a dictionary with 1 key (but this is rather 
implicit) otherwise a random key would be selected.

We could try to do some cleanup, remove the (unnecessary) 
isTemplateWithChildren/needFake and get the fake volume uuid from the loop at 
line 1508:

 fakeVolUUID = None
 for k, v in volsByImg.iteritems():
 if len(v.imgs)  1 and v.imgs[0] == imgUUID:
 if dom.isBackup():
 fakeVolUUID = k
 else:
 raise se.CannotDeleteSharedVolume(...)

 ...
 if fakeVolUUID is not None:
 ...
 tParams = dom.produceVolume(imgUUID, fakeVolUUID).getVolumeParams()
 ...
Line 1541: tParams = dom.produceVolume(imgUUID, 
tName).getVolumeParams()
Line 1542: img.createFakeTemplate(sdUUID=sdUUID, 
volParams=tParams)
Line 1543: self._spmSchedule(spUUID, deleteImage_%s % imgUUID, 
lambda: True)
Line 1544: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com
Gerrit-Reviewer: Eduardo ewars...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: hsm: deleteImage fails because of wrong dictionary use

2013-08-19 Thread ewarszaw
Eduardo has posted comments on this change.

Change subject: hsm: deleteImage fails because of wrong dictionary use
..


Patch Set 1:

(2 comments)


File vdsm/storage/hsm.py
Line 1525: # hence no need to create fake template if postZero is 
true.
Line 1526: self._spmSchedule(spUUID, zeroImage_%s % imgUUID, 
dom.zeroImage,
Line 1527:   sdUUID, imgUUID, volsByImg)
Line 1528: else:
Line 1529: dom.deleteImage(sdUUID, imgUUID, volsByImg)
A fake volume is a small void volume, there is no real gain optimizing here.

Reading the metadata in order to verify legality /  fake is what we want to 
avoid. This produce more disk operations than simply remove this fake.

Failing to the delete the fake volume will lead to fail the subsequent images 
operations since override flag is not set.

We want to simplify the logic, and not little gains that are minor compared 
with the image that is deleted.

The real solution is to remove fake volumes at all, started at: 
http://gerrit.ovirt.org/8280
Line 1530: # This is a hack to keep the interface consistent
Line 1531: # We currently have race conditions in delete image, to 
quickly fix
Line 1532: # this we delete images in the synchronous state. This 
only works
Line 1533: # because Engine does not send two requests at a time. 
This hack is


Line 1536: # an eliminate all race conditions
Line 1537: if needFake:
Line 1538: img = 
image.Image(os.path.join(self.storage_repository,
Line 1539:spUUID))
Line 1540: tName = volsByImg.keys()[0]
Can't be more than one volume in a template image since ovirt images require 
that the template image is composed by a unique volume.

For performance reasons we avoid to read MD multiple times and we want to 
simplify the logic as far we can.

The complexity is a product of the ovirt images layout.
Line 1541: tParams = dom.produceVolume(imgUUID, 
tName).getVolumeParams()
Line 1542: img.createFakeTemplate(sdUUID=sdUUID, 
volParams=tParams)
Line 1543: self._spmSchedule(spUUID, deleteImage_%s % imgUUID, 
lambda: True)
Line 1544: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com
Gerrit-Reviewer: Eduardo ewars...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: hsm: deleteImage fails because of wrong dictionary use

2013-08-19 Thread fsimonce
Federico Simoncelli has posted comments on this change.

Change subject: hsm: deleteImage fails because of wrong dictionary use
..


Patch Set 1:

(2 comments)


File vdsm/storage/hsm.py
Line 1525: # hence no need to create fake template if postZero is 
true.
Line 1526: self._spmSchedule(spUUID, zeroImage_%s % imgUUID, 
dom.zeroImage,
Line 1527:   sdUUID, imgUUID, volsByImg)
Line 1528: else:
Line 1529: dom.deleteImage(sdUUID, imgUUID, volsByImg)
 A fake volume is a small void volume, there is no real gain optimizing here.

Check out what createFakeTemplate and its createVolume do. It looks to me like 
there's a lot to optimize out.

Anyway you wouldn't have to check for FAKE_VOL every time, but only if needFake 
== True:

 if needFake == True and vol.getLegality() == volume.FAKE_VOL:
 self._spmSchedule(spUUID, deleteImage_%s % imgUUID, lambda: True)
 return  # done
Line 1530: # This is a hack to keep the interface consistent
Line 1531: # We currently have race conditions in delete image, to 
quickly fix
Line 1532: # this we delete images in the synchronous state. This 
only works
Line 1533: # because Engine does not send two requests at a time. 
This hack is


Line 1536: # an eliminate all race conditions
Line 1537: if needFake:
Line 1538: img = 
image.Image(os.path.join(self.storage_repository,
Line 1539:spUUID))
Line 1540: tName = volsByImg.keys()[0]
 Can't be more than one volume in a template image since ovirt images require 
 that the template image is composed by a unique volume.

Yes, I stated that as first thing, It works only because you have a 
dictionary with 1 key (but this is rather implicit)

 For performance reasons we avoid to read MD multiple times and we want to 
 simplify the logic as far we can. The complexity is a product of the ovirt 
 images layout.

Irrelevant here as the number of operations are the same. I'm in fact trying to 
simplify the logic here removing two unnecessary flags.
Line 1541: tParams = dom.produceVolume(imgUUID, 
tName).getVolumeParams()
Line 1542: img.createFakeTemplate(sdUUID=sdUUID, 
volParams=tParams)
Line 1543: self._spmSchedule(spUUID, deleteImage_%s % imgUUID, 
lambda: True)
Line 1544: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com
Gerrit-Reviewer: Eduardo ewars...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: hsm: deleteImage fails because of wrong dictionary use

2013-07-28 Thread ykaplan
Yeela Kaplan has uploaded a new change for review.

Change subject: hsm: deleteImage fails because of wrong dictionary use
..

hsm: deleteImage fails because of wrong dictionary use

Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=964649
Signed-off-by: Yeela Kaplan ykap...@redhat.com
---
M vdsm/storage/hsm.py
M vdsm/storage/sd.py
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/83/17383/1

diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 5da6ae6..4f95819 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -1537,7 +1537,7 @@
 if needFake:
 img = image.Image(os.path.join(self.storage_repository,
spUUID))
-tName = volsByImg.iterkeys()[0]
+tName = volsByImg.keys()[0]
 tParams = dom.produceVolume(imgUUID, tName).getVolumeParams()
 img.createFakeTemplate(sdUUID=sdUUID, volParams=tParams)
 self._spmSchedule(spUUID, deleteImage_%s % imgUUID, lambda: True)
diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py
index 36c4877..38cf888 100644
--- a/vdsm/storage/sd.py
+++ b/vdsm/storage/sd.py
@@ -149,7 +149,7 @@
 def getVolsOfImage(allVols, imgUUID):
  Filter allVols dict for volumes related to imgUUID.
 
-Returns {volName: (([templateImge], imgUUID, [otherImg]), volPar)
+Returns {volName: (([templateImage], imgUUID, [otherImg]), volPar)
 For a template volume will be more than one image entry.
 
 allVols: The getAllVols() return dict.


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan ykap...@redhat.com
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: hsm: deleteImage fails because of wrong dictionary use

2013-07-28 Thread Gerrit Code Review
oVirt Jenkins CI Server has posted comments on this change.

Change subject: hsm: deleteImage fails because of wrong dictionary use
..


Patch Set 1:

Build Successful 

http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/2715/ : SUCCESS

http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/3522/ : SUCCESS

http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/3606/ : SUCCESS

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com
Gerrit-Reviewer: Eduardo ewars...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: oVirt Jenkins CI Server
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: hsm: deleteImage fails because of wrong dictionary use

2013-07-28 Thread ewarszaw
Eduardo has posted comments on this change.

Change subject: hsm: deleteImage fails because of wrong dictionary use
..


Patch Set 1: Looks good to me, approved

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com
Gerrit-Reviewer: Eduardo ewars...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: oVirt Jenkins CI Server
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: hsm: deleteImage fails because of wrong dictionary use

2013-07-28 Thread abaron
Ayal Baron has posted comments on this change.

Change subject: hsm: deleteImage fails because of wrong dictionary use
..


Patch Set 1: Looks good to me, approved

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan ykap...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com
Gerrit-Reviewer: Eduardo ewars...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: oVirt Jenkins CI Server
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches