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

[libvirt] [PATCH 7/7] remote generator: Annotate hyper with the actual C type



Remove some special case code that took care of mapping hyper to the
correct C types.

Use macros for hyper to long assignments that perform overflow checks
when long is smaller than hyper. Also use such macros for the safe
hyper to longlong assignemts as this allows to keep the generator a
bit simpler.

Suggested by Eric Blake.
---
 configure.ac                 |    1 +
 daemon/remote.c              |   21 ++++
 daemon/remote_generator.pl   |  240 ++++++++++++++++++++++++++++++++----------
 src/remote/remote_driver.c   |   21 ++++
 src/remote/remote_protocol.x |  144 +++++++++++++------------
 5 files changed, 303 insertions(+), 124 deletions(-)

diff --git a/configure.ac b/configure.ac
index e17e7af..412fdb8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -117,6 +117,7 @@ if test "x$have_cpuid" = xyes; then
 fi
 AC_MSG_RESULT([$have_cpuid])
 
+AC_CHECK_SIZEOF(long)
 
 dnl Availability of various common functions (non-fatal if missing),
 dnl and various less common threadsafe functions
diff --git a/daemon/remote.c b/daemon/remote.c
index 6ca4daa..83587c0 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -68,6 +68,27 @@
     virReportErrorHelper(VIR_FROM_THIS, code, __FILE__,           \
                          __FUNCTION__, __LINE__, __VA_ARGS__)
 
+#define HYPER_TO_TYPE(_type, _to, _from)                                      \
+    do {                                                                      \
+        if ((_from) != (_type)(_from)) {                                      \
+            virNetError(VIR_ERR_INTERNAL_ERROR,                               \
+                        _("conversion from hyper to %s overflowed"), #_type); \
+            goto cleanup;                                                     \
+        }                                                                     \
+        (_to) = (_from);                                                      \
+    } while (0)
+
+#if SIZEOF_LONG < 8
+# define HYPER_TO_LONG(_to, _from) HYPER_TO_TYPE(long, _to, _from)
+# define HYPER_TO_ULONG(_to, _from) HYPER_TO_TYPE(unsigned long, _to, _from)
+#else
+# define HYPER_TO_LONG(_to, _from) (_to) = (_from)
+# define HYPER_TO_ULONG(_to, _from) (_to) = (_from)
+#endif
+
+#define HYPER_TO_LONGLONG(_to, _from) (_to) = (_from)
+#define HYPER_TO_ULONGLONG(_to, _from) (_to) = (_from)
+
 static virDomainPtr get_nonnull_domain(virConnectPtr conn, remote_nonnull_domain domain);
 static virNetworkPtr get_nonnull_network(virConnectPtr conn, remote_nonnull_network network);
 static virInterfacePtr get_nonnull_interface(virConnectPtr conn, remote_nonnull_interface iface);
diff --git a/daemon/remote_generator.pl b/daemon/remote_generator.pl
index ac808fb..f34f420 100755
--- a/daemon/remote_generator.pl
+++ b/daemon/remote_generator.pl
@@ -174,6 +174,62 @@ while (<PROTOCOL>) {
 
 close(PROTOCOL);
 
+sub handle_multi_ret_member
+{
+    my $dst = shift;
+    my $src = shift;
+    my $ret_member = shift;
+    my $check_overflow = shift;
+
+    if ($ret_member =~ m/^(unsigned )?(char|short|int) (\S+)\[\S+\];/) {
+        return "memcpy($dst->$3, $src.$3, sizeof $dst->$3);";
+    } elsif ($ret_member =~ m/^(unsigned )?hyper (\S+)\[\S+\];\s*\/\*\s*(u)?(long|longlong)\s*\*\//) {
+        # FIXME: in the simple case where hyper and the other type have the
+        #        same size a simple memcpy will do, but for size mismatch
+        #        this becomes more complicated and needs a for loop with
+        #        possible overflow check for each item.
+        #
+        #        currently the XDR protocol doesn't use hyper arrays, so the
+        #        generator can lack an implementation for this at the moment
+        die "hyper arrays aren't implemented yet";
+    } elsif ($ret_member =~ m/^(unsigned )?hyper (\S+)\[\S+\];/) {
+        # error out on unannotated hypers
+        die "(unsigned)? hyper without (u)?(long|longlong) annotation: $ret_member";
+    } elsif ($ret_member =~ m/<\S+>;/ or $ret_member =~ m/\[\S+\];/) {
+        # just make all other array types fail
+        die "unhandled type for multi-return-value: $ret_member";
+    } elsif ($ret_member =~ m/^(unsigned )?(char|short|int) (\S+);/) {
+        return "$dst->$3 = $src.$3;";
+    } elsif ($ret_member =~ m/^(unsigned )?hyper (\S+);\s*\/\*\s*(u)?(long|longlong)\s*\*\//) {
+        if (($1 and !$3) or (!$1 and $3)) {
+            die "sign mismatch in (unsigned)? hyper annotation: $ret_member";
+        }
+
+        if ($check_overflow) {
+            my $sign = ""; $sign = "U" if ($3);
+            my $macro;
+
+            # assignment from hyper to long can overflow, check for it
+            if ($4 eq "longlong") {
+                $macro = "HYPER_TO_${sign}LONGLONG";
+            } elsif ($4 eq "long") {
+                $macro = "HYPER_TO_${sign}LONG";
+            } else {
+                die "internal error";
+            }
+
+            return "$macro($dst->$2, $src.$2);";
+        } else {
+            return "$dst->$2 = $src.$2;";
+        }
+    } elsif ($ret_member =~ m/^(unsigned )?hyper (\S+);/) {
+        # error out on unannotated hypers
+        die "(unsigned)? hyper without (u)?(long|longlong) annotation: $ret_member";
+    } else {
+        die "unhandled type for multi-return-value: $ret_member";
+    }
+}
+
 #----------------------------------------------------------------------
 # Output
 
@@ -378,12 +434,45 @@ elsif ($opt_b) {
                     }
 
                     push(@args_list, "args->$1");
-                } elsif ($args_member =~ m/^(unsigned )?(int|hyper) (\S+);/) {
+                } elsif ($args_member =~ m/^(unsigned )?int (\S+);/) {
+                    if (! @args_list) {
+                        push(@args_list, "conn");
+                    }
+
+                    push(@args_list, "args->$2");
+                } elsif ($args_member =~ m/^(unsigned )?hyper (\S+);\s*\/\*\s*(u)?(long|longlong)\s*\*\//) {
+                    if (($1 and !$3) or (!$1 and $3)) {
+                        die "sign mismatch in (unsigned)? hyper annotation: $args_member";
+                    }
+
                     if (! @args_list) {
                         push(@args_list, "conn");
                     }
 
-                    push(@args_list, "args->$3");
+                    my $type_name;
+                    my $arg_name = $2;
+                    my $sign = ""; $sign = "U" if ($3);
+                    my $macro;
+
+                    $type_name = $1 if ($1);
+                    $type_name .= "long";
+
+                    # assignment from hyper to long can overflow, check for it
+                    if ($4 eq "longlong") {
+                        $type_name .= " long";
+                        $macro = "HYPER_TO_${sign}LONGLONG";
+                    } elsif ($4 eq "long") {
+                        $macro = "HYPER_TO_${sign}LONG";
+                    } else {
+                        die "internal error";
+                    }
+
+                    push(@vars_list, "$type_name $arg_name");
+                    push(@getters_list, "    $macro($arg_name, args->$arg_name);\n");
+                    push(@args_list, "$arg_name");
+                } elsif ($args_member =~ m/^(unsigned )?hyper (\S+);/) {
+                    # error out on unannotated hypers
+                    die "(unsigned)? hyper without (u)?(long|longlong) annotation: $args_member";
                 } elsif ($args_member =~ m/^(\/)?\*/) {
                     # ignore comments
                 } else {
@@ -410,13 +499,7 @@ elsif ($opt_b) {
         if ($call->{ret} ne "void") {
             foreach my $ret_member (@{$call->{ret_members}}) {
                 if ($multi_ret) {
-                    if ($ret_member =~ m/^(unsigned )?(char|short|int|hyper) (\S+)\[\S+\];/) {
-                        push(@ret_list, "memcpy(ret->$3, tmp.$3, sizeof ret->$3);");
-                    } elsif ($ret_member =~ m/^(unsigned )?(char|short|int|hyper) (\S+);/) {
-                        push(@ret_list, "ret->$3 = tmp.$3;");
-                    } else {
-                        die "unhandled type for multi-return-value: $ret_member";
-                    }
+                    push(@ret_list, handle_multi_ret_member("ret", "tmp", $ret_member, 0));
                 } elsif ($ret_member =~ m/^remote_nonnull_string (\S+)<(\S+)>;\s*\/\*\s*insert@(\d+)\s*\*\//) {
                     push(@vars_list, "int len");
                     splice(@args_list, int($3), 0, ("ret->$1.$1_val"));
@@ -501,34 +584,60 @@ elsif ($opt_b) {
                             $single_ret_check = " < 0";
                         }
                     }
-                } elsif ($ret_member =~ m/^(?:unsigned )?hyper (\S+)<(\S+)>;\s*\/\*\s*insert@(\d+)\s*\*\//) {
+                } elsif ($ret_member =~ m/^(unsigned )?hyper (\S+)<(\S+)>;\s*\/\*\s*insert@(\d+)\s+(u)?(long|longlong)\s*\*\//) {
+                    if (($1 and !$5) or (!$1 and $5)) {
+                        die "sign mismatch in (unsigned)? hyper annotation: $ret_member";
+                    }
+
+                    my $type_name;
+                    $type_name = $1 if ($1);
+                    $type_name .= "long";
+
+                    # assignment to hyper cannot overflow, no check necessary
+                    if ($6 eq "longlong") {
+                        $type_name .= " long";
+                    } elsif ($6 ne "long") {
+                        die "internal error";
+                    }
+
                     push(@vars_list, "int len");
-                    push(@ret_list, "ret->$1.$1_len = len;");
-                    push(@free_list_on_error, "VIR_FREE(ret->$1.$1_val);");
+                    push(@ret_list, "ret->$2.$2_len = len;");
+                    push(@free_list_on_error, "VIR_FREE(ret->$2.$2_val);");
                     $single_ret_var = "len";
                     $single_ret_by_ref = 0;
                     $single_ret_as_list = 1;
-                    $single_ret_list_name = $1;
-                    $single_ret_list_max_var = "max$1";
-                    $single_ret_list_max_define = $2;
+                    $single_ret_list_name = $2;
+                    $single_ret_list_max_var = "max$2";
+                    $single_ret_list_max_define = $3;
 
                     if ($call->{ProcName} eq "NodeGetCellsFreeMemory") {
                         $single_ret_check = " <= 0";
-                        splice(@args_list, int($3), 0, ("(unsigned long long *)ret->$1.$1_val"));
+                        splice(@args_list, int($4), 0, ("(unsigned long long *)ret->$2.$2_val"));
                     } else {
                         $single_ret_check = " < 0";
-                        splice(@args_list, int($3), 0, ("ret->$1.$1_val"));
+                        splice(@args_list, int($4), 0, ("ret->$2.$2_val"));
                     }
                 } elsif ($ret_member =~ m/^(?:unsigned )?hyper (\S+)<\S+>;/) {
                     # error out on unannotated arrays
-                    die "hyper array without insert@<offset> annotation: $ret_member";
-                } elsif ($ret_member =~ m/^(unsigned )?hyper (\S+);/) {
+                    die "hyper array without insert@<offset> (u)?(long|longlong) annotation: $ret_member";
+                } elsif ($ret_member =~ m/^(unsigned )?hyper (\S+);\s*\/\*\s*(u)?(long|longlong)\s*\*\//) {
+                    if (($1 and !$3) or (!$1 and $3)) {
+                        die "sign mismatch in (unsigned)? hyper annotation: $ret_member";
+                    }
+
                     my $type_name;
                     my $ret_name = $2;
 
                     $type_name = $1 if ($1);
                     $type_name .= "long";
 
+                    # assignment to hyper cannot overflow, no check necessary
+                    if ($4 eq "longlong") {
+                        $type_name .= " long";
+                    } elsif ($4 ne "long") {
+                        die "internal error";
+                    }
+
                     push(@vars_list, "$type_name $ret_name");
                     push(@ret_list, "ret->$ret_name = $ret_name;");
                     $single_ret_var = $ret_name;
@@ -543,6 +652,9 @@ elsif ($opt_b) {
                     } else {
                         $single_ret_by_ref = 1;
                     }
+                } elsif ($ret_member =~ m/^(unsigned )?hyper (\S+);/) {
+                    # error out on unannotated hypers
+                    die "(unsigned)? hyper without (u)?(long|longlong) annotation: $ret_member";
                 } elsif ($ret_member =~ m/^opaque (\S+)<(\S+)>;\s*\/\*\s*insert@(\d+)\s*\*\//) {
                     push(@vars_list, "char *$1 = NULL");
                     push(@vars_list, "int $1_len = 0");
@@ -888,26 +1000,38 @@ elsif ($opt_k) {
                     push(@setters_list, "args.$arg_name.${arg_name}_val = (char *)$arg_name;");
                     push(@setters_list, "args.$arg_name.${arg_name}_len = ${arg_name}len;");
                     push(@args_check_list, { name => "\"$arg_name\"", arg => "${arg_name}len", limit => $limit });
-                } elsif ($args_member =~ m/^(unsigned )?(int|hyper) (\S+);/) {
+                } elsif ($args_member =~ m/^(unsigned )?int (\S+);/) {
                     my $type_name;
-                    my $arg_name = $3;
+                    my $arg_name = $2;
+
+                    $type_name = $1 if ($1);
+                    $type_name .= "int";
+
+                    push(@args_list, "$type_name $arg_name");
+                    push(@setters_list, "args.$arg_name = $arg_name;");
+                } elsif ($args_member =~ m/^(unsigned )?hyper (\S+);\s*\/\*\s*(u)?(long|longlong)\s*\*\//) {
+                    if (($1 and !$3) or (!$1 and $3)) {
+                        die "sign mismatch in (unsigned)? hyper annotation: $args_member";
+                    }
+
+                    my $type_name;
+                    my $arg_name = $2;
 
                     $type_name = $1 if ($1);
-                    $type_name .= $2;
-                    $type_name =~ s/hyper/long/;
-
-                    # SPECIAL: some hyper parameters map to long longs
-                    if (($call->{ProcName} eq "DomainMigrateSetMaxDowntime" and
-                         $arg_name eq "downtime") or
-                        ($call->{ProcName} eq "StorageVolUpload" and
-                         ($arg_name eq "offset" or $arg_name eq "length")) or
-                        ($call->{ProcName} eq "StorageVolDownload" and
-                         ($arg_name eq "offset" or $arg_name eq "length"))) {
+                    $type_name .= "long";
+
+                    # assignment to hyper cannot overflow, no check necessary
+                    if ($4 eq "longlong") {
                         $type_name .= " long";
+                    } elsif ($4 ne "long") {
+                        die "internal error";
                     }
 
                     push(@args_list, "$type_name $arg_name");
                     push(@setters_list, "args.$arg_name = $arg_name;");
+                } elsif ($args_member =~ m/^(unsigned )?hyper (\S+);/) {
+                    # error out on unannotated hypers
+                    die "(unsigned)? hyper without (u)?(long|longlong) annotation: $args_member";
                 } elsif ($args_member =~ m/^(\/)?\*/) {
                     # ignore comments
                 } else {
@@ -960,18 +1084,7 @@ elsif ($opt_k) {
 
             foreach my $ret_member (@{$call->{ret_members}}) {
                 if ($multi_ret) {
-                    if ($ret_member =~ m/^(unsigned )?(char|short|int|hyper) (\S+)\[\S+\];/) {
-                        push(@ret_list, "memcpy(result->$3, ret.$3, sizeof result->$3);");
-                    } elsif ($ret_member =~ m/<\S+>;/ or $ret_member =~ m/\[\S+\];/) {
-                        # just make all other array types fail
-                        die "unhandled type for multi-return-value for " .
-                            "procedure $call->{name}: $ret_member";
-                    } elsif ($ret_member =~ m/^(unsigned )?(char|short|int|hyper) (\S+);/) {
-                        push(@ret_list, "result->$3 = ret.$3;");
-                    } else {
-                        die "unhandled type for multi-return-value for " .
-                            "procedure $call->{name}: $ret_member";
-                    }
+                    push(@ret_list, handle_multi_ret_member("result", "ret", $ret_member, 1));
                 } elsif ($ret_member =~ m/^remote_nonnull_string (\S+)<(\S+)>;\s*\/\*\s*insert@(\d+)\s*\*\//) {
                     splice(@args_list, int($3), 0, ("char **const $1"));
                     push(@ret_list, "rv = ret.$1.$1_len;");
@@ -1038,24 +1151,43 @@ elsif ($opt_k) {
 
                     $single_ret_var = "int rv = -1";
                     $single_ret_type = "int";
-                } elsif ($ret_member =~ m/^unsigned hyper (\S+);/) {
-                    my $arg_name = $1;
+                } elsif ($ret_member =~ m/^(unsigned )?hyper (\S+);\s*\/\*\s*(u)?(long|longlong)\s*\*\//) {
+                    if (($1 and !$3) or (!$1 and $3)) {
+                        die "sign mismatch in (unsigned)? hyper annotation: $ret_member";
+                    }
+
+                    my $type_name;
+                    my $arg_name = $2;
+                    my $sign = ""; $sign = "U" if ($3);
+                    my $macro;
+
+                    $type_name = $1 if ($1);
+                    $type_name .= "long";
+
+                    # assignment from hyper to long can overflow, check for it
+                    if ($4 eq "longlong") {
+                        $type_name .= " long";
+                        $macro = "HYPER_TO_${sign}LONGLONG";
+                    } elsif ($4 eq "long") {
+                        $macro = "HYPER_TO_${sign}LONG";
+                    } else {
+                        die "internal error";
+                    }
 
                     if ($call->{ProcName} =~ m/Get(Lib)?Version/) {
-                        push(@args_list, "unsigned long *$arg_name");
-                        push(@ret_list, "if ($arg_name) *$arg_name = ret.$arg_name;");
+                        push(@args_list, "$type_name *$arg_name");
+                        push(@ret_list, "if ($arg_name) $macro(*$arg_name, ret.$arg_name);");
                         push(@ret_list, "rv = 0;");
                         $single_ret_var = "int rv = -1";
                         $single_ret_type = "int";
-                    } elsif ($call->{ProcName} eq "NodeGetFreeMemory") {
-                        push(@ret_list, "rv = ret.$arg_name;");
-                        $single_ret_var = "unsigned long long rv = 0";
-                        $single_ret_type = "unsigned long long";
                     } else {
-                        push(@ret_list, "rv = ret.$arg_name;");
-                        $single_ret_var = "unsigned long rv = 0";
-                        $single_ret_type = "unsigned long";
+                        push(@ret_list, "$macro(rv, ret.$arg_name);");
+                        $single_ret_var = "$type_name rv = 0";
+                        $single_ret_type = "$type_name";
                     }
+                } elsif ($ret_member =~ m/^(unsigned )?hyper (\S+);/) {
+                    # error out on unannotated hypers
+                    die "(unsigned)? hyper without (u)?(long|longlong) annotation: $ret_member";
                 } elsif ($ret_member =~ m/^(\/)?\*/) {
                     # ignore comments
                 } else {
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 3556b85..9f346ee 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -87,6 +87,27 @@
 
 #define VIR_FROM_THIS VIR_FROM_REMOTE
 
+#define HYPER_TO_TYPE(_type, _to, _from)                                      \
+    do {                                                                      \
+        if ((_from) != (_type)(_from)) {                                      \
+            remoteError(VIR_ERR_INTERNAL_ERROR,                               \
+                        _("conversion from hyper to %s overflowed"), #_type); \
+            goto done;                                                        \
+        }                                                                     \
+        (_to) = (_from);                                                      \
+    } while (0)
+
+#if SIZEOF_LONG < 8
+# define HYPER_TO_LONG(_to, _from) HYPER_TO_TYPE(long, _to, _from)
+# define HYPER_TO_ULONG(_to, _from) HYPER_TO_TYPE(unsigned long, _to, _from)
+#else
+# define HYPER_TO_LONG(_to, _from) (_to) = (_from)
+# define HYPER_TO_ULONG(_to, _from) (_to) = (_from)
+#endif
+
+#define HYPER_TO_LONGLONG(_to, _from) (_to) = (_from)
+#define HYPER_TO_ULONGLONG(_to, _from) (_to) = (_from)
+
 static int inside_daemon = 0;
 
 struct remote_thread_call;
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index 2b9f9de..9928b77 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -371,7 +371,11 @@ struct remote_memory_param {
  *
  * 'remote_CALL_ret' members that are filled via call-by-reference must be
  * annotated with a insert@<offset> comment to indicate the offset in the
- * parameter list of the function to be called. */
+ * parameter list of the function to be called.
+ *
+ * 'remote_CALL_args' and 'remote_CALL_ret' members of type hyper must be
+ * annotated with the C type they should be mapped to: long, ulong, longlong
+ * or ulonglong */
 
 struct remote_open_args {
     /* NB. "name" might be NULL although in practice you can't
@@ -394,11 +398,11 @@ struct remote_get_type_ret {
 };
 
 struct remote_get_version_ret {
-    unsigned hyper hv_ver;
+    unsigned hyper hv_ver; /* ulong */
 };
 
 struct remote_get_lib_version_ret {
-    unsigned hyper lib_ver;
+    unsigned hyper lib_ver; /* ulong */
 };
 
 struct remote_get_hostname_ret {
@@ -430,7 +434,7 @@ struct remote_get_max_vcpus_ret {
 
 struct remote_node_get_info_ret {
     char model[32];
-    unsigned hyper memory;
+    unsigned hyper memory; /* ulong */
     int cpus;
     int mhz;
     int nodes;
@@ -449,11 +453,11 @@ struct remote_node_get_cells_free_memory_args {
 };
 
 struct remote_node_get_cells_free_memory_ret {
-    unsigned hyper cells<REMOTE_NODE_MAX_CELLS>; /* insert 1 */
+    unsigned hyper cells<REMOTE_NODE_MAX_CELLS>; /* insert 1 ulonglong */
 };
 
 struct remote_node_get_free_memory_ret {
-    unsigned hyper freeMem;
+    unsigned hyper freeMem; /* ulonglong */
 };
 
 struct remote_domain_get_scheduler_type_args {
@@ -525,11 +529,11 @@ struct remote_domain_block_stats_args {
 };
 
 struct remote_domain_block_stats_ret {
-    hyper rd_req;
-    hyper rd_bytes;
-    hyper wr_req;
-    hyper wr_bytes;
-    hyper errs;
+    hyper rd_req; /* longlong */
+    hyper rd_bytes; /* longlong */
+    hyper wr_req; /* longlong */
+    hyper wr_bytes; /* longlong */
+    hyper errs; /* longlong */
 };
 
 struct remote_domain_interface_stats_args {
@@ -538,14 +542,14 @@ struct remote_domain_interface_stats_args {
 };
 
 struct remote_domain_interface_stats_ret {
-    hyper rx_bytes;
-    hyper rx_packets;
-    hyper rx_errs;
-    hyper rx_drop;
-    hyper tx_bytes;
-    hyper tx_packets;
-    hyper tx_errs;
-    hyper tx_drop;
+    hyper rx_bytes; /* longlong */
+    hyper rx_packets; /* longlong */
+    hyper rx_errs; /* longlong */
+    hyper rx_drop; /* longlong */
+    hyper tx_bytes; /* longlong */
+    hyper tx_packets; /* longlong */
+    hyper tx_errs; /* longlong */
+    hyper tx_drop; /* longlong */
 };
 
 struct remote_domain_memory_stats_args {
@@ -556,7 +560,7 @@ struct remote_domain_memory_stats_args {
 
 struct remote_domain_memory_stat {
     int tag;
-    unsigned hyper val;
+    unsigned hyper val; /* longlong */
 };
 
 struct remote_domain_memory_stats_ret {
@@ -593,9 +597,9 @@ struct remote_domain_get_block_info_args {
 };
 
 struct remote_domain_get_block_info_ret {
-    unsigned hyper allocation;
-    unsigned hyper capacity;
-    unsigned hyper physical;
+    unsigned hyper allocation; /* ulonglong */
+    unsigned hyper capacity; /* ulonglong */
+    unsigned hyper physical; /* ulonglong */
 };
 
 struct remote_list_domains_args {
@@ -677,22 +681,22 @@ struct remote_domain_get_max_memory_args {
 };
 
 struct remote_domain_get_max_memory_ret {
-    unsigned hyper memory;
+    unsigned hyper memory; /* ulong */
 };
 
 struct remote_domain_set_max_memory_args {
     remote_nonnull_domain dom;
-    unsigned hyper memory;
+    unsigned hyper memory; /* ulong */
 };
 
 struct remote_domain_set_memory_args {
     remote_nonnull_domain dom;
-    unsigned hyper memory;
+    unsigned hyper memory; /* ulong */
 };
 
 struct remote_domain_set_memory_flags_args {
     remote_nonnull_domain dom;
-    unsigned hyper memory;
+    unsigned hyper memory; /* ulong */
     unsigned int flags;
 };
 
@@ -702,10 +706,10 @@ struct remote_domain_get_info_args {
 
 struct remote_domain_get_info_ret {
     unsigned char state;
-    unsigned hyper maxMem;
-    unsigned hyper memory;
+    unsigned hyper maxMem; /* ulong */
+    unsigned hyper memory; /* ulong */
     unsigned short nrVirtCpu;
-    unsigned hyper cpuTime;
+    unsigned hyper cpuTime; /* ulonglong */
 };
 
 struct remote_domain_save_args {
@@ -758,16 +762,16 @@ struct remote_domain_migrate_perform_args {
     remote_nonnull_domain dom;
     opaque cookie<REMOTE_MIGRATE_COOKIE_MAX>;
     remote_nonnull_string uri;
-    unsigned hyper flags;
+    unsigned hyper flags; /* ulong */
     remote_string dname;
-    unsigned hyper resource;
+    unsigned hyper resource; /* ulong */
 };
 
 struct remote_domain_migrate_finish_args {
     remote_nonnull_string dname;
     opaque cookie<REMOTE_MIGRATE_COOKIE_MAX>;
     remote_nonnull_string uri;
-    unsigned hyper flags;
+    unsigned hyper flags; /* ulong */
 };
 
 struct remote_domain_migrate_finish_ret {
@@ -776,9 +780,9 @@ struct remote_domain_migrate_finish_ret {
 
 struct remote_domain_migrate_prepare2_args {
     remote_string uri_in;
-    unsigned hyper flags;
+    unsigned hyper flags; /* ulong */
     remote_string dname;
-    unsigned hyper resource;
+    unsigned hyper resource; /* ulong */
     remote_nonnull_string dom_xml;
 };
 
@@ -791,7 +795,7 @@ struct remote_domain_migrate_finish2_args {
     remote_nonnull_string dname;
     opaque cookie<REMOTE_MIGRATE_COOKIE_MAX>;
     remote_nonnull_string uri;
-    unsigned hyper flags;
+    unsigned hyper flags; /* ulong */
     int retcode;
 };
 
@@ -1328,9 +1332,9 @@ struct remote_storage_pool_get_info_args {
 
 struct remote_storage_pool_get_info_ret {
     unsigned char state;
-    unsigned hyper capacity;
-    unsigned hyper allocation;
-    unsigned hyper available;
+    unsigned hyper capacity; /* ulonglong */
+    unsigned hyper allocation; /* ulonglong */
+    unsigned hyper available; /* ulonglong */
 };
 
 struct remote_storage_pool_get_autostart_args {
@@ -1438,8 +1442,8 @@ struct remote_storage_vol_get_info_args {
 
 struct remote_storage_vol_get_info_ret {
     char type;
-    unsigned hyper capacity;
-    unsigned hyper allocation;
+    unsigned hyper capacity; /* ulonglong */
+    unsigned hyper allocation; /* ulonglong */
 };
 
 struct remote_storage_vol_get_path_args {
@@ -1649,9 +1653,9 @@ struct remote_secret_lookup_by_usage_ret {
 };
 
 struct remote_domain_migrate_prepare_tunnel_args {
-    unsigned hyper flags;
+    unsigned hyper flags; /* ulong */
     remote_string dname;
-    unsigned hyper resource;
+    unsigned hyper resource; /* ulong */
     remote_nonnull_string dom_xml;
 };
 
@@ -1756,20 +1760,20 @@ struct remote_domain_get_job_info_args {
 struct remote_domain_get_job_info_ret {
     int type;
 
-    unsigned hyper timeElapsed;
-    unsigned hyper timeRemaining;
+    unsigned hyper timeElapsed; /* ulonglong */
+    unsigned hyper timeRemaining; /* ulonglong */
 
-    unsigned hyper dataTotal;
-    unsigned hyper dataProcessed;
-    unsigned hyper dataRemaining;
+    unsigned hyper dataTotal; /* ulonglong */
+    unsigned hyper dataProcessed; /* ulonglong */
+    unsigned hyper dataRemaining; /* ulonglong */
 
-    unsigned hyper memTotal;
-    unsigned hyper memProcessed;
-    unsigned hyper memRemaining;
+    unsigned hyper memTotal; /* ulonglong */
+    unsigned hyper memProcessed; /* ulonglong */
+    unsigned hyper memRemaining; /* ulonglong */
 
-    unsigned hyper fileTotal;
-    unsigned hyper fileProcessed;
-    unsigned hyper fileRemaining;
+    unsigned hyper fileTotal; /* ulonglong */
+    unsigned hyper fileProcessed; /* ulonglong */
+    unsigned hyper fileRemaining; /* ulonglong */
 };
 
 
@@ -1780,13 +1784,13 @@ struct remote_domain_abort_job_args {
 
 struct remote_domain_migrate_set_max_downtime_args {
     remote_nonnull_domain dom;
-    unsigned hyper downtime;
+    unsigned hyper downtime; /* ulonglong */
     unsigned int flags;
 };
 
 struct remote_domain_migrate_set_max_speed_args {
     remote_nonnull_domain dom;
-    unsigned hyper bandwidth;
+    unsigned hyper bandwidth; /* ulong */
     unsigned int flags;
 };
 
@@ -1952,15 +1956,15 @@ struct remote_domain_open_console_args {
 
 struct remote_storage_vol_upload_args {
     remote_nonnull_storage_vol vol;
-    unsigned hyper offset;
-    unsigned hyper length;
+    unsigned hyper offset; /* ulonglong */
+    unsigned hyper length; /* ulonglong */
     unsigned int flags;
 };
 
 struct remote_storage_vol_download_args {
     remote_nonnull_storage_vol vol;
-    unsigned hyper offset;
-    unsigned hyper length;
+    unsigned hyper offset; /* ulonglong */
+    unsigned hyper length; /* ulonglong */
     unsigned int flags;
 };
 
@@ -1976,9 +1980,9 @@ struct remote_domain_get_state_ret {
 
 struct remote_domain_migrate_begin3_args {
     remote_nonnull_domain dom;
-    unsigned hyper flags;
+    unsigned hyper flags; /* ulong */
     remote_string dname;
-    unsigned hyper resource;
+    unsigned hyper resource; /* ulong */
 };
 
 struct remote_domain_migrate_begin3_ret {
@@ -1989,9 +1993,9 @@ struct remote_domain_migrate_begin3_ret {
 struct remote_domain_migrate_prepare3_args {
     opaque cookie_in<REMOTE_MIGRATE_COOKIE_MAX>;
     remote_string uri_in;
-    unsigned hyper flags;
+    unsigned hyper flags; /* ulong */
     remote_string dname;
-    unsigned hyper resource;
+    unsigned hyper resource; /* ulong */
     remote_nonnull_string dom_xml;
 };
 
@@ -2002,9 +2006,9 @@ struct remote_domain_migrate_prepare3_ret {
 
 struct remote_domain_migrate_prepare_tunnel3_args {
     opaque cookie_in<REMOTE_MIGRATE_COOKIE_MAX>;
-    unsigned hyper flags;
+    unsigned hyper flags; /* ulong */
     remote_string dname;
-    unsigned hyper resource;
+    unsigned hyper resource; /* ulong */
     remote_nonnull_string dom_xml;
 };
 
@@ -2016,9 +2020,9 @@ struct remote_domain_migrate_perform3_args {
     remote_nonnull_domain dom;
     opaque cookie_in<REMOTE_MIGRATE_COOKIE_MAX>;
     remote_nonnull_string uri;
-    unsigned hyper flags;
+    unsigned hyper flags; /* ulong */
     remote_string dname;
-    unsigned hyper resource;
+    unsigned hyper resource; /* ulong */
 };
 
 struct remote_domain_migrate_perform3_ret {
@@ -2029,7 +2033,7 @@ struct remote_domain_migrate_finish3_args {
     remote_nonnull_string dname;
     opaque cookie_in<REMOTE_MIGRATE_COOKIE_MAX>;
     remote_nonnull_string uri;
-    unsigned hyper flags;
+    unsigned hyper flags; /* ulong */
     int cancelled;
 };
 
@@ -2041,7 +2045,7 @@ struct remote_domain_migrate_finish3_ret {
 struct remote_domain_migrate_confirm3_args {
     remote_nonnull_domain dom;
     opaque cookie_in<REMOTE_MIGRATE_COOKIE_MAX>;
-    unsigned hyper flags;
+    unsigned hyper flags; /* ulong */
     int cancelled;
 };
 
-- 
1.7.0.4


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