]> xenbits.xensource.com Git - libvirt.git/commitdiff
libxl: Fix connection to modular network daemon
authorJim Fehlig <jfehlig@suse.com>
Fri, 22 Sep 2023 18:20:35 +0000 (12:20 -0600)
committerJim Fehlig <jfehlig@suse.com>
Mon, 25 Sep 2023 14:16:24 +0000 (08:16 -0600)
In a modular daemon configuration, virtxend does not support the
virNetwork* APIs. It should open a connection to virtnetworkd when
using those APIs, but currently always opens a connection to
"xen:///system". Switch to using virGetConnectNetwork to obtain a
valid connection instead of using the hardcoded URI.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/libxl/libxl_conf.c

index 4582126d19c1695e285dbff0327511f7c2ac9e49..62e1be66726e190b3568702bcf3fe9c7ed0b95fc 100644 (file)
@@ -1372,7 +1372,7 @@ libxlMakeNic(virDomainDef *def,
             break;
         case VIR_DOMAIN_NET_TYPE_NETWORK:
         {
-            if (!(conn = virConnectOpen("xen:///system")))
+            if (!(conn = virGetConnectNetwork()))
                 goto cleanup;
 
             if (!(network =