[libvirt] [PATCH libvirt-java 2/7] Implement virStorageVolResize by adding resize to StorageVol

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


At Sun, 13 Jan 2013 19:09:24 +0100,
Wido den Hollander wrote:
> 
> This allows us to resize storage pool volumes.
> 
> Signed-off-by: Wido den Hollander <wido at widodh.nl>
> ---
>  src/main/java/org/libvirt/StorageVol.java  |   36 ++++++++++++++++++++++++++++
>  src/main/java/org/libvirt/jna/Libvirt.java |    1 +
>  2 files changed, 37 insertions(+)
> 
> diff --git a/src/main/java/org/libvirt/StorageVol.java b/src/main/java/org/libvirt/StorageVol.java
> index 4b9db80..bc0c01f 100644
> --- a/src/main/java/org/libvirt/StorageVol.java
> +++ b/src/main/java/org/libvirt/StorageVol.java
> @@ -22,6 +22,23 @@ public class StorageVol {
>          static final int VIR_STORAGE_POOL_DELETE_ZEROED = 1;
>      }
>  
> +    static final class ResizeFlags {

This class and its members are not public and hence cannot be used
from client code.

This makes me wonder, did you actually use those flags in your code?
That would only be possible if you author your code in the org.libvirt
package... which shouldn't be done in the first place.

There are other pre-existing flags following this pattern, which
has been a thorn in my side for quite some time. I'll create a
follow up patch.

> @@ -33,6 +50,8 @@ public class StorageVol {
>          VIR_STORAGE_VOL_BLOCK
>      }
>  
> +
> +

Spurious white space addition.

ACK with this squashed in:

--- >8 -----
diff --git a/src/main/java/org/libvirt/StorageVol.java b/src/main/java/org/libvirt/StorageVol.java
index bc0c01f..39776b2 100644
--- a/src/main/java/org/libvirt/StorageVol.java
+++ b/src/main/java/org/libvirt/StorageVol.java
@@ -22,21 +22,21 @@ public class StorageVol {
         static final int VIR_STORAGE_POOL_DELETE_ZEROED = 1;
     }

-    static final class ResizeFlags {
+    public static final class ResizeFlags {
         /**
          * force allocation of new size
         */
-        static final int ALLOCATE = 1;
+        public static final int ALLOCATE = 1;

         /**
          * size is relative to current
          */
-        static final int DELTA = 2;
+        public static final int DELTA = 2;

         /**
          * allow decrease in capacity
          */
-        static final int SHRINK = 4;
+        public static final int SHRINK = 4;
     }

     public static enum Type {
@@ -50,8 +50,6 @@ public class StorageVol {
         VIR_STORAGE_VOL_BLOCK
     }

-
-
     /**
      * the native virStorageVolPtr.
      */

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