use of org.ovirt.engine.core.common.businessentities.storage.DiskVmElement in project ovirt-engine by oVirt.
the class CloneVmCommand method attachDetachDisk.
private void attachDetachDisk(Disk disk, ActionType actionType) {
DiskVmElement oldDve = disk.getDiskVmElementForVm(oldVmId);
runInternalAction(actionType, new AttachDetachVmDiskParameters(new DiskVmElement(disk.getId(), getParameters().getNewVmGuid()), oldDve.isPlugged()));
}
use of org.ovirt.engine.core.common.businessentities.storage.DiskVmElement in project ovirt-engine by oVirt.
the class DiskVmElementDaoTest method testUpdateVmDeviceUsingScsiReservationProperty.
@Test
public void testUpdateVmDeviceUsingScsiReservationProperty() {
DiskVmElement dve = dao.get(getExistingEntityId());
boolean usingScsiReservation = !dve.isUsingScsiReservation();
dve.setUsingScsiReservation(usingScsiReservation);
dao.update(dve);
DiskVmElement dveFromDb = dao.get(getExistingEntityId());
assertEquals(dveFromDb.isUsingScsiReservation(), usingScsiReservation);
}
use of org.ovirt.engine.core.common.businessentities.storage.DiskVmElement in project ovirt-engine by oVirt.
the class BackendVmDiskResourceTest method setUpDiskVmElementExpectations.
private void setUpDiskVmElementExpectations() throws Exception {
DiskVmElement dve = new DiskVmElement(DISK_ID, VM_ID);
dve.setDiskInterface(DiskInterface.VirtIO);
dve.setBoot(false);
setUpGetEntityExpectations(QueryType.GetDiskVmElementById, VmDeviceIdQueryParameters.class, new String[] { "Id" }, new Object[] { new VmDeviceId(DISK_ID, VM_ID) }, dve);
}
use of org.ovirt.engine.core.common.businessentities.storage.DiskVmElement in project ovirt-engine by oVirt.
the class BackendVmDiskResourceTest method testDeactivate.
@Test
public void testDeactivate() throws Exception {
setUriInfo(setUpActionExpectations(ActionType.HotUnPlugDiskFromVm, VmDiskOperationParameterBase.class, new String[] { "DiskVmElement" }, new Object[] { new DiskVmElement(DISK_ID, VM_ID) }, true, true));
Response response = resource.deactivate(new Action());
assertEquals(200, response.getStatus());
}
use of org.ovirt.engine.core.common.businessentities.storage.DiskVmElement in project ovirt-engine by oVirt.
the class VmHandler method updateDisksVmDataForVm.
public void updateDisksVmDataForVm(VM vm) {
for (Disk disk : vm.getDiskMap().values()) {
DiskVmElement dve = diskVmElementDao.get(new VmDeviceId(disk.getId(), vm.getId()));
disk.setDiskVmElements(Collections.singletonList(dve));
}
}
Aggregations