[libvirt] [PATCH 7/9] Implement the remote dispatch bits of vol wiping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* I had to remove daemon/remote_dispatch* and do a make remote.c in daemon in order to get the dispatch files regenerated properly.  The make was failing before I did that.
---
 daemon/remote.c                     |   32 ++++++++++++++++++++++++++++++++
 daemon/remote_dispatch_args.h       |    1 +
 daemon/remote_dispatch_prototypes.h |    8 ++++++++
 daemon/remote_dispatch_table.h      |    5 +++++
 4 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/daemon/remote.c b/daemon/remote.c
index 7c4339f..178b03e 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -4273,6 +4273,38 @@ remoteDispatchStorageVolDelete (struct qemud_server *server ATTRIBUTE_UNUSED,
 }

 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,
                                  virConnectPtr conn,
diff --git a/daemon/remote_dispatch_args.h b/daemon/remote_dispatch_args.h
index f97155b..32a6d78 100644
--- a/daemon/remote_dispatch_args.h
+++ b/daemon/remote_dispatch_args.h
@@ -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;
diff --git a/daemon/remote_dispatch_prototypes.h b/daemon/remote_dispatch_prototypes.h
index b81c8c3..4c944f6 100644
--- a/daemon/remote_dispatch_prototypes.h
+++ b/daemon/remote_dispatch_prototypes.h
@@ -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,
diff --git a/daemon/remote_dispatch_table.h b/daemon/remote_dispatch_table.h
index 5ad6bff..28e7d9a 100644
--- a/daemon/remote_dispatch_table.h
+++ b/daemon/remote_dispatch_table.h
@@ -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,
+},
-- 
1.6.5.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]