libvirtrpc: invalid character '\x00' after top-level value
mdlayher opened this issue · 0 comments
mdlayher commented
Test program:
package main
import (
"log"
"net"
"time"
"github.com/digitalocean/go-qemu"
"github.com/digitalocean/go-qemu/qmp/libvirtrpc"
)
func main() {
c, err := net.DialTimeout("unix", "/var/run/libvirt/libvirt-sock", 2*time.Second)
if err != nil {
log.Fatalf("failed to dial libvirt: %v", err)
}
mon := libvirtrpc.New("ubuntuvm0", c)
if err := mon.Connect(); err != nil {
log.Fatalf("failed to connect monitor: %v", err)
}
dom, err := qemu.NewDomain(mon, "ubuntuvm0")
if err != nil {
log.Fatalf("failed to create domain: %v", err)
}
_, err = dom.Version()
if err != nil {
log.Fatalf("failed to retrieve version: %v", err)
}
}
Libvirt and QEMU versions:
[zsh|matt@servnerr-2]:~ 0 % virsh version
Compiled against library: libvirt 1.2.2
Using library: libvirt 1.2.2
Using API: QEMU 1.2.2
Running hypervisor: QEMU 2.0.0
Error output:
2016/05/03 16:44:55 failed to retrieve version: invalid character '\x00' after top-level value