Skip to content

Commit

Permalink
block: add native support for NFS
Browse files Browse the repository at this point in the history
This patch adds native support for accessing images on NFS
shares without the requirement to actually mount the entire
NFS share on the host.

NFS Images can simply be specified by an url of the form:
nfs://<host>/<export>/<filename>[?param=value[&param2=value2[&...]]]

For example:
qemu-img create -f qcow2 nfs://10.0.0.1/qemu-images/test.qcow2

You need LibNFS from Ronnie Sahlberg available at:
   git://github.com/sahlberg/libnfs.git
for this to work.

During configure it is automatically probed for libnfs and support
is enabled on-the-fly. You can forbid or enforce libnfs support
with --disable-libnfs or --enable-libnfs respectively.

Due to NFS restrictions you might need to execute your binaries
as root, allow them to open priviledged ports (<1024) or specify
insecure option on the NFS server.

For additional information on ROOT vs. non-ROOT operation and URL
format + parameters see:
   https://raw.github.com/sahlberg/libnfs/master/README

Supported by qemu are the uid, gid and tcp-syncnt URL parameters.

LibNFS currently support NFS version 3 only.

Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
plieven authored and kevmw committed Feb 9, 2014
1 parent f510620 commit 6542aa9
Show file tree
Hide file tree
Showing 5 changed files with 472 additions and 0 deletions.
5 changes: 5 additions & 0 deletions MAINTAINERS
Expand Up @@ -937,6 +937,11 @@ M: Peter Lieven <pl@kamp.de>
S: Supported
F: block/iscsi.c

NFS
M: Peter Lieven <pl@kamp.de>
S: Maintained
F: block/nfs.c

SSH
M: Richard W.M. Jones <rjones@redhat.com>
S: Supported
Expand Down
1 change: 1 addition & 0 deletions block/Makefile.objs
Expand Up @@ -12,6 +12,7 @@ block-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
ifeq ($(CONFIG_POSIX),y)
block-obj-y += nbd.o nbd-client.o sheepdog.o
block-obj-$(CONFIG_LIBISCSI) += iscsi.o
block-obj-$(CONFIG_LIBNFS) += nfs.o
block-obj-$(CONFIG_CURL) += curl.o
block-obj-$(CONFIG_RBD) += rbd.o
block-obj-$(CONFIG_GLUSTERFS) += gluster.o
Expand Down

0 comments on commit 6542aa9

Please sign in to comment.