<commit_before>package org.ovirt.engine.core.common.utils;

import java.util.List;

import org.ovirt.engine.core.common.businessentities.BaseDisk;
import org.ovirt.engine.core.common.businessentities.BootSequence;
import org.ovirt.engine.core.common.businessentities.Disk;
import org.ovirt.engine.core.common.businessentities.VM;
import org.ovirt.engine.core.common.businessentities.VmBase;
import org.ovirt.engine.core.common.businessentities.VmDevice;
import org.ovirt.engine.core.common.config.Config;
import org.ovirt.engine.core.common.config.ConfigValues;
import org.ovirt.engine.core.compat.Guid;
import org.ovirt.engine.core.compat.Version;

public class VmDeviceCommonUtils {

    public final static String LOW_VIDEO_MEM = "32768";
    public final static String HIGH_VIDEO_MEM = "65536";

    final static String NETWORK_CHAR = "N";
    final static String CDROM_CHAR = "D";
    final static String DRIVE_CHAR = "C";

    public final static String CDROM_IMAGE_ID = "11111111-1111-1111-1111-111111111111";

    public static boolean isNetwork(VmDevice device) {
        return (device.getType().equals(VmDeviceType.INTERFACE.getName()));
    }

    public static boolean isDisk(VmDevice device) {
        return (device.getType().equals(VmDeviceType.DISK.getName()) && device.getDevice()
                .equals(VmDeviceType.DISK.getName()));
    }

    public static boolean isCD(VmDevice device) {
        return (device.getType().equals(VmDeviceType.DISK.getName()) && device.getDevice()
                .equals(VmDeviceType.CDROM.getName()));
    }

    /**
     * updates given devices boot order
     *
     * @param devices
     * @param bootSequence
     * @param isOldCluster
     */
    public static void updateVmDevicesBootOrder(VM vm,
            List<VmDevice> devices,
            boolean isOldCluster) {
        int bootOrder = 0;
        VmBase vmBase = vm.getStaticData();
        // reset current boot order of all relevant devices before recomputing it.
        for (VmDevice device : devices) {<commit_msg>core: vmDeviceCommonUtils - remove local var<commit_after>package org.ovirt.engine.core.common.utils;

import java.util.List;

import org.ovirt.engine.core.common.businessentities.BaseDisk;
import org.ovirt.engine.core.common.businessentities.BootSequence;
import org.ovirt.engine.core.common.businessentities.Disk;
import org.ovirt.engine.core.common.businessentities.VM;
import org.ovirt.engine.core.common.businessentities.VmDevice;
import org.ovirt.engine.core.common.config.Config;
import org.ovirt.engine.core.common.config.ConfigValues;
import org.ovirt.engine.core.compat.Guid;
import org.ovirt.engine.core.compat.Version;

public class VmDeviceCommonUtils {

    public final static String LOW_VIDEO_MEM = "32768";
    public final static String HIGH_VIDEO_MEM = "65536";

    final static String NETWORK_CHAR = "N";
    final static String CDROM_CHAR = "D";
    final static String DRIVE_CHAR = "C";

    public final static String CDROM_IMAGE_ID = "11111111-1111-1111-1111-111111111111";

    public static boolean isNetwork(VmDevice device) {
        return (device.getType().equals(VmDeviceType.INTERFACE.getName()));
    }

    public static boolean isDisk(VmDevice device) {
        return (device.getType().equals(VmDeviceType.DISK.getName()) && device.getDevice()
                .equals(VmDeviceType.DISK.getName()));
    }

    public static boolean isCD(VmDevice device) {
        return (device.getType().equals(VmDeviceType.DISK.getName()) && device.getDevice()
                .equals(VmDeviceType.CDROM.getName()));
    }

    /**
     * updates given devices boot order
     *
     * @param devices
     * @param bootSequence
     * @param isOldCluster
     */
    public static void updateVmDevicesBootOrder(VM vm,
            List<VmDevice> devices,
            boolean isOldCluster) {
        int bootOrder = 0;

        // reset current boot order of all relevant devices before recomputing it.
        for (VmDevice device : devices) {
{'fraction_non_alphanumeric': 0.10642018486135399, 'fraction_numerical': 0.021483887084686484, 'mean_word_length': 3.453837597330367, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2898816', 'n_tokens_mistral': 1251, 'n_tokens_neox': 1186, 'n_words': 251}