diff options
author | K. Y. Srinivasan | 2014-02-16 11:34:30 -0800 |
---|---|---|
committer | Greg Kroah-Hartman | 2014-02-18 10:53:48 -0800 |
commit | 01325476d6e46185031be4a9bc6443832dbc807c (patch) | |
tree | 0c173657fa89e7612b7ccc643e3b443f2123189f /include/uapi | |
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')
-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 @@ #ifndef _UAPI_HYPERV_H #define _UAPI_HYPERV_H +#include <linux/uuid.h> + /* * Framework version for util services. */ @@ -94,6 +96,50 @@ struct hv_vss_msg { } __attribute__((packed)); /* + * Implementation of a host to guest copy facility. + */ + +#define FCOPY_VERSION_0 0 +#define FCOPY_CURRENT_VERSION FCOPY_VERSION_0 +#define W_MAX_PATH 260 + +enum hv_fcopy_op { + START_FILE_COPY = 0, + WRITE_TO_FILE, + COMPLETE_FCOPY, + CANCEL_FCOPY, +}; + +struct hv_fcopy_hdr { + __u32 operation; + uuid_le service_id0; /* currently unused */ + uuid_le service_id1; /* currently unused */ +} __attribute__((packed)); + +#define OVER_WRITE 0x1 +#define CREATE_PATH 0x2 + +struct hv_start_fcopy { + struct hv_fcopy_hdr hdr; + __u16 file_name[W_MAX_PATH]; + __u16 path_name[W_MAX_PATH]; + __u32 copy_flags; + __u64 file_size; +} __attribute__((packed)); + +/* + * The file is chunked into fragments. + */ +#define DATA_FRAGMENT (6 * 1024) + +struct hv_do_fcopy { + struct hv_fcopy_hdr hdr; + __u64 offset; + __u32 size; + __u8 data[DATA_FRAGMENT]; +}; + +/* * An implementation of HyperV key value pair (KVP) functionality for Linux. * * |