Skip to contentSkip to conversation

Drivers: hv: Implement the file copy service

PATCH Superseded K. Y. Srinivasan 2 participants 2 messages Feb 9, 2014 – Feb 12, 2014 Hyper-V/Azure core and drivers

v5 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

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

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 this version of the patch I have 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.

---
 drivers/hv/Makefile        |    2 +-
 drivers/hv/hv_fcopy.c      |  388 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/hv/hv_util.c       |   10 ++
 include/linux/hyperv.h     |   61 +++++++
 tools/hv/hv_fcopy_daemon.c |  195 ++++++++++++++++++++++
 5 files changed, 655 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 +388 -0

388 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 +61 -0

85 lines not on this page · raw message

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

195 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#1 lore raw

tools/hv/hv_fcopy_daemon.c line 145

Quoted 4 lines · K. Y. Srinivasan
tools/hv/hv_fcopy_daemon.c new file +4 -0
+	fcopy_fd = open("/dev/vmbus/hv_fcopy", O_RDWR);
+
+	if (fcopy_fd < 0) {
+		syslog(LOG_ERR, "open /dev/hv_fcopy failed; error: %d %s",

The error message mentions the old path.

Olaf