[libvirt] [PATCH] Allow byte[] arrays to be set as a secretValue

Eric Blake eblake at redhat.com
Fri Mar 9 14:58:25 UTC 2012


On 03/09/2012 07:23 AM, Wido den Hollander wrote:
> 
> Signed-off-by: Wido den Hollander <wido at widodh.nl>
> ---
>  src/main/java/org/libvirt/Secret.java      |   11 +++++++++++
>  src/main/java/org/libvirt/jna/Libvirt.java |    1 +
>  2 files changed, 12 insertions(+), 0 deletions(-)

If you will do:

git config format.subjectprefix 'PATCH libvirt-jaba'

it will make it easier to identify when you are patching the java bindings.

> 
> diff --git a/src/main/java/org/libvirt/Secret.java b/src/main/java/org/libvirt/Secret.java
> index e536cf4..48f7895 100644
> --- a/src/main/java/org/libvirt/Secret.java
> +++ b/src/main/java/org/libvirt/Secret.java
> @@ -146,6 +146,17 @@ public class Secret {
>      }
>  
>      /**
> +     * Sets the value of the secret
> +     *
> +     * @return 0 on success, -1 on failure.
> +     */
> +    public int setValue(byte[] value) throws LibvirtException {
> +        int returnValue = libvirt.virSecretSetValue(VSP, value, new NativeLong(value.length), 0);
> +        processError();
> +        return returnValue;
> +    }

It looks like the last commit to libvirt-java.git was more than a year
ago; there's a lot of missing bindings.  Would you be willing to step in
and provide even more patches on this front?  Meanwhile, this patch
looks okay to me, but I've never contributed to libvirt-java; I'll wait
to see if someone who has actually participated in this project has
comments.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120309/31b3d02f/attachment-0001.sig>


More information about the libvir-list mailing list