def update_reserved_binding(vlan_id, switch_ip, instance_id,<EOL>port_id, is_switch_binding=True,<EOL>is_native=False, ch_grp=<NUM_LIT:0>):
if not port_id:<EOL><INDENT>LOG.warning("<STR_LIT>")<EOL>return<EOL><DEDENT>LOG.debug("<STR_LIT>")<EOL>session = bc.get_writer_session()<EOL>if is_switch_binding:<EOL><INDENT>binding = _lookup_one_nexus_binding(session=session,<EOL>vlan_id=vlan_id,<EOL>switch_ip=switch_ip,<EOL>instance_id=instance_id)<EOL>binding.port_id = port_id<EOL><DEDENT>else:<EOL><INDENT>binding = _lookup_one_nexus_binding(session=session,<EOL>vlan_id=vlan_id,<EOL>switch_ip=switch_ip,<EOL>instance_id=instance_id,<EOL>port_id=port_id)<EOL><DEDENT>binding.is_native = is_native<EOL>binding.channel_group = ch_grp<EOL>session.merge(binding)<EOL>session.flush()<EOL>return binding<EOL>
Updates reserved binding.

    This overloads port bindings to support reserved Switch binding
    used to maintain the state of a switch so it can be viewed by
    all other neutron processes. There's also the case of
    a reserved port binding to keep switch information on a given
    interface.

    The values of these arguments is as follows:
    :param vlan_id: 0
    :param switch_ip: ip address of the switch
    :param instance_id: fixed string RESERVED_NEXUS_SWITCH_DEVICE_ID_R1
    :param port_id: switch-state of ACTIVE, RESTORE_S1, RESTORE_S2, INACTIVE
    :               port-expected port_id
    :param ch_grp:      0 if no port-channel else non-zero integer