use of org.ovirt.engine.core.common.businessentities.network.VnicProfileView in project ovirt-engine by oVirt.
the class MapVnicFlowTestUtils method profileViewOf.
static VnicProfileView profileViewOf(Guid id) {
VnicProfileView vpv = new VnicProfileView();
vpv.setId(id);
return vpv;
}
use of org.ovirt.engine.core.common.businessentities.network.VnicProfileView in project ovirt-engine by oVirt.
the class VnicProfileViewDaoTest method testGetForUserWithoutPermission.
/**
* Ensures that no network interface profile is returned.
*/
@Test
public void testGetForUserWithoutPermission() {
VnicProfileView result = dao.get(FixturesTool.VM_NETWORK_INTERFACE_PROFILE, UNPRIVILEGED_USER_ID, true);
assertNull(result);
}
use of org.ovirt.engine.core.common.businessentities.network.VnicProfileView in project ovirt-engine by oVirt.
the class VnicProfileViewDaoTest method testGetAllForDataCenterWithPermissions.
/**
* Ensures the right set of vnic profiles is returned for the given data center.
*/
@Test
public void testGetAllForDataCenterWithPermissions() {
List<VnicProfileView> result = dao.getAllForDataCenter(FixturesTool.DATA_CENTER, PRIVILEGED_USER_ID, true);
assertNotNull(result);
assertFalse(result.isEmpty());
for (VnicProfileView profile : result) {
assertEquals(FixturesTool.DATA_CENTER_NAME, profile.getDataCenterName());
}
}
use of org.ovirt.engine.core.common.businessentities.network.VnicProfileView in project ovirt-engine by oVirt.
the class VmInterfaceModel method onSave.
protected void onSave() {
VmNetworkInterface nic = createBaseNic();
if (getProgress() != null) {
return;
}
if (!validate()) {
return;
}
// Save changes.
nic.setName(getName().getEntity());
VnicProfileView profile = getProfile().getSelectedItem();
nic.setVnicProfileId(profile.getId());
nic.setNetworkName(profile.getNetworkName());
nic.setLinked(getLinked().getEntity());
if (getNicType().getSelectedItem() == null) {
nic.setType(null);
} else {
nic.setType(getNicType().getSelectedItem().getValue());
}
onSaveMAC(nic);
nic.setPlugged(getPlugged().getEntity());
startProgress();
Frontend.getInstance().runAction(getActionType(), createVdcActionParameters(nic), result -> {
ActionReturnValue returnValue = result.getReturnValue();
stopProgress();
if (returnValue != null && returnValue.getSucceeded()) {
cancel();
postOnSave();
}
}, this);
}
use of org.ovirt.engine.core.common.businessentities.network.VnicProfileView in project ovirt-engine by oVirt.
the class VmInterfaceModel method getDefaultNicTypeByProfile.
protected VmInterfaceType getDefaultNicTypeByProfile() {
VnicProfileView profile = getProfile().getSelectedItem();
boolean passthroughSupported = getSupportedVnicTypes().contains(VmInterfaceType.pciPassthrough);
return profile != null && profile.isPassthrough() && passthroughSupported ? VmInterfaceType.pciPassthrough : AsyncDataProvider.getInstance().getDefaultNicType(getSupportedVnicTypes());
}
Aggregations