Skip to content

Commit

Permalink
core: avoid pre-polling in import-vm-from-configuration
Browse files Browse the repository at this point in the history
Set entity-info in the parameters of AddVmLease to avoid the pre-polling
period in case a VM with a lease is imported from configuration.

Bug-Url: https://bugzilla.redhat.com/2074112
Signed-off-by: Arik Hadas <ahadas@redhat.com>
  • Loading branch information
ahadas committed May 2, 2022
1 parent 00c6d69 commit 85dade0
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -545,9 +545,8 @@ protected boolean removeVmLease(Guid leaseStorageDomainId, Guid vmId) {
VmLeaseParameters params = new VmLeaseParameters(getStoragePoolId(), leaseStorageDomainId, vmId);
params.setParentCommand(getActionType());
params.setParentParameters(getParameters());
if (getParameters().getEntityInfo() == null) {
getParameters().setEntityInfo(new EntityInfo(VdcObjectType.VM, vmId));
}
params.setEntityInfo(getParameters().getEntityInfo() != null ? getParameters().getEntityInfo()
: new EntityInfo(VdcObjectType.VM, vmId));
ActionReturnValue returnValue = runInternalActionWithTasksContext(ActionType.RemoveVmLease, params);
if (returnValue.getSucceeded()) {
getTaskIdList().addAll(returnValue.getInternalVdsmTaskIdList());
Expand Down Expand Up @@ -576,9 +575,8 @@ protected boolean addVmLease(Guid leaseStorageDomainId, Guid vmId, boolean hotPl
}
params.setParentCommand(getActionType());
params.setParentParameters(getParameters());
if (getParameters().getEntityInfo() == null) {
getParameters().setEntityInfo(new EntityInfo(VdcObjectType.VM, vmId));
}
params.setEntityInfo(getParameters().getEntityInfo() != null ? getParameters().getEntityInfo()
: new EntityInfo(VdcObjectType.VM, vmId));
ActionReturnValue returnValue = runInternalActionWithTasksContext(ActionType.AddVmLease, params);
if (returnValue.getSucceeded()) {
getTaskIdList().addAll(returnValue.getInternalVdsmTaskIdList());
Expand Down

0 comments on commit 85dade0

Please sign in to comment.