Re: [PATCH libvirt-java 5/9] Implement virDomainUndefineFlags

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

 



At Sat,  5 Jan 2013 12:48:22 +0100,
Wido den Hollander wrote:
> 
> 
> Signed-off-by: Wido den Hollander <wido@xxxxxxxxx>
> ---
>  src/main/java/org/libvirt/Domain.java      |   15 +++++++++++++++
>  src/main/java/org/libvirt/jna/Libvirt.java |    1 +
>  2 files changed, 16 insertions(+)
> 
> diff --git a/src/main/java/org/libvirt/Domain.java b/src/main/java/org/libvirt/Domain.java
> index e0be43d..d393960 100644
> --- a/src/main/java/org/libvirt/Domain.java
> +++ b/src/main/java/org/libvirt/Domain.java
> @@ -1134,6 +1134,21 @@ public class Domain {
>      }
>  
>      /**
> +     * undefines this domain but does not stop if it it is running. With flags option

Undefines (capital u)

s/if it/it if/

> +     * @see <a href="http://libvirt.org/html/libvirt-libvirt.html#virDomainUndefineFlags";>Libvirt Documentation</a>
> +     * @param flags
> +     *            flags for undefining the domain. See virDomainUndefineFlagsValues for more information
> +     * @return 0 on success, -1 on error

Exception on error, never -1. Just use return type void.

> +    public int undefineFlags(int flags) throws LibvirtException {

Should we take advantage of Java's method overloading capability here?

I propose to divert from the mapping rules and just overload the
undefine method with an additional parameter.

> diff --git a/src/main/java/org/libvirt/jna/Libvirt.java b/src/main/java/org/libvirt/jna/Libvirt.java
> index dbd8f6c..2bbc8c3 100644
> --- a/src/main/java/org/libvirt/jna/Libvirt.java
> +++ b/src/main/java/org/libvirt/jna/Libvirt.java
> @@ -228,6 +228,7 @@ public interface Libvirt extends Library {
>      public int virDomainSuspend(DomainPointer virDomainPtr);
>      public int virDomainUpdateDeviceFlags(DomainPointer virDomainPtr, String xml, int flags);
>      public int virDomainUndefine(DomainPointer virDomainPtr);
> +    public int virDomainUndefineFlags(DomainPointer virDomainPtr, int flags);

Please drop the public modifier.

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

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