Source:
<code>protected void buildVmDrives() { List<DiskImage> diskImages = getSortedDiskImages(); for (DiskImage disk : diskImages) { XmlRpcStruct struct = new XmlRpcStruct(); VmDevice vmDevice = DbFacade.getInstance() .getVmDeviceDAO() .get(new VmDeviceId(disk.getDisk().getId(), disk.getvm_guid())); if (vmDevice.getIsPlugged()) { struct.add(VdsProperties.Type, vmDevice.getType()); struct.add(VdsProperties.Device, vmDevice.getDevice()); switch (disk.getdisk_interface()) { case IDE: struct.add(VdsProperties.Iface, "ide"); break; case VirtIO: struct.add(VdsProperties.Iface, VdsProperties.Virtio); break; default: logUnsupportedInterfaceType(); break; } Guid diskId = vmDevice.getDeviceId(); if (DbFacade.getInstance().getDiskDao() .get(diskId).getDiskType() .equals(DiskType.System)) { struct.add(VdsProperties.Index, 0); } addAddress(vmDevice, struct); struct.add(VdsProperties.PoolId, disk.getstorage_pool_id().toString()); struct.add(VdsProperties.DomainId, disk.getstorage_ids().get(0).toString()); struct.add(VdsProperties.ImageId, disk.getimage_group_id().toString()); struct.add(VdsProperties.VolumeId, disk.getId().toString()); addBootOrder(vmDevice, struct); struct.add(VdsProperties.Format, disk.getvolume_format().toString() .toLowerCase()); struct.add(VdsProperties.PropagateErrors, disk.getpropagate_errors().toString() .toLowerCase()); <START> struct.add(VdsProperties.Optional, "false"); <END> struct.add(VdsProperties.ReadOnly, new Boolean(vmDevice.getIsReadOnly()).toString()); struct.add(VdsProperties.SpecParams, StringUtils.string2Map(vmDevice.getSpecParams())); devices.add(struct); } } }</code><technical_language>changed this..</technical_language>

Target:
protected void buildVmDrives() { List<DiskImage> diskImages = getSortedDiskImages(); for (DiskImage disk : diskImages) { XmlRpcStruct struct = new XmlRpcStruct(); VmDevice vmDevice = DbFacade.getInstance() .getVmDeviceDAO() .get(new VmDeviceId(disk.getDisk().getId(), disk.getvm_guid())); if (vmDevice.getIsPlugged()) { struct.add(VdsProperties.Type, vmDevice.getType()); struct.add(VdsProperties.Device, vmDevice.getDevice()); switch (disk.getdisk_interface()) { case IDE: struct.add(VdsProperties.Iface, "ide"); break; case VirtIO: struct.add(VdsProperties.Iface, VdsProperties.Virtio); break; default: logUnsupportedInterfaceType(); break; } Guid diskId = vmDevice.getDeviceId(); if (DbFacade.getInstance().getDiskDao() .get(diskId).getDiskType() .equals(DiskType.System)) { struct.add(VdsProperties.Index, 0); } addAddress(vmDevice, struct); struct.add(VdsProperties.PoolId, disk.getstorage_pool_id().toString()); struct.add(VdsProperties.DomainId, disk.getstorage_ids().get(0).toString()); struct.add(VdsProperties.ImageId, disk.getimage_group_id().toString()); struct.add(VdsProperties.VolumeId, disk.getId().toString()); addBootOrder(vmDevice, struct); struct.add(VdsProperties.Format, disk.getvolume_format().toString() .toLowerCase()); struct.add(VdsProperties.PropagateErrors, disk.getpropagate_errors().toString() .toLowerCase()); struct.add(VdsProperties.Optional, Boolean.FALSE.toString()); struct.add(VdsProperties.ReadOnly, String.valueOf(vmDevice.getIsReadOnly())); struct.add(VdsProperties.SpecParams, StringUtils.string2Map(vmDevice.getSpecParams())); devices.add(struct); } } }