digitalocean/go-qemu

go-qemu uses go-libvirt ?

Closed this issue · 2 comments

This package currently uses go-libvirt to monitor domains, but wouldn't it be better to use QMP to interact with and track individual VMs directly? It currently relies on the libvirt API and communicates through go-libvirt. Could we remove this dependency by implementing a new monitoring approach?

In my case, I use qemu-system to spin up VMs, but using this package requires installing libvirt, which is a dealbreaker for me. Is there a workaround for this?

@sswastik02 I can see why it may be better for you, but since we, the authors, use libvirtd to control QEMU, to bypass libvirtd and directly communicate with QEMU without libvirtd knowing isn't better for our use case.

For your use case, I don't have much suggestions. If you could add the capability of direct qemu connect to this package without disturbing the code too much, we'd probably accept it. Breaking our use-case wouldn't be accepted ;-).

You could of course fork and hack it up to your heart's content, or perhaps you can find a direct QEMU communication package somewhere? The QEMU project might have such a thing, I don't know.

It would be good to support using QMP directly to interact with VMs, but the package would have to support both methods. If libvirt was used to start the domain, it will also open the VM's management socket, and this blocks any other process from doing the same.