Print this page




  87 
  88 extern zlog_t logsys;
  89 
  90 extern mutex_t lock;
  91 extern mutex_t msglock;
  92 extern boolean_t in_death_throes;
  93 extern boolean_t bringup_failure_recovery;
  94 extern char *zone_name;
  95 extern char zonepath[MAXNAMELEN];
  96 extern zone_dochandle_t snap_hndl;
  97 extern char pool_name[MAXNAMELEN];
  98 extern char brand_name[MAXNAMELEN];
  99 extern char default_brand[MAXNAMELEN];
 100 extern char boot_args[BOOTARGS_MAX];
 101 extern boolean_t zone_isnative;
 102 extern boolean_t zone_iscluster;
 103 extern dladm_handle_t dld_handle;
 104 
 105 extern void zerror(zlog_t *, boolean_t, const char *, ...);
 106 extern char *localize_msg(char *locale, const char *msg);
 107 extern void nwifent_free_attrs(struct zone_nwiftab *);
 108 
 109 /*
 110  * Eventstream interfaces.
 111  */
 112 typedef enum {
 113         Z_EVT_NULL = 0,
 114         Z_EVT_ZONE_BOOTING,
 115         Z_EVT_ZONE_REBOOTING,
 116         Z_EVT_ZONE_HALTED,
 117         Z_EVT_ZONE_READIED,
 118         Z_EVT_ZONE_UNINSTALLING,
 119         Z_EVT_ZONE_BOOTFAILED
 120 } zone_evt_t;
 121 
 122 extern int eventstream_init();
 123 extern void eventstream_write(zone_evt_t evt);
 124 
 125 /*
 126  * Zone mount styles.  Boot is the standard mount we do when booting the zone,
 127  * scratch is the standard scratch zone mount for upgrade and update is a
 128  * variation on the scratch zone where we don't lofs mount the zone's /etc
 129  * and /var back into the scratch zone so that we can then do an
 130  * 'update on attach' within the scratch zone.
 131  */
 132 typedef enum {
 133         Z_MNT_BOOT = 0,
 134         Z_MNT_SCRATCH,
 135         Z_MNT_UPDATE
 136 } zone_mnt_t;
 137 
 138 /*
 139  * Virtual platform interfaces.
 140  */
 141 extern zoneid_t vplat_create(zlog_t *, zone_mnt_t, zoneid_t);
 142 extern int vplat_bringup(zlog_t *, zone_mnt_t, zoneid_t);
 143 extern int vplat_teardown(zlog_t *, boolean_t, boolean_t, boolean_t);
 144 extern int vplat_get_iptype(zlog_t *, zone_iptype_t *);
 145 
 146 /*
 147  * Filesystem mounting interfaces.
 148  */
 149 extern int valid_mount_path(zlog_t *, const char *, const char *,
 150     const char *, const char *);
 151 extern int make_one_dir(zlog_t *, const char *, const char *,
 152     mode_t, uid_t, gid_t);
 153 extern void resolve_lofs(zlog_t *zlogp, char *path, size_t pathlen);
 154 
 155 /*
 156  * Console subsystem routines.
 157  */
 158 extern int init_console(zlog_t *);
 159 extern void serve_console(zlog_t *);
 160 extern void zcons_statechanged();
 161 
 162 /*
 163  * Memory capping thread creation.
 164  */
 165 extern void create_mcap_thread(zlog_t *, zoneid_t);
 166 extern void destroy_mcap_thread();
 167 
 168 /*
 169  * Zone FD log thread creation.
 170  */
 171 extern void create_log_thread(zlog_t *, zoneid_t);
 172 extern void destroy_log_thread();
 173 
 174 /*
 175  * Contract handling.
 176  */
 177 extern int init_template(void);
 178 
 179 /*
 180  * Routine to manage child processes.
 181  */
 182 extern int do_subproc(zlog_t *, char *, char **, boolean_t);
 183 
 184 #ifdef __cplusplus
 185 }
 186 #endif
 187 
 188 #endif /* _ZONEADMD_H */


  87 
  88 extern zlog_t logsys;
  89 
  90 extern mutex_t lock;
  91 extern mutex_t msglock;
  92 extern boolean_t in_death_throes;
  93 extern boolean_t bringup_failure_recovery;
  94 extern char *zone_name;
  95 extern char zonepath[MAXNAMELEN];
  96 extern zone_dochandle_t snap_hndl;
  97 extern char pool_name[MAXNAMELEN];
  98 extern char brand_name[MAXNAMELEN];
  99 extern char default_brand[MAXNAMELEN];
 100 extern char boot_args[BOOTARGS_MAX];
 101 extern boolean_t zone_isnative;
 102 extern boolean_t zone_iscluster;
 103 extern dladm_handle_t dld_handle;
 104 
 105 extern void zerror(zlog_t *, boolean_t, const char *, ...);
 106 extern char *localize_msg(char *locale, const char *msg);

 107 
 108 /*
 109  * Eventstream interfaces.
 110  */
 111 typedef enum {
 112         Z_EVT_NULL = 0,
 113         Z_EVT_ZONE_BOOTING,
 114         Z_EVT_ZONE_REBOOTING,
 115         Z_EVT_ZONE_HALTED,
 116         Z_EVT_ZONE_READIED,
 117         Z_EVT_ZONE_UNINSTALLING,
 118         Z_EVT_ZONE_BOOTFAILED
 119 } zone_evt_t;
 120 
 121 extern int eventstream_init();
 122 extern void eventstream_write(zone_evt_t evt);
 123 
 124 /*
 125  * Zone mount styles.  Boot is the standard mount we do when booting the zone,
 126  * scratch is the standard scratch zone mount for upgrade and update is a
 127  * variation on the scratch zone where we don't lofs mount the zone's /etc
 128  * and /var back into the scratch zone so that we can then do an
 129  * 'update on attach' within the scratch zone.
 130  */
 131 typedef enum {
 132         Z_MNT_BOOT = 0,
 133         Z_MNT_SCRATCH,
 134         Z_MNT_UPDATE
 135 } zone_mnt_t;
 136 
 137 /*
 138  * Virtual platform interfaces.
 139  */
 140 extern zoneid_t vplat_create(zlog_t *, zone_mnt_t);
 141 extern int vplat_bringup(zlog_t *, zone_mnt_t, zoneid_t);
 142 extern int vplat_teardown(zlog_t *, boolean_t, boolean_t);
 143 extern int vplat_get_iptype(zlog_t *, zone_iptype_t *);
 144 
 145 /*
 146  * Filesystem mounting interfaces.
 147  */
 148 extern int valid_mount_path(zlog_t *, const char *, const char *,
 149     const char *, const char *);
 150 extern int make_one_dir(zlog_t *, const char *, const char *,
 151     mode_t, uid_t, gid_t);
 152 extern void resolve_lofs(zlog_t *zlogp, char *path, size_t pathlen);
 153 
 154 /*
 155  * Console subsystem routines.
 156  */
 157 extern int init_console(zlog_t *);
 158 extern void serve_console(zlog_t *);
 159 extern void zcons_statechanged();
 160 
 161 /*
 162  * Memory capping thread creation.
 163  */
 164 extern void create_mcap_thread(zlog_t *, zoneid_t);
 165 extern void destroy_mcap_thread();
 166 
 167 /*
 168  * Zone FD log thread creation.
 169  */
 170 extern void create_log_thread(zlog_t *, zoneid_t);
 171 extern void destroy_log_thread();
 172 
 173 /*
 174  * Contract handling.
 175  */
 176 extern int init_template(void);
 177 
 178 /*
 179  * Routine to manage child processes.
 180  */
 181 extern int do_subproc(zlog_t *, char *, char **);
 182 
 183 #ifdef __cplusplus
 184 }
 185 #endif
 186 
 187 #endif /* _ZONEADMD_H */