mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Fix up the python bindings for snapshotting.
This involved a few fixes. To start with, an virDomainSnapshot object is really tied to a domain, not a connection, so we have to generate a slightly different object so that we can get at self._dom for the object. Next, we had to "dummy" up an override piece of XML with a bogus argument that the function doesn't actually take. That's so that the generator places virDomainRevertToSnapshot underneath the correct class (namely, the virDomain class). Finally, we had to hand-implement the virDomainRevertToSnapshot implementation, ignoring the bogus pointer we are being passed. With all of this in place, I was able to successfully take a snapshot and revert to it using only the Python bindings. Signed-off-by: Chris Lalancette <clalance@redhat.com>
This commit is contained in:
@@ -277,5 +277,12 @@
|
||||
<arg name='flags' type='unsigned int' info='flags, curently unused'/>
|
||||
<return type='str *' info='the list of Names of 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'/>
|
||||
<arg name='snap' type='virDomainSnapshotPtr' info='pointer to the snapshot'/>
|
||||
<arg name='flags' type='unsigned int' info='flags, curently unused'/>
|
||||
<return type='int' info="0 on success, -1 on error"/>
|
||||
</function>
|
||||
</symbols>
|
||||
</api>
|
||||
|
||||
Reference in New Issue
Block a user