]> xenbits.xensource.com Git - libvirt.git/commit
virsh: fix event registration for single event
authorJán Tomko <jtomko@redhat.com>
Mon, 11 Apr 2022 07:30:12 +0000 (09:30 +0200)
committerJán Tomko <jtomko@redhat.com>
Mon, 11 Apr 2022 15:03:49 +0000 (17:03 +0200)
commitdf757e88fdb26e64e6b5a5c786e6f59d1d9b130a
tree5318da3b045ddb74714f2003fc8f8b0bc4183c6b
parentc11fb2132f313b9aa25ad7c57becc72923623874
virsh: fix event registration for single event

Allocate a larger 'data' array than strictly needed
for simplicity and use 'ndata' as the index when
filling it to put the single event at the first unused
place, instead of at its index in the virshDomainEventCallbacks
array.

https://bugzilla.redhat.com/show_bug.cgi?id=2073887

Fixes: c6bb2746933bbe65877a5f8a8d60e100b0bf8a59
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tools/virsh-domain-event.c