summary refs log tree commit diff stats
path: root/fsdev
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-03-08 12:38:43 +0000
committerPeter Maydell <peter.maydell@linaro.org>2014-03-08 12:38:43 +0000
commitf53f3d0a00b6df39ce8dfca942608e5b6a9a4f71 (patch)
tree1fda6a6482b69da84db90e151c3250a7fd9c7482 /fsdev
parentd7c698af8a5c7330a5ba70de0ff70904a661c20e (diff)
parent993c91a0e996346c7ee8fa2ca310cc76edb59e17 (diff)
downloadfocaccia-qemu-f53f3d0a00b6df39ce8dfca942608e5b6a9a4f71.tar.gz
focaccia-qemu-f53f3d0a00b6df39ce8dfca942608e5b6a9a4f71.zip
Merge remote-tracking branch 'remotes/kvaneesh/for-upstream' into staging
* remotes/kvaneesh/for-upstream:
  hw/9pfs: Include virtio-9p-device.o in build
  hw/9pfs: use g_strdup_printf() instead of PATH_MAX limitation
  hw/9pfs/virtio-9p-local.c: use snprintf() instead of sprintf()
  hw/9pfs/virtio-9p-local.c: move v9fs_string_free() to below "err_out:"
  fsdev: Fix overrun after readlink() fills buffer completely

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'fsdev')
-rw-r--r--fsdev/Makefile.objs4
-rw-r--r--fsdev/virtfs-proxy-helper.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/fsdev/Makefile.objs b/fsdev/Makefile.objs
index 206289c49f..c27dad3f6d 100644
--- a/fsdev/Makefile.objs
+++ b/fsdev/Makefile.objs
@@ -1,4 +1,6 @@
-ifeq ($(CONFIG_REALLY_VIRTFS),y)
+ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy)
+# Lots of the fsdev/9pcode is pulled in by vl.c via qemu_fsdev_add.
+# only pull in the actual virtio-9p device if we also enabled virtio.
 common-obj-y = qemu-fsdev.o virtio-9p-marshal.o
 else
 common-obj-y = qemu-fsdev-dummy.o
diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c
index 713a7b2b87..bfecb8706c 100644
--- a/fsdev/virtfs-proxy-helper.c
+++ b/fsdev/virtfs-proxy-helper.c
@@ -595,7 +595,7 @@ static int do_readlink(struct iovec *iovec, struct iovec *out_iovec)
     }
     buffer = g_malloc(size);
     v9fs_string_init(&target);
-    retval = readlink(path.data, buffer, size);
+    retval = readlink(path.data, buffer, size - 1);
     if (retval > 0) {
         buffer[retval] = '\0';
         v9fs_string_sprintf(&target, "%s", buffer);