[PATCH] libxl: Fix connection to modular network daemon

Jim Fehlig posted 1 patch 7 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20230922202019.24162-1-jfehlig@suse.com
src/libxl/libxl_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] libxl: Fix connection to modular network daemon
Posted by Jim Fehlig 7 months, 1 week ago
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>
---
 src/libxl/libxl_conf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 4582126d19..62e1be6672 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -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 =
-- 
2.42.0
Re: [PATCH] libxl: Fix connection to modular network daemon
Posted by Daniel P. Berrangé 7 months ago
On Fri, Sep 22, 2023 at 02:20:10PM -0600, Jim Fehlig wrote:
> 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>
> ---
>  src/libxl/libxl_conf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
> index 4582126d19..62e1be6672 100644
> --- a/src/libxl/libxl_conf.c
> +++ b/src/libxl/libxl_conf.c
> @@ -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 =

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|