[libvirt-users] HELP!

Martin Kletzander mkletzan at redhat.com
Fri Feb 15 15:20:34 UTC 2019


Please consider writing more descriptive subjects.  No need to shout, too.

On Fri, Feb 15, 2019 at 08:43:36PM +0530, Shashwat shagun wrote:

[...]

>func (d *DomService) Connect() error {
>        var err error
>        d.Conn, err = libvirt.NewConnect("qemu:///system")
>        if err != nil {
>                fmt.Println(err)
>        }
>defer d.Conn.Close()

I have no idea how the golang bindings are structured, but I'm quite sure you
don't want to close the connection right after this function ends...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20190215/4ee295c8/attachment.sig>


More information about the libvirt-users mailing list