mirror of
https://github.com/libvirt/libvirt.git
synced 2026-09-03 20:53:04 -05:00
Implement remote bits for vol wiping
This commit is contained in:
@@ -4272,6 +4272,38 @@ remoteDispatchStorageVolDelete (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchStorageVolWipe(struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
virConnectPtr conn,
|
||||
remote_message_header *hdr ATTRIBUTE_UNUSED,
|
||||
remote_error *rerr,
|
||||
remote_storage_vol_wipe_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
{
|
||||
int retval = -1;
|
||||
virStorageVolPtr vol;
|
||||
|
||||
vol = get_nonnull_storage_vol(conn, args->vol);
|
||||
if (vol == NULL) {
|
||||
remoteDispatchConnError(rerr, conn);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (virStorageVolWipe(vol, args->flags) == -1) {
|
||||
remoteDispatchConnError(rerr, conn);
|
||||
goto out;
|
||||
}
|
||||
|
||||
retval = 0;
|
||||
|
||||
out:
|
||||
if (vol != NULL) {
|
||||
virStorageVolFree(vol);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchStorageVolGetInfo (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
|
||||
@@ -140,3 +140,4 @@
|
||||
remote_cpu_baseline_args val_remote_cpu_baseline_args;
|
||||
remote_domain_get_job_info_args val_remote_domain_get_job_info_args;
|
||||
remote_domain_abort_job_args val_remote_domain_abort_job_args;
|
||||
remote_storage_vol_wipe_args val_remote_storage_vol_wipe_args;
|
||||
|
||||
@@ -1298,6 +1298,14 @@ static int remoteDispatchStorageVolLookupByPath(
|
||||
remote_error *err,
|
||||
remote_storage_vol_lookup_by_path_args *args,
|
||||
remote_storage_vol_lookup_by_path_ret *ret);
|
||||
static int remoteDispatchStorageVolWipe(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
virConnectPtr conn,
|
||||
remote_message_header *hdr,
|
||||
remote_error *err,
|
||||
remote_storage_vol_wipe_args *args,
|
||||
void *ret);
|
||||
static int remoteDispatchSupportsFeature(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
|
||||
@@ -827,3 +827,8 @@
|
||||
.args_filter = (xdrproc_t) xdr_remote_domain_abort_job_args,
|
||||
.ret_filter = (xdrproc_t) xdr_void,
|
||||
},
|
||||
{ /* StorageVolWipe => 165 */
|
||||
.fn = (dispatch_fn) remoteDispatchStorageVolWipe,
|
||||
.args_filter = (xdrproc_t) xdr_remote_storage_vol_wipe_args,
|
||||
.ret_filter = (xdrproc_t) xdr_void,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user