Re: [PATCH libvirt-java 5/7] Overload Domain.snapshotCreateXML with a method that has a argument for flags

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

 



At Sun, 13 Jan 2013 19:09:27 +0100,
Wido den Hollander wrote:
> 
> The original implementation doesn't have a argument for passing flags. It is
> however still there for backwards compatibility.

s/a argument/an argument/ in this sentence and in the subject.

> Signed-off-by: Wido den Hollander <wido@xxxxxxxxx>
> ---
>  src/main/java/org/libvirt/Domain.java |   24 ++++++++++++++++++++++--
>  1 file changed, 22 insertions(+), 2 deletions(-)
> 
> diff --git a/src/main/java/org/libvirt/Domain.java b/src/main/java/org/libvirt/Domain.java
> index da03c27..6bdc1df 100644
> --- a/src/main/java/org/libvirt/Domain.java
> +++ b/src/main/java/org/libvirt/Domain.java
> @@ -1051,11 +1051,13 @@ public class Domain {
>       *      Documentation</a>
>       * @param xmlDesc
>       *            string containing an XML description of the domain
> +     * @param flags
> +     *            flags for creating the snapshot, see the virDomainSnapshotCreateFlags for the flag options
>       * @return the snapshot, or null on Error
>       * @throws LibvirtException
>       */
> -    public DomainSnapshot snapshotCreateXML(String xmlDesc) throws LibvirtException {
> -        DomainSnapshotPointer ptr = libvirt.virDomainSnapshotCreateXML(VDP, xmlDesc, 0);
> +    public DomainSnapshot snapshotCreateXML(String xmlDesc, int flags) throws LibvirtException {
> +        DomainSnapshotPointer ptr = libvirt.virDomainSnapshotCreateXML(VDP, xmlDesc, flags);
>          processError();
>          DomainSnapshot returnValue = null;
>          if (ptr != null) {
> @@ -1065,6 +1067,24 @@ public class Domain {
>      }
>  
>      /**
> +     * Creates a new snapshot of a domain based on the snapshot xml contained in
> +     * xmlDesc.
> +     *
> +     * This method is still here for backwards compatibility since the C version
> +     * has an additional argument with flags, which is set to 0
> here.

IMO, talking about backwards compatibility and C implementation details
here has no value to the average libvirt-java user. See my comment for
4/7, also.

ACK with the typo fixed and this squashed in:

--- >8 ----
diff --git a/src/main/java/org/libvirt/Domain.java b/src/main/java/org/libvirt/Domain.java
index f80e0e7..52aafb3 100644
--- a/src/main/java/org/libvirt/Domain.java
+++ b/src/main/java/org/libvirt/Domain.java
@@ -1076,9 +1076,11 @@ public class Domain {
     /**
      * Creates a new snapshot of a domain based on the snapshot xml contained in
      * xmlDesc.
+     * <p>
+     * This is just a convenience method, it has the same effect
+     * as calling {@code snapshotCreateXML(xmlDesc, 0);}.
      *
-     * This method is still here for backwards compatibility since the C version
-     * has an additional argument with flags, which is set to 0 here.
+     * @see #snapshotCreateXML(int)
      * @see <a
      *      href="http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSnapshotCreateXML";>Libvirt
      *      Documentation</a>

-- 
AV-Test GmbH, Henricistraße 20, 04155 Leipzig, Germany
Phone: +49 341 265 310 19
Web:<http://www.av-test.org>

Eingetragen am / Registered at: Amtsgericht Stendal (HRB 114076)
Geschaeftsfuehrer (CEO): Andreas Marx, Guido Habicht, Maik Morgenstern

--
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]