diff options
Diffstat (limited to 'contrib/pyzfs')
-rw-r--r-- | contrib/pyzfs/libzfs_core/_libzfs_core.py | 16 | ||||
-rw-r--r-- | contrib/pyzfs/libzfs_core/bindings/libzfs_core.py | 6 |
2 files changed, 15 insertions, 7 deletions
diff --git a/contrib/pyzfs/libzfs_core/_libzfs_core.py b/contrib/pyzfs/libzfs_core/_libzfs_core.py index 1e38a3f32..ffc930812 100644 --- a/contrib/pyzfs/libzfs_core/_libzfs_core.py +++ b/contrib/pyzfs/libzfs_core/_libzfs_core.py @@ -1303,7 +1303,8 @@ def lzc_receive_one( @_uncommitted() def lzc_receive_with_cmdprops( snapname, fd, begin_record, force=False, resumable=False, raw=False, - origin=None, props=None, cmdprops=None, cleanup_fd=-1, action_handle=0 + origin=None, props=None, cmdprops=None, key=None, cleanup_fd=-1, + action_handle=0 ): ''' Like :func:`lzc_receive_one`, but allows the caller to pass an additional @@ -1333,6 +1334,8 @@ def lzc_receive_with_cmdprops( every other value is set locally as if the command "zfs set" was invoked immediately before the receive. :type cmdprops: dict of bytes : Any + :param key: raw bytes representing user's wrapping key + :type key: bytes :param int cleanup_fd: file descriptor used to set a cleanup-on-exit file descriptor. :param int action_handle: variable used to pass the handle for guid/ds @@ -1400,14 +1403,19 @@ def lzc_receive_with_cmdprops( props = {} if cmdprops is None: cmdprops = {} + if key is None: + key = bytes("") + else: + key = bytes(key) + nvlist = nvlist_in(props) cmdnvlist = nvlist_in(cmdprops) properrs = {} with nvlist_out(properrs) as c_errors: ret = _lib.lzc_receive_with_cmdprops( - snapname, nvlist, cmdnvlist, c_origin, force, resumable, raw, fd, - begin_record, cleanup_fd, c_read_bytes, c_errflags, - c_action_handle, c_errors) + snapname, nvlist, cmdnvlist, key, len(key), c_origin, + force, resumable, raw, fd, begin_record, cleanup_fd, c_read_bytes, + c_errflags, c_action_handle, c_errors) errors.lzc_receive_translate_errors( ret, snapname, fd, force, raw, False, False, origin, properrs) return (int(c_read_bytes[0]), action_handle) diff --git a/contrib/pyzfs/libzfs_core/bindings/libzfs_core.py b/contrib/pyzfs/libzfs_core/bindings/libzfs_core.py index a67a01ee7..55899b556 100644 --- a/contrib/pyzfs/libzfs_core/bindings/libzfs_core.py +++ b/contrib/pyzfs/libzfs_core/bindings/libzfs_core.py @@ -108,9 +108,9 @@ CDEF = """ int lzc_receive_resumable(const char *, nvlist_t *, const char *, boolean_t, boolean_t, int); int lzc_receive_with_cmdprops(const char *, nvlist_t *, nvlist_t *, - const char *, boolean_t, boolean_t, boolean_t, int, - const dmu_replay_record_t *, int, uint64_t *, uint64_t *, uint64_t *, - nvlist_t **); + uint8_t *, uint_t, const char *, boolean_t, boolean_t, + boolean_t, int, const dmu_replay_record_t *, int, uint64_t *, + uint64_t *, uint64_t *, nvlist_t **); int lzc_receive_with_header(const char *, nvlist_t *, const char *, boolean_t, boolean_t, boolean_t, int, const dmu_replay_record_t *); int lzc_release(nvlist_t *, nvlist_t **); |