cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaanHoogland <...@git.apache.org>
Subject [GitHub] cloudstack pull request: Allow VM snapshots and volume snapshots t...
Date Mon, 01 Feb 2016 07:13:14 GMT
Github user DaanHoogland commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/672#discussion_r51385879
  
    --- Diff: plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
---
    @@ -4251,6 +4257,34 @@ public void rebootVM(final Connection conn, final VM vm, final
String vmName) th
             }
         }
     
    +    protected String skipOrRemoveSR(Connection conn, SR sr) {
    +        if (sr == null) {
    +            return null;
    +        }
    +        if (s_logger.isDebugEnabled()) {
    +            s_logger.debug(logX(sr, "Removing SR"));
    +        }
    +        try {
    +            Set<VDI> vdis = sr.getVDIs(conn);
    +            for (VDI vdi : vdis) {
    +                Map<java.lang.String, Types.VdiOperations> currentOperation = vdi.getCurrentOperations(conn);
    +                if (currentOperation == null || currentOperation.size() == 0) {
    +                    continue;
    +                }
    +                return null;
    +            }
    +            removeSR(conn, sr);
    +            return null;
    +        } catch (XenAPIException e) {
    +            s_logger.warn(logX(sr, "Unable to get current opertions " + e.toString()),
e);
    +        } catch (XmlRpcException e) {
    +            s_logger.warn(logX(sr, "Unable to get current opertions " + e.getMessage()),
e);
    +        }
    +        String msg = "Remove SR failed";
    +        s_logger.warn(msg);
    +        return msg;
    --- End diff --
    
    "wasting time, finding out how it works"? That is definitely a contradiction for someone
trying to enhance the code. relying on javadoc is a no go fomr that perspective. Reading javadoc
if you want to enhance a system like this would be were the time is wasted. The exact working
as it can only be seen in the code is what it is about. Therefore if there is a call for comments
of any kind the code must be revisited. If we are writing public extension points for others
to base their work on our binaries I would consider javadoc as an answer but still I would
want it to be gnerated from the code. the code is the truth  and nothing but the code. sorry
to rant on this, I have seen to much outdated comments in cloudstack.


---
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