[libvirt] [PATCH libvirt-java 4/7] Overload Domain.snapshotListNames with a method that has an addition flags argument.

Claudio Bley cbley at av-test.de
Wed Jan 23 14:47:56 UTC 2013


You're using tabs in the subject line. Is this intentional?

In the subject:

s/addition/additional/

At Sun, 13 Jan 2013 19:09:26 +0100,
Wido den Hollander wrote:
> 
> This commit also adds virDomainSnapshotListFlags which is used by various snapshot
> related methods.
> 
> Signed-off-by: Wido den Hollander <wido at widodh.nl>
> ---
>  src/main/java/org/libvirt/Domain.java |   54 +++++++++++++++++++++++++++++++--
>  1 file changed, 51 insertions(+), 3 deletions(-)
> 
> diff --git a/src/main/java/org/libvirt/Domain.java b/src/main/java/org/libvirt/Domain.java
> index 8f4d9da..da03c27 100644
> --- a/src/main/java/org/libvirt/Domain.java
> +++ b/src/main/java/org/libvirt/Domain.java
> @@ -87,6 +87,40 @@ public class Domain {
>          static final int SNAPSHOTS_METADATA = (1 << 1);
>      }
>  
> +    static final class SnapshotListFlags {
> +        /**
> +         * Filter by snapshots with no parents, when listing a domain
> +         */
> +        static final int ROOTS       = (1 << 0);

Again, this should be public.

> @@ -1072,6 +1106,20 @@ public class Domain {
>      }
>  
>      /**
> +     * Collect the list of domain snapshots for the given domain.
> +     * This method is here for backwards compatibility.

Yes and no. It's a convenience method one can use when not intending
to specify flags. Talking about backwards compatibility in that
comment suggests that this method is deprecated and/or should not be
used.

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 8ff4910..9a2d968 100644
--- a/src/main/java/org/libvirt/Domain.java
+++ b/src/main/java/org/libvirt/Domain.java
@@ -94,38 +94,38 @@ public class Domain {
         public static final int SNAPSHOTS_METADATA = (1 << 1);
     }

-    static final class SnapshotListFlags {
+    public static final class SnapshotListFlags {
         /**
          * Filter by snapshots with no parents, when listing a domain
          */
-        static final int ROOTS       = (1 << 0);
+        public static final int ROOTS       = (1 << 0);

         /**
          * List all descendants, not just children, when listing a snapshot
          */
-        static final int DESCENDANTS = (1 << 0);
+        public static final int DESCENDANTS = (1 << 0);

         /** For historical reasons, groups do not use contiguous bits. */

         /**
          * Filter by snapshots with no children
          */
-        static final int LEAVES      = (1 << 2);
+        public static final int LEAVES      = (1 << 2);

         /**
          * Filter by snapshots that have children
          */
-        static final int NO_LEAVES   = (1 << 3);
+        public static final int NO_LEAVES   = (1 << 3);

         /**
          * Filter by snapshots which have metadata
          */
-        static final int METADATA    = (1 << 1);
+        public static final int METADATA    = (1 << 1);

         /**
          * Filter by snapshots with no metadata
          */
-        static final int NO_METADATA = (1 << 4);
+        public static final int NO_METADATA = (1 << 4);
     }

     /**
@@ -1114,11 +1114,14 @@ public class Domain {

     /**
      * Collect the list of domain snapshots for the given domain.
-     * This method is here for backwards compatibility.
+     * <p>
+     * This is just a convenience method, it has the same effect
+     * as calling {@code snapshotListNames(0);}.
      *
+     * @see #snapshotListNames(int)
      * @see <a
-     *      href="http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSnapshotListNames">Libvirt
-     *      Documentation</a>
+     *      href="http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSnapshotListNames">
+     *        virDomainSnapshotListNames</a>
      * @return The list of names, or null if an error
      * @throws LibvirtException
      */

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




More information about the libvir-list mailing list