Search in sources :

Example 26 with GraphicsDevice

use of org.ovirt.engine.core.common.businessentities.GraphicsDevice in project ovirt-engine by oVirt.

the class CloneVmCommand method setGraphicsDevices.

private void setGraphicsDevices(List<VmDevice> devices) {
    for (GraphicsType graphicsType : GraphicsType.values()) {
        // prevent copying from the template
        getParameters().getGraphicsDevices().put(graphicsType, null);
    }
    for (VmDevice device : devices) {
        if (device.getType() == VmDeviceGeneralType.GRAPHICS) {
            GraphicsDevice graphicsDevice = new GraphicsDevice(device);
            getParameters().getGraphicsDevices().put(graphicsDevice.getGraphicsType(), graphicsDevice);
        }
    }
}
Also used : GraphicsType(org.ovirt.engine.core.common.businessentities.GraphicsType) VmDevice(org.ovirt.engine.core.common.businessentities.VmDevice) GraphicsDevice(org.ovirt.engine.core.common.businessentities.GraphicsDevice)

Aggregations

GraphicsDevice (org.ovirt.engine.core.common.businessentities.GraphicsDevice)26 GraphicsType (org.ovirt.engine.core.common.businessentities.GraphicsType)12 VmDevice (org.ovirt.engine.core.common.businessentities.VmDevice)11 GraphicsParameters (org.ovirt.engine.core.common.action.GraphicsParameters)5 ArrayList (java.util.ArrayList)4 List (java.util.List)4 WebApplicationException (javax.ws.rs.WebApplicationException)4 GraphicsConsole (org.ovirt.engine.api.model.GraphicsConsole)4 DisplayType (org.ovirt.engine.core.common.businessentities.DisplayType)4 Guid (org.ovirt.engine.core.compat.Guid)4 Map (java.util.Map)3 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)3 VmDeviceId (org.ovirt.engine.core.common.businessentities.VmDeviceId)3 VmRngDevice (org.ovirt.engine.core.common.businessentities.VmRngDevice)3 VmWatchdog (org.ovirt.engine.core.common.businessentities.VmWatchdog)3 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)3 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)3 VmDeviceType (org.ovirt.engine.core.common.utils.VmDeviceType)3 Collection (java.util.Collection)2 HashSet (java.util.HashSet)2