zfs
  1. zfs
  2. ZFS-1

zfs_prop_get() implementation.

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Sun

    • Issuezilla Id:
      1

      Description

      I'd like to get the system property method zfs_prop_get() working ... I've tried
      a few things, but no luck, not familiar enough with jna ... Can you take a look
      at this implementing this method in your library ? here's what I've tried:

      in libzfs.java, I changed the definition to:
      int zfs_prop_get(zfs_handle_t handle, int prop, Pointer _4, int cbSize,
      /zprop_source_t */ IntByReference _5, char[] _6, NativeLong _7, boolean _8);

      And have been experimenting with permutations of the following to retrieve a
      user property:

      in main():
      /* arg is the zfs filesystem name */
      for (String arg: args ) {
      LibZFS zfs = new LibZFS();
      ZFSObject fs = zfs.open(arg);
      zfs_handle_t handle = LIBZFS.zfs_open(zfs.getHandle(), arg,
      zfs_type_t.DATASET);

      System.out.println("Request system prop");
      Memory propbuf = new Memory(libzfs.ZFS_MAXPROPLEN);
      String propstr = null;
      char[] buf = null;
      IntByReference ibr = null;
      for (int i=0; i < 20; i++) {
      int ret = LIBZFS.zfs_prop_get(handle, i, propbuf,
      libzfs.ZFS_MAXPROPLEN, ibr, buf, new NativeLong(0), true);
      if ( ret != 0 )

      { propstr = "-"; }

      else

      { propstr = String.valueOf(propbuf.getCharArray(0,libzfs.ZFS_MAXPROPLEN)); }

      System.out.println(i+" = "+propstr);

      Do you have any suggestions ?

      Thanks,
      Jay

        Activity

        jd22761 created issue -
        kenaiadmin made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 1 78827

          People

          • Assignee:
            zfs-issues
            Reporter:
            jd22761
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: