From 795a6e5fa0c0ae771111331a269f51a4fc47ae68 Mon Sep 17 00:00:00 2001 From: Sanjay Tripathi Date: Mon, 28 Apr 2014 10:40:06 +0530 Subject: [PATCH] CLOUDSTACK-6480: Creating Service Offering with Implict Dedication planner fails with message: "Please specify the pciDevice and vgpuType correctly". --- .../com/cloud/configuration/ConfigurationManagerImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index 6aca4a8d044..9844bb7c2af 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -2091,8 +2091,11 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati List detailsVO = null; if (details != null) { - // Check if the user has passed the gpu-type before passing the VGPU type - if (!details.containsKey(GPU.Keys.pciDevice.toString()) || !details.containsKey(GPU.Keys.vgpuType.toString())) { + // To have correct input, either both gpu card name and VGPU type should be passed or nothing should be passed. + // Use XOR condition to verify that. + boolean entry1 = details.containsKey(GPU.Keys.pciDevice.toString()); + boolean entry2 = details.containsKey(GPU.Keys.vgpuType.toString()); + if ((entry1 || entry2) && !(entry1 && entry2)) { throw new InvalidParameterValueException("Please specify the pciDevice and vgpuType correctly."); } detailsVO = new ArrayList();