diff --git a/usr.sbin/bhyve/aarch64/bhyverun_machdep.c b/usr.sbin/bhyve/aarch64/bhyverun_machdep.c --- a/usr.sbin/bhyve/aarch64/bhyverun_machdep.c +++ b/usr.sbin/bhyve/aarch64/bhyverun_machdep.c @@ -183,7 +183,7 @@ set_config_value("uuid", optarg); break; case 'W': - set_config_bool("virtio_msix", false); + set_config_bool("virtio.msix", false); break; case 'h': bhyve_usage(0); @@ -191,6 +191,9 @@ bhyve_usage(1); } } + + /* Handle backwards compatibility aliases in config options. */ + bhyve_cfg_warn("virtio_msix", "virtio.msix", "virtio.msix"); } void diff --git a/usr.sbin/bhyve/amd64/bhyverun_machdep.c b/usr.sbin/bhyve/amd64/bhyverun_machdep.c --- a/usr.sbin/bhyve/amd64/bhyverun_machdep.c +++ b/usr.sbin/bhyve/amd64/bhyverun_machdep.c @@ -250,7 +250,7 @@ set_config_bool("x86.strictmsr", false); break; case 'W': - set_config_bool("virtio_msix", false); + set_config_bool("virtio.msix", false); break; case 'x': set_config_bool("x86.x2apic", true); @@ -266,16 +266,9 @@ } /* 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", "-o bootrom"); + bhyve_cfg_warn("lpc.bootvars", "bootvars", "-o bootvars"); + bhyve_cfg_warn("virtio_msix", "virtio.msix", "virtio.msix"); } void diff --git a/usr.sbin/bhyve/bhyve_config.5 b/usr.sbin/bhyve/bhyve_config.5 --- a/usr.sbin/bhyve/bhyve_config.5 +++ b/usr.sbin/bhyve/bhyve_config.5 @@ -170,7 +170,7 @@ System Management BIOS System Information structure. If an explicit value is not set, a valid UUID is generated from the host's hostname and the VM name. -.It Va virtio_msix Ta bool Ta true Ta +.It Va virtio.msix Ta bool Ta true Ta Use MSI-X interrupts for PCI VirtIO devices. If set to false, MSI interrupts are used instead. .It Va virtio.legacy Ta bool Ta true Ta diff --git a/usr.sbin/bhyve/bhyverun.h b/usr.sbin/bhyve/bhyverun.h --- a/usr.sbin/bhyve/bhyverun.h +++ b/usr.sbin/bhyve/bhyverun.h @@ -84,6 +84,7 @@ 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, const char *msg); void bhyve_init_vcpu(struct vcpu *vcpu); void bhyve_start_vcpu(struct vcpu *vcpu, bool bsp); diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -242,6 +242,16 @@ return (-1); } +void +bhyve_cfg_warn(const char *old, const char *new, const char *msg) +{ + if (get_config_value(old) != NULL && + get_config_value(new) == NULL) { + warnx("'%s' is deprecated, use '%s' instead", old, msg); + set_config_value(new, get_config_value(old)); + } +} + static void calc_mem_affinity(size_t vm_memsize) { @@ -551,8 +561,7 @@ int fbsdrun_virtio_msix(void) { - - return (get_config_bool_default("virtio_msix", true)); + return (get_config_bool_default("virtio.msix", true)); } struct vcpu * diff --git a/usr.sbin/bhyve/riscv/bhyverun_machdep.c b/usr.sbin/bhyve/riscv/bhyverun_machdep.c --- a/usr.sbin/bhyve/riscv/bhyverun_machdep.c +++ b/usr.sbin/bhyve/riscv/bhyverun_machdep.c @@ -174,7 +174,7 @@ set_config_value("uuid", optarg); break; case 'W': - set_config_bool("virtio_msix", false); + set_config_bool("virtio.msix", false); break; case 'h': bhyve_usage(0); @@ -182,6 +182,10 @@ bhyve_usage(1); } } + + /* Handle backwards compatibility aliases in config options. */ + bhyve_cfg_warn("virtio_msix", "virtio.msix", "virtio.msix"); + } void