diff options
Diffstat (limited to 'hypervisior.go')
| -rw-r--r-- | hypervisior.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/hypervisior.go b/hypervisior.go index e338889..cc96a94 100644 --- a/hypervisior.go +++ b/hypervisior.go @@ -18,7 +18,7 @@ import ( "fmt" "log" - hypervisor "github.com/digitalocean/go-qemu/hypervisor" + "github.com/digitalocean/go-qemu/hypervisor" "github.com/digitalocean/go-qemu/qemu" ) @@ -63,6 +63,15 @@ func poolHypervisor(hv *hypervisor.Hypervisor) string { fmt.Println("OFF", status, name, drives) out += "OFF " + name + "\n" } + + // Close the domain to clean up its resources and underlying monitor. + // todo: store dom and reuse it? not closing it hangs libvirt eventually because it leaves dangling + // connects that rack up and all block in virNetSocketReadWire:1781 + // probably this doesn't matter because NOTHING HERE IS DONE IN HIGH FREQUENCY EVER. + // domU changes hardly ever happen + if err := dom.Close(); err != nil { + log.Fatalf("failed to close domain: %v", err) + } } return out } |
