Skip to content

Commit b267332

Browse files
authored
Merge pull request #22 from cobaltcore-dev/cloud-hypervisor-support
[libvirt] switch to cloud hypervisor libvirt connection by default
2 parents 2ac4880 + 0013bb6 commit b267332

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/libvirt/libvirt.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ func (l *LibVirt) Connect() error {
6262
return nil
6363
}
6464

65-
err := l.virt.Connect()
65+
var libVirtUri = libvirt.ConnectURI("ch:///system")
66+
if uri, present := os.LookupEnv("LIBVIRT_DEFAULT_URI"); present {
67+
libVirtUri = libvirt.ConnectURI(uri)
68+
}
69+
err := l.virt.ConnectToURI(libVirtUri)
6670
if err == nil {
6771
// Update the version
6872
if version, err := l.virt.ConnectGetVersion(); err != nil {

0 commit comments

Comments
 (0)