2 # Copyright 2015 ClusterHQ
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
18 Python bindings for ``libzfs_core``.
20 from __future__
import absolute_import
, division
, print_function
25 LZC_SEND_FLAG_EMBED_DATA = 1,
26 LZC_SEND_FLAG_LARGE_BLOCK = 2,
27 LZC_SEND_FLAG_COMPRESS = 4,
41 #define MAXNAMELEN 256
45 uint64_t drr_versioninfo; /* was drr_version */
46 uint64_t drr_creation_time;
47 dmu_objset_type_t drr_type;
50 uint64_t drr_fromguid;
51 char drr_toname[MAXNAMELEN];
54 typedef struct zio_cksum {
58 typedef struct dmu_replay_record {
60 DRR_BEGIN, DRR_OBJECT, DRR_FREEOBJECTS,
61 DRR_WRITE, DRR_FREE, DRR_END, DRR_WRITE_BYREF,
62 DRR_SPILL, DRR_WRITE_EMBEDDED, DRR_NUMTYPES
64 uint32_t drr_payloadlen;
66 struct drr_begin drr_begin;
70 zio_cksum_t drr_checksum;
73 } dmu_replay_record_t;
80 DCP_CMD_FORCE_NEW_KEY,
84 int libzfs_core_init(void);
85 void libzfs_core_fini(void);
87 int lzc_bookmark(nvlist_t *, nvlist_t **);
88 int lzc_change_key(const char *, uint64_t, nvlist_t *, uint8_t *, uint_t);
89 int lzc_channel_program(const char *, const char *, uint64_t, uint64_t,
90 nvlist_t *, nvlist_t **);
91 int lzc_channel_program_nosync(const char *, const char *, uint64_t,
92 uint64_t, nvlist_t *, nvlist_t **);
93 int lzc_clone(const char *, const char *, nvlist_t *);
94 int lzc_create(const char *, dmu_objset_type_t, nvlist_t *, uint8_t *,
96 int lzc_destroy_bookmarks(nvlist_t *, nvlist_t **);
97 int lzc_destroy_snaps(nvlist_t *, boolean_t, nvlist_t **);
98 boolean_t lzc_exists(const char *);
99 int lzc_get_bookmarks(const char *, nvlist_t *, nvlist_t **);
100 int lzc_get_holds(const char *, nvlist_t **);
101 int lzc_hold(nvlist_t *, int, nvlist_t **);
102 int lzc_load_key(const char *, boolean_t, uint8_t *, uint_t);
103 int lzc_promote(const char *, nvlist_t *, nvlist_t **);
104 int lzc_receive(const char *, nvlist_t *, const char *, boolean_t,
106 int lzc_receive_one(const char *, nvlist_t *, const char *, boolean_t,
107 boolean_t, boolean_t, int, const dmu_replay_record_t *, int,
108 uint64_t *, uint64_t *, uint64_t *, nvlist_t **);
109 int lzc_receive_resumable(const char *, nvlist_t *, const char *,
110 boolean_t, boolean_t, int);
111 int lzc_receive_with_cmdprops(const char *, nvlist_t *, nvlist_t *,
112 uint8_t *, uint_t, const char *, boolean_t, boolean_t,
113 boolean_t, int, const dmu_replay_record_t *, int, uint64_t *,
114 uint64_t *, uint64_t *, nvlist_t **);
115 int lzc_receive_with_heal(const char *, nvlist_t *, nvlist_t *,
116 uint8_t *, uint_t, const char *, boolean_t, boolean_t, boolean_t,
117 boolean_t, int, const dmu_replay_record_t *, int, uint64_t *,
118 uint64_t *, uint64_t *, nvlist_t **);
119 int lzc_receive_with_header(const char *, nvlist_t *, const char *,
120 boolean_t, boolean_t, boolean_t, int, const dmu_replay_record_t *);
121 int lzc_release(nvlist_t *, nvlist_t **);
122 int lzc_reopen(const char *, boolean_t);
123 int lzc_rollback(const char *, char *, int);
124 int lzc_rollback_to(const char *, const char *);
125 int lzc_send(const char *, const char *, int, enum lzc_send_flags);
126 int lzc_send_resume(const char *, const char *, int, enum lzc_send_flags,
128 int lzc_send_space(const char *, const char *, enum lzc_send_flags,
130 int lzc_snaprange_space(const char *, const char *, uint64_t *);
131 int lzc_snapshot(nvlist_t *, nvlist_t *, nvlist_t **);
132 int lzc_sync(const char *, nvlist_t *, nvlist_t **);
133 int lzc_unload_key(const char *);
134 int lzc_pool_checkpoint(const char *);
135 int lzc_pool_checkpoint_discard(const char *);
136 int lzc_rename(const char *, const char *);
137 int lzc_destroy(const char *fsname);
139 int lzc_inherit(const char *fsname, const char *name, nvlist_t *);
140 int lzc_set_props(const char *, nvlist_t *, nvlist_t *, nvlist_t *);
141 int lzc_list (const char *, nvlist_t *);
145 #include <libzfs/libzfs_core.h>
150 # vim: softtabstop=4 tabstop=4 expandtab shiftwidth=4