Registry / cloud / go-libvirt

go-libvirt

JSON →
library1.12003.0gogounverified

A Go binding to the libvirt virtualization API for managing hypervisors and virtual machines.

go get libvirt.org/go/libvirt
INSTALL
IMPORT
SIG · GO-LIBVIRT
G
go-libvirt
cloudgov1.12003.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

libvirt
libvirt.org/go/libvirt

Connect to a local QEMU hypervisor and list active domains.

package main import ( "fmt" "libvirt.org/go/libvirt" ) func main() { conn, err := libvirt.NewConnect("qemu:///system") if err != nil { panic(err) } defer conn.Close() doms, err := conn.ListAllDomains(libvirt.CONNECT_LIST_DOMAINS_ACTIVE) if err != nil { panic(err) } fmt.Printf("Active domains: %d\n", len(doms)) }
Debug
Known issues
gotchaRequires libvirt C library and development headers installed on the system.
fix
Install libvirt-dev or libvirt-devel package.
affects: all
Upgrade
Version history
1.12003.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
go-libvirt — go get go-libvirt · libregistry