maint: consistent whitespace after 'if'

Noticed during the review of the previous patch.

* python/libvirt-override.c: Use space between 'if ('.
This commit is contained in:
Eric Blake 2012-10-25 11:36:43 -06:00
parent 857f116871
commit 42bbd93e46

View File

@ -4405,13 +4405,13 @@ static PyObject *libvirt_dom_class = NULL;
static PyObject * static PyObject *
getLibvirtModuleObject (void) { getLibvirtModuleObject (void) {
if(libvirt_module) if (libvirt_module)
return libvirt_module; return libvirt_module;
// PyImport_ImportModule returns a new reference // PyImport_ImportModule returns a new reference
/* Bogus (char *) cast for RHEL-5 python API brokenness */ /* Bogus (char *) cast for RHEL-5 python API brokenness */
libvirt_module = PyImport_ImportModule((char *)"libvirt"); libvirt_module = PyImport_ImportModule((char *)"libvirt");
if(!libvirt_module) { if (!libvirt_module) {
DEBUG("%s Error importing libvirt module\n", __FUNCTION__); DEBUG("%s Error importing libvirt module\n", __FUNCTION__);
PyErr_Print(); PyErr_Print();
return NULL; return NULL;
@ -4422,12 +4422,12 @@ getLibvirtModuleObject (void) {
static PyObject * static PyObject *
getLibvirtDictObject (void) { getLibvirtDictObject (void) {
if(libvirt_dict) if (libvirt_dict)
return libvirt_dict; return libvirt_dict;
// PyModule_GetDict returns a borrowed reference // PyModule_GetDict returns a borrowed reference
libvirt_dict = PyModule_GetDict(getLibvirtModuleObject()); libvirt_dict = PyModule_GetDict(getLibvirtModuleObject());
if(!libvirt_dict) { if (!libvirt_dict) {
DEBUG("%s Error importing libvirt dictionary\n", __FUNCTION__); DEBUG("%s Error importing libvirt dictionary\n", __FUNCTION__);
PyErr_Print(); PyErr_Print();
return NULL; return NULL;
@ -4439,13 +4439,13 @@ getLibvirtDictObject (void) {
static PyObject * static PyObject *
getLibvirtDomainClassObject (void) { getLibvirtDomainClassObject (void) {
if(libvirt_dom_class) if (libvirt_dom_class)
return libvirt_dom_class; return libvirt_dom_class;
// PyDict_GetItemString returns a borrowed reference // PyDict_GetItemString returns a borrowed reference
libvirt_dom_class = PyDict_GetItemString(getLibvirtDictObject(), libvirt_dom_class = PyDict_GetItemString(getLibvirtDictObject(),
"virDomain"); "virDomain");
if(!libvirt_dom_class) { if (!libvirt_dom_class) {
DEBUG("%s Error importing virDomain class\n", __FUNCTION__); DEBUG("%s Error importing virDomain class\n", __FUNCTION__);
PyErr_Print(); PyErr_Print();
return NULL; return NULL;
@ -4506,18 +4506,18 @@ libvirt_virConnectDomainEventCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
virDomainRef(dom); virDomainRef(dom);
pyobj_dom = libvirt_virDomainPtrWrap(dom); pyobj_dom = libvirt_virDomainPtrWrap(dom);
pyobj_dom_args = PyTuple_New(2); pyobj_dom_args = PyTuple_New(2);
if(PyTuple_SetItem(pyobj_dom_args, 0, pyobj_conn_inst)!=0) { if (PyTuple_SetItem(pyobj_dom_args, 0, pyobj_conn_inst)!=0) {
DEBUG("%s error creating tuple",__FUNCTION__); DEBUG("%s error creating tuple",__FUNCTION__);
goto cleanup; goto cleanup;
} }
if(PyTuple_SetItem(pyobj_dom_args, 1, pyobj_dom)!=0) { if (PyTuple_SetItem(pyobj_dom_args, 1, pyobj_dom)!=0) {
DEBUG("%s error creating tuple",__FUNCTION__); DEBUG("%s error creating tuple",__FUNCTION__);
goto cleanup; goto cleanup;
} }
Py_INCREF(pyobj_conn_inst); Py_INCREF(pyobj_conn_inst);
dom_class = getLibvirtDomainClassObject(); dom_class = getLibvirtDomainClassObject();
if(!PyClass_Check(dom_class)) { if (!PyClass_Check(dom_class)) {
DEBUG("%s dom_class is not a class!\n", __FUNCTION__); DEBUG("%s dom_class is not a class!\n", __FUNCTION__);
goto cleanup; goto cleanup;
} }
@ -4528,7 +4528,7 @@ libvirt_virConnectDomainEventCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
Py_DECREF(pyobj_dom_args); Py_DECREF(pyobj_dom_args);
if(!pyobj_dom_inst) { if (!pyobj_dom_inst) {
DEBUG("%s Error creating a python instance of virDomain\n", DEBUG("%s Error creating a python instance of virDomain\n",
__FUNCTION__); __FUNCTION__);
PyErr_Print(); PyErr_Print();
@ -4545,7 +4545,7 @@ libvirt_virConnectDomainEventCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
Py_DECREF(pyobj_dom_inst); Py_DECREF(pyobj_dom_inst);
if(!pyobj_ret) { if (!pyobj_ret) {
DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret); DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret);
PyErr_Print(); PyErr_Print();
} else { } else {
@ -4973,7 +4973,7 @@ libvirt_virEventInvokeHandleCallback(PyObject *self ATTRIBUTE_UNUSED,
cb = (virEventHandleCallback) PyvirEventHandleCallback_Get(py_f); cb = (virEventHandleCallback) PyvirEventHandleCallback_Get(py_f);
opaque = (void *) PyvirVoidPtr_Get(py_opaque); opaque = (void *) PyvirVoidPtr_Get(py_opaque);
if(cb) { if (cb) {
LIBVIRT_BEGIN_ALLOW_THREADS; LIBVIRT_BEGIN_ALLOW_THREADS;
cb (watch, fd, event, opaque); cb (watch, fd, event, opaque);
LIBVIRT_END_ALLOW_THREADS; LIBVIRT_END_ALLOW_THREADS;
@ -5000,7 +5000,7 @@ libvirt_virEventInvokeTimeoutCallback(PyObject *self ATTRIBUTE_UNUSED,
cb = (virEventTimeoutCallback) PyvirEventTimeoutCallback_Get(py_f); cb = (virEventTimeoutCallback) PyvirEventTimeoutCallback_Get(py_f);
opaque = (void *) PyvirVoidPtr_Get(py_opaque); opaque = (void *) PyvirVoidPtr_Get(py_opaque);
if(cb) { if (cb) {
LIBVIRT_BEGIN_ALLOW_THREADS; LIBVIRT_BEGIN_ALLOW_THREADS;
cb (timer, opaque); cb (timer, opaque);
LIBVIRT_END_ALLOW_THREADS; LIBVIRT_END_ALLOW_THREADS;
@ -5189,7 +5189,7 @@ libvirt_virConnectDomainEventLifecycleCallback(virConnectPtr conn ATTRIBUTE_UNUS
Py_DECREF(pyobj_cbData); Py_DECREF(pyobj_cbData);
Py_DECREF(pyobj_dom); Py_DECREF(pyobj_dom);
if(!pyobj_ret) { if (!pyobj_ret) {
DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret); DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret);
PyErr_Print(); PyErr_Print();
} else { } else {
@ -5233,7 +5233,7 @@ libvirt_virConnectDomainEventGenericCallback(virConnectPtr conn ATTRIBUTE_UNUSED
Py_DECREF(pyobj_cbData); Py_DECREF(pyobj_cbData);
Py_DECREF(pyobj_dom); Py_DECREF(pyobj_dom);
if(!pyobj_ret) { if (!pyobj_ret) {
DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret); DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret);
PyErr_Print(); PyErr_Print();
} else { } else {
@ -5280,7 +5280,7 @@ libvirt_virConnectDomainEventRTCChangeCallback(virConnectPtr conn ATTRIBUTE_UNUS
Py_DECREF(pyobj_cbData); Py_DECREF(pyobj_cbData);
Py_DECREF(pyobj_dom); Py_DECREF(pyobj_dom);
if(!pyobj_ret) { if (!pyobj_ret) {
DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret); DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret);
PyErr_Print(); PyErr_Print();
} else { } else {
@ -5327,7 +5327,7 @@ libvirt_virConnectDomainEventWatchdogCallback(virConnectPtr conn ATTRIBUTE_UNUSE
Py_DECREF(pyobj_cbData); Py_DECREF(pyobj_cbData);
Py_DECREF(pyobj_dom); Py_DECREF(pyobj_dom);
if(!pyobj_ret) { if (!pyobj_ret) {
DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret); DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret);
PyErr_Print(); PyErr_Print();
} else { } else {
@ -5376,7 +5376,7 @@ libvirt_virConnectDomainEventIOErrorCallback(virConnectPtr conn ATTRIBUTE_UNUSED
Py_DECREF(pyobj_cbData); Py_DECREF(pyobj_cbData);
Py_DECREF(pyobj_dom); Py_DECREF(pyobj_dom);
if(!pyobj_ret) { if (!pyobj_ret) {
DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret); DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret);
PyErr_Print(); PyErr_Print();
} else { } else {
@ -5426,7 +5426,7 @@ libvirt_virConnectDomainEventIOErrorReasonCallback(virConnectPtr conn ATTRIBUTE_
Py_DECREF(pyobj_cbData); Py_DECREF(pyobj_cbData);
Py_DECREF(pyobj_dom); Py_DECREF(pyobj_dom);
if(!pyobj_ret) { if (!pyobj_ret) {
DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret); DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret);
PyErr_Print(); PyErr_Print();
} else { } else {
@ -5513,7 +5513,7 @@ libvirt_virConnectDomainEventGraphicsCallback(virConnectPtr conn ATTRIBUTE_UNUSE
Py_DECREF(pyobj_cbData); Py_DECREF(pyobj_cbData);
Py_DECREF(pyobj_dom); Py_DECREF(pyobj_dom);
if(!pyobj_ret) { if (!pyobj_ret) {
DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret); DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret);
PyErr_Print(); PyErr_Print();
} else { } else {
@ -5560,7 +5560,7 @@ libvirt_virConnectDomainEventBlockJobCallback(virConnectPtr conn ATTRIBUTE_UNUSE
Py_DECREF(pyobj_cbData); Py_DECREF(pyobj_cbData);
Py_DECREF(pyobj_dom); Py_DECREF(pyobj_dom);
if(!pyobj_ret) { if (!pyobj_ret) {
#if DEBUG_ERROR #if DEBUG_ERROR
printf("%s - ret:%p\n", __FUNCTION__, pyobj_ret); printf("%s - ret:%p\n", __FUNCTION__, pyobj_ret);
#endif #endif
@ -5612,7 +5612,7 @@ libvirt_virConnectDomainEventDiskChangeCallback(virConnectPtr conn ATTRIBUTE_UNU
Py_DECREF(pyobj_cbData); Py_DECREF(pyobj_cbData);
Py_DECREF(pyobj_dom); Py_DECREF(pyobj_dom);
if(!pyobj_ret) { if (!pyobj_ret) {
DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret); DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret);
PyErr_Print(); PyErr_Print();
} else { } else {
@ -5659,7 +5659,7 @@ libvirt_virConnectDomainEventTrayChangeCallback(virConnectPtr conn ATTRIBUTE_UNU
Py_DECREF(pyobj_cbData); Py_DECREF(pyobj_cbData);
Py_DECREF(pyobj_dom); Py_DECREF(pyobj_dom);
if(!pyobj_ret) { if (!pyobj_ret) {
DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret); DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret);
PyErr_Print(); PyErr_Print();
} else { } else {
@ -5706,7 +5706,7 @@ libvirt_virConnectDomainEventPMWakeupCallback(virConnectPtr conn ATTRIBUTE_UNUSE
Py_DECREF(pyobj_cbData); Py_DECREF(pyobj_cbData);
Py_DECREF(pyobj_dom); Py_DECREF(pyobj_dom);
if(!pyobj_ret) { if (!pyobj_ret) {
DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret); DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret);
PyErr_Print(); PyErr_Print();
} else { } else {
@ -5753,7 +5753,7 @@ libvirt_virConnectDomainEventPMSuspendCallback(virConnectPtr conn ATTRIBUTE_UNUS
Py_DECREF(pyobj_cbData); Py_DECREF(pyobj_cbData);
Py_DECREF(pyobj_dom); Py_DECREF(pyobj_dom);
if(!pyobj_ret) { if (!pyobj_ret) {
DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret); DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret);
PyErr_Print(); PyErr_Print();
} else { } else {
@ -5800,7 +5800,7 @@ libvirt_virConnectDomainEventBalloonChangeCallback(virConnectPtr conn ATTRIBUTE_
Py_DECREF(pyobj_cbData); Py_DECREF(pyobj_cbData);
Py_DECREF(pyobj_dom); Py_DECREF(pyobj_dom);
if(!pyobj_ret) { if (!pyobj_ret) {
DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret); DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret);
PyErr_Print(); PyErr_Print();
} else { } else {
@ -5847,7 +5847,7 @@ libvirt_virConnectDomainEventPMSuspendDiskCallback(virConnectPtr conn ATTRIBUTE_
Py_DECREF(pyobj_cbData); Py_DECREF(pyobj_cbData);
Py_DECREF(pyobj_dom); Py_DECREF(pyobj_dom);
if(!pyobj_ret) { if (!pyobj_ret) {
DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret); DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret);
PyErr_Print(); PyErr_Print();
} else { } else {