Source:
<code>public static void autoSelectDefaultDisplayType(Guid srcEntityId, VmBase parametersStaticData, VDSGroup cluster, Map<GraphicsType, GraphicsDevice> graphicsDevices) { List<Pair<GraphicsType, DisplayType>> graphicsAndDisplays = osRepository.getGraphicsAndDisplays( parametersStaticData.getOsId(), CompatibilityVersionUtils.getEffective(parametersStaticData, cluster)); <START> if (parametersStaticData.getOsId() == OsRepository.AUTO_SELECT_OS || <END> (parametersStaticData.getDefaultDisplayType() != null && isDisplayTypeSupported(parametersStaticData.getDefaultDisplayType(), graphicsAndDisplays))) { return; } DisplayType defaultDisplayType = null; Map<DisplayType, Set<GraphicsType>> displayGraphicsSupport = new HashMap<>(); for (Pair<GraphicsType, DisplayType> graphicsAndDisplay : graphicsAndDisplays) { DisplayType display = graphicsAndDisplay.getSecond(); if (!displayGraphicsSupport.containsKey(display)) { displayGraphicsSupport.put(display, new HashSet<>()); } displayGraphicsSupport.get(display).add(graphicsAndDisplay.getFirst()); } for (Map.Entry<DisplayType, Set<GraphicsType>> entry : displayGraphicsSupport.entrySet()) { if (entry.getValue().containsAll(VmHandler.getResultingVmGraphics(VmDeviceUtils.getGraphicsTypesOfEntity(srcEntityId), graphicsDevices))) { defaultDisplayType = entry.getKey(); break; } } if (defaultDisplayType == null) { if (!displayGraphicsSupport.isEmpty()) { Map.Entry<DisplayType, Set<GraphicsType>> entry = displayGraphicsSupport.entrySet().iterator().next(); defaultDisplayType = entry.getKey(); } else { defaultDisplayType = DisplayType.qxl; } } parametersStaticData.setDefaultDisplayType(defaultDisplayType); }</code><technical_language>please explain works AUTO_SELECT_OS? osId==AUTO_SELECT_OS unsupported display type for PPC? if this check remain as-is, moving part (parametersStaticData.getOsId() == OsRepository.AUTO_SELECT_OS) beginning of method clear access os-repository</technical_language>

Target:
public static void autoSelectDefaultDisplayType(Guid srcEntityId, VmBase parametersStaticData, VDSGroup cluster, Map<GraphicsType, GraphicsDevice> graphicsDevices) { if (parametersStaticData.getOsId() == OsRepository.AUTO_SELECT_OS) { return; } List<Pair<GraphicsType, DisplayType>> graphicsAndDisplays = osRepository.getGraphicsAndDisplays( parametersStaticData.getOsId(), CompatibilityVersionUtils.getEffective(parametersStaticData, cluster)); if (parametersStaticData.getDefaultDisplayType() != null && isDisplayTypeSupported(parametersStaticData.getDefaultDisplayType(), graphicsAndDisplays)) { return; } DisplayType defaultDisplayType = null; Map<DisplayType, Set<GraphicsType>> displayGraphicsSupport = new HashMap<>(); for (Pair<GraphicsType, DisplayType> graphicsAndDisplay : graphicsAndDisplays) { DisplayType display = graphicsAndDisplay.getSecond(); if (!displayGraphicsSupport.containsKey(display)) { displayGraphicsSupport.put(display, new HashSet<>()); } displayGraphicsSupport.get(display).add(graphicsAndDisplay.getFirst()); } for (Map.Entry<DisplayType, Set<GraphicsType>> entry : displayGraphicsSupport.entrySet()) { if (entry.getValue().containsAll(VmHandler.getResultingVmGraphics(VmDeviceUtils.getGraphicsTypesOfEntity(srcEntityId), graphicsDevices))) { defaultDisplayType = entry.getKey(); break; } } if (defaultDisplayType == null) { if (!displayGraphicsSupport.isEmpty()) { Map.Entry<DisplayType, Set<GraphicsType>> entry = displayGraphicsSupport.entrySet().iterator().next(); defaultDisplayType = entry.getKey(); } else { defaultDisplayType = DisplayType.qxl; } } parametersStaticData.setDefaultDisplayType(defaultDisplayType); }