From: Daniel P. Berrangé Date: Mon, 28 Apr 2025 10:47:34 +0000 (+0100) Subject: util: stop hardcoding bhyve, bhyvectl, bhyveload paths X-Git-Tag: v11.4.0-rc1~132 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f7abafdd05f300a069eb888db166c1a50deef7d4;p=thirdparty%2Flibvirt.git util: stop hardcoding bhyve, bhyvectl, bhyveload paths Change the meson rules to always enable bhyve if on a FreeBSD host, unless the meson options say not to. Reviewed-by: Peter Krempa Signed-off-by: Daniel P. Berrangé --- diff --git a/meson.build b/meson.build index fd1800bbd9..a5a28e2c33 100644 --- a/meson.build +++ b/meson.build @@ -1495,16 +1495,7 @@ if not get_option('driver_libvirtd').disabled() endif if not get_option('driver_bhyve').disabled() and host_machine.system() == 'freebsd' - bhyve_prog = find_program('bhyve', required: get_option('driver_bhyve')) - bhyvectl_prog = find_program('bhyvectl', required: get_option('driver_bhyve')) - bhyveload_prog = find_program('bhyveload', required: get_option('driver_bhyve')) - - if bhyve_prog.found() and bhyvectl_prog.found() and bhyveload_prog.found() - conf.set('WITH_BHYVE', 1) - conf.set_quoted('BHYVE', bhyve_prog.full_path()) - conf.set_quoted('BHYVECTL', bhyvectl_prog.full_path()) - conf.set_quoted('BHYVELOAD', bhyveload_prog.full_path()) - endif + conf.set('WITH_BHYVE', 1) elif get_option('driver_bhyve').enabled() error('The bhyve driver cannot be enabled') endif diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c index 6578a4326c..44c66ea147 100644 --- a/src/bhyve/bhyve_command.c +++ b/src/bhyve/bhyve_command.c @@ -711,7 +711,7 @@ virBhyveProcessBuildBhyveCmd(struct _bhyveConn *driver, virDomainDef *def, * -S 31,uart,stdio \ * vm0 */ - g_autoptr(virCommand) cmd = virCommandNew(BHYVE); + g_autoptr(virCommand) cmd = virCommandNew("bhyve"); size_t i; unsigned nusbcontrollers = 0; unsigned nisacontrollers = 0; @@ -884,7 +884,7 @@ virCommand * virBhyveProcessBuildDestroyCmd(struct _bhyveConn *driver G_GNUC_UNUSED, virDomainDef *def) { - virCommand *cmd = virCommandNew(BHYVECTL); + virCommand *cmd = virCommandNew("bhyvectl"); virCommandAddArg(cmd, "--destroy"); virCommandAddArgPair(cmd, "--vm", def->name); @@ -907,7 +907,7 @@ virBhyveProcessBuildBhyveloadCmd(virDomainDef *def, virDomainDiskDef *disk) { virCommand *cmd; - cmd = virCommandNew(BHYVELOAD); + cmd = virCommandNew("bhyveload"); if (def->os.bootloaderArgs == NULL) { VIR_DEBUG("bhyveload with default arguments");