Page 3 of 3

Re: pool (terminology)

PostPosted: Sun Feb 22, 2015 2:38 am
by ilovezfs
gperrin wrote:A minor point, terminology.

Create zpool… should be Create pool…

– and so on (zpool is used for creation; not the result of creation).

Quoting from the zpool man page:
Do not add a disk that is currently configured as a quorum device to a zpool.

https://github.com/illumos/illumos-gate ... ol.1m#L931

So perhaps that should be corrected.

Also, https://www.google.com/search?q=site%3A ... %22a+zpool

Re: On all things GUI!

PostPosted: Sun Feb 22, 2015 5:29 pm
by lundman
ObjC can call C directly if I understand the situation, so in theory something along this lines of:

Code: Select all
#include "include/libzfs.h"

/* Global, just initialised once per app */
  libzfs_handle_t *g_zfs;

 if ((g_zfs = libzfs_init()) == NULL)
                return (1);

/* Open a pool */
  zpool_handle_t *zhp;
  zhp = zpool_open(g_zfs, poolname);

/* Get status */
  zpool_get_state(zhp);

  zpool_close(zhp);

/* Program quitting */
   libzfs_fini(g_zfs);


You'd have to do something with "zpool_get_state()" I think it just fills in properties you can look up, I've not checked. cmd/zpool/ has code using it.

Re: On all things GUI!

PostPosted: Sun Feb 22, 2015 11:03 pm
by AlexWasserman
Hmm, looks like the biggest issue is getting the lib sourced in. Seems to drag in zfs, which needs zpl, which drags in the kernel libs, then blows up Xcode.

Must have something wrong, as shouldn't need every library in zfs and spl to implement a call like that.

Re: On all things GUI!

PostPosted: Mon Feb 23, 2015 2:47 am
by lundman
I wouldn't drag in the sources, just add libzfs as a link target, and keep the building separate, first build zfs to get library (or use the one shipped with it) and then build yours, using just headers, and linking against libzfs.

Re: pool (terminology)

PostPosted: Thu Feb 26, 2015 8:38 pm
by armdn
gperrin wrote:A minor point, terminology.

Create zpool… should be Create pool…

– and so on (zpool is used for creation; not the result of creation).


Thanks! :)

Re: On all things GUI!

PostPosted: Tue Mar 10, 2015 11:17 pm
by realfolkblues12
armdn wrote:Im also started to create OpenZFS fronted GUI, but things get slowly, Xcode 6 is a little pain for me :D :
Снимок экрана 2015-02-13 в 21.33.56.png


Compatability is planned 10.7+ (but if everything goes normally, there is also may be a PowerPC version for 10.5 with MacZFS).


Any progress on this? I would be interested in it. Is it on github?

Re: On all things GUI!

PostPosted: Tue Mar 24, 2015 6:47 am
by armdn
Yes, it is on progress, but slow. I maded some interface enhancements and rebuildings, but I'm sitting on documentation now for this utility. I realized that keeping everything in head is too much for me... :D

Image

After i write full documentation (Russian and English), will upload everything to github to start it more widely.

Re: On all things GUI!

PostPosted: Thu Sep 03, 2015 8:38 am
by max
can anyone send the link to the github page please :D

Re: On all things GUI!

PostPosted: Thu Aug 11, 2016 5:31 am
by armdn
Well, hello again.
Im still there, and i'm working on it. Main language i chosen is Swift. Also i used for a help SwiftShell framework. Everything is good to go, i can now monitor status of pools, etc.. but faced a problems with escalating privileges for executing commands that requires "root". The code in Xcode itself could completely working, but outside of Xcode (for example, in builded app) this does not work. Here is the example from playground:

Code: Select all
 import Cocoa
import SwiftShell

let exprtPools: String = run(bash: "sudo /usr/local/bin/zpool export -a")

print(exprtPools, terminator: "")


As you can see, this is a simple code that uses SwiftShell for exporting all available pools. Works in playground, not in app.
So i have a lot of work to do with that...

If someone knows how to gain system administrator privileges in swift, i would appreciate that.

Sorry for my english if it bad.

P.S.: For a GitHub lovers - i segmented full project on a separate apps for development and debugging every function of featured OpenZFS Utility, so github would'n be a good place for a tons of separate projects. If someone want to join, pm me, or write there.