Skip to content

Commit

Permalink
Merge pull request #268 from truenas/NAS-128849
Browse files Browse the repository at this point in the history
NAS-128849 / 13.3 / zpool_add API changed in upstream zfs
  • Loading branch information
amotin authored May 8, 2024
2 parents 17e9728 + f6ad090 commit 4d6ac13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions libzfs.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3181,13 +3181,14 @@ cdef class ZFSPool(object):
hopts = self.root.generate_history_opts(fsopts, '-o')
self.root.write_history('zfs create', hopts, name)

def attach_vdevs(self, vdevs_tree):
def attach_vdevs(self, vdevs_tree, check_ashift=0):
cdef const char *command = 'zpool add'
cdef ZFSVdev vd = self.root.make_vdev_tree(vdevs_tree, {'ashift': self.properties['ashift'].parsed})
cdef int ret
cdef boolean_t ashift = check_ashift

with nogil:
ret = libzfs.zpool_add(self.handle, vd.nvlist.handle)
ret = libzfs.zpool_add(self.handle, vd.nvlist.handle, ashift)

if ret != 0:
raise self.root.get_error()
Expand Down
2 changes: 1 addition & 1 deletion pxd/libzfs.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ cdef extern from "libzfs.h" nogil:
extern int zpool_create(libzfs_handle_t *, const char *, nvpair.nvlist_t *,
nvpair.nvlist_t *, nvpair.nvlist_t *)
extern int zpool_destroy(zpool_handle_t *, const char *)
extern int zpool_add(zpool_handle_t *, nvpair.nvlist_t *)
extern int zpool_add(zpool_handle_t *, nvpair.nvlist_t *, boolean_t)

IF HAVE_ZPOOL_SCAN == 3:
extern int zpool_scan(zpool_handle_t *, zfs.pool_scan_func_t, zfs.pool_scrub_cmd_t)
Expand Down

0 comments on commit 4d6ac13

Please sign in to comment.