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

2014-03-04 Thread Claudio Bley
At Mon, 03 Mar 2014 13:06:50 -0700,
Eric Blake wrote:
 
 [1  text/plain; UTF-8 (quoted-printable)]
 On 02/13/2014 08:22 AM, Claudio Bley wrote:
  Note: these are only used internally.
  
  Signed-off-by: Claudio Bley cb...@av-test.de
  ---
 
  +static final int CONTROL_ERROR = 7;
  +static final int BLOCK_JOB = 8;
  +static final int DISK_CHANGE = 9;
  +static final int TRAY_CHANGE = 10;
  +static final int PMWAKEUP = 11;
  +static final int PMSUSPEND = 12;
 
 Up to here, I can understand.
 
  +static final int LAST = 13;
 
 But you probably do NOT want this value, as we explicitly document that
 our _LAST C enums are not constant (we reserve the right to add more
 events), but merely aids for compilation to ensure that all cases are
 covered compared to the current state of the libvirt.h header.

Trust me, I want this constant. ;-)

Note, that all those constants are private.

This constant is used in patch #41 to define the length of an array:

+// registered event listeners by DomainEventID
+private MapEventListener, Integer[] eventListeners = 
makeHashMapArray(DomainEventID.LAST);

Claudio

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


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

2014-03-03 Thread Eric Blake
On 02/13/2014 08:22 AM, Claudio Bley wrote:
 Note: these are only used internally.
 
 Signed-off-by: Claudio Bley cb...@av-test.de
 ---

 +static final int CONTROL_ERROR = 7;
 +static final int BLOCK_JOB = 8;
 +static final int DISK_CHANGE = 9;
 +static final int TRAY_CHANGE = 10;
 +static final int PMWAKEUP = 11;
 +static final int PMSUSPEND = 12;

Up to here, I can understand.

 +static final int LAST = 13;

But you probably do NOT want this value, as we explicitly document that
our _LAST C enums are not constant (we reserve the right to add more
events), but merely aids for compilation to ensure that all cases are
covered compared to the current state of the libvirt.h header.

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



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 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
--
|: http://berrange.com  -o-http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org  -o- http://virt-manager.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org   -o-   http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list