def METHOD_NAME(test, params, env):
    vm = env.get_vm(params["main_vm"])
    vm.verify_alive()
    check_usb_device_monitor(test, params, env)
    timeout = float(params.get("login_timeout", 240))
    session = vm.wait_for_login(timeout=timeout)
    deviceid_str = params["deviceid_str"]
    vendor_id = params.get("vendor_id")
    product_id = params.get("product_id")
    vendor = params.get("vendor")
    product = params.get("product")
    chk_list = [deviceid_str % (vendor_id, product_id)]
    if vendor:
        chk_list.append(vendor)
    if product:
        chk_list.append(product)
    try:
        session.cmd("dmesg -c")
    except aexpect.ShellCmdError:
        pass
    error_context.context("Verify USB device in guest.")
    cmd = params["chk_usb_info_cmd"]
    for item in chk_list:
        kargs = (session, item, cmd, 5.0)
        exists, msgbox = check_usb_device_guest(*kargs)
        if not exists:
            test.fail(msgbox[0])
    dwprotocols = params.get("dwprotocols", "")
    if dwprotocols:
        cmd = params["chk_specified_usb_info"] % (vendor_id, product_id)
        kargs = (session, dwprotocols, cmd, 5.0)
        exists, msgbox = check_usb_device_guest(*kargs)
        if not exists:
            test.fail(msgbox[0])
    output = ""
    try:
        output = session.cmd("dmesg -c")
        error_context.context("Checking if there is I/O error in dmesg")
    except aexpect.ShellCmdError:
        pass
    io_error_msg = []
    for line in output.splitlines():
        if "error" in line:
            io_error_msg.append(line)
    if io_error_msg:
        e_msg = "Error found in guest's dmesg"
        test.log.error(e_msg)
        for line in io_error_msg:
            test.log.error(line)
        test.fail(e_msg)