Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable connection URI #35

Open
tn-osimis opened this issue Mar 14, 2017 · 3 comments
Open

Configurable connection URI #35

tn-osimis opened this issue Mar 14, 2017 · 3 comments

Comments

@tn-osimis
Copy link

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

@bersace
Copy link

bersace commented Jun 16, 2017

I totally agree with this. That's now easy to have user QEMU thanks to qemu-bridge-helper. We need only two params : the connection string (use the session) and the bridge to use (instead of a libvirt network).

This will avoid a password prompt and make it more secure. Also, this will help isolate dév env in dév home.

🆙 👍 Thanks for the report.

@dhiltgen do you want help on this topic ?

@bersace
Copy link

bersace commented Jun 16, 2017

Actually, in my setup, I simply use the same bridge as for my lxc containers:

   <interface type='bridge'>
     <mac address='52:54:00:a5:a2:78'/>
     <source bridge='lxcbr0'/>
     <model type='rtl8139'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
   </interface>
   <serial type='pty'>

Here is how i setup qemu-bridge-helpers on debian: https://github.com/bersace/dotfiles/blob/master/virtualisation.yml#L58-L79

@karmab
Copy link

karmab commented Nov 7, 2017

addressed by PR #63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants