Re: [libvirt] [PATCH v1 1/4] Introduce virDomain{Get,Set}Time APIs

2014-02-13 Thread Martin Kletzander
On Thu, Feb 13, 2014 at 07:51:42PM +0100, Michal Privoznik wrote: > These APIs allow users to get or set time in a domain, which may come > handy if the domain has been resumed just recently and NTP is not > configured or hasn't kicked in yet and the guest is running > something time critical. In a

Re: [libvirt] [PATCH 2/2] lxc: Only delegate VIR_CGROUP_CONTROLLER_SYSTEMD to containers

2014-02-13 Thread Richard Weinberger
Am 13.02.2014 18:16, schrieb Daniel P. Berrange: > On Tue, Feb 11, 2014 at 11:51:26PM +0100, Richard Weinberger wrote: >> Due to security concerns we delegate only VIR_CGROUP_CONTROLLER_SYSTEMD >> to containers. >> Currently it is not safe to allow a container access to a resource >> controller. >

Re: [libvirt] [PATCH] lxc: Add virCgroupSetOwner()

2014-02-13 Thread Richard Weinberger
Am 14.02.2014 08:10, schrieb Martin Kletzander: > On Thu, Feb 13, 2014 at 05:15:22PM +, Daniel P. Berrange wrote: >> From: Richard Weinberger >> >> Add a new helper function to change the permissions of a control >> group. This function is needed for user namespaces, we need to >> chmod() the

Re: [libvirt] [PATCH] lxc: Add virCgroupSetOwner()

2014-02-13 Thread Martin Kletzander
On Thu, Feb 13, 2014 at 05:15:22PM +, Daniel P. Berrange wrote: > From: Richard Weinberger > > Add a new helper function to change the permissions of a control > group. This function is needed for user namespaces, we need to > chmod() the cgroup to the initial uid/gid such that systemd is > al

Re: [libvirt] [PATCH v6 1/6] conf: Add a keyboard input device type

2014-02-13 Thread Li Zhang
On 2014年02月14日 00:39, Daniel P. Berrange wrote: On Thu, Feb 13, 2014 at 04:48:21PM +0800, Li Zhang wrote: @@ -12422,10 +12426,12 @@ virDomainDefParseXML(xmlDocPtr xml, * XXX will this be true for other virt types ? */ if ((STREQ(def->os.type, "hvm") && input-

Re: [libvirt] [PATCH v6 5/6] qemu: parse qemu command line for USB keyboard

2014-02-13 Thread Li Zhang
On 2014年02月13日 20:37, Ján Tomko wrote: On 02/13/2014 09:48 AM, Li Zhang wrote: From: Li Zhang This patch is to format qemu command line and xen driver for USB keyboard and add test cases for it. Signed-off-by: Li Zhang --- src/qemu/qemu_command.c| 41 +++

Re: [libvirt] [PATCH v6 3/6] conf: Remove the implicit PS2 mouse for non-X86 platforms and add an implicit PS2 keyboard device for X86 platforms.

2014-02-13 Thread Li Zhang
On 2014年02月13日 20:37, Ján Tomko wrote: On 02/13/2014 09:48 AM, Li Zhang wrote: From: Li Zhang PS2 device only works for X86 platform, other platforms may need USB mouse. Athough it doesn't influence the QEMU command line, but it's not right to add one PS2 mouse for non-X86 platform. What's mo

Re: [libvirt] [PATCH v6 4/6] qemu_cap: Add USB keyboard capability

2014-02-13 Thread Li Zhang
On 2014年02月13日 20:37, Ján Tomko wrote: On 02/13/2014 09:48 AM, Li Zhang wrote: From: Li Zhang QEMU can support USB keyboard but libvirt haven't supportted it yet. This patch is to add USB keyboard capabilities and test cases. Signed-off-by: Li Zhang --- src/qemu/qemu_capabilities.c

Re: [libvirt] [PATCH v6 2/6] conf: Add one interface to add default input devices

2014-02-13 Thread Li Zhang
On 2014年02月13日 20:37, Ján Tomko wrote: On 02/13/2014 09:48 AM, Li Zhang wrote: From: Li Zhang This patch is to add one new interface to add input devices. Signed-off-by: Li Zhang --- src/conf/domain_conf.c | 29 + src/conf/domain_conf.h | 4 src/libv

Re: [libvirt] [PATCHv3 2/2] Support IPv6 in port allocator

2014-02-13 Thread Eric Blake
On 02/06/2014 09:43 AM, Ján Tomko wrote: > Also try to bind on IPv6 to check if the port is occupied. > > Change the mocked bind in the test to return EADDRINUSE > for some ports only for the IPv4/IPv6 socket if we're testing > on a host with IPv6 compiled in. > > Also mock socket() to make it fa

Re: [libvirt] [PATCHv6 8/8] qemu: snapshot: Add support for external active snapshots on gluster

2014-02-13 Thread Eric Blake
On 02/13/2014 09:49 AM, Peter Krempa wrote: > Add support for gluster backed images as sources for snapshots in the > qemu driver. This will also simplify adding further network backed > volumes as sources for snapshot in case qemu will support them. > --- > > Notes: > Version 6: > - fixed

Re: [libvirt] [PATCHv6 7/8] qemu: snapshot: Use new APIs to detect presence of existing storage files

2014-02-13 Thread Eric Blake
On 02/13/2014 09:49 AM, Peter Krempa wrote: > Use the new storage driver based "stat" api to detect exiting files just > as we did with local files. > --- > > Notes: > Version 6: > - tweaked, as "conn" is not needed > Version 5: > - new in sereis > ACK -- Eric Blake eblake re

Re: [libvirt] [PATCHv6 6/8] qemu: Switch snapshot deletion to the new API functions

2014-02-13 Thread Eric Blake
On 02/13/2014 09:49 AM, Peter Krempa wrote: > Use the new storage driver APIs to delete snapshot backing files in case > of failure instead of directly relying on "unlink". This will help us in > the future when we will be adding network based storage without local > representation in the host. > -

Re: [libvirt] [PATCHv6 5/8] storage: Add storage file backends for gluster

2014-02-13 Thread Eric Blake
On 02/13/2014 09:49 AM, Peter Krempa wrote: > Implement storage backend functions to deal with gluster volumes and > implement the "stat" and "unlink" backend APIs. > --- > > Notes: > Version 6: > - tweaked error message style > - tweak of private data access due to simplification of e

Re: [libvirt] [PATCHv6 4/8] storage: add file functions for local and block files

2014-02-13 Thread Eric Blake
On 02/13/2014 09:49 AM, Peter Krempa wrote: > Implement the "stat" and "unlink" function for "file" volumes and "stat" > for "block" volumes using the regular system calls. > --- > > Notes: > Version 6: > - tweaked error message style > - made sure that libvirt compiles cleanly with --

Re: [libvirt] [PATCHv6 3/8] storage: Add file storage APIs in the default storage driver

2014-02-13 Thread Eric Blake
On 02/13/2014 09:49 AM, Peter Krempa wrote: > Add APIs that will allow to use the storage driver to assist in > operations on files even for remote filesystems without native > representation as files in the host. > --- > > Notes: > Version 6: > - rewrite due to change of exporting approac

[libvirt] [PATCH v1 2/4] remote: Implement remote{Get,Set}Time

2014-02-13 Thread Michal Privoznik
This is also adding new ACL permission to check 'set_time'. Signed-off-by: Michal Privoznik --- daemon/remote.c | 35 +++ src/access/viraccessperm.c | 2 +- src/access/viraccessperm.h | 6 ++ src/remote/remote_driver.c | 32 +++

[libvirt] [PATCH v1 4/4] qemu: Implement virDomain{Get,Set}Time

2014-02-13 Thread Michal Privoznik
One caveat though, qemu-ga is expecting time and returning time in nanoseconds. With all the buffering and propagation delay, the time is already wrong once it gets to the qemu-ga, but there's nothing we can do about it. Signed-off-by: Michal Privoznik --- src/qemu/qemu_agent.c | 81 ++

[libvirt] [PATCH v1 1/4] Introduce virDomain{Get,Set}Time APIs

2014-02-13 Thread Michal Privoznik
These APIs allow users to get or set time in a domain, which may come handy if the domain has been resumed just recently and NTP is not configured or hasn't kicked in yet and the guest is running something time critical. In addition, NTP may refuse to re-set the clock if the skew is too big. Signe

[libvirt] [PATCH v1 3/4] virsh: Expose virDomain{Get,Set}Time

2014-02-13 Thread Michal Privoznik
These APIs are exposed under new virsh command 'domtime' which both gets and sets (not at the same time of course :)). Signed-off-by: Michal Privoznik --- tools/virsh-domain-monitor.c | 126 +++ tools/virsh.pod | 16 ++ 2 files changed, 1

[libvirt] [PATCH v1 0/4] Time setting and getting in qemu guests

2014-02-13 Thread Michal Privoznik
This can be used all, but 'virsh domtime --sync $dom' is dependent on this qemu patch: http://lists.nongnu.org/archive/html/qemu-devel/2014-01/msg04293.html Anyway, once all the patches are merged, users can simply do: virsh resume $dom virsh domtime --sync $dom and their guest time won't be of

[libvirt] [PATCH v2] bandwidth: Adjust documentation

2014-02-13 Thread John Ferlan
Recent autotest/virt-test testing on f20 discovered an anomaly in how the bandwidth options are documented and used. This was discovered due to a bug fix in the /sbin/tc utility found in iproute-3.11.0.1 (on f20) in which overflow was actually caught and returned as an error. The fix was first intr

Re: [libvirt] [PATCHv6 2/8] conf: Move qemuSnapshotDiskGetActualType to virDomainSnapshotDiskGetActualType

2014-02-13 Thread Eric Blake
On 02/13/2014 09:49 AM, Peter Krempa wrote: > All the data for getting the actual type is present in the snapshot > config. There is no need to have this function private to the qemu > driver and it will be re-used later in other parts of libvirt > --- > > Notes: > Version 6: > - new in se

Re: [libvirt] [PATCHv6 1/8] conf: Move qemuDiskGetActualType to virDomainDiskGetActualType

2014-02-13 Thread Eric Blake
On 02/13/2014 09:49 AM, Peter Krempa wrote: > All the data for getting the actual type is present in the domain > config. There is no need to have this function private to the qemu > driver and it will be re-used later in other parts of libvirt > --- > > Notes: > Version 6: > - new in seri

Re: [libvirt] [PATCH 2/2] lxc: Only delegate VIR_CGROUP_CONTROLLER_SYSTEMD to containers

2014-02-13 Thread Daniel P. Berrange
On Tue, Feb 11, 2014 at 11:51:26PM +0100, Richard Weinberger wrote: > Due to security concerns we delegate only VIR_CGROUP_CONTROLLER_SYSTEMD > to containers. > Currently it is not safe to allow a container access to a resource controller. > We *do* want to allow all controllers to be visible to

[libvirt] [PATCH] lxc: Add virCgroupSetOwner()

2014-02-13 Thread Daniel P. Berrange
From: Richard Weinberger Add a new helper function to change the permissions of a control group. This function is needed for user namespaces, we need to chmod() the cgroup to the initial uid/gid such that systemd is allowed to use the cgroup. Only the systemd controller is made accessible to the

Re: [libvirt] [PATCHv3 1/2] Split out bind() from virPortAllocatorAcquire

2014-02-13 Thread Martin Kletzander
On Thu, Feb 06, 2014 at 05:43:13PM +0100, Ján Tomko wrote: > --- > src/util/virportallocator.c | 72 > - > 1 file changed, 45 insertions(+), 27 deletions(-) > ACK, Martin signature.asc Description: Digital signature -- libvir-list mailing list libvi

[libvirt] [PATCHv6 7/8] qemu: snapshot: Use new APIs to detect presence of existing storage files

2014-02-13 Thread Peter Krempa
Use the new storage driver based "stat" api to detect exiting files just as we did with local files. --- Notes: Version 6: - tweaked, as "conn" is not needed Version 5: - new in sereis src/qemu/qemu_driver.c | 58 ++ 1 file changed,

[libvirt] [PATCHv6 6/8] qemu: Switch snapshot deletion to the new API functions

2014-02-13 Thread Peter Krempa
Use the new storage driver APIs to delete snapshot backing files in case of failure instead of directly relying on "unlink". This will help us in the future when we will be adding network based storage without local representation in the host. --- Notes: Version 6: - simplified as the stor

[libvirt] [PATCHv6 8/8] qemu: snapshot: Add support for external active snapshots on gluster

2014-02-13 Thread Peter Krempa
Add support for gluster backed images as sources for snapshots in the qemu driver. This will also simplify adding further network backed volumes as sources for snapshot in case qemu will support them. --- Notes: Version 6: - fixed after rename of qemuSnapshotDiskGetActualType Vers

[libvirt] [PATCHv6 5/8] storage: Add storage file backends for gluster

2014-02-13 Thread Peter Krempa
Implement storage backend functions to deal with gluster volumes and implement the "stat" and "unlink" backend APIs. --- Notes: Version 6: - tweaked error message style - tweak of private data access due to simplification of export hierarchy Version 5: - adapted to error r

[libvirt] [PATCHv6 1/8] conf: Move qemuDiskGetActualType to virDomainDiskGetActualType

2014-02-13 Thread Peter Krempa
All the data for getting the actual type is present in the domain config. There is no need to have this function private to the qemu driver and it will be re-used later in other parts of libvirt --- Notes: Version 6: - new in series src/conf/domain_conf.c | 10 ++ src/conf/doma

[libvirt] [PATCHv6 4/8] storage: add file functions for local and block files

2014-02-13 Thread Peter Krempa
Implement the "stat" and "unlink" function for "file" volumes and "stat" for "block" volumes using the regular system calls. --- Notes: Version 6: - tweaked error message style - made sure that libvirt compiles cleanly with --without-storage-fs (added ifdefs) Version 5: -

[libvirt] [PATCHv6 0/8] Gluster snapshot series

2014-02-13 Thread Peter Krempa
This version was tweaked according to Dan's and Eric's feedback. Peter Krempa (8): conf: Move qemuDiskGetActualType to virDomainDiskGetActualType conf: Move qemuSnapshotDiskGetActualType to virDomainSnapshotDiskGetActualType storage: Add file storage APIs in the default storage driver

[libvirt] [PATCHv6 3/8] storage: Add file storage APIs in the default storage driver

2014-02-13 Thread Peter Krempa
Add APIs that will allow to use the storage driver to assist in operations on files even for remote filesystems without native representation as files in the host. --- Notes: Version 6: - rewrite due to change of exporting approach Version 5: - adapt to error reporting change

[libvirt] [PATCHv6 2/8] conf: Move qemuSnapshotDiskGetActualType to virDomainSnapshotDiskGetActualType

2014-02-13 Thread Peter Krempa
All the data for getting the actual type is present in the snapshot config. There is no need to have this function private to the qemu driver and it will be re-used later in other parts of libvirt --- Notes: Version 6: - new in series src/conf/snapshot_conf.c | 7 +++ src/conf/snapsh

Re: [libvirt] [PATCH RFC 0/2] support compression with dumping guest memory

2014-02-13 Thread Martin Kletzander
On Thu, Feb 13, 2014 at 11:08:50AM +0800, Qiao Nuohan wrote: > On 01/29/2014 10:04 AM, qiaonuohan wrote: > > --memory-only option is introduced without compression supported. Therefore, > > this is a freature regression of virsh dump. This patchset is used to add > > compression support in libvirt

Re: [libvirt] [PATCH v6 1/6] conf: Add a keyboard input device type

2014-02-13 Thread Daniel P. Berrange
On Thu, Feb 13, 2014 at 04:48:21PM +0800, Li Zhang wrote: > @@ -12422,10 +12426,12 @@ virDomainDefParseXML(xmlDocPtr xml, > * XXX will this be true for other virt types ? */ > if ((STREQ(def->os.type, "hvm") && > input->bus == VIR_DOMAIN_INPUT_BUS_PS2 && > -

[libvirt] Get Info for QEMU/KVM storage and volume

2014-02-13 Thread Qiang Fu
Hi all, I am new to libvirt. Right now I am trying to use libvirt to get statistics information (size, free space and so on) on host storage and vm volume running on QEMU/KVM hypervisor. However when I looked at the API support matrix: http://libvirt.org/hvsupport.html#virStorageDriver It seems

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

2014-02-13 Thread Claudio Bley
Add IOErrorActionListener and IOErrorAction enum which is handed to the onIOError callback method when an IO error event occurs. Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Connect.java | 59 src/main/java/org/libvirt/Domain.java |

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

2014-02-13 Thread Claudio Bley
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 --- src/main/java/org/libvirt/Connect.java | 41 src/main/ja

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

2014-02-13 Thread Claudio Bley
Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Connect.java | 57 src/main/java/org/libvirt/Domain.java | 20 +++ .../java/org/libvirt/event/PMWakeupListener.java | 17 ++ .../java/org/libvirt/event/PMWakeupReason.java

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

2014-02-13 Thread Claudio Bley
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 the public API. There had been some minor interest in my first version

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

2014-02-13 Thread Claudio Bley
In libvirt 0.9.3 this has been changed to simply return the libvirt version number. Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Connect.java | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/libvirt/Connect.java b/src/main/java/org

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

2014-02-13 Thread Claudio Bley
This wraps the virDomainPMWakeup libvirt function available since version 0.9.11. Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Domain.java| 27 ++ src/main/java/org/libvirt/SuspendTarget.java | 15 ++ src/main/java/org/libvirt/jna/Libv

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

2014-02-13 Thread Claudio Bley
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 backwards compat. Signed-off-by: Claudio Bley --- src/main/java/org/li

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

2014-02-13 Thread Claudio Bley
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 --- src/main/java/org/libvirt/Connect.java | 104 +--

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

2014-02-13 Thread Claudio Bley
This wraps the virDomainReset libvirt function available since version 0.9.7. Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Domain.java |7 +++ src/main/java/org/libvirt/jna/Libvirt.java |1 + 2 files changed, 8 insertions(+) diff --git a/src/main/java/org/libvirt/D

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

2014-02-13 Thread Claudio Bley
This wraps the native virDomainScreenshot libvirt function available since version 0.9.2. Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Domain.java | 10 ++ src/main/java/org/libvirt/Stream.java |4 src/main/java/org/libvirt/jna/Libvirt.java |1 + 3 f

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

2014-02-13 Thread Claudio Bley
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. Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Connect.java

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

2014-02-13 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. Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Stream.java | 183

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

2014-02-13 Thread Claudio Bley
This wraps the virDomainIsUpdated libvirt function available since version 0.8.6. Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Domain.java |8 src/main/java/org/libvirt/jna/Libvirt.java |1 + 2 files changed, 9 insertions(+) diff --git a/src/main/java/org/libv

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

2014-02-13 Thread Claudio Bley
This wraps the virDomainSendKey libvirt function available since version 0.9.3. Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Domain.java | 12 src/main/java/org/libvirt/KeycodeSet.java | 46 src/main/java/org/libvirt/jna/Libvirt.java |

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

2014-02-13 Thread Claudio Bley
Signed-off-by: Claudio Bley --- src/test/java/org/libvirt/TestJavaBindings.java | 44 +++ 1 file changed, 44 insertions(+) diff --git a/src/test/java/org/libvirt/TestJavaBindings.java b/src/test/java/org/libvirt/TestJavaBindings.java index a73148f..24d850a 100644 --- a/sr

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

2014-02-13 Thread Claudio Bley
This wraps the virConnectIsAlive libvirt function available since version 0.9.8. Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Connect.java | 12 src/main/java/org/libvirt/jna/Libvirt.java |1 + src/test/java/org/libvirt/TestJavaBindings.java |1 +

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

2014-02-13 Thread Claudio Bley
This wraps the virDomainMemoryPeek libvirt function, available since version 0.4.5. Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Domain.java| 40 ++ src/main/java/org/libvirt/MemoryAddressMode.java | 19 ++ src/main/java/org/libvirt/jna/Li

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

2014-02-13 Thread Claudio Bley
This wraps the virConnectGetSysinfo function available since libvirt version 0.8.8. Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Connect.java | 21 + src/main/java/org/libvirt/jna/Libvirt.java |1 + 2 files changed, 22 insertions(+) diff --git a/src/ma

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

2014-02-13 Thread Claudio Bley
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 callback function matching the prototype of the native callback type.

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

2014-02-13 Thread Claudio Bley
Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Connect.java | 59 src/main/java/org/libvirt/Domain.java | 20 +++ .../java/org/libvirt/event/PMSuspendListener.java | 17 ++ .../java/org/libvirt/event/PMSuspendReason.java

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

2014-02-13 Thread Claudio Bley
Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/BitFlags.java | 18 ++ 1 file changed, 18 insertions(+) create mode 100644 src/main/java/org/libvirt/BitFlags.java diff --git a/src/main/java/org/libvirt/BitFlags.java b/src/main/java/org/libvirt/BitFlags.java new fil

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

2014-02-13 Thread Claudio Bley
Signed-off-by: Claudio Bley --- src/test/java/org/libvirt/TestJavaBindings.java | 69 +++ 1 file changed, 69 insertions(+) diff --git a/src/test/java/org/libvirt/TestJavaBindings.java b/src/test/java/org/libvirt/TestJavaBindings.java index 5cc77e7..a73148f 100644 --- a/src

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

2014-02-13 Thread Claudio Bley
This wraps the virSecretGetUsageType libvirt function available since version 0.7.1. Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Secret.java |5 + src/main/java/org/libvirt/SecretUsageType.java | 23 +++ src/main/java/org/libvirt/jna/Libvirt.j

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

2014-02-13 Thread Claudio Bley
This wraps the virDomainBlockPeek libvirt function, available since version 0.4.5. Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Domain.java | 53 src/main/java/org/libvirt/jna/Libvirt.java |4 +++ 2 files changed, 57 insertions(+) diff --git

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

2014-02-13 Thread Claudio Bley
Note: these are only used internally. Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Connect.java | 20 1 file changed, 20 insertions(+) diff --git a/src/main/java/org/libvirt/Connect.java b/src/main/java/org/libvirt/Connect.java index 0a45ac8..8ba9691 100644

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

2014-02-13 Thread Claudio Bley
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. Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Connect.j

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

2014-02-13 Thread Claudio Bley
Signed-off-by: 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.ja

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

2014-02-13 Thread Claudio Bley
Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Error.java | 397 ++ 1 file changed, 262 insertions(+), 135 deletions(-) diff --git a/src/main/java/org/libvirt/Error.java b/src/main/java/org/libvirt/Error.java index ef339bd..15dd870 100644 --- a/src/m

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

2014-02-13 Thread Claudio Bley
It was deprecated and is no longer used. Signed-off-by: Claudio Bley --- 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..c2e733

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

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

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

2014-02-13 Thread Claudio Bley
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 --- src/main/java/org/libvirt/Domain.java | 14 ++ src/main/java/org/l

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

2014-02-13 Thread Claudio Bley
This wraps the virConnectSetKeepAlive libvirt function available since version 0.9.8. Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Connect.java | 34 src/main/java/org/libvirt/jna/Libvirt.java |1 + 2 files changed, 35 insertions(+) diff --git

[libvirt] [libvirt-java] [PATCH 22/65] Remove processError method from Secret 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 --- src/main/java/org/libvirt/Secret.java | 61 + 1

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

2014-02-13 Thread Claudio Bley
Signed-off-by: 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

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

2014-02-13 Thread Claudio Bley
There can only be a single connection close listener registered per connection object. Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Connect.java | 57 src/main/java/org/libvirt/jna/Libvirt.java | 11 ++ 2 files changed, 68 insertions(+) diff

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

2014-02-13 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. Signed-off-by: Claudio Bley --- src/main/java/org/libvir

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

2014-02-13 Thread Claudio Bley
We need to free the char* entries of the result array returned ourselves. Signed-off-by: Claudio Bley --- 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 a/src/mai

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

2014-02-13 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. Signed-off-by: Claudio Bley --- src/

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

2014-02-13 Thread Claudio Bley
Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Connect.java | 35 + src/main/java/org/libvirt/Domain.java | 48 ++- src/test/java/org/libvirt/TestJavaBindings.java |4 ++ 3 files changed, 86 insertions(+), 1 deletion(-) d

[libvirt] [libvirt-java] [PATCH 25/65] Remove processError method from Stream 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 --- src/main/java/org/libvirt/Stream.java | 64 +++-- 1

[libvirt] [libvirt-java] [PATCH 24/65] Remove processError method from StorageVol 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 --- src/main/java/org/libvirt/StorageVol.java | 56 + 1

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

2014-02-13 Thread Claudio Bley
These functions are not (yet) exposed in the public org.libvirt package but only used internally. Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/jna/Libvirt.java | 11 +++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/org/libvirt/jna/Libvirt.java b/src/main/j

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

2014-02-13 Thread Claudio Bley
Signed-off-by: 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/Dom

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

2014-02-13 Thread Claudio Bley
Signed-off-by: Claudio Bley --- .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 mailing list libvir-

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

2014-02-13 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 to

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

2014-02-13 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 processError

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

2014-02-13 Thread Claudio Bley
Wrap any fallible libvirt function in a call to ErrorHandler.processError(..). Signed-off-by: Claudio Bley --- src/main/java/org/libvirt/Device.java | 49 ++--- 1 file changed, 14 insertions(+), 35 deletions(-) diff --git a/src/main/java/org/libvirt/Device.java b/

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

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

2014-02-13 Thread Claudio Bley
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: # # EXCEPTION_ACCESS_VIOLATION (0xc005) at pc=0x77363290, pid=10180, ti

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

2014-02-13 Thread Claudio Bley
JUnit is used for quite some time now, which supercedes the tests defined in the old "test" class. Signed-off-by: Claudio Bley --- src/test/java/test.java | 280 --- 1 file changed, 280 deletions(-) delete mode 100644 src/test/java/test.java diff --

[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 --- 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/mai

[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 --- src/main/java/org/libvirt/Library.java | 91 src/main/java/org/libvirt/jna/Libvirt.java |4 ++ 2 files changed, 95 i

[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 --- src/main/java/org/libvirt/NetworkFilter.java | 43 ++ 1

[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 Bl

[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 --- 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/test/java/org/libvir

[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 --- As discussed previously[1], with a little delay, here's the patch. [1]: http://www.redhat.com/archives/libvir-list/2013-Sept

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

2014-02-13 Thread Claudio Bley
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, long or even long long on different platforms. JNA provides the s

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

2014-02-13 Thread Claudio Bley
Signed-off-by: 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 a25c4f3..0123e6a 100644 --- a/src/test/ja

[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 --- src/main/java/org/libvirt/Interface.java | 43 -- 1

[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 --- src/main/java/org

[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 --- src/main/java/org/libvirt/jna/Libvirt.java |3 ++-

  1   2   >