[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] KVM/qemu: problems with autostart of vms with non-bridged nets



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:
james cactusamerica com


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]