poussa commented on issue #3839: FEATURE-3823: kvm agent hooks
URL: https://github.com/apache/cloudstack/pull/3839#issuecomment-588987898
 
 
   I was able to use this feature to expose Intel QAT crypto/compression SRIOV 
VF to CS VM via the following snippet (never used groovy before so not pretty 
but works for my PoC)
   
   ```java
   class BaseTransform {
     String transform(Object logger, String xml) {
   
       def parser = new XmlParser()
       def domain = parser.parseText(xml)
       def devices = domain.devices[1]
   
       def hostDevAttr = [:]
       hostDevAttr."mode" = "subsystem"
       hostDevAttr."type" = "pci"
       hostDevAttr."managed" = "yes"
   
       def hostdev = parser.createNode(devices,
         new QName("hostdev"), hostDevAttr)
   
       def source = hostdev.appendNode(new QName("source"))
   
       def addressAttr = [:]
       addressAttr."domain" = "0x0000"
       addressAttr."bus" = "0x3d"
       addressAttr."slot" = "0x01"
       addressAttr."function" = "0x1"
   
       def address = source.appendNode(new QName("address"), addressAttr)
   
       return XmlUtil.serialize(domain)
     }
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to