mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
uses of goto that reduce down to return NULL in any case, breaking the common code out for returning values based upon the success or failure of an operation, and the common code that parses transaction and path parameters, used by xspy_read, xspy_ls, and xspy_mkdir. Break out also the common code that removes a watch token from the XsHandle watches list. Use bool rather than int for result values, where this matches the same use by tools/xenstore/xs.c. Added missing free in xspy_get_permissions. Use PySequence_SetItem inside xs_watch, rather than Py_INCREF followed by PyList_SetItem. If there is no None entry in the watches list, the code goes on to append to the list using PyList_Append, and that call takes its own reference rather than stealing one like PyList_SetItem. This means that we were previously leaking a reference if the list was full and so PyList_Append was necessary. Use PySequence_SetItem rather than Py_INCREF/PyList_SetItem also where we are using assigning Py_None into the list, for neatness. Remove meaningless pipe from xspy_release_domain's arg_spec. Signed-off-by: Ewan Mellor <ewan@xensource.com>
The file test.py here is from the Zope project, and is Copyright (c) 2001, 2002 Zope Corporation and Contributors. This file is released under the Zope Public License, version 2.0, a copy of which is in the file ZPL-2.0.