<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def setup_logical_port_connectivity(self, context, port_db, hosting_device_id):
 """Establishes connectivity for a logical port. This is done by hot plugging the interface(VIF) corresponding to the port from the VM. """

        hosting_port = port_db.hosting_info.hosting_port
        if hosting_port:
            try:
                self._dev_mgr.svc_vm_mgr.interface_attach(hosting_device_id,
                                                          hosting_port.id)
                LOG.debug("Setup logical port completed for port:%s",
                          port_db.id)
            except nova_exc.Conflict as e:
                # VM is still in vm_state building
                LOG.debug("Failed to attach interface - spawn thread "
                          "error %(error)s", {'error': str(e)})
                self._gt_pool.spawn_n(self._attach_hosting_port,
                                      hosting_device_id, hosting_port.id)
            except Exception as e:
                LOG.error("Failed to attach interface mapped to port:"
                          "%(p_id)s on hosting device:%(hd_id)s due to "
                          "error %(error)s", {'p_id': hosting_port.id,
                                              'hd_id': hosting_device_id,
                                              'error': str(e)})