diff options
author | K. Y. Srinivasan <kys@microsoft.com> | 2014-02-16 14:34:30 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-18 13:53:48 -0500 |
commit | 01325476d6e46185031be4a9bc6443832dbc807c (patch) | |
tree | 0c173657fa89e7612b7ccc643e3b443f2123189f /include/uapi/linux/hyperv.h | |
parent | e0270addae23aef8401b1150cbca20b8fb373cd0 (diff) |
Drivers: hv: Implement the file copy service
Implement the file copy service for Linux guests on Hyper-V. This permits the
host to copy a file (over VMBUS) into the guest. This facility is part of
"guest integration services" supported on the Windows platform.
Here is a link that provides additional details on this functionality:
http://technet.microsoft.com/en-us/library/dn464282.aspx
In V1 version of the patch I have addressed comments from
Olaf Hering <olaf@aepfle.de> and Dan Carpenter <dan.carpenter@oracle.com>
In V2 version of this patch I did some minor cleanup (making some globals
static). In V4 version of the patch I have addressed all of Olaf's
most recent set of comments/concerns.
In V5 version of the patch I had addressed Greg's most recent comments.
I would like to thank Greg for suggesting that I use misc device; it has
significantly simplified the code.
In V6 version of the patch I have cleaned up error message based on Olaf's
comments. I have also rebased the patch based on the current tip.
In this version of the patch, I have addressed the latest comments from Greg.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/uapi/linux/hyperv.h')
-rw-r--r-- | include/uapi/linux/hyperv.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/include/uapi/linux/hyperv.h b/include/uapi/linux/hyperv.h index 1861f8e2ce2b..9beb7c991638 100644 --- a/include/uapi/linux/hyperv.h +++ b/include/uapi/linux/hyperv.h | |||
@@ -25,6 +25,8 @@ | |||
25 | #ifndef _UAPI_HYPERV_H | 25 | #ifndef _UAPI_HYPERV_H |
26 | #define _UAPI_HYPERV_H | 26 | #define _UAPI_HYPERV_H |
27 | 27 | ||
28 | #include <linux/uuid.h> | ||
29 | |||
28 | /* | 30 | /* |
29 | * Framework version for util services. | 31 | * Framework version for util services. |
30 | */ | 32 | */ |
@@ -94,6 +96,50 @@ struct hv_vss_msg { | |||
94 | } __attribute__((packed)); | 96 | } __attribute__((packed)); |
95 | 97 | ||
96 | /* | 98 | /* |
99 | * Implementation of a host to guest copy facility. | ||
100 | */ | ||
101 | |||
102 | #define FCOPY_VERSION_0 0 | ||
103 | #define FCOPY_CURRENT_VERSION FCOPY_VERSION_0 | ||
104 | #define W_MAX_PATH 260 | ||
105 | |||
106 | enum hv_fcopy_op { | ||
107 | START_FILE_COPY = 0, | ||
108 | WRITE_TO_FILE, | ||
109 | COMPLETE_FCOPY, | ||
110 | CANCEL_FCOPY, | ||
111 | }; | ||
112 | |||
113 | struct hv_fcopy_hdr { | ||
114 | __u32 operation; | ||
115 | uuid_le service_id0; /* currently unused */ | ||
116 | uuid_le service_id1; /* currently unused */ | ||
117 | } __attribute__((packed)); | ||
118 | |||
119 | #define OVER_WRITE 0x1 | ||
120 | #define CREATE_PATH 0x2 | ||
121 | |||
122 | struct hv_start_fcopy { | ||
123 | struct hv_fcopy_hdr hdr; | ||
124 | __u16 file_name[W_MAX_PATH]; | ||
125 | __u16 path_name[W_MAX_PATH]; | ||
126 | __u32 copy_flags; | ||
127 | __u64 file_size; | ||
128 | } __attribute__((packed)); | ||
129 | |||
130 | /* | ||
131 | * The file is chunked into fragments. | ||
132 | */ | ||
133 | #define DATA_FRAGMENT (6 * 1024) | ||
134 | |||
135 | struct hv_do_fcopy { | ||
136 | struct hv_fcopy_hdr hdr; | ||
137 | __u64 offset; | ||
138 | __u32 size; | ||
139 | __u8 data[DATA_FRAGMENT]; | ||
140 | }; | ||
141 | |||
142 | /* | ||
97 | * An implementation of HyperV key value pair (KVP) functionality for Linux. | 143 | * An implementation of HyperV key value pair (KVP) functionality for Linux. |
98 | * | 144 | * |
99 | * | 145 | * |