Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: "LiveMigrateDiskCommand" small code improvements #522

Merged
merged 3 commits into from
Jul 20, 2022

Conversation

barpavel
Copy link
Member

@barpavel barpavel commented Jul 10, 2022

Small code improvements in a separate PR in order to keep #305 focused on important changes.

  1. Fixed typos in variable & method names.
  2. Eliminated code warnings by fixing a potential NPE.
  3. Removing a redundant getVm().getStatus().isQualifiedForLiveSnapshotMerge() check.
  4. Removing a redundant enum check.

Signed-off-by: Pavel Bar pbar@redhat.com

@barpavel barpavel marked this pull request as draft July 10, 2022 10:49
@barpavel barpavel force-pushed the lsm_small_improvements branch 4 times, most recently from fd99ac2 to 75557b9 Compare July 10, 2022 11:33
@barpavel barpavel requested review from bennyz and ahadas July 10, 2022 12:08
@barpavel barpavel marked this pull request as ready for review July 10, 2022 12:08
@barpavel
Copy link
Member Author

/ost

@barpavel barpavel force-pushed the lsm_small_improvements branch 3 times, most recently from 805ea3e to c18e706 Compare July 14, 2022 10:31
@barpavel
Copy link
Member Author

/ost

Fixed typos in variables, method names & comments.

Signed-off-by: Pavel Bar <pbar@redhat.com>
Fixed a potential NPE and eliminated code warning that was related to it.

Signed-off-by: Pavel Bar <pbar@redhat.com>
1) Remove "is qualified for live merge" check:
   Block commit is used since 4.2, see [1], [2].
   So "getVm().getStatus().isQualifiedForLiveSnapshotMerge()"
   check is not needed anymore.
2) Remove redundant enum check:
  a) Simplifying the "isRemoveAutoGeneratedSnapshotRequired()" method:
     There is no need to test the 2nd part in the condition that looks like:
       stage == enumA && stage != enumB
  b) After the above simplification, the method can be inlined to receive
     an even more simple code.

[1] https://bugzilla.redhat.com/1246114
[2] https://bugzilla.redhat.com/1369942

Signed-off-by: Pavel Bar <pbar@redhat.com>
@barpavel
Copy link
Member Author

/ost

@ahadas ahadas merged commit dfe2c4b into oVirt:master Jul 20, 2022
@barpavel barpavel deleted the lsm_small_improvements branch July 20, 2022 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants