DaanHoogland commented on code in PR #8698:
URL: https://github.com/apache/cloudstack/pull/8698#discussion_r1500696327


##########
plugins/hypervisors/xenserver/src/main/java/org/apache/cloudstack/hypervisor/xenserver/ExtraConfigurationUtility.java:
##########
@@ -71,26 +77,26 @@ private static void 
applyConfigWithNestedKeyValue(Connection conn, VM vm, Map<St
         try {
             switch (actualParam) {
                 case "VCPUs_params":
-                    vm.addToVCPUsParams(conn, keyName, paramValue);
+                    vm.setVCPUsParams(conn, putInMap(vm.getVCPUsParams(conn), 
keyName, paramValue));
                     break;
                 case "platform":
-                    vm.addToOtherConfig(conn, keyName, paramValue);
+                    vm.setOtherConfig(conn, putInMap(vm.getOtherConfig(conn), 
keyName, paramValue));
                     break;
                 case "HVM_boot_params":
-                    vm.addToHVMBootParams(conn, keyName, paramValue);
+                    vm.setHVMBootParams(conn, 
putInMap(vm.getHVMBootParams(conn), keyName, paramValue));
                     break;
                 case "other_config":
-                    vm.addToOtherConfig(conn, keyName, paramValue);
+                    vm.setOtherConfig(conn, putInMap(vm.getOtherConfig(conn), 
keyName, paramValue));
                     break;
                 case "xenstore_data":
-                    vm.addToXenstoreData(conn, keyName, paramValue);
+                    vm.setXenstoreData(conn, 
putInMap(vm.getXenstoreData(conn), keyName, paramValue));
                     break;
                 default:
                     String msg = String.format("Passed configuration %s is not 
supported", paramKey);
                     LOGGER.warn(msg);
             }
         } catch (XmlRpcException | Types.XenAPIException e) {
-            LOGGER.error("Exception caught while setting VM configuration. 
exception: " + e.getMessage());
+            LOGGER.error(String.format("Exception caught while setting VM 
configuration: [%s]", e.getMessage() == null ? e.toString() : e.getMessage()), 
e);

Review Comment:
   rather no stack traces on error level
   ```suggestion
               LOGGER.error("Exception caught while setting VM configuration: 
[{}]", e.getMessage() == null ? e.toString() : e.getMessage());
               LOGGER.debug("Exception caught while setting VM configuration", 
e);
   ```



##########
plugins/hypervisors/xenserver/src/main/java/org/apache/cloudstack/hypervisor/xenserver/ExtraConfigurationUtility.java:
##########
@@ -43,6 +43,7 @@ public static void setExtraConfigurationToVm(Connection conn, 
VM.Record vmr, VM
             String paramValue = configParams.get(paramKey);
 
             //Map params
+            LOGGER.debug(String.format("Applying [%s] configuration as [%s].", 
paramKey, paramValue));

Review Comment:
   ```suggestion
               LOGGER.debug("Applying [{}] configuration as [{}].", paramKey, 
paramValue);
   ```



##########
plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java:
##########
@@ -1972,7 +1972,7 @@ protected void finalizeVmMetaData(final VM vm, final 
VM.Record vmr, final Connec
         // Add configuration settings VM record for User VM instances before 
creating VM
         Map<String, String> extraConfig = vmSpec.getExtraConfig();
         if (vmSpec.getType().equals(VirtualMachine.Type.User) && 
MapUtils.isNotEmpty(extraConfig)) {
-            logger.info("Appending user extra configuration settings to VM");
+            logger.info(String.format("Appending user extra configuration 
settings [%s] to [%s].", extraConfig, vmSpec));

Review Comment:
   ```suggestion
               logger.info("Appending user extra configuration settings [{}] to 
[{}].", extraConfig, vmSpec));
   ```



-- 
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-unsubscr...@cloudstack.apache.org

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

Reply via email to