Jorgen Lundman
2009-Aug-17 00:45 UTC
[zfs-discuss] libzfs API: sharenfs, sharesmb, shareiscsi, $custom ?
Hello list, As the developer of software that exports data/shares like that of NFS and Samba. (HTTP/UPnP export, written in C) I am curious if the libzfs API is flexible enough for me to create my own file-system attributes, similar to that of "sharenfs" and obtain this information in my software. Perhaps something in the lines of: zfs -o shareupnp=on zpool1/media And I will modify my streamer software to do the necessary calls to obtain the file-systems set to export. Or are there other suggestions to achieve similar results? I could mirror "sharenfs" but I was under the impression that the API is flexible. The ultimate goal is to move away from static paths listed in the config file. Lund -- Jorgen Lundman | <lundman at lundman.net> Unix Administrator | +81 (0)3 -5456-2687 ext 1017 (work) Shibuya-ku, Tokyo | +81 (0)90-5578-8500 (cell) Japan | +81 (0)3 -3375-1767 (home)
Cyril Plisko
2009-Aug-17 05:22 UTC
[zfs-discuss] libzfs API: sharenfs, sharesmb, shareiscsi, $custom ?
Jorgen,> As the developer of software that exports data/shares like that of NFS and > Samba. (HTTP/UPnP export, written in C) I am curious if the libzfs API is > flexible enough for me to create my own file-system attributes, similar to > that of "sharenfs" and obtain this information in my software. > > Perhaps something in the lines of: > > ?zfs -o shareupnp=on zpool1/mediaZFS allows user-defined attributes to be set on datasets. So how about something like that: zfs set net.lundman:shareupnp=on rpool/export/ext> And I will modify my streamer software to do the necessary calls to obtain > the file-systems set to export. > > Or are there other suggestions to achieve similar results? I could mirror > "sharenfs" but I was under the impression that the API is flexible. The > ultimate goal is to move away from static paths listed in the config file.That''s a perfect use case for user-defined attributes -- Regards, Cyril
Ross
2009-Aug-17 07:31 UTC
[zfs-discuss] libzfs API: sharenfs, sharesmb, shareiscsi, $custom ?
Hi Jorgen, Does that software work to stream media to an xbox 360? If so could I have a play with it? It sounds ideal for my home server. cheers, Ross -- This message posted from opensolaris.org
Jorgen Lundman
2009-Aug-17 08:31 UTC
[zfs-discuss] libzfs API: sharenfs, sharesmb, shareiscsi, $custom ?
It is "llink", which was initially just HTTP streamer for Syabas/NetworkMediaTank, but I did just add UPnP, based on whtsup360 dumps. http://lundman.net/wiki/index.php/Llink You are welcome to try the latest development sources and test, but I believe the current state is that it shows up on 360, but does not browse. However, llink just shares content, no transcoding. At least not yet. Regarding the original question; It seems that it is easy to add own attributes, I will peruse the API documentation detailing how I would iterate file-systems looking for my attribute, since I would rather not system("zfs") hack it. Lund Ross wrote:> Hi Jorgen, > > Does that software work to stream media to an xbox 360? If so could I have a play with it? It sounds ideal for my home server. > > cheers, > > Ross-- Jorgen Lundman | <lundman at lundman.net> Unix Administrator | +81 (0)3 -5456-2687 ext 1017 (work) Shibuya-ku, Tokyo | +81 (0)90-5578-8500 (cell) Japan | +81 (0)3 -3375-1767 (home)
Jorgen Lundman
2009-Aug-18 05:12 UTC
[zfs-discuss] libzfs API: sharenfs, sharesmb, shareiscsi, $custom ?
I cheated and simply use system() for the time being, but I will say that was rather nice and easy. Thank you Sun and OpenSolaris people. llink.conf: # If you use ZFS, you can auto-export any filesystem with a certain attribute set. # For example: zfs set net.lundman:sharellink=on zpool1/media ROOT|ZFS=net.lundman:sharellink|PATH=/usr/sbin/zfs @root.c debugf(" : looking for ZFS filesystems\n"); snprintf(buffer, sizeof(buffer), "%s list -H -o mountpoint,%s", path, zfs); spawn = lion_system(buffer, 0, LION_FLAG_FULFILL, zfs); if (spawn) lion_set_handler(spawn, root_zfs_handler); # zfs set net.lundman:sharellink=on zpool1/media # ./llink -d -v 32 ./llink - Jorgen Lundman v2.2.1 lundman at shinken.interq.or.jp build 1451 (Tue Aug 18 14:02:44 2009) (libdvdnav). : looking for ZFS filesystems : [root] recognising ''xtrailers'' : zfs command running : zfs adding ''/zpool1/media'' : [root] recognising ''/zpool1/media'' : zfs command finished. [main] ready! -- Jorgen Lundman | <lundman at lundman.net> Unix Administrator | +81 (0)3 -5456-2687 ext 1017 (work) Shibuya-ku, Tokyo | +81 (0)90-5578-8500 (cell) Japan | +81 (0)3 -3375-1767 (home)