Re: [libvirt] Libvirt java build problems

2013-02-22 Thread Claudio Bley
At Fri, 22 Feb 2013 15:20:03 +, Daniel P. Berrange wrote: The Fedora build of libvirt-java is currently broken with a strange error: http://kojipkgs.fedoraproject.org//work/tasks/4719/4994719/build.log Buildfile: /builddir/build/BUILD/libvirt-java-0.4.9/build.xml init:

Re: [libvirt] Libvirt java build problems

2013-02-22 Thread Claudio Bley
At Fri, 22 Feb 2013 15:43:58 +, Daniel P. Berrange wrote: On Fri, Feb 22, 2013 at 04:34:19PM +0100, Claudio Bley wrote: At Fri, 22 Feb 2013 15:20:03 +, Daniel P. Berrange wrote: You're using JNA = 3.5.0, right? Yep, that's what F19 rawhide has got now. See commit

Re: [libvirt] [libvirt-glib] object: Add transfer none annotation to argv parameter

2013-04-17 Thread Claudio Bley
At Wed, 17 Apr 2013 10:17:42 +0200, Christophe Fergeau wrote: This makes the parameter to be passed unowned in Vala. This was previously done using a vala metadata file, but it's better to do it directly through a gtk-doc annotation, as this means the gir file will know about this, and thus

[libvirt] [libvirt-java] [PATCH] Fix wrapping of native size_t data type

2013-04-24 Thread Claudio Bley
the size of a native size_t to us, so using this information we define and use class SizeT and class SizeTByReference for wrapping a native size_t and size_t*, respectively. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Domain.java |5 ++-- src/main/java

Re: [libvirt] [libvirt-java] [Patch] remove unused imports

2013-04-29 Thread Claudio Bley
Hi. At Mon, 29 Apr 2013 12:36:20 +0200, Stefan Majer wrote: Hi, Clean up all java classes which have imports which are not used. Greetings Stefan Majer This part would be directly included in the git commit message. You (most likely) don't want that. Could you send your patches

Re: [libvirt] [PATCH] virthreadpthread: don't try to cast pthread_t to void*

2013-05-02 Thread Claudio Bley
At Thu, 02 May 2013 07:54:47 -0600, Eric Blake wrote: [1 multipart/signed (7bit)] [1.1 text/plain; UTF-8 (quoted-printable)] On 05/02/2013 06:05 AM, Guido Günther wrote: This fixes the build on kFreeBSD that otherwise fails with: util/virthreadpthread.c: In function

Re: [libvirt] [libvirt-java] [RFC] simplify java build process

2013-05-08 Thread Claudio Bley
At Tue, 7 May 2013 16:55:06 +0200, Stefan Majer wrote: after adding a proper setting with the maven-compiler-plugin i get: [ERROR] COMPILATION ERROR : [INFO] - [ERROR]

Re: [libvirt] [libvirt-java] [PATCH] Fix wrapping of native size_t data type

2013-05-08 Thread Claudio Bley
At Wed, 24 Apr 2013 15:43:42 +0200, Claudio Bley wrote: Libvirt function parameters having type (pointer to) size_t were wrapped via JNA using int, long or even NativeLong. Alas, none of these is actually correct as the size of size_t may be the same as the size of either (unsigned) int

Re: [libvirt] [libvirt-java] [PATCH] trivial remove unused imports

2013-05-10 Thread Claudio Bley
At Tue, 07 May 2013 08:27:26 -0600, Eric Blake wrote: On 05/07/2013 05:53 AM, Stefan Majer wrote: Signed-off-by: Stefan Majer stefan.majer at gmail dot com --- src/main/java/org/libvirt/jna/Libvirt.java | 1 - src/main/java/org/libvirt/jna/virError.java | 1 - 2 files changed, 2

[libvirt] RFC version information in API docs

2013-05-13 Thread Claudio Bley
Hi. Sometimes, it's a bit hard to determine when exactly a function, flag or macro appeared in libvirt, ie. whether it will be supported on my target machine having a specific version of libvirt or not. So, I have created an enriched version of the API docs, using a XSL stylesheet enumerating

Re: [libvirt] RFC version information in API docs

2013-05-13 Thread Claudio Bley
At Mon, 13 May 2013 13:39:53 +0100, Daniel P. Berrange wrote: On Mon, May 13, 2013 at 02:30:41PM +0200, Claudio Bley wrote: Hi. Sometimes, it's a bit hard to determine when exactly a function, flag or macro appeared in libvirt, ie. whether it will be supported on my target machine

Re: [libvirt] RFC version information in API docs

2013-05-13 Thread Claudio Bley
At Mon, 13 May 2013 21:17:35 +0800, Daniel Veillard wrote: On Mon, May 13, 2013 at 02:30:41PM +0200, Claudio Bley wrote: Hi. Sometimes, it's a bit hard to determine when exactly a function, flag or macro appeared in libvirt, ie. whether it will be supported on my target machine

[libvirt] [PATCH] schema: simplify RNG pattern, remove superfluous optional

2013-06-12 Thread Claudio Bley
Signed-off-by: Claudio Bley cb...@av-test.de --- Just a minor nit which lets Emacs' nxml-mode fail when parsing the corresponding RNC schema. docs/schemas/domaincommon.rng |8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas

Re: [libvirt] [PATCH] schema: simplify RNG pattern, remove superfluous optional

2013-06-12 Thread Claudio Bley
At Wed, 12 Jun 2013 15:29:45 +0200, Jiri Denemark wrote: On Wed, Jun 12, 2013 at 13:51:29 +0200, Claudio Bley wrote: Signed-off-by: Claudio Bley cb...@av-test.de --- Just a minor nit which lets Emacs' nxml-mode fail when parsing the corresponding RNC schema. docs/schemas

Re: [libvirt] [PATCH] remote: Fix a segfault in remoteDomainCreateWithFlags

2013-08-08 Thread Claudio Bley
At Thu, 8 Aug 2013 16:48:46 +0800, Alex Jia wrote: ... # virsh start domain --paused RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=994855 Signed-off-by: Alex Jia a...@redhat.com --- src/remote/remote_driver.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff

[libvirt] SIGSEGV using virConnect.newStream with Python

2013-08-20 Thread Claudio Bley
Hi. I tried this on Fedora 19, using libvirt 1.0.5 and also tested with git v1.1.1-maint as well as git master on Ubuntu 12.04. How to reproduce: python - import libvirt as l c = l.virConnect(test:///default) v = c.virStream() - Here's my GDB session with git master:

[libvirt] [PATCH] tests: fix building without xattr support

2013-08-21 Thread Claudio Bley
only build when xattr support is available. Signed-off-by: Claudio Bley cb...@av-test.de --- I'm by no means an automake/SELinux expert and thus I am unsure whether this is the right thing to do. Especially since in commit 95577af442e5 Eric commented that the Makefile already guaranteed xattr

Re: [libvirt] SIGSEGV using virConnect.newStream with Python

2013-08-21 Thread Claudio Bley
At Tue, 20 Aug 2013 11:34:56 +0200, Claudio Bley wrote: Hi. I tried this on Fedora 19, using libvirt 1.0.5 and also tested with git v1.1.1-maint as well as git master on Ubuntu 12.04. How to reproduce: python - import libvirt as l c = l.virConnect(test:///default) v

Re: [libvirt] [PATCH] tests: fix building without xattr support

2013-08-21 Thread Claudio Bley
At Wed, 21 Aug 2013 13:55:27 +0100, Daniel P. Berrange wrote: On Wed, Aug 21, 2013 at 09:28:26AM +0200, Claudio Bley wrote: Only compile securityselinuxhelper.c if xattr support was detected to avoid this error: securityselinuxhelper.c:34:24: fatal error: attr/xattr.h: No such file

[libvirt] [PATCH] python: simplify complicated conditional assignment

2013-08-21 Thread Claudio Bley
Signed-off-by: Claudio Bley cb...@av-test.de --- Just noticed this while reading the generated .py files. Might save a few cycles eventually... python/generator.py |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/generator.py b/python/generator.py index 427cebc

Re: [libvirt] [PATCH] python: simplify complicated conditional assignment

2013-08-22 Thread Claudio Bley
At Wed, 21 Aug 2013 10:24:16 -0600, Eric Blake wrote: On 08/21/2013 08:05 AM, Claudio Bley wrote: Signed-off-by: Claudio Bley cb...@av-test.de --- Just noticed this while reading the generated .py files. Might save a few cycles eventually... python/generator.py |3

Re: [libvirt] [PATCH] Test for object identity when checking for None in Python

2013-08-23 Thread Claudio Bley
At Fri, 23 Aug 2013 11:25:35 +0800, Guannan Ren wrote: On 08/22/2013 09:56 PM, Claudio Bley wrote: Consistently use is or is not to compare variables to None, because doing so is preferrable, as per PEP 8 (http://www.python.org/dev/peps/pep-0008/#programming-recommendations

Re: [libvirt] [PATCH] python: simplify complicated conditional assignment

2013-08-23 Thread Claudio Bley
At Thu, 22 Aug 2013 09:55:08 +0200, Claudio Bley wrote: At Wed, 21 Aug 2013 10:24:16 -0600, Eric Blake wrote: On 08/21/2013 08:05 AM, Claudio Bley wrote: Signed-off-by: Claudio Bley cb...@av-test.de --- Just noticed this while reading the generated .py files. Might

Re: [libvirt] JNA Error Callback could cause core dump.

2013-12-20 Thread Claudio Bley
Sorry, I must have taken some bad pills. Just realized that I replied to a message already more than a year old. I swear my MUA displayed it as new... At Thu, 19 Dec 2013 16:55:58 +0100, Claudio Bley wrote: At Thu, 18 Oct 2012 15:48:22 +, Benjamin Wang (gendwang) wrote: -- AV-Test GmbH

[libvirt] [libvirt-java] [PATCH] Fix javadoc comments

2014-01-08 Thread Claudio Bley
Correct some typos and paste the right documentation from virInterfaceCreate, virInterfaceDestroy to the Interface.create and Interface.destroy doc comments. --- Pushing under the trivial rule. src/main/java/org/libvirt/Domain.java | 2 +-

[libvirt] [libvirt-java] [PATCH] Fix javadoc warning about snapshotCreateXML(int)

2014-01-08 Thread Claudio Bley
Javadoc complains about: [javadoc] x:\src\libvirt-java1\src\main\java\org\libvirt\Domain.java:1212: warning - Tag @see: can't find snapshotCreateXML(int) in org.libvirt.Domain There is no such method, snapshotCreateXML(String, int) was intended. --- Pushing under the trivial rule.

[libvirt] [libvirt-java] [PATCH] Fix wrapping of virStreamSend

2014-01-08 Thread Claudio Bley
The native virStreamSend function is meant to be used to transfer byte data. Wrapping the function to use a Java String as the data depends on the default charset of the JVM and might impose further problems transferring \0 characters. Use a byte Array as the parameter type instead, as for

[libvirt] [libvirt-java] [PATCH] Avoid calling processError for functions that cannot fail

2014-01-08 Thread Claudio Bley
The libvirt functions virNodeDeviceNumOfCaps, virNodeDeviceGetParent and virNodeDeviceListCaps never indicate an error because they do not fail. --- src/main/java/org/libvirt/Device.java | 19 ++- src/main/java/org/libvirt/jna/Libvirt.java | 2 +- 2 files changed, 7

[libvirt] [libvirt-java] [PATCH] Use virFree in order to release memory acquired from libvirt

2014-01-08 Thread Claudio Bley
libraries, but have to call virFree for pointers orignating from libvirt itself. So, this patch re-adds and uses the virFree method which had been removed in commit 3220de292990bed71828fba2f3700bc846d440f2. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Library.java

Re: [libvirt] [libvirt-java] [PATCH] Avoid calling processError for functions that cannot fail

2014-01-08 Thread Claudio Bley
At Wed, 8 Jan 2014 16:25:30 +0100, Claudio Bley wrote: The libvirt functions virNodeDeviceNumOfCaps, virNodeDeviceGetParent and virNodeDeviceListCaps never indicate an error because they do not fail. --- src/main/java/org/libvirt/Device.java | 19 ++- src/main/java

Re: [libvirt] [libvirt-java] [PATCH] Avoid calling processError for functions that cannot fail

2014-01-08 Thread Claudio Bley
At Wed, 08 Jan 2014 16:31:38 +0100, Claudio Bley wrote: At Wed, 8 Jan 2014 16:25:30 +0100, Claudio Bley wrote: The libvirt functions virNodeDeviceNumOfCaps, virNodeDeviceGetParent and virNodeDeviceListCaps never indicate an error because they do not fail. --- src/main/java/org

[libvirt] [libvirt-java] [PATCH 0/3] Make the Java wrapper more fun to use

2014-01-08 Thread Claudio Bley
test added to exercise it a bit. Claudio Bley (3): Implement interface ByteChannel for Stream class Domain: add screenshot method test: add testDomainScreenshot JUnit test src/main/java/org/libvirt/Domain.java | 11 ++ src/main/java/org/libvirt/Stream.java | 175

[libvirt] [libvirt-java] [PATCH 1/3] Implement interface ByteChannel for Stream class

2014-01-08 Thread Claudio Bley
This makes the Stream class a native citizen of the Java API. It can be used with the NIO Channel API, as well as (In,Out)putStream's using the java.nio.channels.Channels convenience wrappers. --- src/main/java/org/libvirt/Stream.java | 171 -

[libvirt] [libvirt-java] [PATCH 2/3] Domain: add screenshot method

2014-01-08 Thread Claudio Bley
This wraps the native virDomainScreenshot function. --- src/main/java/org/libvirt/Domain.java | 11 +++ src/main/java/org/libvirt/Stream.java | 4 src/main/java/org/libvirt/jna/Libvirt.java | 1 + 3 files changed, 16 insertions(+) diff --git

[libvirt] [libvirt-java] [PATCH 3/3] test: add testDomainScreenshot JUnit test

2014-01-08 Thread Claudio Bley
--- src/test/java/org/libvirt/TestJavaBindings.java | 38 + 1 file changed, 38 insertions(+) diff --git a/src/test/java/org/libvirt/TestJavaBindings.java b/src/test/java/org/libvirt/TestJavaBindings.java index bba4cdb..2d4ad9d 100644 ---

[libvirt] [PATCH] Clarify documentation on possible return values in case of errors

2014-01-08 Thread Claudio Bley
Signed-off-by: Claudio Bley cb...@av-test.de --- src/libvirt.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libvirt.c b/src/libvirt.c index ffd4f8e..73972f2 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -14502,8 +14502,8 @@ virNodeDeviceGetName

[libvirt] [libvirt-java] [PATCH 1/2] Make Device.listCapabilities return only valid array elements

2014-01-08 Thread Claudio Bley
The libvirt function virNodeDeviceListCaps might return fewer elements than requested. Take this into account and properly decode the UTF-8 strings returned. Additionally, the given strings are freed before returning the resulting string array. --- src/main/java/org/libvirt/Device.java |

[libvirt] [libvirt-java] [PATCH 0/2] Fixes for Device.listCapabilities

2014-01-08 Thread Claudio Bley
adds a unit test which simply uses this function. Claudio Bley (2): Make Device.listCapabilities return only valid array elements test: ensure the Device.listCapabilities method works src/main/java/org/libvirt/Device.java | 10 +++--- src/main/java/org/libvirt/jna/Libvirt.java

[libvirt] [libvirt-java] [PATCH 2/2] test: ensure the Device.listCapabilities method works

2014-01-08 Thread Claudio Bley
--- src/test/java/org/libvirt/TestJavaBindings.java | 14 ++ 1 file changed, 14 insertions(+) diff --git a/src/test/java/org/libvirt/TestJavaBindings.java b/src/test/java/org/libvirt/TestJavaBindings.java index bba4cdb..3600844 100644 ---

Re: [libvirt] [PATCH] Clarify documentation on possible return values in case of errors

2014-01-08 Thread Claudio Bley
At Thu, 9 Jan 2014 08:07:25 +0100, Claudio Bley wrote: Signed-off-by: Claudio Bley cb...@av-test.de --- src/libvirt.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libvirt.c b/src/libvirt.c index ffd4f8e..73972f2 100644 [I didn't push this under

[libvirt] [libvirt-java] [PATCH 05/15] Remove processError from Interface class

2014-01-09 Thread Claudio Bley
Wrap any fallible libvirt function in a call to ErrorHandler.processError(..). Also correct wrong javadoc comments stating that methods would return a value in case an error occurs. --- src/main/java/org/libvirt/Interface.java | 43 1 file changed, 11

[libvirt] [libvirt-java] [PATCH 01/15] Start refactoring of error handling

2014-01-09 Thread Claudio Bley
Almost every class contains a processError() method with an identical definition, just forwarding the call to ErrorHandler.processError(Libvirt). This function is always called after a libvirt function call (as per its javadoc comment). But, actually, there's no use in always calling

[libvirt] [libvirt-java] [PATCH 03/15] Remove processError from Domain class

2014-01-09 Thread Claudio Bley
Wrap any fallible libvirt function in a call to ErrorHandler.processError(..). Also update erroneous javadoc comments stating that methods would return a value in case an error occurs. In case of a libvirt error, a LibvirtException is thrown. Add processErrorIfZero(long) to ErrorHandler class

[libvirt] [libvirt-java] [PATCH 04/15] Remove processError from DomainSnapshot class

2014-01-09 Thread Claudio Bley
Wrap any fallible libvirt function in a call to ErrorHandler.processError(..). Also correct wrong javadoc comments stating that methods would return a value in case an error happens. --- src/main/java/org/libvirt/DomainSnapshot.java | 23 ++- 1 file changed, 6 insertions(+),

[libvirt] [libvirt-java] [PATCH 02/15] Remove processError from Device class

2014-01-09 Thread Claudio Bley
Wrap any fallible libvirt function in a call to ErrorHandler.processError(..). --- Note, that this patch depends on another patch[1] still awaiting review. [1] http://www.redhat.com/archives/libvir-list/2014-January/msg00397.html src/main/java/org/libvirt/Device.java | 49

[libvirt] [libvirt-java] [PATCH 00/15] Refactor error handling

2014-01-09 Thread Claudio Bley
mechanical, just wrapping calls of any libvirt function into a call to processError(int) or processErrorT(T). Patch #14 removes the obsolete processError(Libvirt) method. Patch #15 cleans up patch #1. Claudio Bley (15): Start refactoring of error handling Remove processError from Device class

[libvirt] [libvirt-java] [PATCH 06/15] Remove processError method from Network class

2014-01-09 Thread Claudio Bley
Wrap any fallible libvirt function in a call to ErrorHandler.processError(..). Also correct wrong javadoc comments stating that methods would return a value in case an error occurs. --- src/main/java/org/libvirt/Network.java | 61 ++ 1 file changed, 17

[libvirt] [libvirt-java] [PATCH 10/15] Remove processError method from StorageVol class

2014-01-09 Thread Claudio Bley
Wrap any fallible libvirt function in a call to ErrorHandler.processError(..). Also correct wrong javadoc comments stating that methods would return a value in case an error occurs. --- src/main/java/org/libvirt/StorageVol.java | 56 +-- 1 file changed, 16

[libvirt] [libvirt-java] [PATCH 11/15] Remove processError method from Stream class

2014-01-09 Thread Claudio Bley
Wrap any fallible libvirt function in a call to ErrorHandler.processError(..). Also correct wrong javadoc comments stating that methods would return a value in case an error occurs. --- src/main/java/org/libvirt/Stream.java | 64 +++ 1 file changed, 20

[libvirt] [libvirt-java] [PATCH 13/15] Call processError only when virInitialize signalled an error

2014-01-09 Thread Claudio Bley
--- src/main/java/org/libvirt/Library.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/libvirt/Library.java b/src/main/java/org/libvirt/Library.java index 33d3042..95c13cb 100644 --- a/src/main/java/org/libvirt/Library.java +++

[libvirt] [libvirt-java] [PATCH 12/15] Remove processError method from Connect class

2014-01-09 Thread Claudio Bley
Wrap any fallible libvirt function in a call to ErrorHandler.processError(..) and remove calls to the deprecated ErrorHandler.processError(Libvirt) method. Also correct wrong javadoc comments stating that methods would return a value in case an error occurs. ---

[libvirt] [libvirt-java] [PATCH 14/15] Remove ErrorHandler.processError(Libvirt) method

2014-01-09 Thread Claudio Bley
It was deprecated and is no longer used. --- src/main/java/org/libvirt/ErrorHandler.java | 12 1 file changed, 12 deletions(-) diff --git a/src/main/java/org/libvirt/ErrorHandler.java b/src/main/java/org/libvirt/ErrorHandler.java index 01e25d6..c2e7337 100644 ---

[libvirt] [libvirt-java] [PATCH 08/15] Remove processError method from Secret class

2014-01-09 Thread Claudio Bley
Wrap any fallible libvirt function in a call to ErrorHandler.processError(..). Also correct wrong javadoc comments stating that methods would return a value in case an error occurs. --- src/main/java/org/libvirt/Secret.java | 61 +-- 1 file changed, 16

[libvirt] [libvirt-java] [PATCH 07/15] Remove processError method from NetworkFilter class

2014-01-09 Thread Claudio Bley
Wrap any fallible libvirt function in a call to ErrorHandler.processError(..). Also correct wrong javadoc comments stating that methods would return a value in case an error occurs. --- src/main/java/org/libvirt/NetworkFilter.java | 43 +++- 1 file changed, 10

[libvirt] [libvirt-java] [PATCH 09/15] Remove processError method from StoragePool class

2014-01-09 Thread Claudio Bley
Wrap any fallible libvirt function in a call to ErrorHandler.processError(..). Adjust the doc comment for storageVolLookupByName to indicate that it might return null. Also correct wrong javadoc comments stating that methods would return a value in case an error occurs. ---

[libvirt] [libvirt-java] [PATCH 15/15] fixup! Start refactoring of error handling

2014-01-09 Thread Claudio Bley
There's no compelling reason to keep the various processError overloads which were added just to ease refactoring. Consider this squashed in prior of pushing this series. --- src/main/java/org/libvirt/ErrorHandler.java | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff

Re: [libvirt] [PATCH] Clarify documentation on possible return values in case of errors

2014-01-10 Thread Claudio Bley
At Fri, 10 Jan 2014 07:42:52 +0100, Guido Günther wrote: On Thu, Jan 09, 2014 at 08:07:25AM +0100, Claudio Bley wrote: Signed-off-by: Claudio Bley cb...@av-test.de --- src/libvirt.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) ACK. Thanks, pushed

[libvirt] [PATCH] Fix docs for PMWakeup/PMSuspend callback types

2014-01-14 Thread Claudio Bley
s/is waken up/is woken up/ A registered PMSuspendCallback is called when the domain is suspended, not when it is woken up. Signed-off-by: Claudio Bley cb...@av-test.de --- It's just a trivial fix, but I'd like some educated comment on the grammar fix. IMO it is correct, or is there a better way

Re: [libvirt] [PATCH] Fix docs for PMWakeup/PMSuspend callback types

2014-01-15 Thread Claudio Bley
At Wed, 15 Jan 2014 06:49:10 -0700, Eric Blake wrote: On 01/15/2014 12:28 AM, Claudio Bley wrote: s/is waken up/is woken up/ A registered PMSuspendCallback is called when the domain is suspended, not when it is woken up. Signed-off-by: Claudio Bley cb...@av-test.de --- It's

[libvirt] [libvirt-java] [PATCH 01/10] Implement equals and hashCode methods for Connect and Domain

2014-01-16 Thread Claudio Bley
--- src/main/java/org/libvirt/Connect.java | 35 +++ src/main/java/org/libvirt/Domain.java | 46 - src/test/java/org/libvirt/TestJavaBindings.java | 4 +++ 3 files changed, 84 insertions(+), 1 deletion(-) diff --git

[libvirt] [libvirt-java] [PATCH 05/10] Fix Domain.getSchedulerParameters / getSchedulerType

2014-01-16 Thread Claudio Bley
The getSchedulerType method returns a String (the name of the scheduler), not a String array containing a single element. It's OK to just pass null for the second argument to virDomainGetSchedulerType. Ensure to free the returned string. --- src/main/java/org/libvirt/Domain.java | 43

[libvirt] [libvirt-java] [PATCH 09/10] Fix memleak in StorageVol.getPath

2014-01-16 Thread Claudio Bley
--- src/main/java/org/libvirt/StorageVol.java | 10 +- src/main/java/org/libvirt/jna/Libvirt.java | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/libvirt/StorageVol.java b/src/main/java/org/libvirt/StorageVol.java index 1573070..7035c93 100644

[libvirt] [libvirt-java] [PATCH 04/10] Remove unused fields of Error class

2014-01-16 Thread Claudio Bley
These fields of the Error class are no longer used, no need to keep them around. --- src/main/java/org/libvirt/Error.java | 6 -- 1 file changed, 6 deletions(-) diff --git a/src/main/java/org/libvirt/Error.java b/src/main/java/org/libvirt/Error.java index 6f68f57..9da3a80 100644 ---

[libvirt] [libvirt-java] [PATCH 06/10] Fix memleak in Domain.snapshotListNames

2014-01-16 Thread Claudio Bley
We need to free the char* entries of the result array returned ourselves. --- src/main/java/org/libvirt/Domain.java | 14 +++--- src/main/java/org/libvirt/jna/Libvirt.java | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/libvirt/Domain.java

[libvirt] [libvirt-java] [PATCH 07/10] Fix memleak in StoragePool.listVolumes

2014-01-16 Thread Claudio Bley
We need to free the char* entries of the result array returned ourselves. --- src/main/java/org/libvirt/StoragePool.java | 13 ++--- src/main/java/org/libvirt/jna/Libvirt.java | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git

[libvirt] [libvirt-java] [PATCH 00/10] assorted fixes

2014-01-16 Thread Claudio Bley
This fixes a few memleaks and other errors. Note, that the memleak patches depend on the error refactoring patches I posted to this list[1] [1] https://www.redhat.com/archives/libvir-list/2014-January/msg00415.html Claudio Bley (10): Implement equals and hashCode methods for Connect

[libvirt] [libvirt-java] [PATCH 03/10] Fix warnings about accessing static methods

2014-01-16 Thread Claudio Bley
java/org/libvirt/Error.java:217: The static method wrap(int) from the type Error.ErrorDomain should be accessed in a static way --- src/main/java/org/libvirt/Error.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/libvirt/Error.java

[libvirt] [libvirt-java] [PATCH 10/10] Fix memleak in StorageVol.getXMLDesc

2014-01-16 Thread Claudio Bley
--- src/main/java/org/libvirt/StorageVol.java | 8 +++- src/main/java/org/libvirt/jna/Libvirt.java | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/libvirt/StorageVol.java b/src/main/java/org/libvirt/StorageVol.java index 7035c93..47b79f6 100644 ---

[libvirt] [libvirt-java] [PATCH 02/10] Fix warnings using raw types

2014-01-16 Thread Claudio Bley
Eclipse generates this kind of warning: org/libvirt/jna/virConnectCredential.java:20: List is a raw type. References to generic type ListE should be parameterized --- src/main/java/org/libvirt/jna/virConnectAuth.java | 4 ++-- src/main/java/org/libvirt/jna/virConnectCredential.java|

[libvirt] [libvirt-java] [PATCH 08/10] Fix memleak in DomainSnapshot.getXMLDesc

2014-01-16 Thread Claudio Bley
--- src/main/java/org/libvirt/DomainSnapshot.java | 10 +- src/main/java/org/libvirt/jna/Libvirt.java| 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/libvirt/DomainSnapshot.java b/src/main/java/org/libvirt/DomainSnapshot.java index

[libvirt] [libvirt-java] [PATCH] Depend on JNA versions 3.3 to 4.0

2014-01-21 Thread Claudio Bley
Specify a version range for the net.java.dev.jna / jna artefact in order to accept any version we tested the libvirt Java bindings against. --- It's been some time we discussed this[1], but here we go... https://www.redhat.com/archives/libvir-list/2013-September/msg00929.html pom.xml.in | 2 +-

[libvirt] [PATCH] docs: refer to the correct event ID for DomainEventIOErrorReasonCallback

2014-01-22 Thread Claudio Bley
s/_ID_IO_ERROR/_ID_IO_ERROR_REASON/ Signed-off-by: Claudio Bley cb...@av-test.de --- Pushed under the trivial rule. include/libvirt/libvirt.h.in |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in index a448411

[libvirt] [libvirt-java] state of affairs

2014-01-23 Thread Claudio Bley
Hi. It seems the Java wrapper is nearly dead. It has fallen way behind libvirt development. [in my local tree, there're still 120 libvirt API functions missing from the Java interface which /probably/ are worth to be added] I have send a few patches to the list, but no one is willing / able to

Re: [libvirt] [libvirt-java] state of affairs

2014-01-23 Thread Claudio Bley
At Thu, 23 Jan 2014 10:49:18 +, Daniel P. Berrange wrote: On Thu, Jan 23, 2014 at 11:20:46AM +0100, Claudio Bley wrote: Hi. It seems the Java wrapper is nearly dead. It has fallen way behind libvirt development. [in my local tree, there're still 120 libvirt API functions missing

Re: [libvirt] [PATCH] docs: add a permalink to html headers

2014-01-25 Thread Claudio Bley
At Fri, 24 Jan 2014 10:54:13 -0700, Eric Blake wrote: On 01/23/2014 08:24 AM, Claudio Bley wrote: At Tue, 10 Dec 2013 13:45:05 +0100, Michal Privoznik wrote: On 08.12.2013 23:57, Dan Kenigsberg wrote: Note to reviewers: this patch is too naive and has devastating effect of headers

Re: [libvirt] [PATCH] docs: add a permalink to html headers

2014-01-26 Thread Claudio Bley
At Sat, 25 Jan 2014 13:50:02 +0100, Claudio Bley wrote: ACK; Claudio, since you have the adjustment required in your local tree, can you push the overall patch? Sure, I can do it on Monday, if nobody else did it until then. Pushed. Claudio -- AV-Test GmbH, Henricistraße 20, 04155

Re: [libvirt] [PATCH] event: improve public API docs

2014-02-04 Thread Claudio Bley
At Tue, 31 Dec 2013 08:21:29 -0700, Eric Blake wrote: @@ -132,17 +151,20 @@ virEventAddTimeout(int timeout, * @timer: timer id to change * @timeout: time between events in milliseconds * - * Change frequency for a timer. + * Change frequency for a timer. This function + * requires

Re: [libvirt] [PATCH] event: improve public API docs

2014-02-04 Thread Claudio Bley
At Tue, 4 Feb 2014 10:23:22 +, Daniel P. Berrange wrote: On Tue, Feb 04, 2014 at 10:07:58AM +0100, Claudio Bley wrote: At Tue, 31 Dec 2013 08:21:29 -0700, Eric Blake wrote: @@ -132,17 +151,20 @@ virEventAddTimeout(int timeout, * @timer: timer id to change * @timeout

[libvirt] virDomainGetMaxVcpus does not work as expected

2014-02-13 Thread Claudio Bley
Hi. When calling virDomainGetMaxVcpus (http://libvirt.org/html/libvirt-libvirt.html#virDomainGetMaxVcpus) on an inactive domain, I receive this error: scala res2.getMaxVcpus() libvirt: Domain Config error : Requested operation is not valid: domain is not running org.libvirt.LibvirtException:

[libvirt] [libvirt-java] [PATCH 20/65] Remove processError method from Network class

2014-02-13 Thread Claudio Bley
Wrap any fallible libvirt function in a call to ErrorHandler.processError(..). Also correct wrong javadoc comments stating that methods would return a value in case an error occurs. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Network.java | 61

[libvirt] [libvirt-java] [PATCH 18/65] Remove processError from DomainSnapshot class

2014-02-13 Thread Claudio Bley
Wrap any fallible libvirt function in a call to ErrorHandler.processError(..). Also correct wrong javadoc comments stating that methods would return a value in case an error happens. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/DomainSnapshot.java | 23

[libvirt] [libvirt-java] [PATCH 02/65] Fix warnings about accessing static methods

2014-02-13 Thread Claudio Bley
java/org/libvirt/Error.java:217: The static method wrap(int) from the type Error.ErrorDomain should be accessed in a static way Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Error.java |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src

[libvirt] [libvirt-java] [PATCH 03/65] Fix typos in Error.java

2014-02-13 Thread Claudio Bley
Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Error.java |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/libvirt/Error.java b/src/main/java/org/libvirt/Error.java index 6f68f57..ef339bd 100644 --- a/src/main/java/org

[libvirt] [libvirt-java] [PATCH 04/65] test: fix typo in testConnection()

2014-02-13 Thread Claudio Bley
Signed-off-by: Claudio Bley cb...@av-test.de --- src/test/java/org/libvirt/TestJavaBindings.java |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/org/libvirt/TestJavaBindings.java b/src/test/java/org/libvirt/TestJavaBindings.java index bba4cdb..9e7fa82 100644

[libvirt] [libvirt-java] [PATCH 13/65] Make Device.listCapabilities return only valid array elements

2014-02-13 Thread Claudio Bley
The libvirt function virNodeDeviceListCaps might return fewer elements than requested. Take this into account and properly decode the UTF-8 strings returned. Additionally, the given strings are freed before returning the resulting string array. Signed-off-by: Claudio Bley cb...@av-test.de

[libvirt] [libvirt-java] [PATCH 09/65] jna: load virt-0 or virt library depending on the platform

2014-02-13 Thread Claudio Bley
On Windows, the libvirt DLL is called libvirt-0.dll. Trying to load the virt library hence fails to find the file. Branch on the platform and load virt-0 if we're running on this OS, use virt otherwise. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/jna/Libvirt.java

[libvirt] [libvirt-java] [PATCH 14/65] test: ensure the Device.listCapabilities method works

2014-02-13 Thread Claudio Bley
Signed-off-by: Claudio Bley cb...@av-test.de --- src/test/java/org/libvirt/TestJavaBindings.java | 14 ++ 1 file changed, 14 insertions(+) diff --git a/src/test/java/org/libvirt/TestJavaBindings.java b/src/test/java/org/libvirt/TestJavaBindings.java index a25c4f3..0123e6a 100644

[libvirt] [libvirt-java] [PATCH 10/65] Fix wrapping of native size_t data type

2014-02-13 Thread Claudio Bley
the size of a native size_t to us, so using this information we define and use class SizeT and class SizeTByReference for wrapping a native size_t and size_t*, respectively. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Domain.java |5 +- src/main/java/org

[libvirt] [libvirt-java] [PATCH 19/65] Remove processError from Interface class

2014-02-13 Thread Claudio Bley
Wrap any fallible libvirt function in a call to ErrorHandler.processError(..). Also correct wrong javadoc comments stating that methods would return a value in case an error occurs. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Interface.java | 43

[libvirt] [libvirt-java] [PATCH 05/65] test: ensure that exceptions are thrown when expected

2014-02-13 Thread Claudio Bley
Signed-off-by: Claudio Bley cb...@av-test.de --- src/test/java/org/libvirt/TestJavaBindings.java |2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/java/org/libvirt/TestJavaBindings.java b/src/test/java/org/libvirt/TestJavaBindings.java index 9e7fa82..a25c4f3 100644 --- a/src

[libvirt] [libvirt-java] [PATCH 08/65] Depend on JNA versions 3.4.1 to 4.0.0

2014-02-13 Thread Claudio Bley
Specify a version range for the net.java.dev.jna / jna artifact in order to accept any version we tested the libvirt Java bindings against. Signed-off-by: Claudio Bley cb...@av-test.de --- As discussed previously[1], with a little delay, here's the patch. [1]: http://www.redhat.com/archives

[libvirt] [libvirt-java] [PATCH 23/65] Remove processError method from StoragePool class

2014-02-13 Thread Claudio Bley
Wrap any fallible libvirt function in a call to ErrorHandler.processError(..). Adjust the doc comment for storageVolLookupByName to indicate that it might return null. Also correct wrong javadoc comments stating that methods would return a value in case an error occurs. Signed-off-by: Claudio

[libvirt] [libvirt-java] [PATCH 21/65] Remove processError method from NetworkFilter class

2014-02-13 Thread Claudio Bley
Wrap any fallible libvirt function in a call to ErrorHandler.processError(..). Also correct wrong javadoc comments stating that methods would return a value in case an error occurs. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/NetworkFilter.java | 43

[libvirt] [libvirt-java] [PATCH 39/65] Introduce event loop support

2014-02-13 Thread Claudio Bley
Add initEventLoop(), processEvent(), runEventLoop() and stopEventLoop() static methods to the Library class. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Library.java | 91 src/main/java/org/libvirt/jna/Libvirt.java |4 ++ 2

[libvirt] [libvirt-java] [PATCH 27/65] Call processError only when virInitialize signalled an error

2014-02-13 Thread Claudio Bley
Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Library.java |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/libvirt/Library.java b/src/main/java/org/libvirt/Library.java index 33d3042..95c13cb 100644 --- a/src/main/java

[libvirt] [libvirt-java] [PATCH 17/65] Remove processError from Domain class

2014-02-13 Thread Claudio Bley
to handle special libvirt return codes, such as for virDomainGetMaxMemory. Use it in Domain.getMaxMemory(). Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Domain.java | 328 +-- src/main/java/org/libvirt/ErrorHandler.java |5 + 2 files

[libvirt] [libvirt-java] [PATCH 15/65] Start refactoring of error handling

2014-02-13 Thread Claudio Bley
. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/ErrorHandler.java | 47 ++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/libvirt/ErrorHandler.java b/src/main/java/org/libvirt/ErrorHandler.java index 434c85d

[libvirt] [libvirt-java] [PATCH 07/65] Ignore editor backup files

2014-02-13 Thread Claudio Bley
Signed-off-by: Claudio Bley cb...@av-test.de --- .gitignore |2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index b02fd55..28ddc6e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +*~ +\#*\# .classpath .project .settings -- 1.7.9.5 -- libvir-list

[libvirt] [libvirt-java] [PATCH 11/65] Use virFree in order to release memory acquired from libvirt

2014-02-13 Thread Claudio Bley
libraries, but have to call virFree for pointers orignating from libvirt itself. So, this patch re-adds and uses the virFree method which had been removed in commit 3220de292990bed71828fba2f3700bc846d440f2. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Library.java

[libvirt] [libvirt-java] [PATCH 31/65] Fix memleak in Domain.snapshotListNames

2014-02-13 Thread Claudio Bley
We need to free the char* entries of the result array returned ourselves. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Domain.java | 14 +++--- src/main/java/org/libvirt/jna/Libvirt.java |2 +- 2 files changed, 8 insertions(+), 8 deletions

  1   2   3   4   5   >