[libvirt] [PATCH 00/18] Refactor event-test

Peter Krempa pkrempa at redhat.com
Thu Apr 14 15:52:25 UTC 2016


I was asked to add the new event to the test. My eyes started bleeding after
opening the file. Refactor the mega-ancient code and add missing stuff.

As a finishing touch add a static check that new events are not forgotten.

P.S: I contemplated just deleting that ... stuff ... at first. But I coudn't
think of a bulletproof justification other than the state of the code.

Peter Krempa (18):
  event-test: Remove forward declarations
  event-test: Get rid of useless and ambiguous VIR_DEBUG macro
  event-test: Remove unnecessary 'usage' function
  event-test: touch up coding style
  event-test: Use functions with typecasted switch to convert enums
  lib: document fields virConnectDomainEventDiskChangeReason
  event-test: Force compiler check in switch for connectClose callback
  event-test: Use typecasted enum to convert graphics event phase
  event-test: Use switch instead of if/else if chains for lifecycle
    event translation
  event-test: make few switch statements future proof
  event-test: Enable enum sentinels and warn on not fully populated
    enums
  event-test: make domain event registration declarative
  event-test: Add VIR_DOMAIN_EVENT_ID_BLOCK_JOB and
    VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2
  event-test: Add VIR_DOMAIN_EVENT_ID_MIGRATION_ITERATION callback
  event-test: Add VIR_DOMAIN_EVENT_ID_JOB_COMPLETED
  event-test: Add VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED
  event-test: Add VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON
  event-test: Enforce domain event sync

 examples/Makefile.am                |   5 +
 examples/object-events/event-test.c | 973 +++++++++++++++++++++---------------
 include/libvirt/libvirt-domain.h    |   6 +-
 3 files changed, 580 insertions(+), 404 deletions(-)

-- 
2.8.0




More information about the libvir-list mailing list