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

Re: [PATCH v5 5/5] tools/xenstored: use new stable interface instead of libxenctrl



On Tue, Dec 17, 2024 at 03:22:18PM +0100, Juergen Gross wrote:
> diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c
> index 64c8fd0cc3..a6506a5bb2 100644
> --- a/tools/xenstored/domain.c
> +++ b/tools/xenstored/domain.c
> @@ -1258,15 +1248,9 @@ void domain_early_init(void)
>       if (!domhash)
>               barf_perror("Failed to allocate domain hashtable");
>  
> -     xc_handle = talloc(talloc_autofree_context(), xc_interface*);
> -     if (!xc_handle)
> -             barf_perror("Failed to allocate domain handle");
> -
> -     *xc_handle = xc_interface_open(0,0,0);
> -     if (!*xc_handle)
> -             barf_perror("Failed to open connection to hypervisor");
> -
> -     talloc_set_destructor(xc_handle, close_xc_handle);
> +     xm_handle = xenmanage_open(NULL, 0);
> +     if (!xm_handle)
> +             barf_perror("Failed to open connection to libxenmanage");
>  
>       xgt_handle = talloc(talloc_autofree_context(), xengnttab_handle*);
>       if (!xgt_handle)
> @@ -1306,6 +1290,8 @@ void domain_deinit(void)
>  {
>       if (virq_port)
>               xenevtchn_unbind(xce_handle, virq_port);
> +
> +     xenmanage_close(xm_handle);

Is this the rigth place to free `xm_handle`? domain_deinit() seems to
only be called by the live update code. All the other initialisation
done in domain_early_init() are free via talloc_autofree() it seems,
which is called by atexit().

So, shouldn't `xm_handle` by handle with talloc like the others?

Thanks,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.