[libvirt] [PATCH libvirt-java 3/9] Add virDomainBlockResize to Domain methods

Wido den Hollander wido at widodh.nl
Sat Jan 5 11:48:20 UTC 2013


Signed-off-by: Wido den Hollander <wido at widodh.nl>
---
 src/main/java/org/libvirt/Domain.java |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/main/java/org/libvirt/Domain.java b/src/main/java/org/libvirt/Domain.java
index fc1f665..4b4c572 100644
--- a/src/main/java/org/libvirt/Domain.java
+++ b/src/main/java/org/libvirt/Domain.java
@@ -193,6 +193,24 @@ public class Domain {
     }
 
     /**
+     * Resize a block device of domain while the domain is running.
+     *
+     * @param disk
+     *           path to the block image, or shorthand (like vda)
+     * @param size
+     *           the new size of the block devices
+     * @param flags
+     *           when set to 1, units of size is in bytes instead of KiloBytes
+     * @return 0 on succes, -1 on error
+     * @throws LibvirtException
+     */
+    public int blockResize(String disk, NativeLong size, int flags) throws LibvirtException {
+        int returnValue = libvirt.virDomainBlockResize(VDP, disk, size, flags);
+        processError();
+        return returnValue;
+    }
+
+    /**
      * Dumps the core of this domain on a given file for analysis. Note that for
      * remote Xen Daemon the file path will be interpreted in the remote host.
      *
-- 
1.7.9.5




More information about the libvir-list mailing list