zoneadm.h revision 3c7284bd3243d42a710edac3a15f6019b4c849be
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
* Copyright 2014 Nexenta Systems, Inc. All rights reserved.
*/
#ifndef _ZONEADM_H
#define _ZONEADM_H
#define CMD_HELP 0
#define CMD_BOOT 1
#define CMD_HALT 2
#define CMD_READY 3
#define CMD_SHUTDOWN 4
#define CMD_REBOOT 5
#define CMD_LIST 6
#define CMD_VERIFY 7
#define CMD_INSTALL 8
#define CMD_UNINSTALL 9
#define CMD_MOUNT 10
#define CMD_UNMOUNT 11
#define CMD_CLONE 12
#define CMD_MOVE 13
#define CMD_DETACH 14
#define CMD_ATTACH 15
#define CMD_MARK 16
#define CMD_APPLY 17
#define CMD_SYSBOOT 18
#define CMD_MAX CMD_SYSBOOT
#if !defined(TEXT_DOMAIN) /* should be defined by cc -D */
#endif
#define Z_ERR 1
#define Z_USAGE 2
#define Z_FATAL 3
#define SW_CMP_NONE 0x0
#define SW_CMP_SRC 0x01
#define SW_CMP_SILENT 0x02
/*
* This structure stores information about mounts of interest within an
* installed zone.
*/
typedef struct zone_mounts {
/* The zone's zonepath */
char *zonepath;
/* The length of zonepath */
int zonepath_len;
/*
* This indicates the number of unexpected mounts that were encountered
* in the zone.
*/
/*
* This is the number of overlay mounts detected on the zone's root
* directory.
*/
/*
* This is used to track important zone root mount information. The
* mnt_time field isn't used. If root_mnttab is NULL, then the
* associated zone doesn't have a mounted root filesystem.
*
* NOTE: mnt_mountp is non-NULL iff the zone's root filesystem is a
* ZFS filesystem with a non-legacy mountpoint. In this case, it
* refers to a string containing the dataset's mountpoint.
*/
struct mnttab *root_mnttab;
/*
*/
extern char *target_zone;
extern char *cmd_to_str(int cmd_num);
extern int do_subproc(char *cmdbuf);
/*
* zfs.c
*/
char *validatesnap);
char *postsnapbuf);
extern void create_zfs_zonepath(char *zonepath);
extern int destroy_zfs(char *zonepath);
extern int init_zfs(void);
#endif /* _ZONEADM_H */