tools/xl: fix channel configuration setting

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, use
ARRAY_EXTEND_INIT_NODEVID() in order to avoid overwriting the devid
set by libxl_device_channel_init().

Fixes: 3a66796347 ("libxl: set channel devid when not provided by application")
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
This commit is contained in:
Juergen Gross authored and Jan Beulich committed 2025-03-05 16:37:37 +01:00
1 parent c2e3d122de
commit e1ccced4af
1 file changed
+3 -2
+3 -2
View File
@@ -2423,8 +2423,9 @@ void parse_config_data(const char *config_source,
char *path = NULL;
int len;
chn = ARRAY_EXTEND_INIT(d_config->channels, d_config->num_channels,
libxl_device_channel_init);
chn = ARRAY_EXTEND_INIT_NODEVID(d_config->channels,
d_config->num_channels,
libxl_device_channel_init);
split_string_into_string_list(buf, ",", &pairs);
len = libxl_string_list_length(&pairs);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.