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

list: provide python bindings for snapshots

This adds support for the new virDomainListAllSnapshots (a domain
function) and virDomainSnapshotListAllChildren (a snapshot function)
to the libvirt-python bindings.  The implementation is done manually
as the generator does not support wrapping lists of C pointers into
python objects.

* python/libvirt-override.c (libvirt_virDomainListAllSnapshots)
(libvirt_virDomainSnapshotListAllChildren): New functions.
* python/libvirt-override-api.xml: Document them.
* python/libvirt-override-virDomain.py (listAllSnapshots): New
file.
* python/libvirt-override-virDomainSnapshot.py (listAllChildren):
Likewise.
* python/Makefile.am (CLASSES_EXTRA): Ship them.
This commit is contained in:
Eric Blake
2012-06-09 09:55:36 -06:00
parent 7beedf6c63
commit cb8fb3d062
5 changed files with 130 additions and 2 deletions

View File

@ -406,17 +406,29 @@
<arg name='flags' type='unsigned int' info='fine-tuning flags, currently unused, pass 0.'/>
</function>
<function name='virDomainSnapshotListNames' file='python'>
<info>collect the list of snapshots for the given domain</info>
<info>collect the list of snapshot names for the given domain</info>
<arg name='dom' type='virDomainPtr' info='pointer to the domain'/>
<arg name='flags' type='unsigned int' info='flags'/>
<return type='str *' info='the list of Names or None in case of error'/>
</function>
<function name='virDomainListAllSnapshots' file='python'>
<info>returns the list of snapshots for the given domain</info>
<arg name='dom' type='virDomainPtr' info='pointer to the domain'/>
<arg name='flags' type='unsigned int' info='flags'/>
<return type='snapshot *' info='the list of snapshots or None in case of error'/>
</function>
<function name='virDomainSnapshotListChildrenNames' file='python'>
<info>collect the list of child snapshots for the given snapshot</info>
<info>collect the list of child snapshot names for the given snapshot</info>
<arg name='snapshot' type='virDomainSnapshotPtr' info='pointer to the snapshot'/>
<arg name='flags' type='unsigned int' info='flags'/>
<return type='str *' info='the list of Names or None in case of error'/>
</function>
<function name='virDomainSnapshotListAllChildren' file='python'>
<info>returns the list of child snapshots for the given snapshot</info>
<arg name='snapshot' type='virDomainSnapshotPtr' info='pointer to the snapshot'/>
<arg name='flags' type='unsigned int' info='flags'/>
<return type='snapshot *' info='the list of snapshots or None in case of error'/>
</function>
<function name='virDomainRevertToSnapshot' file='python'>
<info>revert the domain to the given snapshot</info>
<arg name='dom' type='virDomainPtr' info='dummy domain pointer'/>