xref: /illumos-gate/usr/src/cmd/zoneadm/zoneadm.h (revision 46b592853d0f4f11781b6b0a7533f267c6aee132)
1 /*
2  * CDDL HEADER START
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 /*
23  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _ZONEADM_H
28 #define	_ZONEADM_H
29 
30 #define	CMD_HELP	0
31 #define	CMD_BOOT	1
32 #define	CMD_HALT	2
33 #define	CMD_READY	3
34 #define	CMD_REBOOT	4
35 #define	CMD_LIST	5
36 #define	CMD_VERIFY	6
37 #define	CMD_INSTALL	7
38 #define	CMD_UNINSTALL	8
39 #define	CMD_MOUNT	9
40 #define	CMD_UNMOUNT	10
41 #define	CMD_CLONE	11
42 #define	CMD_MOVE	12
43 #define	CMD_DETACH	13
44 #define	CMD_ATTACH	14
45 #define	CMD_MARK	15
46 #define	CMD_APPLY	16
47 #define	CMD_SYSBOOT	17
48 
49 #define	CMD_MIN		CMD_HELP
50 #define	CMD_MAX		CMD_SYSBOOT
51 
52 #if !defined(TEXT_DOMAIN)		/* should be defined by cc -D */
53 #define	TEXT_DOMAIN	"SYS_TEST"	/* Use this only if it wasn't */
54 #endif
55 
56 #define	Z_ERR		1
57 #define	Z_USAGE		2
58 #define	Z_FATAL		3
59 
60 #define	SW_CMP_NONE	0x0
61 #define	SW_CMP_SRC	0x01
62 #define	SW_CMP_SILENT	0x02
63 
64 /*
65  * zoneadm.c
66  */
67 extern char *target_zone;
68 
69 extern int clone_copy(char *source_zonepath, char *zonepath);
70 extern char *cmd_to_str(int cmd_num);
71 extern int do_subproc(char *cmdbuf);
72 extern int subproc_status(const char *cmd, int status,
73     boolean_t verbose_failure);
74 extern void zerror(const char *fmt, ...);
75 extern void zperror(const char *str, boolean_t zonecfg_error);
76 extern void zperror2(const char *zone, const char *str);
77 
78 /*
79  * zfs.c
80  */
81 extern int clone_snapshot_zfs(char *snap_name, char *zonepath,
82     char *validatesnap);
83 extern int clone_zfs(char *source_zonepath, char *zonepath, char *presnapbuf,
84     char *postsnapbuf);
85 extern void create_zfs_zonepath(char *zonepath);
86 extern int destroy_zfs(char *zonepath);
87 extern boolean_t is_zonepath_zfs(char *zonepath);
88 extern int move_zfs(char *zonepath, char *new_zonepath);
89 extern int verify_datasets(zone_dochandle_t handle);
90 extern int verify_fs_zfs(struct zone_fstab *fstab);
91 extern int init_zfs(void);
92 
93 #endif	/* _ZONEADM_H */
94