xref: /freebsd/sys/dev/hyperv/utilities/hv_snapshot.h (revision 168fce73b59d6023cab45d063a452551a1f2103e)
1*168fce73SSepherosa Ziehau /*-
2*168fce73SSepherosa Ziehau  * Copyright (c) 2016 Microsoft Corp.
3*168fce73SSepherosa Ziehau  * All rights reserved.
4*168fce73SSepherosa Ziehau  *
5*168fce73SSepherosa Ziehau  * Redistribution and use in source and binary forms, with or without
6*168fce73SSepherosa Ziehau  * modification, are permitted provided that the following conditions
7*168fce73SSepherosa Ziehau  * are met:
8*168fce73SSepherosa Ziehau  * 1. Redistributions of source code must retain the above copyright
9*168fce73SSepherosa Ziehau  *    notice unmodified, this list of conditions, and the following
10*168fce73SSepherosa Ziehau  *    disclaimer.
11*168fce73SSepherosa Ziehau  * 2. Redistributions in binary form must reproduce the above copyright
12*168fce73SSepherosa Ziehau  *    notice, this list of conditions and the following disclaimer in the
13*168fce73SSepherosa Ziehau  *    documentation and/or other materials provided with the distribution.
14*168fce73SSepherosa Ziehau  *
15*168fce73SSepherosa Ziehau  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16*168fce73SSepherosa Ziehau  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17*168fce73SSepherosa Ziehau  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18*168fce73SSepherosa Ziehau  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19*168fce73SSepherosa Ziehau  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20*168fce73SSepherosa Ziehau  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21*168fce73SSepherosa Ziehau  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22*168fce73SSepherosa Ziehau  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23*168fce73SSepherosa Ziehau  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24*168fce73SSepherosa Ziehau  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*168fce73SSepherosa Ziehau  *
26*168fce73SSepherosa Ziehau  * $FreeBSD$
27*168fce73SSepherosa Ziehau  */
28*168fce73SSepherosa Ziehau 
29*168fce73SSepherosa Ziehau #ifndef _VSS_H
30*168fce73SSepherosa Ziehau #define _VSS_H
31*168fce73SSepherosa Ziehau #include <sys/ioccom.h>
32*168fce73SSepherosa Ziehau #define FS_VSS_DEV_NAME		"hv_fsvss_dev"
33*168fce73SSepherosa Ziehau #define APP_VSS_DEV_NAME	"hv_appvss_dev"
34*168fce73SSepherosa Ziehau 
35*168fce73SSepherosa Ziehau #define VSS_DEV(VSS)		"/dev/"VSS
36*168fce73SSepherosa Ziehau 
37*168fce73SSepherosa Ziehau #define VSS_SUCCESS		0x00000000
38*168fce73SSepherosa Ziehau #define VSS_FAIL		0x00000001
39*168fce73SSepherosa Ziehau 
40*168fce73SSepherosa Ziehau enum hv_vss_op_t {
41*168fce73SSepherosa Ziehau 	HV_VSS_NONE = 0,
42*168fce73SSepherosa Ziehau 	HV_VSS_CHECK,
43*168fce73SSepherosa Ziehau 	HV_VSS_FREEZE,
44*168fce73SSepherosa Ziehau 	HV_VSS_THAW,
45*168fce73SSepherosa Ziehau 	HV_VSS_COUNT
46*168fce73SSepherosa Ziehau };
47*168fce73SSepherosa Ziehau 
48*168fce73SSepherosa Ziehau struct hv_vss_opt_msg {
49*168fce73SSepherosa Ziehau 	uint32_t	opt;		/* operation */
50*168fce73SSepherosa Ziehau 	uint32_t	status;		/* 0 for success, 1 for error */
51*168fce73SSepherosa Ziehau 	uint64_t	msgid;		/* an ID used to identify the transaction */
52*168fce73SSepherosa Ziehau 	uint8_t		reserved[48];	/* reserved values are all zeroes */
53*168fce73SSepherosa Ziehau };
54*168fce73SSepherosa Ziehau #define IOCHVVSSREAD		_IOR('v', 2, struct hv_vss_opt_msg)
55*168fce73SSepherosa Ziehau #define IOCHVVSSWRITE		_IOW('v', 3, struct hv_vss_opt_msg)
56*168fce73SSepherosa Ziehau #endif
57