cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhaisaab <...@git.apache.org>
Subject [GitHub] cloudstack pull request: CLOUDSTACK-9142 Migrate VM changes xmlDes...
Date Wed, 16 Mar 2016 21:37:10 GMT
Github user bhaisaab commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1348#discussion_r56420080
  
    --- Diff: plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java
---
    @@ -190,4 +195,27 @@ Use VIR_DOMAIN_XML_SECURE (value = 1) prior to v1.0.0.
     
             return new MigrateAnswer(command, result == null, result, null);
         }
    -}
    \ No newline at end of file
    +
    +    /**
    +     * This function assumes an qemu machine description containing a single graphics
element like
    +     *     <graphics type='vnc' port='5900' autoport='yes' listen='10.10.10.1'>
    +     *       <listen type='address' address='10.10.10.1'/>
    +     *     </graphics>
    +     * @param xmlDesc the qemu xml description
    +     * @param target the ip address to migrate to
    +     * @return the new xmlDesc
    +     */
    +    String replaceIpForVNCInDescFile(String xmlDesc, final String target) {
    +        final int begin = xmlDesc.indexOf(GRAPHICS_ELEM_START);
    --- End diff --
    
    While this should work for most cases, the code is not defensive. For example, it will
fail for multiple graphics nodes or if there are any whitespaces between closing brackets.
Consider using a dom parser.


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