1210 id = vnic->dlv_vnic_id;
1211 if (nvlist_add_uint64(nvl, RCM_NV_LINKID, id) != 0) {
1212 rcm_log_message(RCM_ERROR,
1213 _("VNIC: failed to construct nvlist\n"));
1214 (void) mutex_unlock(&cache_lock);
1215 goto done;
1216 }
1217 }
1218 (void) mutex_unlock(&cache_lock);
1219
1220 if (rcm_notify_event(hd, RCM_RESOURCE_LINK_NEW, 0, nvl, NULL) !=
1221 RCM_SUCCESS) {
1222 rcm_log_message(RCM_ERROR,
1223 _("VNIC: failed to notify %s event for %s\n"),
1224 RCM_RESOURCE_LINK_NEW, node->vc_resource);
1225 goto done;
1226 }
1227
1228 ret = 0;
1229 done:
1230 if (nvl != NULL)
1231 nvlist_free(nvl);
1232 return (ret);
1233 }
1234
1235 /*
1236 * vnic_consumer_notify() - Notify consumers of VNICs coming back online.
1237 */
1238 static int
1239 vnic_consumer_notify(rcm_handle_t *hd, datalink_id_t linkid, char **errorp,
1240 uint_t flags, rcm_info_t **info)
1241 {
1242 char rsrc[RCM_LINK_RESOURCE_MAX];
1243 link_cache_t *node;
1244
1245 /* Check for the interface in the cache */
1246 (void) snprintf(rsrc, RCM_LINK_RESOURCE_MAX, "%s/%u", RCM_LINK_PREFIX,
1247 linkid);
1248
1249 rcm_log_message(RCM_TRACE2, "VNIC: vnic_consumer_notify(%s)\n", rsrc);
1250
|
1210 id = vnic->dlv_vnic_id;
1211 if (nvlist_add_uint64(nvl, RCM_NV_LINKID, id) != 0) {
1212 rcm_log_message(RCM_ERROR,
1213 _("VNIC: failed to construct nvlist\n"));
1214 (void) mutex_unlock(&cache_lock);
1215 goto done;
1216 }
1217 }
1218 (void) mutex_unlock(&cache_lock);
1219
1220 if (rcm_notify_event(hd, RCM_RESOURCE_LINK_NEW, 0, nvl, NULL) !=
1221 RCM_SUCCESS) {
1222 rcm_log_message(RCM_ERROR,
1223 _("VNIC: failed to notify %s event for %s\n"),
1224 RCM_RESOURCE_LINK_NEW, node->vc_resource);
1225 goto done;
1226 }
1227
1228 ret = 0;
1229 done:
1230 nvlist_free(nvl);
1231 return (ret);
1232 }
1233
1234 /*
1235 * vnic_consumer_notify() - Notify consumers of VNICs coming back online.
1236 */
1237 static int
1238 vnic_consumer_notify(rcm_handle_t *hd, datalink_id_t linkid, char **errorp,
1239 uint_t flags, rcm_info_t **info)
1240 {
1241 char rsrc[RCM_LINK_RESOURCE_MAX];
1242 link_cache_t *node;
1243
1244 /* Check for the interface in the cache */
1245 (void) snprintf(rsrc, RCM_LINK_RESOURCE_MAX, "%s/%u", RCM_LINK_PREFIX,
1246 linkid);
1247
1248 rcm_log_message(RCM_TRACE2, "VNIC: vnic_consumer_notify(%s)\n", rsrc);
1249
|