Skip to content

Commit

Permalink
core: remove duplicate "setStoragePoolId()" call
Browse files Browse the repository at this point in the history
Exactly the same call to "setStoragePoolId()" is already performed in
"init()", see [1].
So I see no reason why the same code should be executed again in "validate()",
especially that "validate()" is designed for other purposes.

[1] https://github.com/oVirt/ovirt-engine/blob/ovirt-engine-4.5.2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/lsm/LiveMigrateDiskCommand.java#L143

Signed-off-by: Pavel Bar <pbar@redhat.com>
  • Loading branch information
barpavel authored and ahadas committed Sep 13, 2022
1 parent 41851f2 commit 389eadc
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
import org.ovirt.engine.core.vdsbroker.builder.vminfo.VmInfoBuildUtils;

@NonTransactiveCommandAttribute(forceCompensation = true)
public class LiveMigrateDiskCommand<T extends LiveMigrateDiskParameters> extends MoveOrCopyDiskCommand<T>implements SerialChildExecutingCommand {
public class LiveMigrateDiskCommand<T extends LiveMigrateDiskParameters> extends MoveOrCopyDiskCommand<T>
implements SerialChildExecutingCommand {

private Guid sourceQuotaId;
private Guid sourceDiskProfileId;
Expand Down Expand Up @@ -618,8 +619,6 @@ protected boolean validate() {
return failValidation(EngineMessage.CANNOT_LIVE_MIGRATE_VM_SHOULD_BE_IN_PAUSED_OR_UP_STATUS);
}

setStoragePoolId(getVm().getStoragePoolId());

if (!validate(new StorageDomainValidator(getDstStorageDomain()).isNotBackupDomain())
|| !validateDestDomainsSpaceRequirements()) {
return false;
Expand Down

0 comments on commit 389eadc

Please sign in to comment.