On 02/25/2017 02:30 PM, Roman Bogorodskiy wrote:
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.
---
po/POTFILES.in | 1 +
tools/Makefile.am | 1 +
tools/virt-host-validate-bhyve.c | 78 ++++++++++++++++++++++++++++++++++++++++
tools/virt-host-validate-bhyve.h | 27 ++++++++++++++
tools/virt-host-validate.c | 12 +++++++
tools/virt-host-validate.pod | 4 +--
6 files changed, 121 insertions(+), 2 deletions(-)
create mode 100644 tools/virt-host-validate-bhyve.c
create mode 100644 tools/virt-host-validate-bhyve.h
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 9f66697d7..51b5859cb 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -306,6 +306,7 @@ tools/virsh-snapshot.c
tools/virsh-volume.c
tools/virsh.c
tools/virt-admin.c
+tools/virt-host-validate-bhyve.c
tools/virt-host-validate-common.c
tools/virt-host-validate-lxc.c
tools/virt-host-validate-qemu.c
diff --git a/tools/Makefile.am b/tools/Makefile.am
index e6ae15025..a8bd3d1c2 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -142,6 +142,7 @@ virt_host_validate_SOURCES = \
virt-host-validate-common.c virt-host-validate-common.h \
virt-host-validate-qemu.c virt-host-validate-qemu.h \
virt-host-validate-lxc.c virt-host-validate-lxc.h \
+ virt-host-validate-bhyve.c virt-host-validate-bhyve.h \
This will need a condition. virt-host-validate-bhyve.c is not really able to compile on
Linux. Other sources should be conditionally included too. Something among these lines:
diff --git i/tools/Makefile.am w/tools/Makefile.am
index a8bd3d1c2..64d3af4f0 100644
--- i/tools/Makefile.am
+++ w/tools/Makefile.am
@@ -139,11 +139,28 @@ libvirt_shell_la_SOURCES = vsh.c vsh.h
virt_host_validate_SOURCES = \
virt-host-validate.c \
- virt-host-validate-common.c virt-host-validate-common.h \
- virt-host-validate-qemu.c virt-host-validate-qemu.h \
- virt-host-validate-lxc.c virt-host-validate-lxc.h \
- virt-host-validate-bhyve.c virt-host-validate-bhyve.h \
- $(NULL)
+ virt-host-validate-common.c virt-host-validate-common.h
+
+VIRT_HOST_VALIDATE_QEMU = virt-host-validate-qemu.c virt-host-validate-qemu.h
+VIRT_HOST_VALIDATE_LXC = virt-host-validate-lxc.c virt-host-validate-lxc.h
+VIRT_HOST_VALIDATE_BHYVE = virt-host-validate-bhyve.c virt-host-validate-bhyve.h
+if WITH_QEMU
+virt_host_validate_SOURCES += $(VIRT_HOST_VALIDATE_QEMU)
+else ! WITH_QEMU
+EXTRA_DIST += $(VIRT_HOST_VALIDATE_QEMU)
+endif ! WITH_QEMU
+
+if WITH_LXC
+virt_host_validate_SOURCES += $(VIRT_HOST_VALIDATE_LXC)
+else ! WITH_LXC
+EXTRA_DIST += $(VIRT_HOST_VALIDATE_LXC)
+endif ! WITH_LXC
+
+if WITH_BHYVE
+virt_host_validate_SOURCES += $(VIRT_HOST_VALIDATE_BHYVE)
+else ! WITH_BHYVE
+EXTRA_DIST += $(VIRT_HOST_VALIDATE_BHYVE)
+endif ! WITH_BHYVE
virt_host_validate_LDFLAGS = \
$(AM_LDFLAGS) \
ACK with this squashed in.
Michal