mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-10-21 15:33:53 +03:00
virt-host-validate: add bhyve support
Add bhyve support to virt-host-validate(1). It checks for the essential kernel modules to be available so that user can actually start VMs, have networking and console access. It uses the kldnext(2)/kldstat(2) routines to retrieve modules list. As bhyve is only available on FreeBSD and these routines were available long before bhyve appeared, not adding any specific configure checks for that. Also, update tools/Makefile.am to add virt-host-validate-$driver.[hc] to the build only if the appropriate driver is enabled.
This commit is contained in:
@@ -36,6 +36,9 @@
|
||||
#if WITH_LXC
|
||||
# include "virt-host-validate-lxc.h"
|
||||
#endif
|
||||
#if WITH_BHYVE
|
||||
# include "virt-host-validate-bhyve.h"
|
||||
#endif
|
||||
|
||||
static void
|
||||
show_help(FILE *out, const char *argv0)
|
||||
@@ -48,6 +51,7 @@ show_help(FILE *out, const char *argv0)
|
||||
"\n"
|
||||
" - qemu\n"
|
||||
" - lxc\n"
|
||||
" - bhyve\n"
|
||||
"\n"
|
||||
" Options:\n"
|
||||
" -h, --help Display command line help\n"
|
||||
@@ -130,6 +134,14 @@ main(int argc, char **argv)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if WITH_BHYVE
|
||||
if (!hvname || STREQ(hvname, "bhyve")) {
|
||||
usedHvname = true;
|
||||
if (virHostValidateBhyve() < 0)
|
||||
ret = EXIT_FAILURE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (hvname && !usedHvname) {
|
||||
fprintf(stderr, _("%s: unsupported hypervisor name %s\n"),
|
||||
argv[0], hvname);
|
||||
|
Reference in New Issue
Block a user