Re: [libvirt] [PATCHv4 02/10] Implement domainMemoryStats API slot for LXC driver.

2014-02-21 Thread Michal Privoznik
On 20.02.2014 22:04, Thorsten Behrens wrote: Hi Michal, thx for further cleaning up, and pushing - Michal Privoznik wrote: +if (!virCgroupGetMemoryUsage(priv-cgroup, mem_usage)) +goto cleanup; + +ret = 0; +if (!virDomainObjIsActive(vm)) +goto cleanup; I think

[libvirt] [PATCH] Add a stub for virCgroupGetDomainTotalCpuStats

2014-02-21 Thread Ján Tomko
Commit 6515889 broke the build on FreeBSD: In function `qemuDomainGetCPUStats': /../../src/qemu/qemu_driver.c:16102: undefined reference to `virCgroupGetDomainTotalCpuStats' --- Pushed as a build-breaker. src/util/vircgroup.c | 11 +++ 1 file changed, 11 insertions(+) diff --git

Re: [libvirt] Question about building libvirt.so

2014-02-21 Thread Cedric Bosdonnat
Hello Vik, On Thu, 2014-02-20 at 15:14 -0800, vikhyath reddy wrote: Thanks for libvirt. It is a life saver. I am in the process of writing some custom wrappers for libvirt so that it can be easily accessed from nodejs using the nodejs-ffi interfacing (basically describes a way to convert

[libvirt] [PATCH] XML: Escape double-hyphens in XML comment

2014-02-21 Thread Philipp Hahn
To quote http://www.w3.org/TR/REC-xml/#sec-comments: For compatibility, the string -- (double-hyphen) must not occur within comments. For example this breaks creating snapshots: $ virsh snapshot-create-as $VM comment--bug $ xmllint --noout /var/lib/libvirt/qemu/snapshot/$VM/comment--bug.xml

[libvirt] [PATCH] Ignore additional fields in iscsiadm output

2014-02-21 Thread Ján Tomko
There has been a new field introduced in iscsiadm --mode session output [1], but our regex only expects four fields. This breaks startup of iscsi pools: error: Failed to start pool iscsi error: internal error: cannot find session Fix this by ignoring anything after the fourth field.

Re: [libvirt] [PATCH] Ignore additional fields in iscsiadm output

2014-02-21 Thread Daniel P. Berrange
On Fri, Feb 21, 2014 at 11:01:17AM +0100, Ján Tomko wrote: There has been a new field introduced in iscsiadm --mode session output [1], but our regex only expects four fields. This breaks startup of iscsi pools: error: Failed to start pool iscsi error: internal error: cannot find session

Re: [libvirt] [PATCH] Ignore additional fields in iscsiadm output

2014-02-21 Thread Ján Tomko
On 02/21/2014 11:08 AM, Daniel P. Berrange wrote: On Fri, Feb 21, 2014 at 11:01:17AM +0100, Ján Tomko wrote: There has been a new field introduced in iscsiadm --mode session output [1], but our regex only expects four fields. This breaks startup of iscsi pools: error: Failed to start pool

Re: [libvirt] [libvirt-java] [PATCH 01/65] Fix warnings about using raw types

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:09PM +0100, Claudio Bley wrote: 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 Signed-off-by: Claudio Bley cb...@av-test.de ---

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

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:13PM +0100, Claudio Bley wrote: Signed-off-by: Claudio Bley cb...@av-test.de --- src/test/java/org/libvirt/TestJavaBindings.java |2 ++ 1 file changed, 2 insertions(+) ACK Daniel -- |: http://berrange.com -o-

Re: [libvirt] [libvirt-java] [PATCH 06/65] Make comments proper javadoc comments for enum constants

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:14PM +0100, Claudio Bley wrote: Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Error.java | 397 ++ 1 file changed, 262 insertions(+), 135 deletions(-) ACK Daniel -- |: http://berrange.com

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

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:10PM +0100, Claudio Bley wrote: 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 +++---

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

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:12PM +0100, Claudio Bley wrote: Signed-off-by: Claudio Bley cb...@av-test.de --- src/test/java/org/libvirt/TestJavaBindings.java |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ACK Daniel -- |: http://berrange.com -o-

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

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:16PM +0100, Claudio Bley wrote: 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

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

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:17PM +0100, Claudio Bley wrote: 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

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

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:18PM +0100, 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 13/65] Make Device.listCapabilities return only valid array elements

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:21PM +0100, Claudio Bley wrote: 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

Re: [libvirt] [libvirt-java] [PATCH 12/65] tests: remove obsolete test driver

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:20PM +0100, Claudio Bley wrote: JUnit is used for quite some time now, which supercedes the tests defined in the old test class. Signed-off-by: Claudio Bley cb...@av-test.de --- src/test/java/test.java | 280 ---

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

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:15PM +0100, Claudio Bley wrote: Signed-off-by: Claudio Bley cb...@av-test.de --- .gitignore |2 ++ 1 file changed, 2 insertions(+) ACK. Counts as a trivial patch that can be pushed without asking. Daniel -- |: http://berrange.com -o-

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

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:22PM +0100, Claudio Bley wrote: Signed-off-by: Claudio Bley cb...@av-test.de --- src/test/java/org/libvirt/TestJavaBindings.java | 14 ++ 1 file changed, 14 insertions(+) ACK Daniel -- |: http://berrange.com -o-

Re: [libvirt] [libvirt-java] [PATCH 16/65] Remove processError from Device class

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:24PM +0100, Claudio Bley wrote: Wrap any fallible libvirt function in a call to ErrorHandler.processError(..). Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Device.java | 49 ++--- 1 file changed, 14

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

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:23PM +0100, Claudio Bley wrote: 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

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

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:25PM +0100, Claudio Bley wrote: 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

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

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:27PM +0100, Claudio Bley wrote: 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

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

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:28PM +0100, Claudio Bley wrote: 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

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

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:26PM +0100, Claudio Bley wrote: 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

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

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:35PM +0100, Claudio Bley wrote: Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Library.java |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ACK Regards, Daniel -- |: http://berrange.com -o-

Re: [libvirt] [libvirt-java] [PATCH 24/65] Remove processError method from StorageVol class

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:32PM +0100, Claudio Bley wrote: 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

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

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:19PM +0100, Claudio Bley wrote: When JNA is linked to a different runtime library than libvirt, using JNA's Native.free will probably lead to crashes as witnessed on Windows: # A fatal error has been detected by the Java Runtime Environment: # #

Re: [libvirt] [libvirt-java] [PATCH 28/65] Remove ErrorHandler.processError(Libvirt) method

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:36PM +0100, Claudio Bley wrote: It was deprecated and is no longer used. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/ErrorHandler.java | 12 1 file changed, 12 deletions(-) ACK Regards, Daniel -- |:

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

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:31PM +0100, Claudio Bley wrote: 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

Re: [libvirt] [libvirt-java] [PATCH 30/65] Fix Domain.getSchedulerParameters / getSchedulerType

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:38PM +0100, Claudio Bley wrote: 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

Re: [libvirt] [libvirt-java] [PATCH 29/65] Implement equals and hashCode methods for Connect and Domain

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:37PM +0100, Claudio Bley wrote: Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Connect.java | 35 + src/main/java/org/libvirt/Domain.java | 48 ++-

Re: [libvirt] [libvirt-java] [PATCH 25/65] Remove processError method from Stream class

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:33PM +0100, Claudio Bley wrote: 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

Re: [libvirt] [libvirt-java] [PATCH 32/65] Fix memleak in StoragePool.listVolumes

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:40PM +0100, Claudio Bley wrote: 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/StoragePool.java | 13 ++---

Re: [libvirt] [libvirt-java] [PATCH 35/65] Fix memleak in StorageVol.getXMLDesc

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:43PM +0100, Claudio Bley wrote: Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/StorageVol.java |8 +++- src/main/java/org/libvirt/jna/Libvirt.java |2 +- 2 files changed, 8 insertions(+), 2 deletions(-) ACK Regards,

Re: [libvirt] [PATCH] make virDomainGetMaxVcpus work on inactive domains

2014-02-21 Thread Claudio Bley
At Thu, 20 Feb 2014 12:19:35 -0700, Jim Fehlig wrote: Claudio Bley wrote: Signed-off-by: Claudio Bley cb...@av-test.de --- OK, how about this patch? While at it, should I convert the VIR_DOMAIN_VCPU_* instances to VIR_DOMAIN_AFFECT_* instances for consistency?

Re: [libvirt] [libvirt-java] [PATCH 26/65] Remove processError method from Connect class

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:34PM +0100, Claudio Bley wrote: 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

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

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:39PM +0100, Claudio Bley wrote: 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 +++---

Re: [libvirt] [libvirt-java] [PATCH 38/65] Implement Connect.setKeepAlive

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:46PM +0100, Claudio Bley wrote: This wraps the virConnectSetKeepAlive libvirt function available since version 0.9.8. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Connect.java | 34

Re: [libvirt] [libvirt-java] [PATCH 40/65] Add constants for enum virDomainEventID

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:48PM +0100, Claudio Bley wrote: Note: these are only used internally. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Connect.java | 20 1 file changed, 20 insertions(+) ACK Regards, Daniel -- |:

Re: [libvirt] [libvirt-java] [PATCH 33/65] Fix memleak in DomainSnapshot.getXMLDesc

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:41PM +0100, Claudio Bley wrote: Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/DomainSnapshot.java | 10 +- src/main/java/org/libvirt/jna/Libvirt.java|2 +- 2 files changed, 10 insertions(+), 2 deletions(-) ACK

Re: [libvirt] [libvirt-java] [PATCH 36/65] jna: Wrap the virEvent(Add, Remove)Timeout libvirt functions

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:44PM +0100, Claudio Bley wrote: These functions are not (yet) exposed in the public org.libvirt package but only used internally. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/jna/Libvirt.java | 11 +++ 1 file changed,

Re: [libvirt] [libvirt-java] [PATCH 41/65] Prepare to define proper domain event callback support

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:49PM +0100, Claudio Bley wrote: Remove the public domainEventRegisterAny and domainEventDeregisterAny methods. These methods basically were of no use since the only thing you could register was a generic callback. At runtime, you would have to provide a real

Re: [libvirt] [libvirt-java] [PATCH 43/65] events: handle registration for IOError events

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:51PM +0100, Claudio Bley wrote: Add IOErrorActionListener and IOErrorAction enum which is handed to the onIOError callback method when an IO error event occurs. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Connect.java

Re: [libvirt] [libvirt-java] [PATCH 44/65] events: handle registration for Reboot events

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:52PM +0100, Claudio Bley wrote: Add RebootListener interface in package org.libvirt.event and implement addRebootListener methods in classes Domain and Connect. Add removeRebootListener to Connect class. Signed-off-by: Claudio Bley cb...@av-test.de ---

Re: [libvirt] [libvirt-java] [PATCH 34/65] Fix memleak in StorageVol.getPath

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:42PM +0100, Claudio Bley wrote: Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/StorageVol.java | 10 +- src/main/java/org/libvirt/jna/Libvirt.java |2 +- 2 files changed, 10 insertions(+), 2 deletions(-) ACK

Re: [libvirt] [libvirt-java] [PATCH 49/65] Implement connection close callback support

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:57PM +0100, Claudio Bley wrote: There can only be a single connection close listener registered per connection object. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Connect.java | 57

Re: [libvirt] [libvirt-java] [PATCH 46/65] test: add unit test for domain lifecycle events

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:54PM +0100, Claudio Bley wrote: Signed-off-by: Claudio Bley cb...@av-test.de --- src/test/java/org/libvirt/TestJavaBindings.java | 69 +++ 1 file changed, 69 insertions(+) ACK Regards, Daniel -- |: http://berrange.com -o-

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

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:47PM +0100, Claudio Bley wrote: 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

Re: [libvirt] [libvirt-java] [PATCH 45/65] events: handle registration of domain lifecycle events

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:53PM +0100, Claudio Bley wrote: Add LifecycleListener interface which needs to be implemented when the user wishes to receive lifecycle change events on domains. The DomainEvent class represents the kind of event that occurred including details on that event.

Re: [libvirt] [libvirt-java] [PATCH 48/65] events: add support for PMSuspend events

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:56PM +0100, Claudio Bley wrote: Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Connect.java | 59 src/main/java/org/libvirt/Domain.java | 20 +++

Re: [libvirt] [libvirt-java] [PATCH 50/65] Implement Connect.getSysinfo

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:58PM +0100, Claudio Bley wrote: This wraps the virConnectGetSysinfo function available since libvirt version 0.8.8. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Connect.java | 21 +

Re: [libvirt] [libvirt-java] [PATCH 53/65] Implement Secret.getUsageType

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:23:01PM +0100, Claudio Bley wrote: This wraps the virSecretGetUsageType libvirt function available since version 0.7.1. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Secret.java |5 +

Re: [libvirt] [libvirt-java] [PATCH 52/65] Implement Domain.memoryPeek

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:23:00PM +0100, Claudio Bley wrote: This wraps the virDomainMemoryPeek libvirt function, available since version 0.4.5. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Domain.java| 40 ++

Re: [libvirt] [libvirt-java] [PATCH 55/65] Implement Domain.reset

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:23:03PM +0100, Claudio Bley wrote: This wraps the virDomainReset libvirt function available since version 0.9.7. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Domain.java |7 +++

Re: [libvirt] [libvirt-java] [PATCH 59/65] Implement Domain.screenshot

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:23:07PM +0100, Claudio Bley wrote: This wraps the native virDomainScreenshot libvirt function available since version 0.9.2. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Domain.java | 10 ++

Re: [libvirt] [libvirt-java] [PATCH 60/65] test: add testDomainScreenshot JUnit test

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:23:08PM +0100, Claudio Bley wrote: Signed-off-by: Claudio Bley cb...@av-test.de --- src/test/java/org/libvirt/TestJavaBindings.java | 44 +++ 1 file changed, 44 insertions(+) ACK Regards, Daniel -- |: http://berrange.com -o-

Re: [libvirt] [libvirt-java] [PATCH 58/65] Implement interface ByteChannel for Stream class

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:23:06PM +0100, Claudio Bley wrote: 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. Signed-off-by: Claudio Bley

Re: [libvirt] [libvirt-java] [PATCH 42/65] Add constructIncRef factory method to Domain class

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:50PM +0100, Claudio Bley wrote: This method constructs a new Domain class instance while increasing the reference count on the virDomainPtr in order to make sure the Domain object owns the given virDomainPtr. Signed-off-by: Claudio Bley cb...@av-test.de ---

Re: [libvirt] [libvirt-java] [PATCH 47/65] events: handle registration for PMWakeup events

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:55PM +0100, Claudio Bley wrote: Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Connect.java | 57 src/main/java/org/libvirt/Domain.java | 20 +++

Re: [libvirt] [libvirt-java] [PATCH 54/65] Implement Domain.isUpdated

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:23:02PM +0100, Claudio Bley wrote: This wraps the virDomainIsUpdated libvirt function available since version 0.8.6. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Domain.java |8

Re: [libvirt] [libvirt-java] [PATCH 62/65] Connect: add constructors using java.net.URI params

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:23:10PM +0100, Claudio Bley wrote: Additionally, add an OpenFlags enum to the Connect classes which implements the BitFlags interface. This should be used when creating a read-only connection or to prevent using URI aliases. Signed-off-by: Claudio Bley

Re: [libvirt] [PATCH] XML: Escape double-hyphens in XML comment

2014-02-21 Thread Ján Tomko
On 02/21/2014 10:01 AM, Philipp Hahn wrote: To quote http://www.w3.org/TR/REC-xml/#sec-comments: For compatibility, the string -- (double-hyphen) must not occur within comments. For example this breaks creating snapshots: $ virsh snapshot-create-as $VM comment--bug $ xmllint --noout

Re: [libvirt] [libvirt-java] [PATCH 63/65] Replace Connect.getLibVirVersion method with Library.getVersion

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:23:11PM +0100, Claudio Bley wrote: It should not be necessary to create a Connect object in order to determine the version of the libvirt library. Introduce Library.getVersion which returns this information. Deprecate Connect.getLibVirVersion but keep it for

Re: [libvirt] [libvirt-java] [PATCH 37/65] Implement Connect.isAlive

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:45PM +0100, Claudio Bley wrote: This wraps the virConnectIsAlive libvirt function available since version 0.9.8. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Connect.java | 12

Re: [libvirt] [libvirt-java] [PATCH 64/65] Replace static connectionVersion method with getLibVersion

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:23:12PM +0100, Claudio Bley wrote: Since the libvirt version information is a property of an *instance* of a connnection, the method to retrieve this information should not be static. Deprecate its use and recommend using aConnect.getLibVersion instead.

Re: [libvirt] [PATCH v2 glib] gobject-stream: fix issue found by coverity

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 20, 2014 at 04:58:21PM +0100, Pavel Hrdina wrote: The coverity server found issue in gvir_stream_close function that we ignore return values of g_input_stream_close and g_output_stream_close, but we also ignore the error message and we assume that it's closed without error. Now

Re: [libvirt] [libvirt-java] [PATCH 61/65] Add helper for handling bit-flags

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:23:09PM +0100, Claudio Bley wrote: Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/BitFlags.java | 18 ++ 1 file changed, 18 insertions(+) create mode 100644 src/main/java/org/libvirt/BitFlags.java ACK Regards,

Re: [libvirt] [libvirt-java] [PATCH 57/65] Implement Domain.sendKey

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:23:05PM +0100, Claudio Bley wrote: This wraps the virDomainSendKey libvirt function available since version 0.9.3. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Domain.java | 12

Re: [libvirt] [libvirt-java] [PATCH 00/65]

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:08PM +0100, Claudio Bley wrote: Hi. Here are a few patches that piled up in my local branch. Some of them I already submitted to this list, but there has been no reponse to them. Included are a few trivial fixes as well as memory leak fixes and additions to

Re: [libvirt] [PATCH v12 01/11] change used_by: specify both driver and domain

2014-02-21 Thread Daniel P. Berrange
On Mon, Feb 17, 2014 at 09:31:36AM +0100, Cedric Bosdonnat wrote: diff --git a/src/util/virpci.c b/src/util/virpci.c index 00d1064..4ea2bcf 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -59,7 +59,10 @@ struct _virPCIDevice { char name[PCI_ADDR_LEN]; /*

Re: [libvirt] [libvirt-java] [PATCH 51/65] Implement Domain.blockPeek

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:59PM +0100, Claudio Bley wrote: This wraps the virDomainBlockPeek libvirt function, available since version 0.4.5. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Domain.java | 53

Re: [libvirt] [PATCH] XML: Escape double-hyphens in XML comment

2014-02-21 Thread Philipp Hahn
On 21.02.2014 12:18, Ján Tomko wrote: This no longer reproduces with current master, it has been fixed by either of: commit 0b121614a2086a8e66ae1f004fe912ba7c1d8a75 Author: Ján Tomko jto...@redhat.com CommitDate: 2012-10-29 14:38:43 +0100 xml: print uuids in the warning commit

Re: [libvirt] [libvirt-java] [PATCH 56/65] Implement Domain.PMwakeup

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:23:04PM +0100, Claudio Bley wrote: This wraps the virDomainPMWakeup libvirt function available since version 0.9.11. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Domain.java| 27 ++

Re: [libvirt] [libvirt-java] [PATCH 65/65] Deprecate Connect.getHypervisorVersion

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:23:13PM +0100, Claudio Bley wrote: In libvirt 0.9.3 this has been changed to simply return the libvirt version number. Signed-off-by: Claudio Bley cb...@av-test.de --- src/main/java/org/libvirt/Connect.java | 11 --- 1 file changed, 8 insertions(+), 3

Re: [libvirt] [libvirt-java] [PATCH 00/65]

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:08PM +0100, Claudio Bley wrote: Hi. Here are a few patches that piled up in my local branch. Some of them I already submitted to this list, but there has been no reponse to them. Included are a few trivial fixes as well as memory leak fixes and additions to

Re: [libvirt] [PATCH 01/10] nwfilter: don't ignore child process failures

2014-02-21 Thread Laine Stump
On 02/20/2014 07:13 AM, Eric Blake wrote: While auditing all callers of virCommandRun, I noticed that nwfilter code never paid attention to commands with a non-zero status. In the cases where status was captured, either the callers required that the status was 0, or they discarded any failures

Re: [libvirt] [PATCH v2 glib] gobject-stream: fix issue found by coverity

2014-02-21 Thread Pavel Hrdina
On 21.2.2014 12:24, Daniel P. Berrange wrote: On Thu, Feb 20, 2014 at 04:58:21PM +0100, Pavel Hrdina wrote: The coverity server found issue in gvir_stream_close function that we ignore return values of g_input_stream_close and g_output_stream_close, but we also ignore the error message and we

Re: [libvirt] [PATCH glib] Disable test suite unless glib = 2.38

2014-02-21 Thread Pavel Hrdina
On 20.2.2014 17:24, Daniel P. Berrange wrote: The TAP harness for glib only works with version 2.38 or later, so must be disabled for earlier versions Signed-off-by: Daniel P. Berrange berra...@redhat.com --- ACK Pavel -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [libvirt-java] [PATCH 22/65] Remove processError method from Secret class

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:30PM +0100, Claudio Bley wrote: 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

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

2014-02-21 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:22:29PM +0100, Claudio Bley wrote: 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

[libvirt] [PATCH 1/3] virSystemdCreateMachine: Set dependencies for slices

2014-02-21 Thread Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1031696 When creating a new domain, we let systemd know about it by calling CreateMachine() function via dbus. Systemd then creates a scope and places domain into it. However, later when the host is shutting down, systemd computes the shutdown order to

[libvirt] [PATCH 0/3] Couple of libvirt-guests fixes

2014-02-21 Thread Michal Privoznik
*** BLURB HERE *** Michal Privoznik (3): virSystemdCreateMachine: Set dependencies for slices libvirt-guests: Wait for libirtd to initialize virNetServerRun: Notify systemd that we're accepting clients configure.ac | 2 ++ daemon/libvirtd.service.in | 1 +

[libvirt] [PATCH 2/3] libvirt-guests: Wait for libirtd to initialize

2014-02-21 Thread Michal Privoznik
I've noticed that in some cases systemd was quick enough and even if libvirt-guests.service is marked to be started after the libvirtd.service my guests were not resumed as libvirt-guests.sh failed to connect. This is because of a simple fact: systemd correctly starts libvirt-guests after it execs

[libvirt] [PATCH 3/3] virNetServerRun: Notify systemd that we're accepting clients

2014-02-21 Thread Michal Privoznik
Systemd does not forget about the cases, where client service needs to wait for daemon service to initialize and start accepting new clients. Setting a dependency in client is not enough as systemd doesn't know when the daemon has initialized itself and started accepting new clients. However, it

Re: [libvirt] [PATCH 2/3] libvirt-guests: Wait for libirtd to initialize

2014-02-21 Thread Daniel P. Berrange
On Fri, Feb 21, 2014 at 01:32:36PM +0100, Michal Privoznik wrote: I've noticed that in some cases systemd was quick enough and even if libvirt-guests.service is marked to be started after the libvirtd.service my guests were not resumed as libvirt-guests.sh failed to connect. This is because of

Re: [libvirt] [PATCH 1/3] virSystemdCreateMachine: Set dependencies for slices

2014-02-21 Thread Daniel P. Berrange
On Fri, Feb 21, 2014 at 01:32:35PM +0100, Michal Privoznik wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1031696 When creating a new domain, we let systemd know about it by calling CreateMachine() function via dbus. Systemd then creates a scope and places domain into it. However, later

Re: [libvirt] [PATCH 3/3] virNetServerRun: Notify systemd that we're accepting clients

2014-02-21 Thread Daniel P. Berrange
On Fri, Feb 21, 2014 at 01:32:37PM +0100, Michal Privoznik wrote: Systemd does not forget about the cases, where client service needs to wait for daemon service to initialize and start accepting new clients. Setting a dependency in client is not enough as systemd doesn't know when the daemon

Re: [libvirt] [PATCH 2/3] libvirt-guests: Wait for libirtd to initialize

2014-02-21 Thread Michal Privoznik
On 21.02.2014 13:50, Daniel P. Berrange wrote: On Fri, Feb 21, 2014 at 01:32:36PM +0100, Michal Privoznik wrote: I've noticed that in some cases systemd was quick enough and even if libvirt-guests.service is marked to be started after the libvirtd.service my guests were not resumed as

Re: [libvirt] [PATCH 2/3] libvirt-guests: Wait for libirtd to initialize

2014-02-21 Thread Daniel P. Berrange
On Fri, Feb 21, 2014 at 02:25:24PM +0100, Michal Privoznik wrote: On 21.02.2014 13:50, Daniel P. Berrange wrote: On Fri, Feb 21, 2014 at 01:32:36PM +0100, Michal Privoznik wrote: I've noticed that in some cases systemd was quick enough and even if libvirt-guests.service is marked to be started

Re: [libvirt] [PATCH 2/3] libvirt-guests: Wait for libirtd to initialize

2014-02-21 Thread Ján Tomko
s/libirtd/libvirtd/ in the subject Jan signature.asc Description: OpenPGP digital signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [libvirt-java] [PATCH 00/65]

2014-02-21 Thread Claudio Bley
At Fri, 21 Feb 2014 11:19:23 +, Daniel P. Berrange wrote: On Thu, Feb 13, 2014 at 04:22:08PM +0100, Claudio Bley wrote: Hi. Here are a few patches that piled up in my local branch. Some of them I already submitted to this list, but there has been no reponse to them. Included

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

2014-02-21 Thread Claudio Bley
At Fri, 14 Feb 2014 11:06:12 +0100, Guido Günther wrote: On Thu, Feb 13, 2014 at 04:22:15PM +0100, Claudio Bley wrote: Signed-off-by: Claudio Bley cb...@av-test.de --- .gitignore |2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index

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

2014-02-21 Thread Claudio Bley
At Fri, 21 Feb 2014 10:37:36 +, Daniel P. Berrange wrote: On Thu, Feb 13, 2014 at 04:22:18PM +0100, 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

[libvirt] [PATCH 1/7] conf: clarify what is returned for actual bandwidth and vlan

2014-02-21 Thread Laine Stump
In practice, if a virDomainNetDef has a virDomainActualNetDef allocated, the ActualNetDef will *always* contain the bandwidth and vlan data from the NetDef (unless there was also a portgroup involved - see networkAllocateActualDevice()). However, virDomainNetGetActual(Bandwidth|Vlan)() were coded

[libvirt] [PATCH 2/7] conf: handle null pointer in virNetDevVlanFormat

2014-02-21 Thread Laine Stump
Other *Format() functions (e.g. virNetDevBandwidthFormat()) return with no action when called with a NULL *Def pointer. This makes virNetDevVlanFormat() consistent with that behavior. --- src/conf/netdev_vlan_conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[libvirt] [PATCH 5/7] conf: new function virDomainActualNetDefContentsFormat

2014-02-21 Thread Laine Stump
This function is currently only called from one place, but in a subsequent patch will be called from a 2nd place. The new function exactly replicates the original behavior of the part of virDomainActualNetDefFormat() that it replaces, but takes a virDomainNetDefPtr instead of

[libvirt] [PATCH 4/7] conf: re-situate bandwidth element in interface

2014-02-21 Thread Laine Stump
This moves the call to virNetDevBandwidthFormat() in virDomainNetDefFormat() to be called right after the call to virNetDevVPortProfileFormat(), so that a single chunk of that function can be placed inside an if that conditionally calls virDomainActualNetDefContentsFormat() instead (next patch).

[libvirt] [PATCH 0/7] network: include plugged interface XML in plugged network hook

2014-02-21 Thread Laine Stump
Although the immediate reason for all these patches is $subject, it really is something that should have been done a long time ago (I just hadn't convinced myself it was the right thing to do). These patches will allow a management application to easily learn exactly what physical hardware is

[libvirt] [PATCH 4/5] apparmor: add debug traces when changing profile.

2014-02-21 Thread Cédric Bosdonnat
The reason for these is that aa-status doesn't show the process using the profile as they are in another namespace. --- src/security/security_apparmor.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c index

  1   2   >