Print this page
OS-5330 zoneadm mounting an lx or joyent branded zone fails
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Approved by: Jerry Jelinek <jerry.jelinek@joyent.com>
(NOTE: Manual port, because of divergence from SmartOS.)
OS-2564 zone boot failed: could not start zoneadmd
OS-3524 in order to support interaction with docker containers, need to be able to connect to stdio for init from GZ
OS-3525 in order to support 'docker logs' need to be able to get stdio from zone to log file
OS-3075 zone long boot args aren't passed through
OS-11 rcapd behaves poorly when under extreme load

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/zoneadmd/zoneadmd.h
          +++ new/usr/src/cmd/zoneadmd/zoneadmd.h
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
       25 + * Copyright 2016 Joyent, Inc.
  25   26   */
  26   27  
  27   28  #ifndef _ZONEADMD_H
  28   29  #define _ZONEADMD_H
  29   30  
  30   31  #ifdef  __cplusplus
  31   32  extern "C" {
  32   33  #endif
  33   34  
  34   35  #include <libdladm.h>
↓ open down ↓ 27 lines elided ↑ open up ↑
  62   63  #define SHUTDOWN_WAIT           60
  63   64  #define SHUTDOWN_DEFAULT        "/sbin/init 0"
  64   65  #define SHUTDOWN_FMRI   "svc:/system/zones:default"
  65   66  
  66   67  /* 0755 is the default directory mode. */
  67   68  #define DEFAULT_DIR_MODE \
  68   69          (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
  69   70  #define DEFAULT_DIR_USER -1     /* user ID for chown: -1 means don't change */
  70   71  #define DEFAULT_DIR_GROUP -1    /* grp ID for chown: -1 means don't change */
  71   72  
       73 +#define ALT_MOUNT(mount_cmd)    ((mount_cmd) != Z_MNT_BOOT)
  72   74  
  73   75  typedef struct zlog {
  74   76          FILE *logfile;  /* file to log to */
  75   77  
  76   78          /*
  77   79           * The following are used if logging to a buffer.
  78   80           */
  79   81          char *log;      /* remaining log */
  80   82          size_t loglen;  /* size of remaining log */
  81   83          char *buf;      /* underlying storage */
↓ open down ↓ 1 lines elided ↑ open up ↑
  83   85          char *locale;   /* locale to use for gettext() */
  84   86  } zlog_t;
  85   87  
  86   88  extern zlog_t logsys;
  87   89  
  88   90  extern mutex_t lock;
  89   91  extern mutex_t msglock;
  90   92  extern boolean_t in_death_throes;
  91   93  extern boolean_t bringup_failure_recovery;
  92   94  extern char *zone_name;
       95 +extern char zonepath[MAXNAMELEN];
       96 +extern zone_dochandle_t snap_hndl;
  93   97  extern char pool_name[MAXNAMELEN];
  94   98  extern char brand_name[MAXNAMELEN];
  95   99  extern char default_brand[MAXNAMELEN];
  96  100  extern char boot_args[BOOTARGS_MAX];
  97      -extern char bad_boot_arg[BOOTARGS_MAX];
  98  101  extern boolean_t zone_isnative;
  99  102  extern boolean_t zone_iscluster;
 100  103  extern dladm_handle_t dld_handle;
 101  104  
 102  105  extern void zerror(zlog_t *, boolean_t, const char *, ...);
 103  106  extern char *localize_msg(char *locale, const char *msg);
 104  107  
 105  108  /*
 106  109   * Eventstream interfaces.
 107  110   */
 108  111  typedef enum {
 109  112          Z_EVT_NULL = 0,
 110  113          Z_EVT_ZONE_BOOTING,
 111  114          Z_EVT_ZONE_REBOOTING,
 112  115          Z_EVT_ZONE_HALTED,
 113  116          Z_EVT_ZONE_READIED,
 114  117          Z_EVT_ZONE_UNINSTALLING,
 115      -        Z_EVT_ZONE_BOOTFAILED,
 116      -        Z_EVT_ZONE_BADARGS
      118 +        Z_EVT_ZONE_BOOTFAILED
 117  119  } zone_evt_t;
 118  120  
 119  121  extern int eventstream_init();
 120  122  extern void eventstream_write(zone_evt_t evt);
 121  123  
 122  124  /*
 123  125   * Zone mount styles.  Boot is the standard mount we do when booting the zone,
 124  126   * scratch is the standard scratch zone mount for upgrade and update is a
 125  127   * variation on the scratch zone where we don't lofs mount the zone's /etc
 126  128   * and /var back into the scratch zone so that we can then do an
↓ open down ↓ 20 lines elided ↑ open up ↑
 147  149      const char *, const char *);
 148  150  extern int make_one_dir(zlog_t *, const char *, const char *,
 149  151      mode_t, uid_t, gid_t);
 150  152  extern void resolve_lofs(zlog_t *zlogp, char *path, size_t pathlen);
 151  153  
 152  154  /*
 153  155   * Console subsystem routines.
 154  156   */
 155  157  extern int init_console(zlog_t *);
 156  158  extern void serve_console(zlog_t *);
      159 +extern void zcons_statechanged();
 157  160  
 158  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 +/*
 159  174   * Contract handling.
 160  175   */
 161  176  extern int init_template(void);
 162  177  
 163  178  /*
 164  179   * Routine to manage child processes.
 165  180   */
 166  181  extern int do_subproc(zlog_t *, char *, char **);
 167  182  
 168  183  #ifdef __cplusplus
 169  184  }
 170  185  #endif
 171  186  
 172  187  #endif /* _ZONEADMD_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX