Print this page
2594 implement graceful shutdown for local zones in zoneadm
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/zoneadm/zoneadm.h
+++ new/usr/src/cmd/zoneadm/zoneadm.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
↓ 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 2009 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 + * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
25 26 */
26 27
27 28 #ifndef _ZONEADM_H
28 29 #define _ZONEADM_H
29 30
30 31 #include <sys/types.h>
31 32
32 33 #define CMD_HELP 0
33 34 #define CMD_BOOT 1
34 35 #define CMD_HALT 2
35 36 #define CMD_READY 3
36 -#define CMD_REBOOT 4
37 -#define CMD_LIST 5
38 -#define CMD_VERIFY 6
39 -#define CMD_INSTALL 7
40 -#define CMD_UNINSTALL 8
41 -#define CMD_MOUNT 9
42 -#define CMD_UNMOUNT 10
43 -#define CMD_CLONE 11
44 -#define CMD_MOVE 12
45 -#define CMD_DETACH 13
46 -#define CMD_ATTACH 14
47 -#define CMD_MARK 15
48 -#define CMD_APPLY 16
49 -#define CMD_SYSBOOT 17
37 +#define CMD_SHUTDOWN 4
38 +#define CMD_REBOOT 5
39 +#define CMD_LIST 6
40 +#define CMD_VERIFY 7
41 +#define CMD_INSTALL 8
42 +#define CMD_UNINSTALL 9
43 +#define CMD_MOUNT 10
44 +#define CMD_UNMOUNT 11
45 +#define CMD_CLONE 12
46 +#define CMD_MOVE 13
47 +#define CMD_DETACH 14
48 +#define CMD_ATTACH 15
49 +#define CMD_MARK 16
50 +#define CMD_APPLY 17
51 +#define CMD_SYSBOOT 18
50 52
51 53 #define CMD_MIN CMD_HELP
52 54 #define CMD_MAX CMD_SYSBOOT
53 55
54 56 #if !defined(TEXT_DOMAIN) /* should be defined by cc -D */
55 57 #define TEXT_DOMAIN "SYS_TEST" /* Use this only if it wasn't */
56 58 #endif
57 59
58 60 #define Z_ERR 1
59 61 #define Z_USAGE 2
60 62 #define Z_FATAL 3
61 63
62 64 #define SW_CMP_NONE 0x0
63 65 #define SW_CMP_SRC 0x01
64 66 #define SW_CMP_SILENT 0x02
65 67
66 68 /*
67 69 * This structure stores information about mounts of interest within an
68 70 * installed zone.
69 71 */
70 72 typedef struct zone_mounts {
71 73 /* The zone's zonepath */
72 74 char *zonepath;
73 75
74 76 /* The length of zonepath */
75 77 int zonepath_len;
76 78
77 79 /*
78 80 * This indicates the number of unexpected mounts that were encountered
79 81 * in the zone.
80 82 */
81 83 int num_unexpected_mounts;
82 84
83 85 /*
84 86 * This is the number of overlay mounts detected on the zone's root
85 87 * directory.
86 88 */
87 89 int num_root_overlay_mounts;
88 90
89 91 /*
90 92 * This is used to track important zone root mount information. The
91 93 * mnt_time field isn't used. If root_mnttab is NULL, then the
92 94 * associated zone doesn't have a mounted root filesystem.
93 95 *
94 96 * NOTE: mnt_mountp is non-NULL iff the zone's root filesystem is a
95 97 * ZFS filesystem with a non-legacy mountpoint. In this case, it
96 98 * refers to a string containing the dataset's mountpoint.
97 99 */
98 100 struct mnttab *root_mnttab;
99 101 } zone_mounts_t;
100 102
101 103 /*
102 104 * zoneadm.c
103 105 */
104 106 extern char *target_zone;
105 107
106 108 extern int zfm_print(const struct mnttab *mntp, void *unused);
107 109 extern int clone_copy(char *source_zonepath, char *zonepath);
108 110 extern char *cmd_to_str(int cmd_num);
109 111 extern int do_subproc(char *cmdbuf);
110 112 extern int subproc_status(const char *cmd, int status,
111 113 boolean_t verbose_failure);
112 114 extern void zerror(const char *fmt, ...);
113 115 extern void zperror(const char *str, boolean_t zonecfg_error);
114 116 extern void zperror2(const char *zone, const char *str);
115 117
116 118 /*
117 119 * zfs.c
118 120 */
119 121 extern int clone_snapshot_zfs(char *snap_name, char *zonepath,
120 122 char *validatesnap);
121 123 extern int clone_zfs(char *source_zonepath, char *zonepath, char *presnapbuf,
122 124 char *postsnapbuf);
123 125 extern void create_zfs_zonepath(char *zonepath);
124 126 extern int destroy_zfs(char *zonepath);
125 127 extern boolean_t is_zonepath_zfs(char *zonepath);
126 128 extern int move_zfs(char *zonepath, char *new_zonepath);
127 129 extern int verify_datasets(zone_dochandle_t handle);
128 130 extern int verify_fs_zfs(struct zone_fstab *fstab);
129 131 extern int zone_mounts_init(zone_mounts_t *mounts, const char *zonepath);
130 132 extern void zone_mounts_destroy(zone_mounts_t *mounts);
131 133 extern int zone_mount_rootfs(zone_mounts_t *mounts, const char *zonepath);
132 134 extern int zone_unmount_rootfs(zone_mounts_t *mounts, const char *zonepath,
133 135 boolean_t force);
134 136 extern int init_zfs(void);
135 137
136 138 #endif /* _ZONEADM_H */
↓ open down ↓ |
77 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX