public DiskVmElement(VmDeviceId id) { setId(id); }
public DiskVmElement(Guid diskId, Guid vmId) { setId(new VmDeviceId(diskId, vmId)); }
private void fixDiskVmElements() { // In the time of disk creation the VM ID is an empty Guid, this is changed to the real ID only after the // reading of the OS properties which comes after the disks creation so the disk VM elements are set to // the wrong VM ID this part sets them to the correct VM ID for (DiskImage disk : _images) { disk.getDiskVmElements().forEach(dve -> dve.setId(new VmDeviceId(disk.getId(), vmBase.getId()))); disk.setDiskVmElements(disk.getDiskVmElements()); } for (LunDisk lunDisk : luns) { lunDisk.getDiskVmElements().forEach(dve -> dve.setId(new VmDeviceId(lunDisk.getId(), vmBase.getId()))); lunDisk.setDiskVmElements(lunDisk.getDiskVmElements()); } }
@Mapping(from = DiskAttachment.class, to = org.ovirt.engine.core.common.businessentities.storage.DiskVmElement.class) public static org.ovirt.engine.core.common.businessentities.storage.DiskVmElement map(DiskAttachment model, org.ovirt.engine.core.common.businessentities.storage.DiskVmElement template) { org.ovirt.engine.core.common.businessentities.storage.DiskVmElement entity = template != null ? template : new DiskVmElement(); if (model.isSetId()) { entity.setId(new VmDeviceId(GuidUtils.asGuid(model.getId()), null)); } else { entity.setId(new VmDeviceId()); } if (model.isSetBootable()) { entity.setBoot(model.isBootable()); } if (model.isSetPassDiscard()) { entity.setPassDiscard(model.isPassDiscard()); } if (model.isSetInterface()) { entity.setDiskInterface(DiskMapper.mapInterface(model.getInterface())); } if (model.isSetUsesScsiReservation()) { entity.setUsingScsiReservation(model.isUsesScsiReservation()); } if (model.isSetReadOnly()) { entity.setReadOnly(model.isReadOnly()); } return entity; }