aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/pyzfs
diff options
context:
space:
mode:
authorAndriy Gapon <[email protected]>2018-06-28 00:37:54 +0300
committerBrian Behlendorf <[email protected]>2018-12-14 09:49:45 -0800
commitdc1c630b8abf2db4ce78b583b441bd0c74f42936 (patch)
tree99b6a2915f304ad28532346c37190bcebfe7bc28 /contrib/pyzfs
parenteff7d78f8a1e2c8c8a151b99ee7e66ad619b201c (diff)
OpenZFS 9630 - add lzc_rename and lzc_destroy to libzfs_core
Porting Notes: * Additional changes to recv_rename_impl() were required due to encryption code not being merged in OpenZFS yet. * libzfs_core python bindings (pyzfs) were updated to fully support both lzc_rename() and lzc_destroy() Authored by: Andriy Gapon <[email protected]> Reviewed by: Andy Stormont <[email protected]> Reviewed by: Matt Ahrens <[email protected]> Reviewed by: Serapheim Dimitropoulos <[email protected]> Reviewed by: Brian Behlendorf <[email protected]> Approved by: Dan McDonald <[email protected]> Ported-by: loli10K <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/9630 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/049ba63 Closes #8207
Diffstat (limited to 'contrib/pyzfs')
-rw-r--r--contrib/pyzfs/libzfs_core/_libzfs_core.py14
-rw-r--r--contrib/pyzfs/libzfs_core/bindings/libzfs_core.py4
2 files changed, 5 insertions, 13 deletions
diff --git a/contrib/pyzfs/libzfs_core/_libzfs_core.py b/contrib/pyzfs/libzfs_core/_libzfs_core.py
index db207bf71..157dc16e9 100644
--- a/contrib/pyzfs/libzfs_core/_libzfs_core.py
+++ b/contrib/pyzfs/libzfs_core/_libzfs_core.py
@@ -1605,7 +1605,6 @@ def lzc_pool_checkpoint_discard(name):
errors.lzc_pool_checkpoint_discard_translate_error(ret, name)
-@_uncommitted()
def lzc_rename(source, target):
'''
Rename the ZFS dataset.
@@ -1621,12 +1620,11 @@ def lzc_rename(source, target):
:raises FilesystemExists: if the target already exists.
:raises PoolsDiffer: if the source and target belong to different pools.
'''
- ret = _lib.lzc_rename(source, target, _ffi.NULL, _ffi.NULL)
+ ret = _lib.lzc_rename(source, target)
errors.lzc_rename_translate_error(ret, source, target)
-@_uncommitted()
-def lzc_destroy_one(name):
+def lzc_destroy(name):
'''
Destroy the ZFS dataset.
@@ -1635,16 +1633,10 @@ def lzc_destroy_one(name):
:raises NameTooLong: if the dataset name is too long.
:raises FilesystemNotFound: if the dataset does not exist.
'''
- ret = _lib.lzc_destroy_one(name, _ffi.NULL)
+ ret = _lib.lzc_destroy(name)
errors.lzc_destroy_translate_error(ret, name)
-# As the extended API is not committed yet, the names of the new interfaces
-# are not settled down yet.
-# lzc_destroy() might make more sense as we do not have lzc_create_one().
-lzc_destroy = lzc_destroy_one
-
-
@_uncommitted()
def lzc_inherit(name, prop):
'''
diff --git a/contrib/pyzfs/libzfs_core/bindings/libzfs_core.py b/contrib/pyzfs/libzfs_core/bindings/libzfs_core.py
index b69c8d779..658394a3f 100644
--- a/contrib/pyzfs/libzfs_core/bindings/libzfs_core.py
+++ b/contrib/pyzfs/libzfs_core/bindings/libzfs_core.py
@@ -129,9 +129,9 @@ CDEF = """
int lzc_remap(const char *);
int lzc_pool_checkpoint(const char *);
int lzc_pool_checkpoint_discard(const char *);
+ int lzc_rename(const char *, const char *);
+ int lzc_destroy(const char *fsname);
- int lzc_rename(const char *, const char *, nvlist_t *, char **);
- int lzc_destroy_one(const char *fsname, nvlist_t *);
int lzc_inherit(const char *fsname, const char *name, nvlist_t *);
int lzc_set_props(const char *, nvlist_t *, nvlist_t *, nvlist_t *);
int lzc_list (const char *, nvlist_t *);