diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2010-04-20 11:49:27 +0200 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2010-04-20 11:49:27 +0200 |
commit | 37f24b06c0f96539f8964e0b41010f4ebe514f5f (patch) | |
tree | aff148090f9c563bfcb63e203d9d0414ae40ab00 /generator.py | |
parent | 73d5ccb8d2792ddf11c58e337039dd27f65923e2 (diff) | |
download | libvirt-python-v6-37f24b06c0f96539f8964e0b41010f4ebe514f5f.tar.gz libvirt-python-v6-37f24b06c0f96539f8964e0b41010f4ebe514f5f.tar.xz libvirt-python-v6-37f24b06c0f96539f8964e0b41010f4ebe514f5f.zip |
Fixup python binding for virDomainSnapshot APIs
The generator code was totally wrong for the virDomainSnapshot
APIs, not generating the wrapper class, and giving methods the
wrong names
* generator.py: Set metadata for virDomainSnapshot type & APIs
* libvirt-override-api.xml, libvirt-override.c: Hand-code the
virDomainSnapshotListNames glue layer
Diffstat (limited to 'generator.py')
-rwxr-xr-x | generator.py | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/generator.py b/generator.py index cb9f3d9..6f082e8 100755 --- a/generator.py +++ b/generator.py @@ -243,6 +243,9 @@ py_types = { 'const virStream *': ('O', "virStream", "virStreamPtr", "virStreamPtr"), 'virDomainSnapshotPtr': ('O', "virDomainSnapshot", "virDomainSnapshotPtr", "virDomainSnapshotPtr"), + 'const virDomainSnapshotPtr': ('O', "virDomainSnapshot", "virDomainSnapshotPtr", "virDomainSnapshotPtr"), + 'virDomainSnapshot *': ('O', "virDomainSnapshot", "virDomainSnapshotPtr", "virDomainSnapshotPtr"), + 'const virDomainSnapshot *': ('O', "virDomainSnapshot", "virDomainSnapshotPtr", "virDomainSnapshotPtr"), } py_return_types = { @@ -277,6 +280,7 @@ skip_impl = ( 'virConnectListDefinedStorageVols', 'virConnectListDefinedInterfaces', 'virConnectListNWFilters', + 'virDomainSnapshotListNames', 'virConnGetLastError', 'virGetLastError', 'virDomainGetInfo', @@ -643,6 +647,8 @@ classes_type = { "virStream *": ("._o", "virStream(self, _obj=%s)", "virStream"), "virConnectPtr": ("._o", "virConnect(_obj=%s)", "virConnect"), "virConnect *": ("._o", "virConnect(_obj=%s)", "virConnect"), + "virDomainSnapshotPtr": ("._o", "virDomainSnapshot(self,_obj=%s)", "virDomainSnapshot"), + "virDomainSnapshot *": ("._o", "virDomainSnapshot(self, _obj=%s)", "virDomainSnapshot"), } converter_type = { @@ -651,7 +657,7 @@ converter_type = { primary_classes = ["virDomain", "virNetwork", "virInterface", "virStoragePool", "virStorageVol", "virConnect", "virNodeDevice", "virSecret", - "virStream"] + "virStream", "virDomainSnapshot"] classes_ancestor = { } @@ -663,6 +669,7 @@ classes_destructors = { "virStorageVol": "virStorageVolFree", "virNodeDevice" : "virNodeDeviceFree", "virSecret": "virSecretFree", + "virDomainSnapshot": "virDomainSnapshotFree", # We hand-craft __del__ for this one #"virStream": "virStreamFree", } @@ -767,6 +774,24 @@ def nameFixup(name, classe, type, file): elif name[0:12] == "virDomainGet": func = name[12:] func = string.lower(func[0:1]) + func[1:] + elif name[0:29] == "virDomainSnapshotLookupByName": + func = name[9:] + func = string.lower(func[0:1]) + func[1:] + elif name[0:26] == "virDomainSnapshotListNames": + func = name[9:] + func = string.lower(func[0:1]) + func[1:] + elif name[0:20] == "virDomainSnapshotNum": + func = name[9:] + func = string.lower(func[0:1]) + func[1:] + elif name[0:26] == "virDomainSnapshotCreateXML": + func = name[9:] + func = string.lower(func[0:1]) + func[1:] + elif name[0:24] == "virDomainSnapshotCurrent": + func = name[9:] + func = string.lower(func[0:1]) + func[1:] + elif name[0:17] == "virDomainSnapshot": + func = name[17:] + func = string.lower(func[0:1]) + func[1:] elif name[0:9] == "virDomain": func = name[9:] func = string.lower(func[0:1]) + func[1:] |