def METHOD_NAME(guest_xml, params, virsh_func, test, *args):
    """
    Setup for the tests, including
    1. Configure os firmware attribute
    2. Create nvram file and make its size invalid
    :param guest_xml: the guest xml
    :param params: dict for parameters of the tests
    :param virsh_func: virsh function will be invoked
    :param args:  tuple, virsh function uses
    """
    test.log.info("Config guest xml with firmware efi")
    vm_name = params.get("main_vm", "avocado-vt-vm1")
    os_attrs = eval(params.get('os_attrs'))
    if os_attrs:
        osxml = vm_xml.VMOSXML()
        osxml.setup_attrs(**os_attrs)
        guest_xml.os = osxml
        guest_xml.sync()
    test.log.debug("After configuration, vm xml:\n%s", vm_xml.VMXML.new_from_inactive_dumpxml(vm_name))
    test.log.info("Start vm to create %s_VARS.fd file" % vm_name)
    virsh.start(vm_name)
    test.log.info("Modify the nvram file to make it invalid")
    cmd = 'echo > /var/lib/libvirt/qemu/nvram/%s_VARS.fd' % vm_name
    process.run(cmd, ignore_status=False, shell=True)
    test.log.debug("Prepare the required vm state")
    if len(args) > 1:
        virsh_func(args[0], args[1], ignore_status=False)
    else:
        virsh_func(args[0], ignore_status=False)