summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2011-05-29 18:24:20 +0800
committerDaniel Veillard <veillard@redhat.com>2011-05-29 18:24:20 +0800
commitf173e5c0886e35ab140404baf570f18f1a2b724f (patch)
treeb5ca758036032519ea9b6567a2ea7745875ac3cd
parentebf5ee12d15857363bcfde7fed25aa7fe8334d79 (diff)
downloadlibvirt-python-v6-f173e5c0886e35ab140404baf570f18f1a2b724f.tar.gz
libvirt-python-v6-f173e5c0886e35ab140404baf570f18f1a2b724f.tar.xz
libvirt-python-v6-f173e5c0886e35ab140404baf570f18f1a2b724f.zip
libvirt.h: avoid regression, and document preferred name
Commit 824dcaff was a regression (thankfully unreleased) for any client code that used 'struct _virSchedParameter' directly rather than the preferred virSchedParameter typedef. Adding a #define avoids even that API change, while rearranging the file makes it clear what the old vs. new API is. * include/libvirt/libvirt.h.in: Rearrange older names to the bottom and improve documentation on preferred names. (virDomainGetSchedulerParameters, virDomainSetSchedulerParameters) (virDomainSetSchedulerParametersFlags) (virDomainSetBlkioParameters, virDomainGetBlkioParameters) (virDomainSetMemoryParameters, virDomainGetMemoryParameters): Use newer type names. * python/libvirt-override.c: Adjust code generation to cope. Suggested by Daniel P. Berrange.
-rw-r--r--libvirt-override.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/libvirt-override.c b/libvirt-override.c
index c42931d..8676aba 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -206,7 +206,7 @@ libvirt_virDomainGetSchedulerParameters(PyObject *self ATTRIBUTE_UNUSED,
char *c_retval;
int i_retval;
int nparams, i;
- virSchedParameterPtr params;
+ virTypedParameterPtr params;
if (!PyArg_ParseTuple(args, (char *)"O:virDomainGetScedulerParameters",
&pyobj_domain))
@@ -242,27 +242,27 @@ libvirt_virDomainGetSchedulerParameters(PyObject *self ATTRIBUTE_UNUSED,
PyObject *key, *val;
switch (params[i].type) {
- case VIR_DOMAIN_SCHED_FIELD_INT:
+ case VIR_TYPED_PARAM_INT:
val = PyInt_FromLong((long)params[i].value.i);
break;
- case VIR_DOMAIN_SCHED_FIELD_UINT:
+ case VIR_TYPED_PARAM_UINT:
val = PyInt_FromLong((long)params[i].value.ui);
break;
- case VIR_DOMAIN_SCHED_FIELD_LLONG:
+ case VIR_TYPED_PARAM_LLONG:
val = PyLong_FromLongLong((long long)params[i].value.l);
break;
- case VIR_DOMAIN_SCHED_FIELD_ULLONG:
+ case VIR_TYPED_PARAM_ULLONG:
val = PyLong_FromLongLong((long long)params[i].value.ul);
break;
- case VIR_DOMAIN_SCHED_FIELD_DOUBLE:
+ case VIR_TYPED_PARAM_DOUBLE:
val = PyFloat_FromDouble((double)params[i].value.d);
break;
- case VIR_DOMAIN_SCHED_FIELD_BOOLEAN:
+ case VIR_TYPED_PARAM_BOOLEAN:
val = PyBool_FromLong((long)params[i].value.b);
break;
@@ -287,7 +287,7 @@ libvirt_virDomainSetSchedulerParameters(PyObject *self ATTRIBUTE_UNUSED,
char *c_retval;
int i_retval;
int nparams, i;
- virSchedParameterPtr params;
+ virTypedParameterPtr params;
if (!PyArg_ParseTuple(args, (char *)"OO:virDomainSetScedulerParameters",
&pyobj_domain, &info))
@@ -325,27 +325,27 @@ libvirt_virDomainSetSchedulerParameters(PyObject *self ATTRIBUTE_UNUSED,
continue;
switch (params[i].type) {
- case VIR_DOMAIN_SCHED_FIELD_INT:
+ case VIR_TYPED_PARAM_INT:
params[i].value.i = (int)PyInt_AS_LONG(val);
break;
- case VIR_DOMAIN_SCHED_FIELD_UINT:
+ case VIR_TYPED_PARAM_UINT:
params[i].value.ui = (unsigned int)PyInt_AS_LONG(val);
break;
- case VIR_DOMAIN_SCHED_FIELD_LLONG:
+ case VIR_TYPED_PARAM_LLONG:
params[i].value.l = (long long)PyLong_AsLongLong(val);
break;
- case VIR_DOMAIN_SCHED_FIELD_ULLONG:
+ case VIR_TYPED_PARAM_ULLONG:
params[i].value.ul = (unsigned long long)PyLong_AsLongLong(val);
break;
- case VIR_DOMAIN_SCHED_FIELD_DOUBLE:
+ case VIR_TYPED_PARAM_DOUBLE:
params[i].value.d = (double)PyFloat_AsDouble(val);
break;
- case VIR_DOMAIN_SCHED_FIELD_BOOLEAN:
+ case VIR_TYPED_PARAM_BOOLEAN:
{
/* Hack - Python's definition of Py_True breaks strict
* aliasing rules, so can't directly compare :-(