Giter Club home page Giter Club logo

Comments (4)

connorkuehl avatar connorkuehl commented on August 25, 2024

Are you able to connect to the modular sockets with the dialers package? Something like this:

dialer := dialers.NewLocal(dialers.WithSocket("/var/run/libvirt/virtqemud"))
lv := libvirt.NewWithDialer(dialer)
err := lv.Connect()
defer lv.Disconnect()

from go-libvirt.

folliehiyuki avatar folliehiyuki commented on August 25, 2024

Sorry that I'm not familiar with Go. I modified the snippet above a little:

package main

import (
	"github.com/digitalocean/go-libvirt"
	"github.com/digitalocean/go-libvirt/socket/dialers"
	"github.com/sirupsen/logrus"
)

func main() {
	dialer := dialers.NewLocal(dialers.WithSocket("/var/run/libvirt/virtqemud-sock"))
	lv := libvirt.NewWithDialer(dialer)
	if err := lv.Connect(); err != nil {
		logrus.Fatal(err)
	}
	defer lv.Disconnect()
}

Running it with go run main.go doesn't return any errors (and it returns 0) so I guess it connects successfully.

from go-libvirt.

folliehiyuki avatar folliehiyuki commented on August 25, 2024

What I want to ask here is to support dynamic socket. So instead of relying on 1 defined socket, we can detect which modular socket we need to connect to based on the API call.

On a normal system, 1 modular daemon alone is kind of useless, but also people might not want to enable libvirtd as they don't use all libvirt features.

from go-libvirt.

connorkuehl avatar connorkuehl commented on August 25, 2024

Ah, I see. That makes sense. I can't promise this will get done in the near future, but if someone else beats one of us and submits patches, I'm happy to review them.

Thanks for filing this feature request 🙂

from go-libvirt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.