Re: Need some help with the RBD Java bindings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 15, 2013 at 8:51 AM, Wido den Hollander <wido@xxxxxxxx> wrote:
>
> public List<RbdSnapInfo> snapList() throws RbdException {
>     IntByReference numSnaps = new IntByReference(16);
>     PointerByReference snaps = new PointerByReference();
>     List<RbdSnapInfo> list = new ArrayList<RbdSnapInfo>();
>     RbdSnapInfo snapInfo, snapInfos[];
>
>     while (true) {
>         int r = rbd.rbd_snap_list(this.getPointer(), snaps, numSnaps);

I think you need to allocate the memory for `snaps` yourself. Here is
the RBD wrapper for Python which does that:

  self.snaps = (rbd_snap_info_t * num_snaps.value)()
  ret = self.librbd.rbd_snap_list(image.image, byref(self.snaps),
                       byref(num_snaps))

- Noah
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux