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

[Xen-changelog] Misc fixes for breakage when moving to new Python/C interface style.



# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID f546d8697b0e614d05e2505d10ffb2542c16f3b8
# Parent  11a06dd44a8d5fd8aa503adf8120329085741b07
Misc fixes for breakage when moving to new Python/C interface style.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r 11a06dd44a8d -r f546d8697b0e tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Mon Nov 21 17:47:31 2005
+++ b/tools/python/xen/lowlevel/xc/xc.c Mon Nov 21 18:08:27 2005
@@ -1061,14 +1061,14 @@
     return Py_FindMethod(pyxc_methods, obj, name);
 }
 
-static PyObject *PyXc_new(PyTypeObject *type, PyObject *args)
+static PyObject *PyXc_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
     XcObject *self = (XcObject *)type->tp_alloc(type, 0);
 
     if (self == NULL)
         return NULL;
 
-    self->xc_handle = NULL;
+    self->xc_handle = -1;
 
     return (PyObject *)self;
 }
@@ -1086,9 +1086,9 @@
 
 static void PyXc_dealloc(XcObject *self)
 {
-    if (self->xc_handle) {
+    if (self->xc_handle != -1) {
         xc_interface_close(self->xc_handle);
-        self->xc_handle = NULL;
+        self->xc_handle = -1;
     }
 
     self->ob_type->tp_free((PyObject *)self);
@@ -1145,7 +1145,7 @@
     if (PyType_Ready(&PyXcType) < 0)
         return;
 
-    m = Py_InitModule(PKG, PyXc_methods);
+    m = Py_InitModule(PKG, xc_methods);
 
     if (m == NULL)
       return;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.