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



##########
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:
       @leolleeooleo exactly. we should not change the global variables.
   
   you can use 
   ```
   String videoHw = _videoHw;
   int videoRam = _videoRam;
   if (details != null) {
         ...... // update videoHw and 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to