Print this page
*** 19,29 ****
* CDDL HEADER END
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, Joyent Inc. All rights reserved.
*/
/*
* Main door handler functions used by dlmgmtd to process the different door
* call requests. Door call requests can come from the user-land applications,
--- 19,28 ----
*** 63,72 ****
--- 62,72 ----
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "dlmgmt_impl.h"
+
typedef void dlmgmt_door_handler_t(void *, void *, size_t *, zoneid_t,
ucred_t *);
typedef struct dlmgmt_door_info_s {
uint_t di_cmd;
*** 447,460 ****
dlmgmt_door_getlinkid_t *getlinkid = argp;
dlmgmt_getlinkid_retval_t *retvalp = retp;
dlmgmt_link_t *linkp;
int err = 0;
- /* Enable the global zone to lookup links it has given away. */
- if (zoneid == GLOBAL_ZONEID && getlinkid->ld_zoneid != -1)
- zoneid = getlinkid->ld_zoneid;
-
/*
* Hold the reader lock to access the link
*/
dlmgmt_table_lock(B_FALSE);
--- 447,456 ----
*** 1273,1295 ****
err = errno;
dlmgmt_log(LOG_WARNING, "unable to remove link %d from "
"zone %d: %s", linkid, oldzoneid, strerror(err));
goto done;
}
!
! if (newzoneid == GLOBAL_ZONEID && linkp->ll_onloan) {
! /*
! * We can only reassign a loaned VNIC back to the
! * global zone when the zone is shutting down, since
! * otherwise the VNIC is in use by the zone and will be
! * busy. Leave the VNIC assigned to the zone so we can
! * still see it and delete it when dlmgmt_zonehalt()
! * runs.
! */
! goto done;
! }
!
linkp->ll_onloan = B_FALSE;
}
if (newzoneid != GLOBAL_ZONEID) {
if (zone_add_datalink(newzoneid, linkid) != 0) {
err = errno;
--- 1269,1279 ----
err = errno;
dlmgmt_log(LOG_WARNING, "unable to remove link %d from "
"zone %d: %s", linkid, oldzoneid, strerror(err));
goto done;
}
! avl_remove(&dlmgmt_loan_avl, linkp);
linkp->ll_onloan = B_FALSE;
}
if (newzoneid != GLOBAL_ZONEID) {
if (zone_add_datalink(newzoneid, linkid) != 0) {
err = errno;
*** 1296,1305 ****
--- 1280,1290 ----
dlmgmt_log(LOG_WARNING, "unable to add link %d to zone "
"%d: %s", linkid, newzoneid, strerror(err));
(void) zone_add_datalink(oldzoneid, linkid);
goto done;
}
+ avl_add(&dlmgmt_loan_avl, linkp);
linkp->ll_onloan = B_TRUE;
}
avl_remove(&dlmgmt_name_avl, linkp);
linkp->ll_zoneid = newzoneid;