• D
    Expose event loop implementation as a public API · 2ed6cc7b
    Daniel P. Berrange 提交于
    Not all applications have an existing event loop they need
    to integrate with. Forcing them to implement the libvirt
    event loop integration APIs is an undue burden. This just
    exposes our simple poll() based implementation for apps
    to use. So instead of calling
    
       virEventRegister(....callbacks...)
    
    The app would call
    
       virEventRegisterDefaultImpl()
    
    And then have a thread somewhere calling
    
        static bool quit = false;
        ....
        while (!quit)
          virEventRunDefaultImpl()
    
    * daemon/libvirtd.c, tools/console.c,
      tools/virsh.c: Convert to public event loop APIs
    * include/libvirt/libvirt.h.in, src/libvirt_private.syms: Add
      virEventRegisterDefaultImpl and virEventRunDefaultImpl
    * src/util/event.c: Implement virEventRegisterDefaultImpl
      and virEventRunDefaultImpl using poll() event loop
    * src/util/event_poll.c: Add full error reporting
    * src/util/virterror.c, include/libvirt/virterror.h: Add
      VIR_FROM_EVENTS
    2ed6cc7b
libvirt_public.syms 8.8 KB