Omer Frenkel has submitted this change and it was merged. Change subject: core: mark fields that vdsm cannot change with annotation ......................................................................
core: mark fields that vdsm cannot change with annotation We used to have the names of the fields in VmDynamic that cannot be changed by VDSM hard-coded in VdsUpdateRunTimeInfo (so that if we detect when we compare the VmDynamic we hold in the DB and the VmDynamic we get from VDSM that only such kind of fields are different, we will not update the DB). But holding the field names hard-coded in VdsUpdateRunTimeInfo is problematic because: * It means that the fields are renamed, we need to remember to rename them in VdsUpdateRunTimeInfo as well * When new fields that should not be change by VDSM are added to VmDynamic, we tend to forget to add them to the list that resides in VdsUpdateRunTimeInfo and it cause the number of unneeded writes to the DB to increase. The solution is to mark those fields in VmDynamic with an annotation which indicates that they cannot be changed by VDSM, and then retrieve all the fields with that annotation in VdsUpdateRunTimeInfo instead of using hard-coded list of field names. In addition, the block of code that maps pause status to audit log type in VdsUpdateRunTimeInfo#updateRepository is extracted to separate method to make it a bit shorter and more readable. Change-Id: I8c1981a7adaa6b4ff3ba4012fbe7318f6488e2ab Signed-off-by: Arik Hadas <aha...@redhat.com> --- A backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/UnchangeableByVdsm.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmDynamic.java M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java 3 files changed, 77 insertions(+), 40 deletions(-) Approvals: Omer Frenkel: Looks good to me, approved Arik Hadas: Verified -- To view, visit http://gerrit.ovirt.org/22644 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8c1981a7adaa6b4ff3ba4012fbe7318f6488e2ab Gerrit-PatchSet: 18 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Michal Skrivanek <michal.skriva...@redhat.com> Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com> Gerrit-Reviewer: Roy Golan <rgo...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches