All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Anthony PERARD" <anthony.perard@vates.tech>
To: "Juergen Gross" <jgross@suse.com>
Cc: xen-devel@lists.xenproject.org,
	"Samuel Thibault" <samuel.thibault@ens-lyon.org>,
	"Julien Grall" <julien@xen.org>
Subject: Re: [PATCH v5 5/5] tools/xenstored: use new stable interface instead of libxenctrl
Date: Tue, 17 Dec 2024 17:33:24 +0000	[thread overview]
Message-ID: <Z2G14bDyV_Dn06YP@l14> (raw)
In-Reply-To: <20241217142218.24129-6-jgross@suse.com>

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


  reply	other threads:[~2024-12-17 17:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-17 14:22 [PATCH v5 0/5] remove libxenctrl usage from xenstored Juergen Gross
2024-12-17 14:22 ` [PATCH v5 1/5] tools: add a dedicated header file for barrier definitions Juergen Gross
2024-12-17 14:22 ` [PATCH v5 2/5] xen: add bitmap to indicate per-domain state changes Juergen Gross
2024-12-17 15:19   ` Jan Beulich
2024-12-17 15:55     ` Jürgen Groß
2024-12-17 16:12       ` Jan Beulich
2024-12-18  7:15         ` Jürgen Groß
2024-12-19  8:01           ` Jan Beulich
2025-01-06  9:34             ` Juergen Gross
2024-12-17 14:22 ` [PATCH v5 3/5] xen: add new domctl get_changed_domain Juergen Gross
2024-12-17 14:41   ` Jan Beulich
2024-12-18  1:20   ` Daniel P. Smith
2024-12-17 14:22 ` [PATCH v5 4/5] tools/libs: add a new libxenmanage library Juergen Gross
2024-12-17 14:22 ` [PATCH v5 5/5] tools/xenstored: use new stable interface instead of libxenctrl Juergen Gross
2024-12-17 17:33   ` Anthony PERARD [this message]
2024-12-17 18:40     ` Jürgen Groß

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z2G14bDyV_Dn06YP@l14 \
    --to=anthony.perard@vates.tech \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.