Print this page
2594 implement graceful shutdown for local zones in zoneadm


   3  *
   4  * The contents of this file are subject to the terms of the
   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  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.

  23  */
  24 
  25 #ifndef _SYS_ZONE_H
  26 #define _SYS_ZONE_H
  27 
  28 #include <sys/types.h>
  29 #include <sys/mutex.h>
  30 #include <sys/param.h>
  31 #include <sys/rctl.h>
  32 #include <sys/ipc_rctl.h>
  33 #include <sys/pset.h>
  34 #include <sys/tsol/label.h>
  35 #include <sys/cred.h>
  36 #include <sys/netstack.h>
  37 #include <sys/uadmin.h>
  38 #include <sys/ksynch.h>
  39 #include <sys/socket_impl.h>
  40 #include <netinet/in.h>
  41 
  42 #ifdef  __cplusplus


 214         ZONE_IS_UNINITIALIZED = 0,
 215         ZONE_IS_INITIALIZED,
 216         ZONE_IS_READY,
 217         ZONE_IS_BOOTING,
 218         ZONE_IS_RUNNING,
 219         ZONE_IS_SHUTTING_DOWN,
 220         ZONE_IS_EMPTY,
 221         ZONE_IS_DOWN,
 222         ZONE_IS_DYING,
 223         ZONE_IS_DEAD
 224 } zone_status_t;
 225 #define ZONE_MIN_STATE          ZONE_IS_UNINITIALIZED
 226 #define ZONE_MAX_STATE          ZONE_IS_DEAD
 227 
 228 /*
 229  * Valid commands which may be issued by zoneadm to zoneadmd.  The kernel also
 230  * communicates with zoneadmd, but only uses Z_REBOOT and Z_HALT.
 231  */
 232 typedef enum zone_cmd {
 233         Z_READY, Z_BOOT, Z_FORCEBOOT, Z_REBOOT, Z_HALT, Z_NOTE_UNINSTALLING,
 234         Z_MOUNT, Z_FORCEMOUNT, Z_UNMOUNT
 235 } zone_cmd_t;
 236 
 237 /*
 238  * The structure of a request to zoneadmd.
 239  */
 240 typedef struct zone_cmd_arg {
 241         uint64_t        uniqid;         /* unique "generation number" */
 242         zone_cmd_t      cmd;            /* requested action */
 243         uint32_t        _pad;           /* need consistent 32/64 bit alignmt */
 244         char locale[MAXPATHLEN];        /* locale in which to render messages */
 245         char bootbuf[BOOTARGS_MAX];     /* arguments passed to zone_boot() */
 246 } zone_cmd_arg_t;
 247 
 248 /*
 249  * Structure of zoneadmd's response to a request.  A NULL return value means
 250  * the caller should attempt to restart zoneadmd and retry.
 251  */
 252 typedef struct zone_cmd_rval {
 253         int rval;                       /* return value of request */
 254         char errbuf[1]; /* variable-sized buffer containing error messages */




   3  *
   4  * The contents of this file are subject to the terms of the
   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  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
  24  */
  25 
  26 #ifndef _SYS_ZONE_H
  27 #define _SYS_ZONE_H
  28 
  29 #include <sys/types.h>
  30 #include <sys/mutex.h>
  31 #include <sys/param.h>
  32 #include <sys/rctl.h>
  33 #include <sys/ipc_rctl.h>
  34 #include <sys/pset.h>
  35 #include <sys/tsol/label.h>
  36 #include <sys/cred.h>
  37 #include <sys/netstack.h>
  38 #include <sys/uadmin.h>
  39 #include <sys/ksynch.h>
  40 #include <sys/socket_impl.h>
  41 #include <netinet/in.h>
  42 
  43 #ifdef  __cplusplus


 215         ZONE_IS_UNINITIALIZED = 0,
 216         ZONE_IS_INITIALIZED,
 217         ZONE_IS_READY,
 218         ZONE_IS_BOOTING,
 219         ZONE_IS_RUNNING,
 220         ZONE_IS_SHUTTING_DOWN,
 221         ZONE_IS_EMPTY,
 222         ZONE_IS_DOWN,
 223         ZONE_IS_DYING,
 224         ZONE_IS_DEAD
 225 } zone_status_t;
 226 #define ZONE_MIN_STATE          ZONE_IS_UNINITIALIZED
 227 #define ZONE_MAX_STATE          ZONE_IS_DEAD
 228 
 229 /*
 230  * Valid commands which may be issued by zoneadm to zoneadmd.  The kernel also
 231  * communicates with zoneadmd, but only uses Z_REBOOT and Z_HALT.
 232  */
 233 typedef enum zone_cmd {
 234         Z_READY, Z_BOOT, Z_FORCEBOOT, Z_REBOOT, Z_HALT, Z_NOTE_UNINSTALLING,
 235         Z_MOUNT, Z_FORCEMOUNT, Z_UNMOUNT, Z_SHUTDOWN
 236 } zone_cmd_t;
 237 
 238 /*
 239  * The structure of a request to zoneadmd.
 240  */
 241 typedef struct zone_cmd_arg {
 242         uint64_t        uniqid;         /* unique "generation number" */
 243         zone_cmd_t      cmd;            /* requested action */
 244         uint32_t        _pad;           /* need consistent 32/64 bit alignmt */
 245         char locale[MAXPATHLEN];        /* locale in which to render messages */
 246         char bootbuf[BOOTARGS_MAX];     /* arguments passed to zone_boot() */
 247 } zone_cmd_arg_t;
 248 
 249 /*
 250  * Structure of zoneadmd's response to a request.  A NULL return value means
 251  * the caller should attempt to restart zoneadmd and retry.
 252  */
 253 typedef struct zone_cmd_rval {
 254         int rval;                       /* return value of request */
 255         char errbuf[1]; /* variable-sized buffer containing error messages */