node-libvirt icon indicating copy to clipboard operation
node-libvirt copied to clipboard

How to listen for all domain events from hypervisor

Open veber-alex opened this issue 7 years ago • 0 comments

Hi, I am trying to write an app that will notify when a new VM is added to a HV. How can I listen to all events from the hypervisor? I know the Domain object has RegisterEventAsync but I don't want to register events from a specific domain.

This is what I am trying to do:

libvirt = require("libvirt")

libvirt.startEventLoop()

async function foo () {
  hv = new libvirt.Hypervisor("qemu:///system")
  await hv.connectAsync()
  hv.registerDomainEvent(...)
}

foo()

veber-alex avatar Jun 26 '18 15:06 veber-alex