zone.h revision a19609f85693e4e7d7e744d836a4e87193c934e4
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * CDDL HEADER START
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * The contents of this file are subject to the terms of the
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * Common Development and Distribution License (the "License").
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * You may not use this file except in compliance with the License.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * or http://www.opensolaris.org/os/licensing.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * See the License for the specific language governing permissions
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * and limitations under the License.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * When distributing Covered Code, include this CDDL HEADER in each
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * If applicable, add the following below this CDDL HEADER, with the
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * fields enclosed by brackets "[]" replaced with your own identifying
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * information: Portions Copyright [yyyy] [name of copyright owner]
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * CDDL HEADER END
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * The contents of this file are private to the implementation of
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * Solaris and are subject to change at any time without notice.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * Applications and drivers using these interfaces may fail to
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * run on future releases.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy/* Available both in kernel and for user space */
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy/* zone id restrictions and special ids */
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#define MIN_USERZONEID 1 /* lowest user-creatable zone ID */
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#define MIN_ZONEID 0 /* minimum zone ID on system */
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * Special zoneid_t token to refer to all zones.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy/* system call subcodes */
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy/* zone attributes */
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy/* Start of the brand-specific attribute namespace */
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#define ZONE_EVENT_CHANNEL "com.sun:zones:status"
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#define ZONE_EVENT_STATUS_SUBCLASS "change"
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#define ZONE_EVENT_UNINITIALIZED "uninitialized"
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy#define ZONE_EVENT_INITIALIZED "initialized"
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy#define ZONE_EVENT_SHUTTING_DOWN "shutting_down"
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * Exit values that may be returned by scripts or programs invoked by various
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * zone commands.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * These are defined as:
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * ZONE_SUBPROC_OK
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * ===============
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * The subprocess completed successfully.
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy * ZONE_SUBPROC_USAGE
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy * ==================
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * The subprocess failed with a usage message, or a usage message should
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * be output in its behalf.
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy * ZONE_SUBPROC_NOTCOMPLETE
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * ========================
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * The subprocess did not complete, but the actions performed by the
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * subprocess require no recovery actions by the user.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * For example, if the subprocess were called by "zoneadm install," the
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * installation of the zone did not succeed but the user need not perform
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * a "zoneadm uninstall" before attempting another install.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * ZONE_SUBPROC_FATAL
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * ==================
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy * The subprocess failed in a fatal manner, usually one that will require
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy * some type of recovery action by the user.
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy * For example, if the subprocess were called by "zoneadm install," the
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * installation of the zone did not succeed and the user will need to
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy * perform a "zoneadm uninstall" before another install attempt is
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * The non-success exit values are large to avoid accidental collision
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * with values used internally by some commands (e.g. "Z_ERR" and
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * "Z_USAGE" as used by zoneadm.)
#ifdef _SYSCALL32
int flags;
} zone_def32;
const char *zone_name;
const char *zone_root;
const char *rctlbuf;
int *extended_error;
const char *zfsbuf;
int flags;
} zone_def;
typedef enum zone_cmd {
} zone_cmd_t;
typedef struct zone_cmd_arg {
typedef struct zone_cmd_rval {
typedef struct zone_net_data {
int zn_type;
int zn_len;
#ifdef _KERNEL
struct pool;
struct brand;
typedef enum zone_ref_subsys {
typedef struct zone_ref {
} zone_ref_t;
typedef struct zone_dataset {
char *zd_dataset;
typedef struct zone_kstat {
} zone_kstat_t;
struct cpucap;
typedef struct zone {
char *zone_fs_allowed;
} zone_t;
extern long zone(int, void *, void *, void *, void *);
extern void zone_zsd_init(void);
extern void zone_init(void);
#define ZONE_KEY_UNINITIALIZED 0
* The definition of a zsd_entry is truly private to zone.c and is only
struct zsd_entry {
#define ZSD_CREATE_ALL \
#define ZSD_SHUTDOWN_ALL \
#define ZSD_DESTROY_ALL \
#define ZSD_ALL_INPROGRESS \
#define INGLOBALZONE(p) \
pri_t);
extern void zthread_exit(void);
* Get the number of cpus/online-cpus visible from the given zone.
extern int zone_dataset_visible(const char *, int *);
extern void zone_shutdown_global(void);
extern void mount_in_progress(void);
extern void mount_completed(void);
#ifdef __cplusplus