RUMP_ETFS(3) | Library Functions Manual | RUMP_ETFS(3) |
int
rump_pub_etfs_register(const char *key, const char *hostpath, enum rump_etfs_type ftype);
int
rump_pub_etfs_register_withsize(const char *key, const char *hostpath, enum rump_etfs_type ftype, uint64_t begin, uint64_t size);
void
rump_boot_etfs_register(struct rump_boot_etfs *eb);
int
rump_pub_etfs_remove(const char *key);
The operation is based on registered key values which each map to a hostpath. A key must be an absolute path (i.e. begin with “/”). Multiple leading slashes are collapsed to one (i.e. “/key” is the same as “//key”). The rest of the path, including slashes, is compared verbatim (i.e. “/key/path” does not match “/key//path”).
The hostpath is interpreted in host system context for the current working directory and can be either absolute or relative.
The key is accessible from all rump kernel clients, both local and remote. Note, the keys are not be visible via readdir, so you will not see them in directory listings.
The 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:
The interfaces are:
To use rump_boot_etfs_register(), the client fills out eb. The layout of eb is as follows:
struct rump_boot_etfs { /* client initializes */ const char *eb_key; const char *eb_hostpath; enum rump_etfs_type eb_type; uint64_t eb_begin; uint64_t eb_size; /* rump kernel initializes */ struct rump_boot_etfs *_eb_next; int eb_status; };
All of the client fields must be initialized before the call. See rump_pub_etfs_register_withsize() for descriptions of the fields. After the function has been called, the client may not touch the structure memory or the pathname pointers. After rump_init() returns, the client may check the status of the registration from eb_status and free the structure. A value of -1 designates that the etfs registration was not performed, 0 designates success and a value larger than 0 designates an errno. The client must serialize calls to rump_boot_etfs_register().
rump_pub_etfs_register_withsize("/dev/harddisk", "disk.img", RUMP_ETFS_BLK, pp->p_offset << DEV_BSHIFT, pp->p_size << DEV_BSHIFT);
Make the host kernel module directory hierarchy available within the rump kernel.
rump_pub_etfs_register("/stand/i386/5.99.41", "/stand/i386/5.99.41", RUMP_ETFS_DIR_SUBDIRS);
June 13, 2014 | NetBSD 7.2 |