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

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



At Sat,  5 Jan 2013 12:48:20 +0100,
Wido den Hollander wrote:
> 
> 
> Signed-off-by: Wido den Hollander <wido 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

This is not true as this method will throw an exception on error, it
should never return -1.

Just use return type void instead. Either it will work or throw an exception.

> +     * @throws LibvirtException
> +     */
> +    public int blockResize(String disk, NativeLong size, int flags) throws LibvirtException {
> +        int returnValue = libvirt.virDomainBlockResize(VDP, disk, size, flags);
> +        processError();
> +        return returnValue;
> +    }

Same comment applies to NativeLong as for patch 2/9.

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


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