Print this page
OS-192 zone_create() warning on headnode


   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright 2014 Nexenta Systems, Inc. All rights reserved.

  25  */
  26 
  27 #ifndef _ZONEADMD_H
  28 #define _ZONEADMD_H
  29 
  30 #ifdef  __cplusplus
  31 extern "C" {
  32 #endif
  33 
  34 #include <libdladm.h>
  35 
  36 /*
  37  * Multi-threaded programs should avoid MT-unsafe library calls (i.e., any-
  38  * thing which could try to acquire a user-level lock unprotected by an atfork
  39  * handler) between fork(2) and exec(2).  See the pthread_atfork(3THR) man
  40  * page for details.  In particular, we want to avoid calls to zerror() in
  41  * such situations, as it calls setlocale(3c) which is susceptible to such
  42  * problems.  So instead we have the child use one of the special exit codes
  43  * below when needed, and the parent look out for such possibilities and call
  44  * zerror() there.


 118 
 119 extern int eventstream_init();
 120 extern void eventstream_write(zone_evt_t evt);
 121 
 122 /*
 123  * Zone mount styles.  Boot is the standard mount we do when booting the zone,
 124  * scratch is the standard scratch zone mount for upgrade and update is a
 125  * variation on the scratch zone where we don't lofs mount the zone's /etc
 126  * and /var back into the scratch zone so that we can then do an
 127  * 'update on attach' within the scratch zone.
 128  */
 129 typedef enum {
 130         Z_MNT_BOOT = 0,
 131         Z_MNT_SCRATCH,
 132         Z_MNT_UPDATE
 133 } zone_mnt_t;
 134 
 135 /*
 136  * Virtual platform interfaces.
 137  */
 138 extern zoneid_t vplat_create(zlog_t *, zone_mnt_t);
 139 extern int vplat_bringup(zlog_t *, zone_mnt_t, zoneid_t);
 140 extern int vplat_teardown(zlog_t *, boolean_t, boolean_t);
 141 extern int vplat_get_iptype(zlog_t *, zone_iptype_t *);
 142 
 143 /*
 144  * Filesystem mounting interfaces.
 145  */
 146 extern int valid_mount_path(zlog_t *, const char *, const char *,
 147     const char *, const char *);
 148 extern int make_one_dir(zlog_t *, const char *, const char *,
 149     mode_t, uid_t, gid_t);
 150 extern void resolve_lofs(zlog_t *zlogp, char *path, size_t pathlen);
 151 
 152 /*
 153  * Console subsystem routines.
 154  */
 155 extern int init_console(zlog_t *);
 156 extern void serve_console(zlog_t *);
 157 
 158 /*


   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
  25  * Copyright (c) 2011, Joyent Inc. All rights reserved.
  26  */
  27 
  28 #ifndef _ZONEADMD_H
  29 #define _ZONEADMD_H
  30 
  31 #ifdef  __cplusplus
  32 extern "C" {
  33 #endif
  34 
  35 #include <libdladm.h>
  36 
  37 /*
  38  * Multi-threaded programs should avoid MT-unsafe library calls (i.e., any-
  39  * thing which could try to acquire a user-level lock unprotected by an atfork
  40  * handler) between fork(2) and exec(2).  See the pthread_atfork(3THR) man
  41  * page for details.  In particular, we want to avoid calls to zerror() in
  42  * such situations, as it calls setlocale(3c) which is susceptible to such
  43  * problems.  So instead we have the child use one of the special exit codes
  44  * below when needed, and the parent look out for such possibilities and call
  45  * zerror() there.


 119 
 120 extern int eventstream_init();
 121 extern void eventstream_write(zone_evt_t evt);
 122 
 123 /*
 124  * Zone mount styles.  Boot is the standard mount we do when booting the zone,
 125  * scratch is the standard scratch zone mount for upgrade and update is a
 126  * variation on the scratch zone where we don't lofs mount the zone's /etc
 127  * and /var back into the scratch zone so that we can then do an
 128  * 'update on attach' within the scratch zone.
 129  */
 130 typedef enum {
 131         Z_MNT_BOOT = 0,
 132         Z_MNT_SCRATCH,
 133         Z_MNT_UPDATE
 134 } zone_mnt_t;
 135 
 136 /*
 137  * Virtual platform interfaces.
 138  */
 139 extern zoneid_t vplat_create(zlog_t *, zone_mnt_t, zoneid_t);
 140 extern int vplat_bringup(zlog_t *, zone_mnt_t, zoneid_t);
 141 extern int vplat_teardown(zlog_t *, boolean_t, boolean_t);
 142 extern int vplat_get_iptype(zlog_t *, zone_iptype_t *);
 143 
 144 /*
 145  * Filesystem mounting interfaces.
 146  */
 147 extern int valid_mount_path(zlog_t *, const char *, const char *,
 148     const char *, const char *);
 149 extern int make_one_dir(zlog_t *, const char *, const char *,
 150     mode_t, uid_t, gid_t);
 151 extern void resolve_lofs(zlog_t *zlogp, char *path, size_t pathlen);
 152 
 153 /*
 154  * Console subsystem routines.
 155  */
 156 extern int init_console(zlog_t *);
 157 extern void serve_console(zlog_t *);
 158 
 159 /*