Skip to content

Commit b9c136d

Browse files
sanjaytripathiDaanHoogland
authored andcommitted
CLOUDSTACK-6480: Creating Service Offering with Implict Dedication planner
fails with message: "Please specify the pciDevice and vgpuType correctly".
1 parent b6d14d7 commit b9c136d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎server/src/com/cloud/configuration/ConfigurationManagerImpl.java‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2085,8 +2085,11 @@ protected ServiceOfferingVO createServiceOffering(long userId, boolean isSystem,
20852085

20862086
List<ServiceOfferingDetailsVO> detailsVO = null;
20872087
if (details != null) {
2088-
// Check if the user has passed the gpu-type before passing the VGPU type
2089-
if (!details.containsKey(GPU.Keys.pciDevice.toString()) || !details.containsKey(GPU.Keys.vgpuType.toString())) {
2088+
// To have correct input, either both gpu card name and VGPU type should be passed or nothing should be passed.
2089+
// Use XOR condition to verify that.
2090+
boolean entry1 = details.containsKey(GPU.Keys.pciDevice.toString());
2091+
boolean entry2 = details.containsKey(GPU.Keys.vgpuType.toString());
2092+
if ((entry1 || entry2) && !(entry1 && entry2)) {
20902093
throw new InvalidParameterValueException("Please specify the pciDevice and vgpuType correctly.");
20912094
}
20922095
detailsVO = new ArrayList<ServiceOfferingDetailsVO>();

0 commit comments

Comments
 (0)