From nobody Tue Apr 23 09:08:48 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1557829924; cv=none; d=zoho.com; s=zohoarc; b=CqzvWAEeSZHfMQxr9gc/yB5cdHn2ZYkhAex2gt+NtZ0Rg1eBqS5T7eSvpDbkAc6iDG9KAqRLrc5rZ9t0khXSjMcyKswNFRFWT8eSWiJXSjXSOsSoKobplk92oerOUhyOVjv6D1GWD5oqTOqmkXctboZB1jeYbM+/8gATQccDLYU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557829924; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=55DKktTjnBOOEhLzWnQ2iHtIR7cldSVaXdCRVghZxvA=; b=JG8/x1q3Cf9RxqO7d73x8llk7ipxUK2hTRphLknHzorSaMOk6yzZ+EOa8sziRvuEcoIWI1cEbwUDRhr/MSfe0afNtu9LG4+PBJzuMb4CqbVt0MsFSQ5K85rKji0e2qnmEbCMNo8v88bT7m3SSZzz9Fer7pMuQZW937ejjfd2sxs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1557829924788870.3386035427906; Tue, 14 May 2019 03:32:04 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hQUhr-0004ba-CG; Tue, 14 May 2019 10:30:47 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hQUhq-0004bN-Ke for xen-devel@lists.xenproject.org; Tue, 14 May 2019 10:30:46 +0000 Received: from SMTP03.CITRIX.COM (unknown [162.221.156.55]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 53cbed22-7633-11e9-9b05-7bff1ff72ce6; Tue, 14 May 2019 10:30:43 +0000 (UTC) X-Inumbo-ID: 53cbed22-7633-11e9-9b05-7bff1ff72ce6 X-IronPort-AV: E=Sophos;i="5.60,468,1549929600"; d="scan'208";a="85431509" From: Wei Liu To: Date: Tue, 14 May 2019 11:30:29 +0100 Message-ID: <20190514103030.8393-2-wei.liu2@citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190514103030.8393-1-wei.liu2@citrix.com> References: <20190514103030.8393-1-wei.liu2@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 1/2] tools: remove blktap2 related code and documentation X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Blktap2 is effectively dead for a few years. Notable changes in this patch: 0. Unhook blktap2 from build system 1. libxl no longer supports TAP disk backend, with appropriate assertions added and some code paths now return ERROR_FAIL 2. Tap is no longer a supported backend 3. Remove blktap2 entry from MAINTAINERS A patch to remove blktap2 directory will come later. Signed-off-by: Wei Liu --- .gitignore | 15 ----- .hgignore | 12 ---- INSTALL | 4 -- MAINTAINERS | 4 -- config/Tools.mk.in | 1 - docs/man/xl-disk-configuration.5.pod | 2 +- tools/Makefile | 1 - tools/Rules.mk | 16 +---- tools/config.h.in | 6 -- tools/configure | 78 ----------------------- tools/configure.ac | 18 ------ tools/golang/xenlight/xenlight.go | 2 +- tools/libxl/Makefile | 8 +-- tools/libxl/check-xl-disk-parse | 2 +- tools/libxl/libxl_blktap2.c | 94 ---------------------------- tools/libxl/libxl_device.c | 40 +----------- tools/libxl/libxl_disk.c | 25 +------- tools/libxl/libxl_dm.c | 17 +---- tools/libxl/libxl_internal.h | 26 -------- tools/libxl/libxl_noblktap2.c | 42 ------------- tools/libxl/xenlight.pc.in | 2 +- tools/xenstore/hashtable.c | 5 -- tools/xenstore/hashtable.h | 5 -- tools/xenstore/hashtable_private.h | 5 -- 24 files changed, 15 insertions(+), 415 deletions(-) delete mode 100644 tools/libxl/libxl_blktap2.c delete mode 100644 tools/libxl/libxl_noblktap2.c diff --git a/.gitignore b/.gitignore index 26bc583f74..b4f5e82d1d 100644 --- a/.gitignore +++ b/.gitignore @@ -114,20 +114,6 @@ tools/libs/foreignmemory/headers.chk tools/libs/foreignmemory/xenforeignmemory.pc tools/libs/devicemodel/headers.chk tools/libs/devicemodel/xendevicemodel.pc -tools/blktap2/control/xenblktapctl.pc -tools/blktap2/daemon/blktapctrl -tools/blktap2/drivers/img2qcow -tools/blktap2/drivers/lock-util -tools/blktap2/drivers/qcow-create -tools/blktap2/drivers/qcow2raw -tools/blktap2/drivers/tapdisk -tools/blktap2/drivers/tapdisk-client -tools/blktap2/drivers/tapdisk-diff -tools/blktap2/drivers/tapdisk-stream -tools/blktap2/drivers/tapdisk2 -tools/blktap2/drivers/td-util -tools/blktap2/vhd/vhd-update -tools/blktap2/vhd/vhd-util tools/console/xenconsole tools/console/xenconsoled tools/console/client/_paths.h @@ -382,7 +368,6 @@ tools/libxl/*.pyc tools/libxl/libxl-save-helper tools/libxl/test_timedereg tools/libxl/test_fdderegrace -tools/blktap2/control/tap-ctl tools/firmware/etherboot/eb-roms.h tools/firmware/etherboot/gpxe-git-snapshot.tar.gz tools/misc/xenwatchdogd diff --git a/.hgignore b/.hgignore index ded8cef532..10025c8793 100644 --- a/.hgignore +++ b/.hgignore @@ -128,18 +128,6 @@ ^stubdom/stubdompath\.sh$ ^stubdom/vtpm/vtpm_manager\.h$ ^tools/.*/build/lib.*/.*\.py$ -^tools/blktap2/control/tap-ctl$ -^tools/blktap2/drivers/img2qcow$ -^tools/blktap2/drivers/lock-util$ -^tools/blktap2/drivers/qcow-create$ -^tools/blktap2/drivers/qcow2raw$ -^tools/blktap2/drivers/tapdisk-client$ -^tools/blktap2/drivers/tapdisk-diff$ -^tools/blktap2/drivers/tapdisk-stream$ -^tools/blktap2/drivers/tapdisk2$ -^tools/blktap2/drivers/td-util$ -^tools/blktap2/vhd/vhd-update$ -^tools/blktap2/vhd/vhd-util$ ^tools/check/\..*$ ^tools/console/xenconsole$ ^tools/console/xenconsoled$ diff --git a/INSTALL b/INSTALL index 9aa9ebdddc..ff8e086fbd 100644 --- a/INSTALL +++ b/INSTALL @@ -144,10 +144,6 @@ this detection and the sysv runlevel scripts have to b= e used. --with-systemd=3DDIR --with-systemd-modules-load=3DDIR =20 -The old backend drivers are disabled because qdisk is now the default. -This option can be used to build them anyway. - --enable-blktap2 - Build various stubom components, some are only example code. Its usually enough to specify just --enable-stubdom and leave these options alone. --enable-ioemu-stubdom diff --git a/MAINTAINERS b/MAINTAINERS index 1f422d96a8..8a1e040258 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -192,10 +192,6 @@ F: xen/include/asm-arm/ F: xen/include/public/arch-arm/ F: xen/include/public/arch-arm.h =20 -BLKTAP2 -S: Orphaned -F: tools/blktap2/ - Continuous Integration (CI) M: Doug Goldstein W: https://gitlab.com/xen-project/xen diff --git a/config/Tools.mk.in b/config/Tools.mk.in index 98245f63c9..62f154662e 100644 --- a/config/Tools.mk.in +++ b/config/Tools.mk.in @@ -53,7 +53,6 @@ CONFIG_SEABIOS :=3D @seabios@ CONFIG_IPXE :=3D @ipxe@ CONFIG_QEMU_TRAD :=3D @qemu_traditional@ CONFIG_QEMU_XEN :=3D @qemu_xen@ -CONFIG_BLKTAP2 :=3D @blktap2@ CONFIG_QEMUU_EXTRA_ARGS:=3D @EXTRA_QEMUU_CONFIGURE_ARGS@ CONFIG_LIBNL :=3D @libnl@ =20 diff --git a/docs/man/xl-disk-configuration.5.pod b/docs/man/xl-disk-config= uration.5.pod index eea893ef91..7965d5dd73 100644 --- a/docs/man/xl-disk-configuration.5.pod +++ b/docs/man/xl-disk-configuration.5.pod @@ -232,7 +232,7 @@ Specifies the backend implementation to use =20 =3Ditem Supported values =20 -phy, tap, qdisk +phy, qdisk =20 =3Ditem Mandatory =20 diff --git a/tools/Makefile b/tools/Makefile index 99cbc950dc..7b1f6c4d28 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -20,7 +20,6 @@ SUBDIRS-y +=3D console SUBDIRS-y +=3D xenmon SUBDIRS-y +=3D xenstat SUBDIRS-$(CONFIG_Linux) +=3D memshr=20 -SUBDIRS-$(CONFIG_BLKTAP2) +=3D blktap2 SUBDIRS-$(CONFIG_NetBSD) +=3D xenbackendd SUBDIRS-y +=3D libfsimage SUBDIRS-$(CONFIG_Linux) +=3D libvchan diff --git a/tools/Rules.mk b/tools/Rules.mk index f5613f73a7..cf8935d6a3 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -25,7 +25,6 @@ XEN_XENLIGHT =3D $(XEN_ROOT)/tools/libxl XEN_XLUTIL =3D $(XEN_XENLIGHT) XEN_XENSTORE =3D $(XEN_ROOT)/tools/xenstore XEN_LIBXENSTAT =3D $(XEN_ROOT)/tools/xenstat/libxenstat/src -XEN_BLKTAP2 =3D $(XEN_ROOT)/tools/blktap2 XEN_LIBVCHAN =3D $(XEN_ROOT)/tools/libvchan =20 CFLAGS_xeninclude =3D -I$(XEN_INCLUDE) @@ -174,21 +173,8 @@ else CFLAGS +=3D -O2 -fomit-frame-pointer endif =20 -ifeq ($(CONFIG_BLKTAP2),y) -CFLAGS_libblktapctl =3D -I$(XEN_BLKTAP2)/control -I$(XEN_BLKTAP2)/include = $(CFLAGS_xeninclude) -SHDEPS_libblktapctl =3D -LDLIBS_libblktapctl =3D $(SHDEPS_libblktapctl) $(XEN_BLKTAP2)/control/libb= lktapctl$(libextension) -SHLIB_libblktapctl =3D $(SHDEPS_libblktapctl) -Wl,-rpath-link=3D$(XEN_BLK= TAP2)/control -else -CFLAGS_libblktapctl =3D -SHDEPS_libblktapctl =3D -LDLIBS_libblktapctl =3D -SHLIB_libblktapctl =3D -PKG_CONFIG_REMOVE +=3D xenblktapctl -endif - CFLAGS_libxenlight =3D -I$(XEN_XENLIGHT) $(CFLAGS_libxenctrl) $(CFLAGS_xen= include) -SHDEPS_libxenlight =3D $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_li= bblktapctl) +SHDEPS_libxenlight =3D $(SHLIB_libxenctrl) $(SHLIB_libxenstore) LDLIBS_libxenlight =3D $(SHDEPS_libxenlight) $(XEN_XENLIGHT)/libxenlight$(= libextension) SHLIB_libxenlight =3D $(SHDEPS_libxenlight) -Wl,-rpath-link=3D$(XEN_XENLI= GHT) =20 diff --git a/tools/config.h.in b/tools/config.h.in index 5987f087b8..5a5944ebe1 100644 --- a/tools/config.h.in +++ b/tools/config.h.in @@ -3,9 +3,6 @@ /* Enabling support partial device tree in libxl */ #undef ENABLE_PARTIAL_DEVICE_TREE =20 -/* Blktap2 enabled */ -#undef HAVE_BLKTAP2 - /* Define to 1 if you have the declaration of `fdt_first_subnode', and to = 0 if you don't. */ #undef HAVE_DECL_FDT_FIRST_SUBNODE @@ -27,9 +24,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H =20 -/* Define to 1 if you have the `aio' library (-laio). */ -#undef HAVE_LIBAIO - /* Define to 1 if you have the `fdt' library (-lfdt). */ #undef HAVE_LIBFDT =20 diff --git a/tools/configure b/tools/configure index 92ead93335..2e21b97fe6 100755 --- a/tools/configure +++ b/tools/configure @@ -703,7 +703,6 @@ BCC LD86 AS86 qemu_traditional -blktap2 LINUX_BACKEND_MODULES seabios ovmf @@ -808,7 +807,6 @@ enable_xsmpolicy enable_ovmf enable_seabios with_linux_backend_modules -enable_blktap2 enable_qemu_traditional enable_rombios with_system_qemu @@ -1493,7 +1491,6 @@ Optional Features: --disable-xsmpolicy Disable XSM policy compilation (default is ENABL= ED) --enable-ovmf Enable OVMF (default is DISABLED) --disable-seabios Disable SeaBIOS (default is ENABLED) - --enable-blktap2 Enable blktap2, (DEFAULT is off) --enable-qemu-traditional Enable qemu traditional device model, (DEFAULT i= s on for Linux or NetBSD x86, otherwise off) @@ -4221,7 +4218,6 @@ xen-scsibk usbbk pciback xen-acpi-processor -blktap2 " ;; *) @@ -4233,29 +4229,6 @@ fi LINUX_BACKEND_MODULES=3D"`eval echo $LINUX_BACKEND_MODULES`" =20 =20 -# Check whether --enable-blktap2 was given. -if test "${enable_blktap2+set}" =3D set; then : - enableval=3D$enable_blktap2; -else - - enable_blktap2=3D"no" - -fi - -if test "x$enable_blktap2" =3D "xyes"; then : - - -$as_echo "#define HAVE_BLKTAP2 1" >>confdefs.h - - blktap2=3Dy -else - - blktap2=3Dn - -fi - - - # Check whether --enable-qemu-traditional was given. if test "${enable_qemu_traditional+set}" =3D set; then : enableval=3D$enable_qemu_traditional; @@ -8467,57 +8440,6 @@ fi =20 =20 =20 -if test "x$enable_blktap2" =3D "xyes"; then : - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for io_setup in -laio" >= &5 -$as_echo_n "checking for io_setup in -laio... " >&6; } -if ${ac_cv_lib_aio_io_setup+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=3D$LIBS -LIBS=3D"-laio $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char io_setup (); -int -main () -{ -return io_setup (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_aio_io_setup=3Dyes -else - ac_cv_lib_aio_io_setup=3Dno -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=3D$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_aio_io_setup" = >&5 -$as_echo "$ac_cv_lib_aio_io_setup" >&6; } -if test "x$ac_cv_lib_aio_io_setup" =3D xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBAIO 1 -_ACEOF - - LIBS=3D"-laio $LIBS" - -else - as_fn_error $? "Could not find libaio" "$LINENO" 5 -fi - - -fi =20 =20 ac_fn_c_check_header_mongrel "$LINENO" "ext2fs/ext2fs.h" "ac_cv_header_ext= 2fs_ext2fs_h" "$ac_includes_default" diff --git a/tools/configure.ac b/tools/configure.ac index c9fd69ddfa..ba5115e142 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -106,7 +106,6 @@ xen-scsibk usbbk pciback xen-acpi-processor -blktap2 " ;; *) @@ -116,20 +115,6 @@ esac]) LINUX_BACKEND_MODULES=3D"`eval echo $LINUX_BACKEND_MODULES`" AC_SUBST(LINUX_BACKEND_MODULES) =20 -dnl Enable blktap2 on Linux only. -AC_ARG_ENABLE([blktap2], - AS_HELP_STRING([--enable-blktap2], - [Enable blktap2, (DEFAULT is off)]),,[ - enable_blktap2=3D"no" -]) -AS_IF([test "x$enable_blktap2" =3D "xyes"], [ -AC_DEFINE([HAVE_BLKTAP2], [1], [Blktap2 enabled]) - blktap2=3Dy],[ - blktap2=3Dn -]) -AC_SUBST(blktap2) - - AC_ARG_ENABLE([qemu-traditional], AS_HELP_STRING([--enable-qemu-traditional], [Enable qemu traditional device model, (DEFAULT is on f= or Linux or NetBSD x86, otherwise off)]),,[ @@ -402,9 +387,6 @@ AC_CHECK_HEADER([lzo/lzo1x.h], [ AC_CHECK_LIB([lzo2], [lzo1x_decompress], [zlib=3D"$zlib -DHAVE_LZO1X -llzo= 2"]) ]) AC_SUBST(zlib) -AS_IF([test "x$enable_blktap2" =3D "xyes"], [ -AC_CHECK_LIB([aio], [io_setup], [], [AC_MSG_ERROR([Could not find libaio])= ]) -]) AC_SUBST(system_aio) AX_CHECK_EXTFS AX_CHECK_PTHREAD diff --git a/tools/golang/xenlight/xenlight.go b/tools/golang/xenlight/xenl= ight.go index 9c37e59ec0..53534d047e 100644 --- a/tools/golang/xenlight/xenlight.go +++ b/tools/golang/xenlight/xenlight.go @@ -28,7 +28,7 @@ import "C" * -lnl-route-3 -lnl-3 * * To get back to static linking: - * #cgo LDFLAGS: -lxenlight -lyajl_s -lxengnttab -lxenstore -lxenguest -lx= entoollog -lxenevtchn -lxenctrl -lblktapctl -lxenforeignmemory -lxencall -l= z -luuid -lutil + * #cgo LDFLAGS: -lxenlight -lyajl_s -lxengnttab -lxenstore -lxenguest -lx= entoollog -lxenevtchn -lxenctrl -lxenforeignmemory -lxencall -lz -luuid -lu= til */ =20 import ( diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile index 5015ecbf27..6fdcbbddd6 100644 --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -20,7 +20,7 @@ LIBUUID_LIBS +=3D -luuid endif =20 LIBXL_LIBS =3D -LIBXL_LIBS =3D $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_lib= xenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) $(LDLIBS_libblktapctl)= $(LDLIBS_libxentoolcore) $(PTYFUNCS_LIBS) $(LIBUUID_LIBS) +LIBXL_LIBS =3D $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_lib= xenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) $(LDLIBS_libxentoolcor= e) $(PTYFUNCS_LIBS) $(LIBUUID_LIBS) ifeq ($(CONFIG_LIBNL),y) LIBXL_LIBS +=3D $(LIBNL3_LIBS) endif @@ -31,7 +31,6 @@ CFLAGS_LIBXL +=3D $(CFLAGS_libxenevtchn) CFLAGS_LIBXL +=3D $(CFLAGS_libxenctrl) CFLAGS_LIBXL +=3D $(CFLAGS_libxenguest) CFLAGS_LIBXL +=3D $(CFLAGS_libxenstore) -CFLAGS_LIBXL +=3D $(CFLAGS_libblktapctl)=20 ifeq ($(CONFIG_LIBNL),y) CFLAGS_LIBXL +=3D $(LIBNL3_CFLAGS) endif @@ -47,11 +46,6 @@ LIBXL_LIBS +=3D $(LIBXL_LIBS-y) LIBXLU_LIBS =3D $(LDLIBS_libxenlight) =20 LIBXL_OBJS-y =3D osdeps.o libxl_paths.o libxl_bootloader.o flexarray.o -ifeq ($(CONFIG_BLKTAP2),y) -LIBXL_OBJS-y +=3D libxl_blktap2.o -else -LIBXL_OBJS-y +=3D libxl_noblktap2.o -endif =20 ifeq ($(CONFIG_LIBNL),y) LIBXL_OBJS-y +=3D libxl_netbuffer.o diff --git a/tools/libxl/check-xl-disk-parse b/tools/libxl/check-xl-disk-pa= rse index 03572e4471..643f4f4ecb 100755 --- a/tools/libxl/check-xl-disk-parse +++ b/tools/libxl/check-xl-disk-parse @@ -3,7 +3,7 @@ set -e =20 if [ -x ./xl ] ; then - export LD_LIBRARY_PATH=3D.:../libxc:../xenstore:../blktap2/control + export LD_LIBRARY_PATH=3D.:../libxc:../xenstore XL=3D./xl else XL=3Dxl diff --git a/tools/libxl/libxl_blktap2.c b/tools/libxl/libxl_blktap2.c deleted file mode 100644 index 5c9a0a2da8..0000000000 --- a/tools/libxl/libxl_blktap2.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2010 Advanced Micro Devices - * Author Christoph Egger - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; version 2.1 only. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - */ - -#include "libxl_osdeps.h" /* must come before any other headers */ -#include "libxl_internal.h" - -#include "tap-ctl.h" - -int libxl__blktap_enabled(libxl__gc *gc) -{ - const char *msg; - return !tap_ctl_check(&msg); -} - -char *libxl__blktap_devpath(libxl__gc *gc, - const char *disk, - libxl_disk_format format) -{ - const char *type; - char *params, *devname =3D NULL; - tap_list_t tap; - int err; - - type =3D libxl__device_disk_string_of_format(format); - err =3D tap_ctl_find(type, disk, &tap); - if (err =3D=3D 0) { - devname =3D GCSPRINTF("/dev/xen/blktap-2/tapdev%d", tap.minor); - if (devname) - return devname; - } - - params =3D GCSPRINTF("%s:%s", type, disk); - err =3D tap_ctl_create(params, &devname); - if (!err) { - libxl__ptr_add(gc, devname); - return devname; - } - - free(devname); - return NULL; -} - - -int libxl__device_destroy_tapdisk(libxl__gc *gc, const char *params) -{ - char *type, *disk; - int err; - tap_list_t tap; - - type =3D libxl__strdup(gc, params); - - disk =3D strchr(type, ':'); - if (!disk) { - LOG(ERROR, "Unable to parse params %s", params); - return ERROR_INVAL; - } - - *disk++ =3D '\0'; - - err =3D tap_ctl_find(type, disk, &tap); - if (err < 0) { - /* returns -errno */ - LOGEV(ERROR, -err, "Unable to find type %s disk %s", type, disk); - return ERROR_FAIL; - } - - err =3D tap_ctl_destroy(tap.id, tap.minor); - if (err < 0) { - LOGEV(ERROR, -err, "Failed to destroy tap device id %d minor %d", - tap.id, tap.minor); - return ERROR_FAIL; - } - - return 0; -} - -/* - * Local variables: - * mode: C - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - */ diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c index 87ddfc3ac7..f8340ba815 100644 --- a/tools/libxl/libxl_device.c +++ b/tools/libxl/libxl_device.c @@ -321,26 +321,9 @@ static int disk_try_backend(disk_try_backend_args *a, return 0; =20 case LIBXL_DISK_BACKEND_TAP: - if (a->disk->script) goto bad_script; - - if (libxl_defbool_val(a->disk->colo_enable)) - goto bad_colo; - - if (a->disk->is_cdrom) { - LOG(DEBUG, "Disk vdev=3D%s, backend tap unsuitable for cdroms", - a->disk->vdev); - return 0; - } - if (!libxl__blktap_enabled(a->gc)) { - LOG(DEBUG, "Disk vdev=3D%s, backend tap unsuitable because blk= tap " - "not available", a->disk->vdev); - return 0; - } - if (!(a->disk->format =3D=3D LIBXL_DISK_FORMAT_RAW || - a->disk->format =3D=3D LIBXL_DISK_FORMAT_VHD)) { - goto bad_format; - } - return backend; + LOG(DEBUG, "Disk vdev=3D%s, backend tap unsuitable because blktap " + "not available", a->disk->vdev); + return 0; =20 case LIBXL_DISK_BACKEND_QDISK: if (a->disk->script) goto bad_script; @@ -746,19 +729,11 @@ int libxl__device_destroy(libxl__gc *gc, libxl__devic= e *dev) const char *be_path =3D NULL; const char *fe_path =3D NULL; const char *libxl_path =3D libxl__device_libxl_path(gc, dev); - const char *tapdisk_path =3D NULL; - const char *tapdisk_params =3D NULL; xs_transaction_t t =3D 0; int rc; uint32_t domid; int libxl_only =3D dev->backend_kind =3D=3D LIBXL__DEVICE_KIND_NONE; =20 - if (!libxl_only) { - be_path =3D libxl__device_backend_path(gc, dev); - fe_path =3D libxl__device_frontend_path(gc, dev); - tapdisk_path =3D GCSPRINTF("%s/%s", be_path, "tapdisk-params"); - } - rc =3D libxl__get_domid(gc, &domid); if (rc) goto out; =20 @@ -766,12 +741,6 @@ int libxl__device_destroy(libxl__gc *gc, libxl__device= *dev) rc =3D libxl__xs_transaction_start(gc, &t); if (rc) goto out; =20 - /* May not exist if this is not a tap device */ - if (tapdisk_path) { - rc =3D libxl__xs_read_checked(gc, t, tapdisk_path, &tapdisk_pa= rams); - if (rc) goto out; - } - if (domid =3D=3D LIBXL_TOOLSTACK_DOMID) { /* * The toolstack domain is in charge of removing the @@ -794,9 +763,6 @@ int libxl__device_destroy(libxl__gc *gc, libxl__device = *dev) if (rc < 0) goto out; } =20 - if (tapdisk_params) - rc =3D libxl__device_destroy_tapdisk(gc, tapdisk_params); - out: libxl__xs_transaction_abort(gc, &t); return rc; diff --git a/tools/libxl/libxl_disk.c b/tools/libxl/libxl_disk.c index 79e30f8d52..bc9e2d5a74 100644 --- a/tools/libxl/libxl_disk.c +++ b/tools/libxl/libxl_disk.c @@ -321,7 +321,6 @@ static void device_disk_add(libxl__egc *egc, uint32_t d= omid, case LIBXL_DISK_BACKEND_PHY: dev =3D disk->pdev_path; =20 - do_backend_phy: flexarray_append(back, "params"); flexarray_append(back, dev); =20 @@ -333,27 +332,9 @@ static void device_disk_add(libxl__egc *egc, uint32_t = domid, break; =20 case LIBXL_DISK_BACKEND_TAP: - if (dev =3D=3D NULL) { - dev =3D libxl__blktap_devpath(gc, disk->pdev_path, - disk->format); - if (!dev) { - LOGD(ERROR, domid, "Failed to get blktap devpath f= or %p", - disk->pdev_path); - rc =3D ERROR_FAIL; - goto out; - } - } - flexarray_append(back, "tapdisk-params"); - flexarray_append(back, GCSPRINTF("%s:%s", - libxl__device_disk_string_of_format(disk->format), - disk->pdev_path)); - - /* tap backends with scripts are rejected by - * libxl__device_disk_set_backend */ - assert(!disk->script); - - /* now create a phy device to export the device to the gue= st */ - goto do_backend_phy; + LOG(ERROR, "blktap is not supported"); + rc =3D ERROR_FAIL; + goto out; case LIBXL_DISK_BACKEND_QDISK: flexarray_append(back, "params"); flexarray_append(back, GCSPRINTF("%s:%s", diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 2f19786bdd..f4fc96415d 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -1812,20 +1812,9 @@ static int libxl__build_device_model_args_new(libxl_= _gc *gc, continue; } =20 - /* - * We can't call libxl__blktap_devpath from - * libxl__device_disk_find_local_path for now because - * the bootloader is called before the disks are set - * up, so this function would set up a blktap node, - * but there's no TAP tear-down on error conditions in - * the bootloader path. - */ - if (disks[i].backend =3D=3D LIBXL_DISK_BACKEND_TAP) - target_path =3D libxl__blktap_devpath(gc, disks[i].pde= v_path, - disks[i].format); - else - target_path =3D libxl__device_disk_find_local_path(gc, - guest_domid, &disks[i], t= rue); + assert(disks[i].backend !=3D LIBXL_DISK_BACKEND_TAP); + target_path =3D libxl__device_disk_find_local_path(gc, + guest_domid, &disks[i], true); =20 if (!target_path) { LOGD(WARN, guest_domid, "No way to get local access di= sk to image: %s\n" diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 44e0221284..3be5c644c1 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -1890,32 +1890,6 @@ struct libxl__cpuid_policy { char *policy[4]; }; =20 -/* - * blktap2 support - */ - -/* libxl__blktap_enabled: - * return true if blktap/blktap2 support is available. - */ -_hidden int libxl__blktap_enabled(libxl__gc *gc); - -/* libxl__blktap_devpath: - * Argument: path and disk image as specified in config file. - * The type specifies whether this is aio, qcow, qcow2, etc. - * returns device path xenstore wants to have. returns NULL - * if no device corresponds to the disk. - */ -_hidden char *libxl__blktap_devpath(libxl__gc *gc, - const char *disk, - libxl_disk_format format); - -/* libxl__device_destroy_tapdisk: - * Destroys any tapdisk process associated with the backend represented - * by be_path. - * Always logs on failure. - */ -_hidden int libxl__device_destroy_tapdisk(libxl__gc *gc, const char *param= s); - /* Calls poll() again - useful to check whether a signaled condition * is still true. Cannot fail. Returns currently-true revents. */ _hidden short libxl__fd_poll_recheck(libxl__egc *egc, int fd, short events= ); diff --git a/tools/libxl/libxl_noblktap2.c b/tools/libxl/libxl_noblktap2.c deleted file mode 100644 index 5a86ed1b6a..0000000000 --- a/tools/libxl/libxl_noblktap2.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2010 Advanced Micro Devices - * Author Christoph Egger - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; version 2.1 only. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - */ - -#include "libxl_osdeps.h" /* must come before any other headers */ - -#include "libxl_internal.h" - -int libxl__blktap_enabled(libxl__gc *gc) -{ - return 0; -} - -char *libxl__blktap_devpath(libxl__gc *gc, - const char *disk, - libxl_disk_format format) -{ - return NULL; -} - -int libxl__device_destroy_tapdisk(libxl__gc *gc, const char *params) -{ - return 0; -} - -/* - * Local variables: - * mode: C - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - */ diff --git a/tools/libxl/xenlight.pc.in b/tools/libxl/xenlight.pc.in index 86c38a5634..c0f769fd20 100644 --- a/tools/libxl/xenlight.pc.in +++ b/tools/libxl/xenlight.pc.in @@ -9,4 +9,4 @@ Description: The Xenlight library for Xen hypervisor Version: @@version@@ Cflags: -I${includedir} Libs: @@libsflag@@${libdir} -lxenlight -Requires.private: xentoollog,xenevtchn,xencontrol,xenguest,xenstore,xenblk= tapctl +Requires.private: xentoollog,xenevtchn,xencontrol,xenguest,xenstore diff --git a/tools/xenstore/hashtable.c b/tools/xenstore/hashtable.c index 0ba1d552f1..394b1cf9d0 100644 --- a/tools/xenstore/hashtable.c +++ b/tools/xenstore/hashtable.c @@ -1,10 +1,5 @@ /* Copyright (C) 2004 Christopher Clark = */ =20 -/* - * There are duplicates of this code in: - * - tools/blktap2/drivers/hashtable.c - */ - #include "hashtable.h" #include "hashtable_private.h" #include diff --git a/tools/xenstore/hashtable.h b/tools/xenstore/hashtable.h index 4d6822354e..b90781abd4 100644 --- a/tools/xenstore/hashtable.h +++ b/tools/xenstore/hashtable.h @@ -1,10 +1,5 @@ /* Copyright (C) 2002 Christopher Clark = */ =20 -/* - * There are duplicates of this code in: - * - tools/blktap2/drivers/hashtable.h - */ - #ifndef __HASHTABLE_CWC22_H__ #define __HASHTABLE_CWC22_H__ =20 diff --git a/tools/xenstore/hashtable_private.h b/tools/xenstore/hashtable_= private.h index a08559d5df..3e95f60057 100644 --- a/tools/xenstore/hashtable_private.h +++ b/tools/xenstore/hashtable_private.h @@ -1,10 +1,5 @@ /* Copyright (C) 2002, 2004 Christopher Clark */ =20 -/* - * There are duplicates of this code in: - * - tools/blktap2/drivers/hashtable_private.h - */ - #ifndef __HASHTABLE_PRIVATE_CWC22_H__ #define __HASHTABLE_PRIVATE_CWC22_H__ =20 --=20 2.20.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel