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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <cbley@xxxxxxxxxx>
> > ---
> 
> > +        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 Map<EventListener, Integer>[] eventListeners = makeHashMapArray(DomainEventID.LAST);

Claudio

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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]