cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nvazquez <...@git.apache.org>
Subject [GitHub] cloudstack pull request #1727: CLOUDSTACK-9539: Support changing Service off...
Date Mon, 16 Jan 2017 19:41:21 GMT
Github user nvazquez commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1727#discussion_r96294242
  
    --- Diff: server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java ---
    @@ -350,6 +368,24 @@ public VMSnapshot allocVMSnapshot(Long vmId, String vsDisplayName,
String vsDesc
             return null;
         }
     
    +    /**
    +     * Add entries on vm_snapshot_details if service offering is dynamic. This will allow
setting details when revert to vm snapshot
    +     * @param vmId vm id
    +     * @param serviceOfferingId service offering id
    +     * @param vmSnapshotId vm snapshot id
    +     */
    +    private void addSupportForCustomServiceOffering(long vmId, long serviceOfferingId,
long vmSnapshotId) {
    +        ServiceOfferingVO serviceOfferingVO = _serviceOfferingDao.findById(serviceOfferingId);
    +        if (serviceOfferingVO.isDynamic()) {
    +            List<UserVmDetailVO> vmDetails = _userVmDetailsDao.listDetails(vmId);
    +            for (UserVmDetailVO detail : vmDetails) {
    +                if(detail.getName().equalsIgnoreCase("cpuNumber") || detail.getName().equalsIgnoreCase("cpuSpeed")
|| detail.getName().equalsIgnoreCase("memory")) {
    +                    _vmSnapshotDetailsDao.addDetail(vmSnapshotId, detail.getName(), detail.getValue(),
true);
    --- End diff --
    
    Done, thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message