Skip to content

Commit

Permalink
DLPX-82017 Azure-blob: Support for resume destroy (openzfs#518)
Browse files Browse the repository at this point in the history
  • Loading branch information
manoj-joseph authored Jul 15, 2022
1 parent 2c4dd58 commit db672db
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions lib/libzutil/zutil_import.c
Original file line number Diff line number Diff line change
Expand Up @@ -2167,6 +2167,7 @@ for_each_vdev_in_nvlist(nvlist_t *nvroot, pool_vdev_iter_f func, void *data)
int
zoa_resume_destroy(void *hdl, importargs_t *iarg)
{
char *protocol = NULL;
char *endpoint = NULL;
char *region = NULL;
char *bucket = NULL;
Expand All @@ -2183,30 +2184,28 @@ zoa_resume_destroy(void *hdl, importargs_t *iarg)
if (bucket == NULL) {
return (-1);
}
if (nvlist_lookup_string(iarg->props, "object-endpoint", &endpoint)
!= 0) {
return (-1);
}
if (nvlist_lookup_string(iarg->props, "object-region", &region) != 0) {
return (-1);
}
nvlist_lookup_string(iarg->props, "object-protocol", &protocol);
nvlist_lookup_string(iarg->props, "object-endpoint", &endpoint);
nvlist_lookup_string(iarg->props, "object-region", &region);
nvlist_lookup_string(iarg->props, "object-credentials-profile",
&profile);

// Resume destroy
nvlist_t *msg = fnvlist_alloc();
fnvlist_add_string(msg, AGENT_REQUEST_TYPE,
AGENT_TYPE_RESUME_DESTROY_POOL);
fnvlist_add_string(msg, AGENT_BUCKET, bucket);
fnvlist_add_string(msg, AGENT_REGION, region);
fnvlist_add_string(msg, AGENT_ENDPOINT, endpoint);
if (profile != NULL) {
fnvlist_add_string(msg, AGENT_CRED_PROFILE, profile);
}
fnvlist_add_uint64(msg, AGENT_GUID, iarg->guid);
if (iarg->poolname != NULL) {
if (iarg->poolname != NULL)
fnvlist_add_string(msg, AGENT_NAME, iarg->poolname);
}
fnvlist_add_string(msg, AGENT_BUCKET, bucket);
if (region != NULL)
fnvlist_add_string(msg, AGENT_REGION, region);
if (endpoint != NULL)
fnvlist_add_string(msg, AGENT_ENDPOINT, endpoint);
if (protocol != NULL)
fnvlist_add_string(msg, AGENT_PROTOCOL, protocol);
if (profile != NULL)
fnvlist_add_string(msg, AGENT_CRED_PROFILE, profile);

nvlist_t *resp = zoa_send_recv_msg(&handle, msg,
AGENT_PUBLIC_PROTOCOL_VERSION, ZFS_ROOT_SOCKET, NULL);
Expand Down

0 comments on commit db672db

Please sign in to comment.