1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

Fix sign mismatches between public API, driver API and XDR protocol

In most cases this affects flags parameters that are unsigned in the
public and driver API but signed in the XDR protocol. Switch the
XDR protocol to unsigned for those.

A counterexample is virNWFilterGetXMLDesc. Its flags parameter is signed
in the public API and XDR protocol, but unsigned in the driver API.
This commit is contained in:
Matthias Bolte 2011-05-21 16:20:44 +02:00
parent 30e9b1a186
commit 1ff2b6f6ee
5 changed files with 32 additions and 48 deletions

View File

@ -896,22 +896,6 @@ elsif ($opt_k) {
$type_name .= $2;
$type_name =~ s/hyper/long/;
if ($type_name eq "int") {
# fix bad decisions in the xdr protocol
if ($arg_name eq "flags" and
$call->{ProcName} ne "DomainCoreDump" and
$call->{ProcName} ne "DomainGetXMLDesc" and
$call->{ProcName} ne "NetworkGetXMLDesc") {
$type_name = "unsigned int";
} elsif ($arg_name eq "nvcpus" and
$call->{ProcName} eq "DomainSetVcpus") {
$type_name = "unsigned int";
} elsif ($arg_name eq "vcpu" and
$call->{ProcName} eq "DomainPinVcpu") {
$type_name = "unsigned int";
}
}
# SPECIAL: some hyper parameters map to long longs
if (($call->{ProcName} eq "DomainMigrateSetMaxDowntime" and
$arg_name eq "downtime") or

View File

@ -1285,7 +1285,7 @@ typedef int
typedef char *
(*virDrvNWFilterGetXMLDesc) (virNWFilterPtr nwfilter,
unsigned int flags);
int flags);
typedef struct _virNWFilterDriver virNWFilterDriver;

View File

@ -407,7 +407,7 @@ cleanup:
static char *
nwfilterGetXMLDesc(virNWFilterPtr obj,
unsigned int flags) {
int flags) {
virNWFilterDriverStatePtr driver = obj->conn->nwfilterPrivateData;
virNWFilterObjPtr nwfilter;
char *ret = NULL;

View File

@ -430,7 +430,7 @@ struct remote_get_max_vcpus_ret {
struct remote_node_get_info_ret {
char model[32];
hyper memory;
unsigned hyper memory;
int cpus;
int mhz;
int nodes;
@ -612,7 +612,7 @@ struct remote_num_of_domains_ret {
struct remote_domain_create_xml_args {
remote_nonnull_string xml_desc;
int flags;
unsigned int flags;
};
struct remote_domain_create_xml_ret {
@ -657,7 +657,7 @@ struct remote_domain_shutdown_args {
struct remote_domain_reboot_args {
remote_nonnull_domain dom;
int flags;
unsigned int flags;
};
struct remote_domain_destroy_args {
@ -843,7 +843,7 @@ struct remote_domain_inject_nmi_args {
struct remote_domain_set_vcpus_args {
remote_nonnull_domain dom;
int nvcpus;
unsigned int nvcpus;
};
struct remote_domain_set_vcpus_flags_args {
@ -863,7 +863,7 @@ struct remote_domain_get_vcpus_flags_ret {
struct remote_domain_pin_vcpu_args {
remote_nonnull_domain dom;
int vcpu;
unsigned int vcpu;
opaque cpumap<REMOTE_CPUMAP_MAX>;
};
@ -1527,7 +1527,7 @@ struct remote_node_device_reset_args {
struct remote_node_device_create_xml_args {
remote_nonnull_string xml_desc;
int flags;
unsigned int flags;
};
struct remote_node_device_create_xml_ret {
@ -1871,7 +1871,7 @@ struct remote_domain_managed_save_remove_args {
struct remote_domain_snapshot_create_xml_args {
remote_nonnull_domain dom;
remote_nonnull_string xml_desc;
int flags;
unsigned int flags;
};
struct remote_domain_snapshot_create_xml_ret {
@ -1880,7 +1880,7 @@ struct remote_domain_snapshot_create_xml_ret {
struct remote_domain_snapshot_get_xml_desc_args {
remote_nonnull_domain_snapshot snap;
int flags;
unsigned int flags;
};
struct remote_domain_snapshot_get_xml_desc_ret {
@ -1889,7 +1889,7 @@ struct remote_domain_snapshot_get_xml_desc_ret {
struct remote_domain_snapshot_num_args {
remote_nonnull_domain dom;
int flags;
unsigned int flags;
};
struct remote_domain_snapshot_num_ret {
@ -1899,7 +1899,7 @@ struct remote_domain_snapshot_num_ret {
struct remote_domain_snapshot_list_names_args {
remote_nonnull_domain dom;
int maxnames;
int flags;
unsigned int flags;
};
struct remote_domain_snapshot_list_names_ret {
@ -1909,7 +1909,7 @@ struct remote_domain_snapshot_list_names_ret {
struct remote_domain_snapshot_lookup_by_name_args {
remote_nonnull_domain dom;
remote_nonnull_string name;
int flags;
unsigned int flags;
};
struct remote_domain_snapshot_lookup_by_name_ret {
@ -1918,7 +1918,7 @@ struct remote_domain_snapshot_lookup_by_name_ret {
struct remote_domain_has_current_snapshot_args {
remote_nonnull_domain dom;
int flags;
unsigned int flags;
};
struct remote_domain_has_current_snapshot_ret {
@ -1927,7 +1927,7 @@ struct remote_domain_has_current_snapshot_ret {
struct remote_domain_snapshot_current_args {
remote_nonnull_domain dom;
int flags;
unsigned int flags;
};
struct remote_domain_snapshot_current_ret {
@ -1936,12 +1936,12 @@ struct remote_domain_snapshot_current_ret {
struct remote_domain_revert_to_snapshot_args {
remote_nonnull_domain_snapshot snap;
int flags;
unsigned int flags;
};
struct remote_domain_snapshot_delete_args {
remote_nonnull_domain_snapshot snap;
int flags;
unsigned int flags;
};
struct remote_domain_open_console_args {

View File

@ -140,7 +140,7 @@ struct remote_get_max_vcpus_ret {
};
struct remote_node_get_info_ret {
char model[32];
int64_t memory;
uint64_t memory;
int cpus;
int mhz;
int nodes;
@ -325,7 +325,7 @@ struct remote_num_of_domains_ret {
};
struct remote_domain_create_xml_args {
remote_nonnull_string xml_desc;
int flags;
u_int flags;
};
struct remote_domain_create_xml_ret {
remote_nonnull_domain dom;
@ -359,7 +359,7 @@ struct remote_domain_shutdown_args {
};
struct remote_domain_reboot_args {
remote_nonnull_domain dom;
int flags;
u_int flags;
};
struct remote_domain_destroy_args {
remote_nonnull_domain dom;
@ -526,7 +526,7 @@ struct remote_domain_inject_nmi_args {
};
struct remote_domain_set_vcpus_args {
remote_nonnull_domain dom;
int nvcpus;
u_int nvcpus;
};
struct remote_domain_set_vcpus_flags_args {
remote_nonnull_domain dom;
@ -542,7 +542,7 @@ struct remote_domain_get_vcpus_flags_ret {
};
struct remote_domain_pin_vcpu_args {
remote_nonnull_domain dom;
int vcpu;
u_int vcpu;
struct {
u_int cpumap_len;
char * cpumap_val;
@ -1103,7 +1103,7 @@ struct remote_node_device_reset_args {
};
struct remote_node_device_create_xml_args {
remote_nonnull_string xml_desc;
int flags;
u_int flags;
};
struct remote_node_device_create_xml_ret {
remote_nonnull_node_device dev;
@ -1370,21 +1370,21 @@ struct remote_domain_managed_save_remove_args {
struct remote_domain_snapshot_create_xml_args {
remote_nonnull_domain dom;
remote_nonnull_string xml_desc;
int flags;
u_int flags;
};
struct remote_domain_snapshot_create_xml_ret {
remote_nonnull_domain_snapshot snap;
};
struct remote_domain_snapshot_get_xml_desc_args {
remote_nonnull_domain_snapshot snap;
int flags;
u_int flags;
};
struct remote_domain_snapshot_get_xml_desc_ret {
remote_nonnull_string xml;
};
struct remote_domain_snapshot_num_args {
remote_nonnull_domain dom;
int flags;
u_int flags;
};
struct remote_domain_snapshot_num_ret {
int num;
@ -1392,7 +1392,7 @@ struct remote_domain_snapshot_num_ret {
struct remote_domain_snapshot_list_names_args {
remote_nonnull_domain dom;
int maxnames;
int flags;
u_int flags;
};
struct remote_domain_snapshot_list_names_ret {
struct {
@ -1403,32 +1403,32 @@ struct remote_domain_snapshot_list_names_ret {
struct remote_domain_snapshot_lookup_by_name_args {
remote_nonnull_domain dom;
remote_nonnull_string name;
int flags;
u_int flags;
};
struct remote_domain_snapshot_lookup_by_name_ret {
remote_nonnull_domain_snapshot snap;
};
struct remote_domain_has_current_snapshot_args {
remote_nonnull_domain dom;
int flags;
u_int flags;
};
struct remote_domain_has_current_snapshot_ret {
int result;
};
struct remote_domain_snapshot_current_args {
remote_nonnull_domain dom;
int flags;
u_int flags;
};
struct remote_domain_snapshot_current_ret {
remote_nonnull_domain_snapshot snap;
};
struct remote_domain_revert_to_snapshot_args {
remote_nonnull_domain_snapshot snap;
int flags;
u_int flags;
};
struct remote_domain_snapshot_delete_args {
remote_nonnull_domain_snapshot snap;
int flags;
u_int flags;
};
struct remote_domain_open_console_args {
remote_nonnull_domain dom;