1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-08-05 16:21:59 +03:00

fix libvirt headers list

Since libvirt.h has been split out, generator.py
should be fixed accordingly. So add full list of header
files.

Signed-off-by: Dmitry Guryanov <dguryanov@parallels.com>
This commit is contained in:
Dmitry Guryanov
2014-10-28 20:29:58 +03:00
committed by Eric Blake
parent 309be0a148
commit 8e09c79a07

View File

@ -29,6 +29,21 @@ import xml.sax
debug = 0 debug = 0
onlyOverrides = False onlyOverrides = False
libvirt_headers = [
"libvirt",
"libvirt-domain",
"libvirt-domain-snapshot",
"libvirt-event",
"libvirt-host",
"libvirt-interface",
"libvirt-network",
"libvirt-nodedev",
"libvirt-nwfilter",
"libvirt-secret",
"libvirt-storage",
"libvirt-stream",
]
def getparser(): def getparser():
# Attach parser to an unmarshalling object. return both objects. # Attach parser to an unmarshalling object. return both objects.
target = docParser() target = docParser()
@ -112,9 +127,7 @@ class docParser(xml.sax.handler.ContentHandler):
self.function_return_field = attrs['field'] self.function_return_field = attrs['field']
elif tag == 'enum': elif tag == 'enum':
# enums come from header files, hence virterror.h # enums come from header files, hence virterror.h
if (attrs['file'] == "libvirt" or if attrs['file'] in libvirt_headers + ["virerror", "virterror"]:
attrs['file'] == "virterror" or
attrs['file'] == "virerror"):
enum(attrs['type'],attrs['name'],attrs['value']) enum(attrs['type'],attrs['name'],attrs['value'])
elif attrs['file'] == "libvirt-lxc": elif attrs['file'] == "libvirt-lxc":
lxc_enum(attrs['type'],attrs['name'],attrs['value']) lxc_enum(attrs['type'],attrs['name'],attrs['value'])
@ -127,11 +140,8 @@ class docParser(xml.sax.handler.ContentHandler):
if tag == 'function': if tag == 'function':
# fuctions come from source files, hence 'virerror.c' # fuctions come from source files, hence 'virerror.c'
if self.function is not None: if self.function is not None:
if (self.function_module == "libvirt" or if self.function_module in libvirt_headers + \
self.function_module == "event" or ["event", "virevent", "virerror", "virterror"]:
self.function_module == "virevent" or
self.function_module == "virerror" or
self.function_module == "virterror"):
function(self.function, self.function_descr, function(self.function, self.function_descr,
self.function_return, self.function_args, self.function_return, self.function_args,
self.function_file, self.function_module, self.function_file, self.function_module,