Module Name: src Committed By: pooka Date: Tue Nov 30 17:32:29 UTC 2010
Modified Files: src/distrib/sets/lists/comp: mi src/lib/librumpvfs: Makefile Added Files: src/lib/librumpvfs: rump_etfs.3 Log Message: document rump_etfs To generate a diff of this commit: cvs rdiff -u -r1.1526 -r1.1527 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.2 -r1.3 src/lib/librumpvfs/Makefile cvs rdiff -u -r0 -r1.1 src/lib/librumpvfs/rump_etfs.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.1526 src/distrib/sets/lists/comp/mi:1.1527 --- src/distrib/sets/lists/comp/mi:1.1526 Mon Nov 22 22:20:26 2010 +++ src/distrib/sets/lists/comp/mi Tue Nov 30 17:32:28 2010 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1526 2010/11/22 22:20:26 pooka Exp $ +# $NetBSD: mi,v 1.1527 2010/11/30 17:32:28 pooka Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -7916,6 +7916,7 @@ ./usr/share/man/cat3/rresvport_af.0 comp-c-catman .cat ./usr/share/man/cat3/rsa.0 comp-obsolete obsolete ./usr/share/man/cat3/rump.0 comp-c-catman .cat +./usr/share/man/cat3/rump_etfs.0 comp-c-catman .cat ./usr/share/man/cat3/rump_lwproc.0 comp-c-catman .cat ./usr/share/man/cat3/rumpuser.0 comp-c-catman .cat ./usr/share/man/cat3/ruserok.0 comp-c-catman .cat @@ -13819,6 +13820,7 @@ ./usr/share/man/html3/rresvport.html comp-c-htmlman html ./usr/share/man/html3/rresvport_af.html comp-c-htmlman html ./usr/share/man/html3/rump.html comp-c-htmlman html +./usr/share/man/html3/rump_etfs.html comp-c-htmlman html ./usr/share/man/html3/rump_lwproc.html comp-c-htmlman html ./usr/share/man/html3/rumpuser.html comp-c-htmlman html ./usr/share/man/html3/ruserok.html comp-c-htmlman html @@ -19730,6 +19732,7 @@ ./usr/share/man/man3/rresvport_af.3 comp-c-man .man ./usr/share/man/man3/rsa.3 comp-obsolete obsolete ./usr/share/man/man3/rump.3 comp-c-man .man +./usr/share/man/man3/rump_etfs.3 comp-c-man .man ./usr/share/man/man3/rump_lwproc.3 comp-c-man .man ./usr/share/man/man3/rumpuser.3 comp-c-man .man ./usr/share/man/man3/ruserok.3 comp-c-man .man Index: src/lib/librumpvfs/Makefile diff -u src/lib/librumpvfs/Makefile:1.2 src/lib/librumpvfs/Makefile:1.3 --- src/lib/librumpvfs/Makefile:1.2 Thu Feb 12 13:20:17 2009 +++ src/lib/librumpvfs/Makefile Tue Nov 30 17:32:29 2010 @@ -1,9 +1,10 @@ -# $NetBSD: Makefile,v 1.2 2009/02/12 13:20:17 lukem Exp $ +# $NetBSD: Makefile,v 1.3 2010/11/30 17:32:29 pooka Exp $ # RUMPTOP= ${.CURDIR}/../../sys/rump LIBDPLIBS+= rump ${.CURDIR}/../librump +MAN= rump_etfs.3 WARNS= 3 # XXX: kernel isn't ready for -Wsign-compare Added files: Index: src/lib/librumpvfs/rump_etfs.3 diff -u /dev/null src/lib/librumpvfs/rump_etfs.3:1.1 --- /dev/null Tue Nov 30 17:32:29 2010 +++ src/lib/librumpvfs/rump_etfs.3 Tue Nov 30 17:32:29 2010 @@ -0,0 +1,143 @@ +.\" $NetBSD: rump_etfs.3,v 1.1 2010/11/30 17:32:29 pooka Exp $ +.\" +.\" Copyright (c) 2010 Antti Kantee. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd November 30, 2010 +.Dt RUMP_ETFS 3 +.Os +.Sh NAME +.Nm rump_etfs +.Nd rump host file system interface +.Sh LIBRARY +rump kernel (librump, \-lrump) +.Sh SYNOPSIS +.In rump/rump.h +.Ft int +.Fo etfs_register +.Fa "const char *key" "const char *hostpath" "enum rump_etfs_type ftype" +.Fc +.Ft int +.Fo etfs_register_withsize +.Fa "const char *key" "const char *hostpath" "enum rump_etfs_type ftype" +.Fa "uint64_t begin" "uint64_t end" +.Fc +.Ft int +.Fn etfs_remove "const char *key" +.Sh DESCRIPTION +The rump ExtraTerrestrial File System +.Nm ( ) +is used to provide access to the host file system namespace +within a rump kernel. +.Pp +The operation is based on registered +.Fa key +values which each map to a +.Fa hostpath . +A key must be an absolute path (i.e. begin with +.Dq / ) . +Multiple leading slashes are collapsed to one (i.e. +.Dq /key +is the same as +.Dq //key ) . +The rest of the path, including slashes, is compared verbatim (i.e. +.Dq /key/path +does not match +.Dq /key//path ) . +.Pp +The +.Fa hostpath +is interpreted in host system context for the current working directory +and can be either absolute or relative. +.Pp +The +.Fa ftype +parameter specifies how etfs file will be presented and does not +have to match the host type, although some limitations apply. +Possible values are: +.Bl -tag -width RUMP_ETFS_DIR_SUBDIRSXXX +.It Dv RUMP_ETFS_REG +regular file +.It Dv RUMP_ETFS_BLK +block device. +This is often used when mapping file system images. +.It Dv RUMP_ETFS_CHR +character device +.It Dv RUMP_ETFS_DIR +directory. +This option is valid only when +.Fa hostpath +is a directory. +The immediate children of the host directory will be accessible +inside a rump kernel. +.It Dv RUMP_ETFS_DIR_SUBDIRS +directory. +This option is valid only when +.Fa hostpath +is a directory. +This option recursively applies to all subdirectories, and allows +a rump kernel to access an entire directory tree. +.El +.Pp +The interfaces are: +.Bl -tag -width xxxx +.It Fn etfs_register "key" "hostpath" "ftype" +Map +.Fa key +to a file of type +.Fa ftype +with the contents of +.Fa hostpath . +.It Fn etfs_register_withsize "key" "hostpath" "ftype" "begin" "size" +Like the above, but map only +.Fa [ begin , begin+size ] +from +.Fa hostpath . +This is useful when mapping disk images where only one partition is +relevant to the application. +.It Fn etfs_remove "key" +Remove etfs mapping for +.Fa key . +This routine may be called only if the file related to the mapping +is not in use. +.Sh EXAMPLES +Map a host image file to a mountable /dev/harddisk path using +window offsets from the disklabel. +.Bd -literal -offset indent +rump_etfs_register_withsize("/dev/harddisk", "disk.img", + RUMP_ETFS_BLK, + pp->p_offset << DEV_BSHIFT, pp->p_size << DEV_BSHIFT); +.Ed +.Pp +Make the host kernel module directory hierarchy available within the +rump kernel. +.Bd -literal -offset indent +rump_etfs_register("/stand/i386/5.99.41", + "/stand/i386/5.99.41", RUMP_ETFS_DIR_SUBDIRS); +.Ed +.Sh SEE ALSO +.Xr rump 3 +.Sh HISTORY +.Nm +first appeared in +.Nx 6.0 .