Open
Description
Sifting through the code I gather the connection URI is not configurable.
const (
connectionString = "qemu:///system"
func (d *Driver) getConn() (*libvirt.Connect, error) {
if d.conn == nil {
conn, err := libvirt.NewConnect(connectionString)
I need to use a different URI (e.g. qemu:///session
). I think a driver parameter would be appropriate here. Alternatively, passing an empty string to libvirt.NewConnect
would have libvirt select the default connection and let the user configure it themselves.
func NewConnect(uri string) (*Connect, error) {
var cUri *C.char
if uri != "" {
cUri = C.CString(uri)
defer C.free(unsafe.Pointer(cUri))
}
ptr := C.virConnectOpen(cUri)
virConnectOpen
: https://libvirt.org/html/libvirt-libvirt-host.html#virConnectOpen
Metadata
Metadata
Assignees
Labels
No labels