summaryrefslogtreecommitdiffstats
path: root/include/linux/hyperv.h
diff options
context:
space:
mode:
authorK. Y. Srinivasan <kys@microsoft.com>2013-03-15 15:30:06 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-15 15:12:36 -0400
commit96dd86fa588169b745a71aedf2070e80f4943623 (patch)
tree3affd55b169f7c3030b5ecb1d4caf700d31b28c2 /include/linux/hyperv.h
parentc87059793dd02390b504b0292bdb024ffd68b822 (diff)
Drivers: hv: Add a new driver to support host initiated backup
This driver supports host initiated backup of the guest. On Windows guests, the host can generate application consistent backups using the Windows VSS framework. On Linux, we ensure that the backup will be file system consistent. This driver allows the host to initiate a "Freeze" operation on all the mounted file systems in the guest. Once the mounted file systems in the guest are frozen, the host snapshots the guest's file systems. Once this is done, the guest's file systems are "thawed". This driver has a user-level component (daemon) that invokes the appropriate operation on all the mounted file systems in response to the requests from the host. The duration for which the guest is frozen is very short - a few seconds. During this interval, the diff disk is comitted. In this version of the patch I have addressed the feedback from Olaf Herring. Also, some of the connector related issues have been fixed. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Cc: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/hyperv.h')
-rw-r--r--include/linux/hyperv.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index df77ba9a8166..95d0850584da 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -27,6 +27,63 @@
27 27
28#include <linux/types.h> 28#include <linux/types.h>
29 29
30
31/*
32 * Implementation of host controlled snapshot of the guest.
33 */
34
35#define VSS_OP_REGISTER 128
36
37enum hv_vss_op {
38 VSS_OP_CREATE = 0,
39 VSS_OP_DELETE,
40 VSS_OP_HOT_BACKUP,
41 VSS_OP_GET_DM_INFO,
42 VSS_OP_BU_COMPLETE,
43 /*
44 * Following operations are only supported with IC version >= 5.0
45 */
46 VSS_OP_FREEZE, /* Freeze the file systems in the VM */
47 VSS_OP_THAW, /* Unfreeze the file systems */
48 VSS_OP_AUTO_RECOVER,
49 VSS_OP_COUNT /* Number of operations, must be last */
50};
51
52
53/*
54 * Header for all VSS messages.
55 */
56struct hv_vss_hdr {
57 __u8 operation;
58 __u8 reserved[7];
59} __attribute__((packed));
60
61
62/*
63 * Flag values for the hv_vss_check_feature. Linux supports only
64 * one value.
65 */
66#define VSS_HBU_NO_AUTO_RECOVERY 0x00000005
67
68struct hv_vss_check_feature {
69 __u32 flags;
70} __attribute__((packed));
71
72struct hv_vss_check_dm_info {
73 __u32 flags;
74} __attribute__((packed));
75
76struct hv_vss_msg {
77 union {
78 struct hv_vss_hdr vss_hdr;
79 int error;
80 };
81 union {
82 struct hv_vss_check_feature vss_cf;
83 struct hv_vss_check_dm_info dm_info;
84 };
85} __attribute__((packed));
86
30/* 87/*
31 * An implementation of HyperV key value pair (KVP) functionality for Linux. 88 * An implementation of HyperV key value pair (KVP) functionality for Linux.
32 * 89 *
@@ -1253,6 +1310,14 @@ void vmbus_driver_unregister(struct hv_driver *hv_driver);
1253 } 1310 }
1254 1311
1255/* 1312/*
1313 * VSS (Backup/Restore) GUID
1314 */
1315#define HV_VSS_GUID \
1316 .guid = { \
1317 0x29, 0x2e, 0xfa, 0x35, 0x23, 0xea, 0x36, 0x42, \
1318 0x96, 0xae, 0x3a, 0x6e, 0xba, 0xcb, 0xa4, 0x40 \
1319 }
1320/*
1256 * Common header for Hyper-V ICs 1321 * Common header for Hyper-V ICs
1257 */ 1322 */
1258 1323
@@ -1356,6 +1421,10 @@ int hv_kvp_init(struct hv_util_service *);
1356void hv_kvp_deinit(void); 1421void hv_kvp_deinit(void);
1357void hv_kvp_onchannelcallback(void *); 1422void hv_kvp_onchannelcallback(void *);
1358 1423
1424int hv_vss_init(struct hv_util_service *);
1425void hv_vss_deinit(void);
1426void hv_vss_onchannelcallback(void *);
1427
1359/* 1428/*
1360 * Negotiated version with the Host. 1429 * Negotiated version with the Host.
1361 */ 1430 */