Francesco Romani has submitted this change and it was merged. Change subject: virt: Introduce Vm._setVolumeSize helper ......................................................................
virt: Introduce Vm._setVolumeSize helper We have two place invoking self.cif.irs.setVolumeSize(), ignoring errors without documenting the reason. This patch adds Vm._setVolumeSize() helper that raises on errors, eliminating such code. We use setVolumeSize() when extending a disk. First we set volume size to 0, marking it as in transaction. Then we update the guest about the new size via libvirt, and finally we store the new size in the volume. In the first setVolumeSize() call setting volume size to 0, it is clear that we want to fail the operation, so using _setVolumeSize() the request fails without additional error handling code. The second setVolumeSize() call updating the volume to the actual new size is done after the vm was updated and can use the new device, so it is not clear if we should fail the request or just warn about the incorrect meta data in the volume (size=0). This patches changes the behavior to fail the request in this case. Change-Id: I742fde77a23387f89fa746c2030e151237cb230f Signed-off-by: Nir Soffer <[email protected]> Reviewed-on: https://gerrit.ovirt.org/37943 Reviewed-by: Francesco Romani <[email protected]> Reviewed-by: Adam Litke <[email protected]> Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1251958 Reviewed-on: https://gerrit.ovirt.org/45949 Tested-by: Adam Litke <[email protected]> Continuous-Integration: Francesco Romani <[email protected]> --- M vdsm/virt/vm.py 1 file changed, 12 insertions(+), 5 deletions(-) Approvals: Nir Soffer: Looks good to me, but someone else must approve Adam Litke: Verified Francesco Romani: Looks good to me, approved; Passed CI tests -- To view, visit https://gerrit.ovirt.org/45949 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I742fde77a23387f89fa746c2030e151237cb230f Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.5 Gerrit-Owner: Adam Litke <[email protected]> Gerrit-Reviewer: Adam Litke <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Francesco Romani <[email protected]> Gerrit-Reviewer: Nir Soffer <[email protected]> Gerrit-Reviewer: Yaniv Bronhaim <[email protected]> Gerrit-Reviewer: [email protected] _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
