diff --git a/config/Tools.mk.in b/config/Tools.mk.in index 84b261211a..852c941d68 100644 --- a/config/Tools.mk.in +++ b/config/Tools.mk.in @@ -54,6 +54,7 @@ CONFIG_SEABIOS := @seabios@ CONFIG_QEMU_TRAD := @qemu_traditional@ CONFIG_QEMU_XEN := @qemu_xen@ CONFIG_BLKTAP1 := @blktap1@ +CONFIG_BLKTAP2 := @blktap2@ CONFIG_VTPM := @vtpm@ CONFIG_QEMUU_EXTRA_ARGS:= @EXTRA_QEMUU_CONFIGURE_ARGS@ diff --git a/tools/Makefile b/tools/Makefile index 63382b16e4..4682f439d2 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -16,11 +16,8 @@ SUBDIRS-y += console SUBDIRS-y += xenmon SUBDIRS-y += xenstat SUBDIRS-$(CONFIG_Linux) += memshr -ifeq ($(CONFIG_X86)$(CONFIG_Linux),yy) SUBDIRS-$(CONFIG_BLKTAP1) += blktap -endif -SUBDIRS-$(CONFIG_Linux) += blktap2 -SUBDIRS-$(CONFIG_NetBSD) += blktap2 +SUBDIRS-$(CONFIG_BLKTAP2) += blktap2 SUBDIRS-$(CONFIG_NetBSD) += xenbackendd SUBDIRS-y += libfsimage SUBDIRS-$(CONFIG_Linux) += libvchan diff --git a/tools/config.h.in b/tools/config.h.in index 028c360207..40f3d1cde7 100644 --- a/tools/config.h.in +++ b/tools/config.h.in @@ -1,5 +1,8 @@ /* config.h.in. Generated from configure.ac by autoheader. */ +/* Blktap2 enabled */ +#undef HAVE_BLKTAP2 + /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H diff --git a/tools/configure b/tools/configure index c3a6824f55..d84d9504ec 100755 --- a/tools/configure +++ b/tools/configure @@ -689,6 +689,7 @@ seabios_path qemu_xen rombios qemu_traditional +blktap2 blktap1 debug seabios @@ -763,6 +764,7 @@ enable_ovmf enable_seabios enable_debug enable_blktap1 +enable_blktap2 enable_qemu_traditional enable_rombios with_system_qemu @@ -1424,6 +1426,8 @@ Optional Features: --disable-seabios Disable SeaBIOS (default is ENABLED) --disable-debug Disable debug build of tools (default is ENABLED) --enable-blktap1 Enable blktap1 tools (default is DISABLED) + --enable-blktap2 Enable blktap2, (DEFAULT is on for Linux, otherwise + off) --enable-qemu-traditional Enable qemu traditional device model, (DEFAULT is on for Linux or NetBSD x86, otherwise off) @@ -3724,6 +3728,33 @@ blktap1=$ax_cv_blktap1 +# Check whether --enable-blktap2 was given. +if test "${enable_blktap2+set}" = set; then : + enableval=$enable_blktap2; +else + + case "$host_os" in + linux*) + enable_blktap2="yes";; + *) enable_blktap2="no";; + esac + +fi + +if test "x$enable_blktap2" = "xyes"; then : + + +$as_echo "#define HAVE_BLKTAP2 1" >>confdefs.h + + blktap2=y +else + + blktap2=n + +fi + + + # Check whether --enable-qemu-traditional was given. if test "${enable_qemu_traditional+set}" = set; then : enableval=$enable_qemu_traditional; diff --git a/tools/configure.ac b/tools/configure.ac index 9db798b57a..836bbba4a3 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -58,6 +58,24 @@ AX_ARG_DEFAULT_ENABLE([seabios], [Disable SeaBIOS]) AX_ARG_DEFAULT_ENABLE([debug], [Disable debug build of tools]) AX_ARG_DEFAULT_DISABLE([blktap1], [Enable blktap1 tools]) +dnl Enable blktap2 on Linux only. +AC_ARG_ENABLE([blktap2], + AS_HELP_STRING([--enable-blktap2], + [Enable blktap2, (DEFAULT is on for Linux, otherwise off)]),,[ + case "$host_os" in + linux*) + enable_blktap2="yes";; + *) enable_blktap2="no";; + esac +]) +AS_IF([test "x$enable_blktap2" = "xyes"], [ +AC_DEFINE([HAVE_BLKTAP2], [1], [Blktap2 enabled]) + blktap2=y],[ + blktap2=n +]) +AC_SUBST(blktap2) + + AC_ARG_ENABLE([qemu-traditional], AS_HELP_STRING([--enable-qemu-traditional], [Enable qemu traditional device model, (DEFAULT is on for Linux or NetBSD x86, otherwise off)]),,[