rgbkrk / libvirt-go

[DEPRECATED] Go bindings for libvirt
https://github.com/libvirt/libvirt-go
MIT License
166 stars 50 forks source link

events: fix non-lifecycle domain event handling #102

Closed vincentbernat closed 8 years ago

vincentbernat commented 8 years ago

This is a partial rip-off of #80, so credit goes to @kunteynir.

Only the following changes were taken:

  1. String() methods for most events.
  2. Correct handling of non-lifecycle events.

Should fix #98 too. Unfortunately, for the second parts, tests are missing since most events are difficult to test (and I am too lazy for the remaining ones).

clementino commented 8 years ago

The fallthroughs are still missing, which was the first of the two problems in https://github.com/rgbkrk/libvirt-go/issues/98 If you could add them (or merge such cases in a comma separated list) it would be perfect, thanks.

vincentbernat commented 8 years ago

OK, I just fixed that.

vincentbernat commented 8 years ago

I have also added another commit to fix the signature of all domain event callbacks. They should not return an int. This is fixed for the C functions but we keep the original signature for Go as it is part of the public API. We just add a comment to explain the return value is not used.