'Check libvirt version, hypervisor version, and hypervisor type
:param hv_type: hypervisor driver from the top of this file.'

def _version_check(self, lv_ver=None, hv_ver=None, hv_type=None, op=operator.lt):

    conn = self.get_connection()
    try:
        if (lv_ver is not None):
            libvirt_version = conn.getLibVersion()
            if op(libvirt_version, versionutils.convert_version_to_int(lv_ver)):
                return False
        if (hv_ver is not None):
            hypervisor_version = conn.getVersion()
            if op(hypervisor_version, versionutils.convert_version_to_int(hv_ver)):
                return False
        if (hv_type is not None):
            hypervisor_type = conn.getType()
            if (hypervisor_type != hv_type):
                return False
        return True
    except Exception:
        return False
