Re: [PATCH v2] python: Fix bindings for virDomainSnapshotGet{Domain, Connect}

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/23/2013 04:26 AM, Jiri Denemark wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=895882
> 
> virDomainSnapshot.getDomain() and virDomainSnapshot.getConnect()
> wrappers around virDomainSnapshotGet{Domain,Connect} were not supposed
> to be ever implemented. The class should contain proper domain() and
> connect() accessors that fetch python objects stored internally within
> the class. While domain() was already provided, connect() was missing.
> 
> This patch adds connect() method to virDomainSnapshot class and
> reimplements getDomain() and getConnect() methods as aliases to domain()
> and connect() for backward compatibility.
> ---
>  python/generator.py                          |  4 +++-
>  python/libvirt-override-virDomainSnapshot.py |  8 ++++++++
>  src/libvirt.c                                | 10 ++++++++--
>  3 files changed, 19 insertions(+), 3 deletions(-)


>   * virDomainSnapshotGetDomain:
>   * @snapshot: a snapshot object
>   *
> - * Get the domain that a snapshot was created for
> + * Get the domain that a snapshot was created for.
> + *

Missing the following (based on copy-and-paste from virDomainGetConnect):

 * Provides the domain pointer associated with a snapshot.  The
 * reference counter on the domain is not increased by this
 * call.

> + * WARNING: When writing libvirt bindings in other languages, do not use this
> + * function.  Instead, store the domain and the snapshot object together.
>   *
>   * Returns the domain or NULL.
>   */
> @@ -17874,7 +17877,10 @@ virDomainSnapshotGetDomain(virDomainSnapshotPtr snapshot)
>   * virDomainSnapshotGetConnect:
>   * @snapshot: a snapshot object
>   *
> - * Get the connection that owns the domain that a snapshot was created for
> + * Get the connection that owns the domain that a snapshot was created for.
> + *

Likewise:

 * Provides the connection pointer associated with a snapshot.  The
 * reference counter on the connection is not increased by this
 * call.

> + * WARNING: When writing libvirt bindings in other languages, do not use this
> + * function.  Instead, store the connection and the snapshot object together.
>   *
>   * Returns the connection or NULL.
>   */

ACK with those additions; no need to see a v3.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]