'Update trunk metadata.
:param trunk_bridge: OVS trunk bridge.
:param port: OVS parent port.
:param trunk_id: trunk ID.
:param subport_ids: subports affecting the metadata.
:param wire: if True subport_ids are added, otherwise removed.'

def _update_trunk_metadata(self, trunk_bridge, port, trunk_id, subport_ids, wire=True):

    trunk_bridge = (trunk_bridge or ovs_lib.OVSBridge(utils.gen_trunk_br_name(trunk_id)))
    port = (port or self._get_parent_port(trunk_bridge))
    (_port_id, _trunk_id, old_subports) = self._get_trunk_metadata(port)
    if wire:
        new_subports = (set(old_subports) | set(subport_ids))
    else:
        new_subports = (set(old_subports) - set(subport_ids))
    self._set_trunk_metadata(trunk_bridge, port, trunk_id, new_subports)
