From: "Anthony PERARD" <anthony.perard@vates.tech>
To: "Juergen Gross" <jgross@suse.com>
Cc: xen-devel@lists.xenproject.org
Subject: Re: [PATCH] tools/xl: fix channel configuration setting
Date: Mon, 24 Feb 2025 16:40:46 +0000 [thread overview]
Message-ID: <Z7yhAUMRvTeSNoco@l14> (raw)
In-Reply-To: <20250224142005.24172-1-jgross@suse.com>
On Mon, Feb 24, 2025 at 03:20:05PM +0100, Juergen Gross wrote:
> Channels work differently than other device types: their devid should
> be -1 initially in order to distinguish them from the primary console
> which has the devid of 0.
>
> So when parsing the channel configuration, set devid explicitly to -1
> after expanding the channels array, as this expansion of the array will
> have set the devid to the index of the item in the array, overwriting
> the -1 initialization done by libxl_device_channel_init().
>
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
> tools/xl/xl_parse.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
> index 3d85be7dd4..4705f6fd4b 100644
> --- a/tools/xl/xl_parse.c
> +++ b/tools/xl/xl_parse.c
> @@ -2426,6 +2426,9 @@ void parse_config_data(const char *config_source,
> chn = ARRAY_EXTEND_INIT(d_config->channels, d_config->num_channels,
> libxl_device_channel_init);
>
> + /* ARRAY_EXTEND_INIT() has set the devid, but it must be -1. */
> + chn->devid = -1;
> +
You can use ARRAY_EXTEND_INIT_NODEVID() instead which doesn't touch
`devid` and let the value set by libxl_device_channel_init().
Cheers,
--
Anthony Perard | Vates XCP-ng Developer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
prev parent reply other threads:[~2025-02-24 16:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-24 14:20 [PATCH] tools/xl: fix channel configuration setting Juergen Gross
2025-02-24 16:40 ` Anthony PERARD [this message]
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=Z7yhAUMRvTeSNoco@l14 \
--to=anthony.perard@vates.tech \
--cc=jgross@suse.com \
--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.