On Tue, Jul 28, 2026 at 12:21:11PM +0800, 410664530 via Devel wrote: > On Wed, Jul 24, 2026, Ján Tomko wrote: > > This can lead to duplicit timer IDs - at least at startup, the daemon > > sets some long-lasting timers. > > > > Can we instead change this to use long long int? > > > > Using unsigned for this would require rewriting more code. > > > > Jano > > > You're right, resetting to 1 could cause duplicate timer IDs since > the auto-shutdown timer and CPU/memory collection timer > are created at startup and live for the entire lifetime of the daemon. > > > I agree that changing to long long int is the correct approach. This > requires changing the timer ID type in: > > > - vireventglib.c: nexttimer, virEventGLibTimeout.timer > - virevent.h/c: virEventAddTimeout() return type, virEventRemoveTimeout() > and virEventUpdateTimeout() parameters > - All callers that store timer IDs > > > This changes the public event API (virEventAddTimeout etc.) which is > declared in libvirt-event.h. But since timer IDs are opaque > handles, the impact on existing callers is just variable type changes > (int -> long long). > > > I'll prepare v2 with this approach.
No, you cannot change public API in this way. A variable type size change is an ABI breakage. With regards, Daniel -- |: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
