mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
list: add virDomainListAllSnapshots API
There was an inherent race between virDomainSnapshotNum() and virDomainSnapshotListNames(), where an additional snapshot could be created in the meantime, or where a snapshot could be deleted before converting the name back to a virDomainSnapshotPtr. It was also an awkward name: the function operates on domains, not domain snapshots. virDomainSnapshotListChildrenNames() suffered from the same inherent race, although its naming was nicer. This patch makes things nicer by grabbing a snapshot list atomically, in the format most useful to the user. * include/libvirt/libvirt.h.in (virDomainListAllSnapshots) (virDomainSnapshotListAllChildren): New declarations. * src/libvirt.c (virDomainSnapshotListNames) (virDomainSnapshotListChildrenNames): Add cross-references. (virDomainListAllSnapshots, virDomainSnapshotListAllChildren): New functions. * src/libvirt_public.syms (LIBVIRT_0.9.13): Export them. * src/driver.h (virDrvDomainListAllSnapshots) (virDrvDomainSnapshotListAllChildren): New callbacks. * python/generator.py (skip_function): Prepare for later hand-written versions.
This commit is contained in:
@@ -454,6 +454,8 @@ skip_function = (
|
||||
'virSaveLastError', # We have our own python error wrapper
|
||||
'virFreeError', # Only needed if we use virSaveLastError
|
||||
'virConnectListAllDomains', #overridden in virConnect.py
|
||||
'virDomainListAllSnapshots', # overridden in virDomain.py
|
||||
'virDomainSnapshotListAllChildren', # overridden in virDomainSnapshot.py
|
||||
|
||||
'virStreamRecvAll', # Pure python libvirt-override-virStream.py
|
||||
'virStreamSendAll', # Pure python libvirt-override-virStream.py
|
||||
|
||||
Reference in New Issue
Block a user