zoneadm.h revision 555afedfc38adf0cc5fbc1de696dc811973eaaca
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe/*
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * CDDL HEADER START
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe *
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * The contents of this file are subject to the terms of the
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * Common Development and Distribution License (the "License").
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov * You may not use this file except in compliance with the License.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe *
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * or http://www.opensolaris.org/os/licensing.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * See the License for the specific language governing permissions
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * and limitations under the License.
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov *
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov * When distributing Covered Code, include this CDDL HEADER in each
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * If applicable, add the following below this CDDL HEADER, with the
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * fields enclosed by brackets "[]" replaced with your own identifying
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * information: Portions Copyright [yyyy] [name of copyright owner]
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe *
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * CDDL HEADER END
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe */
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe/*
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * Use is subject to license terms.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe */
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#ifndef _ZONEADM_H
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define _ZONEADM_H
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#pragma ident "%Z%%M% %I% %E% SMI"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define CMD_HELP 0
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define CMD_BOOT 1
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define CMD_HALT 2
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define CMD_READY 3
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define CMD_REBOOT 4
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define CMD_LIST 5
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define CMD_VERIFY 6
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define CMD_INSTALL 7
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define CMD_UNINSTALL 8
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define CMD_MOUNT 9
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define CMD_UNMOUNT 10
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define CMD_CLONE 11
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define CMD_MOVE 12
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define CMD_DETACH 13
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define CMD_ATTACH 14
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define CMD_MARK 15
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define CMD_MIN CMD_HELP
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define CMD_MAX CMD_MARK
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#if !defined(TEXT_DOMAIN) /* should be defined by cc -D */
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define TEXT_DOMAIN "SYS_TEST" /* Use this only if it wasn't */
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#endif
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define Z_ERR 1
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define Z_USAGE 2
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define SW_CMP_NONE 0x0
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define SW_CMP_SRC 0x01
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define SW_CMP_SILENT 0x02
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe/*
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * zoneadm.c
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe */
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweextern char *target_zone;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweextern int clone_copy(char *source_zonepath, char *zonepath);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweextern char *cmd_to_str(int cmd_num);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweextern void zerror(const char *fmt, ...);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweextern void zperror(const char *str, boolean_t zonecfg_error);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweextern void zperror2(const char *zone, const char *str);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe/*
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * zfs.c
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe */
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweextern int clone_snapshot_zfs(char *snap_name, char *zonepath);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweextern int clone_zfs(char *source_zone, char *source_zonepath, char *zonepath);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweextern void create_zfs_zonepath(char *zonepath);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweextern int destroy_zfs(char *zonepath);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweextern boolean_t is_zonepath_zfs(char *zonepath);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweextern int move_zfs(char *zonepath, char *new_zonepath);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweextern int verify_datasets(zone_dochandle_t handle);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweextern int verify_fs_zfs(struct zone_fstab *fstab);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweextern int init_zfs(void);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe/*
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * sw_cmp.c
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe */
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweextern int sw_cmp(zone_dochandle_t l_handle, zone_dochandle_t s_handle,
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe uint_t flag);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#endif /* _ZONEADM_H */
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe