def METHOD_NAME(device_address, params, options=""):
    """
    Do the detach and reattach.
    Step1.Do detach.
    Step2.Check the result of detach.
    Step3.Do reattach.
    Step4.Check the result of reattach
    """
    # Libvirt acl polkit related params
    uri = params.get("virsh_uri")
    # Nodedev-detach/reattach are special, the connect driver is still qemu
    # with split daemon, and the connect_driver in polkit rule
    # should be 'QEMU' for detach, 'nodedev' for read. update the polkit
    # rule to include both QEMU and nodedev in such situation.
    set_polkit = 'yes' == params.get('setup_libvirt_polkit', 'no')
    if utils_split_daemons.is_modular_daemon() and set_polkit:
        rule_path = '/etc/polkit-1/rules.d/500-libvirt-acl-virttest.rules'
        cmd = '''sed -i "s/'nodedev'/'nodedev'||'QEMU'/g" %s''' % rule_path
        process.run(cmd)
        process.run('cat /etc/polkit-1/rules.d/500-libvirt-acl-virttest.rules')
    unprivileged_user = params.get('unprivileged_user')
    readonly = (params.get('nodedev_detach_readonly', 'no') == 'yes')
    if unprivileged_user:
        if unprivileged_user.count('EXAMPLE'):
            unprivileged_user = 'testacl'
    # Do the detach
    logging.debug('Node device name is %s.', device_address)
    CmdResult = virsh.nodedev_detach(device_address, options,
                                     unprivileged_user=unprivileged_user,
                                     uri=uri, readonly=readonly, debug=True)
    # Check the exit_status.
    libvirt.check_exit_status(CmdResult)
    # Check the driver.
    driver = get_driver_readlink(device_address)
    logging.debug('Driver after detach is %s.', driver)
    if libvirt_version.version_compare(1, 1, 1):
        device_driver_name = 'vfio-pci'
    else:
        device_driver_name = 'pci-stub'
    if (driver is None) or (not driver.endswith(device_driver_name)):
        test.fail("Driver for %s is not %s "
                  "after nodedev-detach" % (device_address, device_driver_name))
    # Do the reattach.
    CmdResult = virsh.nodedev_reattach(device_address, options)
    # Check the exit_status.
    libvirt.check_exit_status(CmdResult)
    # Check the driver.
    driver = get_driver_readlink(device_address)
    if libvirt_version.version_compare(1, 1, 1):
        device_driver_name = 'vfio-pci'
    else:
        device_driver_name = 'pci-stub'
    if driver and driver.endswith(device_driver_name):
        test.fail("Driver for %s is not %s "
                  "after nodedev-detach" % (device_address, device_driver_name))