int busNumber = profGen.getBusNumber(ckey);
/* Create virtual disk manager and virtual controller manager. */
VirtualDiskManager vdm = new VirtualDiskManager
(key, unitNumber, capacityInKb, datastoreName);
VirtualControllerManager vcm =
new VirtualControllerManager(type, ckey, busNumber);
/* Get the corresponding virtual controller manager
in the set, or the created one is added to the set. */
VirtualControllerManager vcmInSet = vcmSet.ceiling(vcm);
if (vcmInSet == null || vcmInSet.compareTo(vcm) != 0) {
vcmSet.add(vcm);
vcmInSet = vcm;
} else {
assert vcmInSet.compareTo(vcm) == 0;
}
/* Assign relationship of the disk and the controller */
vcmInSet.add(vdm);
} /* for */
/* Set -> List */
List<VirtualControllerManager> ret =
new LinkedList<VirtualControllerManager>();