Skip to content

Commit 4c641fc

Browse files
move MAX_CPU_QUOTA to CpuTuneDef
1 parent 3663ac2 commit 4c641fc

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,6 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
456456

457457
private static final int MINIMUM_QEMU_VERSION_FOR_INCREMENTAL_SNAPSHOT = 6001000;
458458

459-
public static final long MAX_CPU_QUOTA = 17592186044415L;
460-
461459
protected HypervisorType hypervisorType;
462460
protected String hypervisorURI;
463461
protected long hypervisorLibvirtVersion;
@@ -3034,8 +3032,8 @@ public void updateCpuQuotaAndPeriod(Domain domain, VirtualMachineTO vmTO, boolea
30343032
}
30353033

30363034
if (limitCpuUseChange && !vmTO.isLimitCpuUse()) {
3037-
logger.info("Updating the [{}] of the [{}] domain to [{}], because CPU limitation has been removed.", CpuSchedulerParameter.QUOTA, domain.getName(), LibvirtComputingResource.MAX_CPU_QUOTA);
3038-
LibvirtComputingResource.setQuota(domain, LibvirtComputingResource.MAX_CPU_QUOTA);
3035+
logger.info("Updating the [{}] of the [{}] domain to [{}], because CPU limitation has been removed.", CpuSchedulerParameter.QUOTA, domain.getName(), CpuTuneDef.MAX_CPU_QUOTA);
3036+
LibvirtComputingResource.setQuota(domain, CpuTuneDef.MAX_CPU_QUOTA);
30393037
return;
30403038
}
30413039

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1925,6 +1925,7 @@ public static class CpuTuneDef {
19251925
static final int DEFAULT_PERIOD = 10000;
19261926
static final int MIN_QUOTA = 1000;
19271927
static final int MAX_PERIOD = 1000000;
1928+
public static final long MAX_CPU_QUOTA = 17592186044415L;
19281929

19291930
public void setShares(int shares) {
19301931
_shares = shares;

0 commit comments

Comments
 (0)