tools/xl: reject bootloader=pygrub in case pygrub is disabled

In case Xen has been configured with "--disable-pygrub", don't accept
the domain config option "bootloader=pygrub".

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
This commit is contained in:
Juergen Gross authored and Jan Beulich committed 2023-08-09 09:05:55 +02:00
1 parent df8852543d
commit a8a7c33e7d
1 file changed
+9
+9
View File
@@ -1692,6 +1692,15 @@ void parse_config_data(const char *config_source,
xlu_cfg_get_defbool(config, "acpi", &b_info->acpi, 0);
xlu_cfg_replace_string (config, "bootloader", &b_info->bootloader, 0);
#ifndef HAVE_PYGRUB
if (b_info->bootloader &&
(!strcmp(b_info->bootloader, "pygrub") ||
!strcmp(b_info->bootloader, "/usr/bin/pygrub"))) {
fprintf(stderr, "ERROR: this instance of Xen has been built without support of \"pygrub\".\n");
exit(-ERROR_FAIL);
}
#endif
switch (xlu_cfg_get_list_as_string_list(config, "bootloader_args",
&b_info->bootloader_args, 1)) {
case 0:
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.