On all things GUI!

Developer discussions about the GUI.

Re: pool (terminology)

Postby ilovezfs » Sun Feb 22, 2015 2:38 am

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
ilovezfs
 
Posts: 232
Joined: Thu Mar 06, 2014 7:58 am

Re: On all things GUI!

Postby lundman » Sun Feb 22, 2015 5:29 pm

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.
User avatar
lundman
 
Posts: 1334
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: On all things GUI!

Postby AlexWasserman » Sun Feb 22, 2015 11:03 pm

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.
AlexWasserman
 
Posts: 11
Joined: Sat Mar 29, 2014 3:40 pm

Re: On all things GUI!

Postby lundman » Mon Feb 23, 2015 2:47 am

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.
User avatar
lundman
 
Posts: 1334
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: pool (terminology)

Postby armdn » Thu Feb 26, 2015 8:38 pm

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! :)
armdn
 
Posts: 11
Joined: Mon Mar 24, 2014 9:05 am

Re: On all things GUI!

Postby realfolkblues12 » Tue Mar 10, 2015 11:17 pm

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?
realfolkblues12
 
Posts: 34
Joined: Thu Feb 12, 2015 10:41 pm

Re: On all things GUI!

Postby armdn » Tue Mar 24, 2015 6:47 am

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.
Last edited by armdn on Thu Aug 11, 2016 5:40 am, edited 1 time in total.
armdn
 
Posts: 11
Joined: Mon Mar 24, 2014 9:05 am

Re: On all things GUI!

Postby max » Thu Sep 03, 2015 8:38 am

can anyone send the link to the github page please :D
max
 
Posts: 1
Joined: Thu Sep 03, 2015 8:33 am

Re: On all things GUI!

Postby armdn » Thu Aug 11, 2016 5:31 am

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.
armdn
 
Posts: 11
Joined: Mon Mar 24, 2014 9:05 am

Previous

Return to GUI Development

Who is online

Users browsing this forum: No registered users and 2 guests