Print this page
patch tsoome-feedback


 563          * consumed by the RCM framework to restore all the datalink and
 564          * IP configuration.
 565          */
 566         status = DLADM_STATUS_FAILED;
 567         if ((nvlist_alloc(&nvl, 0, 0) != 0) ||
 568             (nvlist_add_uint64(nvl, RCM_NV_LINKID, linkid2) != 0)) {
 569                 goto done;
 570         }
 571 
 572         if (rcm_alloc_handle(NULL, 0, NULL, &rcm_hdl) != RCM_SUCCESS)
 573                 goto done;
 574 
 575         if (rcm_notify_event(rcm_hdl, RCM_RESOURCE_LINK_NEW, 0, nvl, NULL) ==
 576             RCM_SUCCESS) {
 577                 status = DLADM_STATUS_OK;
 578         }
 579 
 580 done:
 581         if (rcm_hdl != NULL)
 582                 (void) rcm_free_handle(rcm_hdl);
 583         if (nvl != NULL)
 584                 nvlist_free(nvl);
 585         return (status);
 586 }
 587 
 588 /*
 589  * case 3: rename a non-existent link to a REMOVED physical link.
 590  * Set the removed physical link's device name to link1, so that
 591  * when link1 attaches, it inherits all the link configuration of
 592  * the removed physical link.
 593  */
 594 static dladm_status_t
 595 i_dladm_rename_link_c3(dladm_handle_t handle, const char *link1,
 596     datalink_id_t linkid2)
 597 {
 598         dladm_conf_t    conf;
 599         dladm_status_t  status;
 600 
 601         if (!dladm_valid_linkname(link1))
 602                 return (DLADM_STATUS_LINKINVAL);
 603 




 563          * consumed by the RCM framework to restore all the datalink and
 564          * IP configuration.
 565          */
 566         status = DLADM_STATUS_FAILED;
 567         if ((nvlist_alloc(&nvl, 0, 0) != 0) ||
 568             (nvlist_add_uint64(nvl, RCM_NV_LINKID, linkid2) != 0)) {
 569                 goto done;
 570         }
 571 
 572         if (rcm_alloc_handle(NULL, 0, NULL, &rcm_hdl) != RCM_SUCCESS)
 573                 goto done;
 574 
 575         if (rcm_notify_event(rcm_hdl, RCM_RESOURCE_LINK_NEW, 0, nvl, NULL) ==
 576             RCM_SUCCESS) {
 577                 status = DLADM_STATUS_OK;
 578         }
 579 
 580 done:
 581         if (rcm_hdl != NULL)
 582                 (void) rcm_free_handle(rcm_hdl);

 583         nvlist_free(nvl);
 584         return (status);
 585 }
 586 
 587 /*
 588  * case 3: rename a non-existent link to a REMOVED physical link.
 589  * Set the removed physical link's device name to link1, so that
 590  * when link1 attaches, it inherits all the link configuration of
 591  * the removed physical link.
 592  */
 593 static dladm_status_t
 594 i_dladm_rename_link_c3(dladm_handle_t handle, const char *link1,
 595     datalink_id_t linkid2)
 596 {
 597         dladm_conf_t    conf;
 598         dladm_status_t  status;
 599 
 600         if (!dladm_valid_linkname(link1))
 601                 return (DLADM_STATUS_LINKINVAL);
 602