def __init__(self, test, params, env):
        self.errors = []
        self.params = params
        self.vmxml = ''
        self.xmltree = None
        self.vm_name = params.get('main_vm')
        self.v2v_cmd = params.get('v2v_command', '')
        self.original_vm_name = params.get('original_vm_name')
        self.hypervisor = params.get("hypervisor")
        self.target = params.get('target')
        self.input_mode = params.get('input_mode')
        self.output_method = params.get('output_method')
        # The expected boottype of guest, default 0 is 'i440fx+bios'
        # Other values are 1 for q35+bios, 2 for q35+uefi, 3 for
        # q35+secure_uefi
        self.boottype = int(params.get("boottype", 0))
        # Due to changes in v2v and rhv, the current logic is:
        # 1) boottype value set by users takes the hignest precedence.
        # 2) if bootype is not set and '-o rhv_upload' is used, if ovirt
        # is >= 4.4, then set boottype to 1, else keep the default 0.
        # 3) if v2v version is newer enough to support q35 by default, then all latest
        # guests will be converted to q35 by default.
        if self.target == 'ovirt' and self.output_method == 'rhv_upload':
            from virttest.ovirt import connect
            _, self.ovirt_server_version = connect(params)
            LOG.info("rhv server version is: %s",
                     self.ovirt_server_version.full_version)
            if self.ovirt_server_version.major >= 4 and self.ovirt_server_version.minor >= 4:
                self.boottype = int(params.get("boottype", 1))
            rhv_bz_1961945_ver = '[4.4.6.8, 4.4.7.6)'  # bz1961945
            rhv_bz_1983610_ver = '[4.4.6.8, 4.4.8.2)'  # bz1983610
            if utils_v2v.compare_version(
                    rhv_bz_1961945_ver, self.ovirt_server_version.full_version
            ) or self.hypervisor == 'xen' and utils_v2v.compare_version(
                    rhv_bz_1983610_ver, self.ovirt_server_version.full_version
            ) or self.hypervisor == 'kvm' and self.input_mode != 'ova':
                self.boottype = int(params.get("boottype", 0))
        if compare_version(FEATURE_SUPPORT['q35']):
            self.boottype = int(params.get("boottype", 1))

        self.os_type = params.get('os_type')
        self.os_version = params.get('os_version', 'OS_VERSION_V2V_EXAMPLE')
        self.original_vmxml = params.get('original_vmxml')
        self.vmx_nfs_src = params.get('vmx_nfs_src')
        self.virsh_session = params.get('virsh_session')
        self.virsh_session_id = self.virsh_session.get_id(
        ) if self.virsh_session else params.get('virsh_session_id')
        self.checker = utils_v2v.VMCheck(test, params, env)
        # Should delete the guest when setup_session failed
        try:
            self.setup_session()
        except Exception:
            self.checker.cleanup()
            raise
        if not self.checker.virsh_session_id:
            self.checker.virsh_session_id = self.virsh_session_id
        self.init_vmxml(raise_exception=False)
        # Save NFS mount records like {0:(src, dst, fstype)}
        self.mount_records = {}
    def __init__(self, test, params, env):
        self.errors = []
        self.params = params
        self.vmxml = ''
        self.xmltree = None
        self.vm_name = params.get('main_vm')
        self.v2v_cmd = params.get('v2v_command', '')
        self.original_vm_name = params.get('original_vm_name')
        self.hypervisor = params.get("hypervisor")
        self.target = params.get('target')
        # The expected boottype of guest, default 0 is 'i440fx+bios'
        # Other values are 1 for q35+bios, 2 for q35+uefi, 3 for
        # q35+secure_uefi
        self.boottype = int(params.get("boottype", 0))
        # Due to changes in v2v and rhv, the current logic is:
        # 1) boottype value set by users takes the hignest precedence.
        # 2) if bootype is not set, first check ovirt version, the default
        # boottype value on rhv is 1 from rhv4.4.
        # 3) if v2v version is newer enough to support q35 by default, then all latest
        # guests will be converted to q35 by default.
        if self.target == 'ovirt':
            from virttest.ovirt import connect
            _, self.ovirt_server_version = connect(params)
            logging.info("rhv server version is: %s",
                         self.ovirt_server_version.full_version)
            if self.ovirt_server_version.major >= 4 and self.ovirt_server_version.minor >= 4:
                self.boottype = int(params.get("boottype", 1))
        if compare_version(FEATURE_SUPPORT['q35']):
            self.boottype = int(params.get("boottype", 1))

        self.os_type = params.get('os_type')
        self.os_version = params.get('os_version', 'OS_VERSION_V2V_EXAMPLE')
        self.original_vmxml = params.get('original_vmxml')
        self.vmx_nfs_src = params.get('vmx_nfs_src')
        self.virsh_session = params.get('virsh_session')
        self.virsh_session_id = self.virsh_session.get_id(
        ) if self.virsh_session else params.get('virsh_session_id')
        self.checker = utils_v2v.VMCheck(test, params, env)
        self.setup_session()
        if not self.checker.virsh_session_id:
            self.checker.virsh_session_id = self.virsh_session_id
        self.init_vmxml(raise_exception=False)
        # Save NFS mount records like {0:(src, dst, fstype)}
        self.mount_records = {}
    def __init__(self, test, params, env):
        self.errors = []
        self.params = params
        self.vmxml = ''
        self.xmltree = None
        self.vm_name = params.get('main_vm')
        self.v2v_cmd = params.get('v2v_command', '')
        self.original_vm_name = params.get('original_vm_name')
        self.hypervisor = params.get("hypervisor")
        self.target = params.get('target')
        # The expected boottype of guest, default 0 is 'i440fx+bios'
        # Other values are 1 for q35+bios, 2 for q35+uefi, 3 for
        # q35+secure_uefi
        self.boottype = int(params.get("boottype", 0))
        if self.target == 'ovirt':
            from virttest.ovirt import connect
            _, self.ovirt_server_version = connect(params)
            logging.info("rhv server version is: %s",
                         self.ovirt_server_version.full_version)
            if self.ovirt_server_version.major >= 4 and self.ovirt_server_version.minor >= 4:
                self.boottype = int(params.get("boottype", 1))

        self.os_type = params.get('os_type')
        self.os_version = params.get('os_version', 'OS_VERSION_V2V_EXAMPLE')
        self.original_vmxml = params.get('original_vmxml')
        self.vmx_nfs_src = params.get('vmx_nfs_src')
        self.virsh_session = params.get('virsh_session')
        self.virsh_session_id = self.virsh_session.get_id(
        ) if self.virsh_session else params.get('virsh_session_id')
        self.checker = utils_v2v.VMCheck(test, params, env)
        self.setup_session()
        if not self.checker.virsh_session_id:
            self.checker.virsh_session_id = self.virsh_session_id
        self.init_vmxml(raise_exception=False)
        # Save NFS mount records like {0:(src, dst, fstype)}
        self.mount_records = {}