aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNimish Jain <njain15@protonmail.com>2026-08-11 14:12:39 +0000
committerMark Johnston <markj@FreeBSD.org>2026-08-11 14:15:02 +0000
commit80d82fca1f0d741173006021dafb259590f1d1d9 (patch)
tree9ee6ebaeabeef1f172ecb906458f3b88bda0497a
parent12857d8f4269af7df85605b48ae5e7b2fd810fde (diff)
bhyve: add deprecation warning function
Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D58636
-rw-r--r--usr.sbin/bhyve/amd64/bhyverun_machdep.c12
-rw-r--r--usr.sbin/bhyve/bhyverun.c10
-rw-r--r--usr.sbin/bhyve/bhyverun.h1
3 files changed, 13 insertions, 10 deletions
diff --git a/usr.sbin/bhyve/amd64/bhyverun_machdep.c b/usr.sbin/bhyve/amd64/bhyverun_machdep.c
index 2c8f825b4a7c..5b23807b30d5 100644
--- a/usr.sbin/bhyve/amd64/bhyverun_machdep.c
+++ b/usr.sbin/bhyve/amd64/bhyverun_machdep.c
@@ -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
diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c
index ace631594544..09605b7c114f 100644
--- a/usr.sbin/bhyve/bhyverun.c
+++ b/usr.sbin/bhyve/bhyverun.c
@@ -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)
{
diff --git a/usr.sbin/bhyve/bhyverun.h b/usr.sbin/bhyve/bhyverun.h
index 5e6c81d008b8..a6fddd9f11f8 100644
--- a/usr.sbin/bhyve/bhyverun.h
+++ b/usr.sbin/bhyve/bhyverun.h
@@ -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);