Skip to contentSkip to conversation

Drivers: hv: Implement the file copy service

PATCH Superseded K. Y. Srinivasan 1 participant 1 message Jan 14, 2014 Hyper-V/Azure core and drivers

v1 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 this version of the patch I have addressed comments from Olaf Hering <[email protected]> and Dan Carpenter <[email protected]>

---
 drivers/hv/Makefile        |    2 +-
 drivers/hv/hv_fcopy.c      |  422 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/hv/hv_util.c       |   10 +
 include/linux/hyperv.h     |   60 +++++++
 tools/hv/hv_fcopy_daemon.c |  173 ++++++++++++++++++
 5 files changed, 666 insertions(+), 1 deletions(-)
 create mode 100644 drivers/hv/hv_fcopy.c
 create mode 100644 tools/hv/hv_fcopy_daemon.c
drivers/hv/Makefile +1 -1
index 0a74b56..5e4dfa4 100644
@@ -5,4 +5,4 @@ obj-$(CONFIG_HYPERV_BALLOON)	+= hv_balloon.o
 hv_vmbus-y := vmbus_drv.o \
 		 hv.o connection.o channel.o \
 		 channel_mgmt.o ring_buffer.o
-hv_utils-y := hv_util.o hv_kvp.o hv_snapshot.o
+hv_utils-y := hv_util.o hv_kvp.o hv_snapshot.o hv_fcopy.o
drivers/hv/hv_fcopy.c new file +422 -0

422 lines not on this page · raw message

drivers/hv/hv_util.c +10 -0
index 62dfd246..efc5e83 100644
@@ -82,6 +82,12 @@ static struct hv_util_service util_vss = {
 	.util_deinit = hv_vss_deinit,
 };
 
+static struct hv_util_service util_fcopy = {
+	.util_cb = hv_fcopy_onchannelcallback,
+	.util_init = hv_fcopy_init,
+	.util_deinit = hv_fcopy_deinit,
+};
+
 static void perform_shutdown(struct work_struct *dummy)
 {
 	orderly_poweroff(true);
@@ -401,6 +407,10 @@ static const struct hv_vmbus_device_id id_table[] = {
 	{ HV_VSS_GUID,
 	  .driver_data = (unsigned long)&util_vss
 	},
+	/* File copy GUID */
+	{ HV_FCOPY_GUID,
+	  .driver_data = (unsigned long)&util_fcopy
+	},
 	{ },
 };
 
include/linux/hyperv.h +60 -0

84 lines not on this page · raw message

tools/hv/hv_fcopy_daemon.c new file +173 -0

173 lines not on this page · raw message

Signature · 1 line
1.7.4.1