You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/09/30 07:12:17 UTC

[GitHub] [cloudstack] leolleeooleo commented on a change in pull request #5513: kvm: add MV Settings for virtual GPU hardware type and memory

leolleeooleo commented on a change in pull request #5513:
URL: https://github.com/apache/cloudstack/pull/5513#discussion_r719120825



##########
File path: plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
##########
@@ -2488,7 +2488,17 @@ protected ConsoleDef createConsoleDef() {
         return new ConsoleDef(PTY, null, null, (short)0);
     }
 
-    protected VideoDef createVideoDef() {
+    protected VideoDef createVideoDef(VirtualMachineTO vmTO) {
+        Map<String, String> details = vmTO.getDetails();
+        if (details != null) {
+            if (details.containsKey(VideoDef.VIDEO_MODEL)) {
+                _videoHw = details.get(VideoDef.VIDEO_MODEL);

Review comment:
       I copy from https://github.com/apache/cloudstack/blob/789d68e43b9e70eecdebbcbf09fcacf25212cc63/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java#L1040
   
   The value _videoHw and _videoRam are load from /etc/cloudstack/agent/agent.properties
   If details value exist will override the value.
   
   Do you mean:
   ```
       protected VideoDef createVideoDef(VirtualMachineTO vmTO) {
           Map<String, String> details = vmTO.getDetails();
           if (details != null) {
               if (details.containsKey(VideoDef.VIDEO_MODEL)) {
                   String videoHw = details.get(VideoDef.VIDEO_MODEL);
                   int videoRam = 16384;
                   if (details.containsKey(VideoDef.VIDEO_RAM)) {
                       String value = details.get(VideoDef.VIDEO_RAM);
                       videoRam = NumbersUtil.parseInt(value, videoRam);
                   }
               return new VideoDef(videoHw, videoRam);
               }
           }
           return new VideoDef(_videoHw, _videoRam);
       }
   ```
   
   




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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org