[PATCH] Use common parameter order for remote(De)SerializeTypedParameters

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

 



We commonly use "value, length" order, let's stick to this.
---
 daemon/remote.c            |   40 ++++++++++++++++++++--------------------
 src/remote/remote_driver.c |   40 ++++++++++++++++++++--------------------
 2 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/daemon/remote.c b/daemon/remote.c
index 5bcf202..e8db25b 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -546,8 +546,8 @@ cleanup:
 static int
 remoteSerializeTypedParameters(virTypedParameterPtr params,
                                int nparams,
-                               u_int *ret_params_len,
-                               remote_typed_param **ret_params_val)
+                               remote_typed_param **ret_params_val,
+                               u_int *ret_params_len)
 {
     int i;
     int rv = -1;
@@ -608,8 +608,8 @@ cleanup:
 
 /* Helper to deserialize typed parameters. */
 static virTypedParameterPtr
-remoteDeserializeTypedParameters(u_int args_params_len,
-                                 remote_typed_param *args_params_val,
+remoteDeserializeTypedParameters(remote_typed_param *args_params_val,
+                                 u_int args_params_len,
                                  int limit,
                                  int *nparams)
 {
@@ -712,8 +712,8 @@ remoteDispatchDomainGetSchedulerParameters(struct qemud_server *server ATTRIBUTE
         goto cleanup;
 
     if (remoteSerializeTypedParameters(params, nparams,
-                                       &ret->params.params_len,
-                                       &ret->params.params_val) < 0)
+                                       &ret->params.params_val,
+                                       &ret->params.params_len) < 0)
         goto cleanup;
 
     rv = 0;
@@ -765,8 +765,8 @@ remoteDispatchDomainGetSchedulerParametersFlags(struct qemud_server *server ATTR
         goto cleanup;
 
     if (remoteSerializeTypedParameters(params, nparams,
-                                       &ret->params.params_len,
-                                       &ret->params.params_val) < 0)
+                                       &ret->params.params_val,
+                                       &ret->params.params_len) < 0)
         goto cleanup;
 
     rv = 0;
@@ -805,8 +805,8 @@ remoteDispatchDomainSetSchedulerParameters(struct qemud_server *server ATTRIBUTE
 
     nparams = args->params.params_len;
 
-    if ((params = remoteDeserializeTypedParameters(args->params.params_len,
-                                                   args->params.params_val,
+    if ((params = remoteDeserializeTypedParameters(args->params.params_val,
+                                                   args->params.params_len,
                                                    REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX,
                                                    &nparams)) == NULL)
         goto cleanup;
@@ -847,8 +847,8 @@ remoteDispatchDomainSetSchedulerParametersFlags(struct qemud_server *server ATTR
         goto cleanup;
     }
 
-    if ((params = remoteDeserializeTypedParameters(args->params.params_len,
-                                                   args->params.params_val,
+    if ((params = remoteDeserializeTypedParameters(args->params.params_val,
+                                                   args->params.params_len,
                                                    REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX,
                                                    &nparams)) == NULL)
         goto cleanup;
@@ -1387,8 +1387,8 @@ remoteDispatchDomainSetMemoryParameters(struct qemud_server *server
 
     flags = args->flags;
 
-    if ((params = remoteDeserializeTypedParameters(args->params.params_len,
-                                                   args->params.params_val,
+    if ((params = remoteDeserializeTypedParameters(args->params.params_val,
+                                                   args->params.params_len,
                                                    REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX,
                                                    &nparams)) == NULL)
         goto cleanup;
@@ -1461,8 +1461,8 @@ remoteDispatchDomainGetMemoryParameters(struct qemud_server *server
     }
 
     if (remoteSerializeTypedParameters(params, nparams,
-                                       &ret->params.params_len,
-                                       &ret->params.params_val) < 0)
+                                       &ret->params.params_val,
+                                       &ret->params.params_len) < 0)
         goto cleanup;
 
 success:
@@ -1502,8 +1502,8 @@ remoteDispatchDomainSetBlkioParameters(struct qemud_server *server
 
     flags = args->flags;
 
-    if ((params = remoteDeserializeTypedParameters(args->params.params_len,
-                                                   args->params.params_val,
+    if ((params = remoteDeserializeTypedParameters(args->params.params_val,
+                                                   args->params.params_len,
                                                    REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX,
                                                    &nparams)) == NULL)
         goto cleanup;
@@ -1576,8 +1576,8 @@ remoteDispatchDomainGetBlkioParameters(struct qemud_server *server
     }
 
     if (remoteSerializeTypedParameters(params, nparams,
-                                       &ret->params.params_len,
-                                       &ret->params.params_val) < 0)
+                                       &ret->params.params_val,
+                                       &ret->params.params_len) < 0)
         goto cleanup;
 
 success:
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 75c7db3..ec290a0 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -1801,8 +1801,8 @@ done:
 static int
 remoteSerializeTypedParameters(virTypedParameterPtr params,
                                int nparams,
-                               u_int *args_params_len,
-                               remote_typed_param **args_params_val)
+                               remote_typed_param **args_params_val,
+                               u_int *args_params_len)
 {
     int i;
     int rv = -1;
@@ -1863,8 +1863,8 @@ cleanup:
 
 /* Helper to deserialize typed parameters. */
 static int
-remoteDeserializeTypedParameters(u_int ret_params_len,
-                                 remote_typed_param *ret_params_val,
+remoteDeserializeTypedParameters(remote_typed_param *ret_params_val,
+                                 u_int ret_params_len,
                                  int limit,
                                  virTypedParameterPtr params,
                                  int *nparams)
@@ -1946,8 +1946,8 @@ remoteDomainSetMemoryParameters (virDomainPtr domain,
     args.flags = flags;
 
     if (remoteSerializeTypedParameters(params, nparams,
-                                       &args.params.params_len,
-                                       &args.params.params_val) < 0) {
+                                       &args.params.params_val,
+                                       &args.params.params_len) < 0) {
         xdr_free ((xdrproc_t) xdr_remote_domain_set_memory_parameters_args,
                   (char *) &args);
         goto done;
@@ -1996,8 +1996,8 @@ remoteDomainGetMemoryParameters (virDomainPtr domain,
         goto cleanup;
     }
 
-    if (remoteDeserializeTypedParameters(ret.params.params_len,
-                                         ret.params.params_val,
+    if (remoteDeserializeTypedParameters(ret.params.params_val,
+                                         ret.params.params_len,
                                          REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX,
                                          params,
                                          nparams) < 0)
@@ -2030,8 +2030,8 @@ remoteDomainSetBlkioParameters (virDomainPtr domain,
     args.flags = flags;
 
     if (remoteSerializeTypedParameters(params, nparams,
-                                       &args.params.params_len,
-                                       &args.params.params_val) < 0) {
+                                       &args.params.params_val,
+                                       &args.params.params_len) < 0) {
         xdr_free ((xdrproc_t) xdr_remote_domain_set_blkio_parameters_args,
                   (char *) &args);
         goto done;
@@ -2080,8 +2080,8 @@ remoteDomainGetBlkioParameters (virDomainPtr domain,
         goto cleanup;
     }
 
-    if (remoteDeserializeTypedParameters(ret.params.params_len,
-                                         ret.params.params_val,
+    if (remoteDeserializeTypedParameters(ret.params.params_val,
+                                         ret.params.params_len,
                                          REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX,
                                          params,
                                          nparams) < 0)
@@ -2468,8 +2468,8 @@ remoteDomainGetSchedulerParameters (virDomainPtr domain,
               (xdrproc_t) xdr_remote_domain_get_scheduler_parameters_ret, (char *) &ret) == -1)
         goto done;
 
-    if (remoteDeserializeTypedParameters(ret.params.params_len,
-                                         ret.params.params_val,
+    if (remoteDeserializeTypedParameters(ret.params.params_val,
+                                         ret.params.params_len,
                                          REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX,
                                          params,
                                          nparams) < 0)
@@ -2507,8 +2507,8 @@ remoteDomainGetSchedulerParametersFlags (virDomainPtr domain,
               (xdrproc_t) xdr_remote_domain_get_scheduler_parameters_flags_ret, (char *) &ret) == -1)
         goto done;
 
-    if (remoteDeserializeTypedParameters(ret.params.params_len,
-                                         ret.params.params_val,
+    if (remoteDeserializeTypedParameters(ret.params.params_val,
+                                         ret.params.params_len,
                                          REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX,
                                          params,
                                          nparams) < 0)
@@ -2536,8 +2536,8 @@ remoteDomainSetSchedulerParameters (virDomainPtr domain,
     make_nonnull_domain (&args.dom, domain);
 
     if (remoteSerializeTypedParameters(params, nparams,
-                                       &args.params.params_len,
-                                       &args.params.params_val) < 0) {
+                                       &args.params.params_val,
+                                       &args.params.params_len) < 0) {
         xdr_free ((xdrproc_t) xdr_remote_domain_set_scheduler_parameters_args,
                   (char *) &args);
         goto done;
@@ -2572,8 +2572,8 @@ remoteDomainSetSchedulerParametersFlags(virDomainPtr domain,
     args.flags = flags;
 
     if (remoteSerializeTypedParameters(params, nparams,
-                                       &args.params.params_len,
-                                       &args.params.params_val) < 0) {
+                                       &args.params.params_val,
+                                       &args.params.params_len) < 0) {
         xdr_free ((xdrproc_t) xdr_remote_domain_set_scheduler_parameters_flags_args,
                   (char *) &args);
         goto done;
-- 
1.7.0.4

--
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]