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.
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.
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]
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
31 #include <sys/types.h>
37 #define CMD_SHUTDOWN 4
42 #define CMD_UNINSTALL 9
44 #define CMD_UNMOUNT 11
51 #define CMD_SYSBOOT 18
53 #define CMD_MIN CMD_HELP
54 #define CMD_MAX CMD_SYSBOOT
56 #if !defined(TEXT_DOMAIN) /* should be defined by cc -D */
57 #define TEXT_DOMAIN "SYS_TEST" /* Use this only if it wasn't */
64 #define SW_CMP_NONE 0x0
65 #define SW_CMP_SRC 0x01
66 #define SW_CMP_SILENT 0x02
69 * This structure stores information about mounts of interest within an
72 typedef struct zone_mounts
{
73 /* The zone's zonepath */
76 /* The length of zonepath */
80 * This indicates the number of unexpected mounts that were encountered
83 int num_unexpected_mounts
;
86 * This is the number of overlay mounts detected on the zone's root
89 int num_root_overlay_mounts
;
92 * This is used to track important zone root mount information. The
93 * mnt_time field isn't used. If root_mnttab is NULL, then the
94 * associated zone doesn't have a mounted root filesystem.
96 * NOTE: mnt_mountp is non-NULL iff the zone's root filesystem is a
97 * ZFS filesystem with a non-legacy mountpoint. In this case, it
98 * refers to a string containing the dataset's mountpoint.
100 struct mnttab
*root_mnttab
;
106 extern char *target_zone
;
108 extern int zfm_print(const struct mnttab
*mntp
, void *unused
);
109 extern int clone_copy(char *source_zonepath
, char *zonepath
);
110 extern char *cmd_to_str(int cmd_num
);
111 extern int do_subproc(char *cmdbuf
);
112 extern int subproc_status(const char *cmd
, int status
,
113 boolean_t verbose_failure
);
114 extern void zerror(const char *fmt
, ...);
115 extern void zperror(const char *str
, boolean_t zonecfg_error
);
116 extern void zperror2(const char *zone
, const char *str
);
121 extern int clone_snapshot_zfs(char *snap_name
, char *zonepath
,
123 extern int clone_zfs(char *source_zonepath
, char *zonepath
, char *presnapbuf
,
125 extern void create_zfs_zonepath(char *zonepath
);
126 extern int destroy_zfs(char *zonepath
);
127 extern boolean_t
is_zonepath_zfs(char *zonepath
);
128 extern int move_zfs(char *zonepath
, char *new_zonepath
);
129 extern int verify_datasets(zone_dochandle_t handle
);
130 extern int verify_fs_zfs(struct zone_fstab
*fstab
);
131 extern int zone_mounts_init(zone_mounts_t
*mounts
, const char *zonepath
);
132 extern void zone_mounts_destroy(zone_mounts_t
*mounts
);
133 extern int zone_mount_rootfs(zone_mounts_t
*mounts
, const char *zonepath
);
134 extern int zone_unmount_rootfs(zone_mounts_t
*mounts
, const char *zonepath
,
136 extern int init_zfs(void);
138 #endif /* _ZONEADM_H */