remote generator: Rename virNodeGetCellsFreeMemory parameters to common pattern

This allows to remove some special case code from the generator.
This commit is contained in:
Matthias Bolte 2011-05-21 09:52:19 +02:00
parent a125f82ff4
commit fc86e6faa0
4 changed files with 11 additions and 12 deletions

View File

@ -505,17 +505,16 @@ elsif ($opt_b) {
$single_ret_by_ref = 0; $single_ret_by_ref = 0;
$single_ret_as_list = 1; $single_ret_as_list = 1;
$single_ret_list_name = $1; $single_ret_list_name = $1;
$single_ret_list_max_var = "max$1";
$single_ret_list_max_define = $2; $single_ret_list_max_define = $2;
my $conn = shift(@args_list); my $conn = shift(@args_list);
if ($call->{ProcName} eq "NodeGetCellsFreeMemory") { if ($call->{ProcName} eq "NodeGetCellsFreeMemory") {
$single_ret_check = " <= 0"; $single_ret_check = " <= 0";
$single_ret_list_max_var = "maxCells";
unshift(@args_list, "(unsigned long long *)ret->$1.$1_val"); unshift(@args_list, "(unsigned long long *)ret->$1.$1_val");
} else { } else {
$single_ret_check = " < 0"; $single_ret_check = " < 0";
$single_ret_list_max_var = "max$1";
unshift(@args_list, "ret->$1.$1_val"); unshift(@args_list, "ret->$1.$1_val");
} }

View File

@ -1714,7 +1714,7 @@ remoteNodeGetCellsFreeMemory(virConnectPtr conn,
} }
args.startCell = startCell; args.startCell = startCell;
args.maxCells = maxCells; args.maxcells = maxCells;
memset (&ret, 0, sizeof ret); memset (&ret, 0, sizeof ret);
if (call (conn, priv, 0, REMOTE_PROC_NODE_GET_CELLS_FREE_MEMORY, if (call (conn, priv, 0, REMOTE_PROC_NODE_GET_CELLS_FREE_MEMORY,
@ -1722,12 +1722,12 @@ remoteNodeGetCellsFreeMemory(virConnectPtr conn,
(xdrproc_t) xdr_remote_node_get_cells_free_memory_ret, (char *)&ret) == -1) (xdrproc_t) xdr_remote_node_get_cells_free_memory_ret, (char *)&ret) == -1)
goto done; goto done;
for (i = 0 ; i < ret.freeMems.freeMems_len ; i++) for (i = 0 ; i < ret.cells.cells_len ; i++)
freeMems[i] = ret.freeMems.freeMems_val[i]; freeMems[i] = ret.cells.cells_val[i];
xdr_free((xdrproc_t) xdr_remote_node_get_cells_free_memory_ret, (char *) &ret); xdr_free((xdrproc_t) xdr_remote_node_get_cells_free_memory_ret, (char *) &ret);
rv = ret.freeMems.freeMems_len; rv = ret.cells.cells_len;
done: done:
remoteDriverUnlock(priv); remoteDriverUnlock(priv);

View File

@ -442,11 +442,11 @@ struct remote_get_capabilities_ret {
struct remote_node_get_cells_free_memory_args { struct remote_node_get_cells_free_memory_args {
int startCell; int startCell;
int maxCells; int maxcells;
}; };
struct remote_node_get_cells_free_memory_ret { struct remote_node_get_cells_free_memory_ret {
hyper freeMems<REMOTE_NODE_MAX_CELLS>; hyper cells<REMOTE_NODE_MAX_CELLS>;
}; };
struct remote_node_get_free_memory_ret { struct remote_node_get_free_memory_ret {

View File

@ -153,13 +153,13 @@ struct remote_get_capabilities_ret {
}; };
struct remote_node_get_cells_free_memory_args { struct remote_node_get_cells_free_memory_args {
int startCell; int startCell;
int maxCells; int maxcells;
}; };
struct remote_node_get_cells_free_memory_ret { struct remote_node_get_cells_free_memory_ret {
struct { struct {
u_int freeMems_len; u_int cells_len;
int64_t * freeMems_val; int64_t * cells_val;
} freeMems; } cells;
}; };
struct remote_node_get_free_memory_ret { struct remote_node_get_free_memory_ret {
int64_t freeMem; int64_t freeMem;