bhyve: add deprecation warning function

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D58636
This commit is contained in:
Nimish Jain authored and Mark Johnston committed 2026-08-11 14:15:02 +00:00
1 parent 12857d8f42
commit 80d82fca1f
3 files changed
+13 -10

No files matched your search

+2 -10
View File
@@ -266,16 +266,8 @@ bhyve_optparse(int argc, char **argv)
}
/* Handle backwards compatibility aliases in config options. */
if (get_config_value("lpc.bootrom") != NULL &&
get_config_value("bootrom") == NULL) {
warnx("lpc.bootrom is deprecated, use '-o bootrom' instead");
set_config_value("bootrom", get_config_value("lpc.bootrom"));
}
if (get_config_value("lpc.bootvars") != NULL &&
get_config_value("bootvars") == NULL) {
warnx("lpc.bootvars is deprecated, use '-o bootvars' instead");
set_config_value("bootvars", get_config_value("lpc.bootvars"));
}
bhyve_cfg_warn("lpc.bootrom", "bootrom");
bhyve_cfg_warn("lpc.bootvars", "bootvars");
}
void
+10
View File
@@ -242,6 +242,16 @@ out:
return (-1);
}
void
bhyve_cfg_warn(const char *old, const char *new)
{
if (get_config_value(old) != NULL &&
get_config_value(new) == NULL) {
warnx("'%s' is deprecated, use '%s' instead", old, new);
set_config_value(new, get_config_value(old));
}
}
static void
calc_mem_affinity(size_t vm_memsize)
{
+1
View File
@@ -84,6 +84,7 @@ void bhyve_parse_gdb_options(const char *opt);
int bhyve_pincpu_parse(const char *opt);
int bhyve_topology_parse(const char *opt);
int bhyve_numa_parse(const char *opt);
void bhyve_cfg_warn(const char *old, const char *new);
void bhyve_init_vcpu(struct vcpu *vcpu);
void bhyve_start_vcpu(struct vcpu *vcpu, bool bsp);