Hi Daniel,

thanks for looking into this.

> +    virConnectPtr conn = virConnectOpen(getuid() ?
> +                                        "qemu:///session" :
> +                                        "qemu:///system");
> +
> +    if (!conn) {
> +        qemudLog(QEMUD_ERR, "%s",
> +                 _("Cannot autostart domains, failed to open
> connection")); +        return;
> +    }

I thought about that check too, but decided against it, because

a) currently we always call it with conn=NULL, it only fails if you don't use 
a directly bridged network

b) it currently won't do any harm calling with conn=NULL, creating the vm 
fails later on because it can't find the network device.

But if some code relying on the conn-structure is added later on without 
sanity-checks, this check will make sure no bigger harm is done.

Kind regards,

Gerd

-- 
Address (better: trap) for people I really don't want to get mail from:
[EMAIL PROTECTED]

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to