From patchwork Thu Nov 6 12:54:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Denis V. Lunev" X-Patchwork-Id: 407442 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2392B1400B6 for ; Thu, 6 Nov 2014 23:56:30 +1100 (AEDT) Received: from localhost ([::1]:52669 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmMc0-0004hV-Bg for incoming@patchwork.ozlabs.org; Thu, 06 Nov 2014 07:56:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmMYg-0007oV-2Q for qemu-devel@nongnu.org; Thu, 06 Nov 2014 07:53:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XmMYb-00050p-Ru for qemu-devel@nongnu.org; Thu, 06 Nov 2014 07:53:02 -0500 Received: from mailhub.sw.ru ([195.214.232.25]:6643 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmMYb-0004vR-F8 for qemu-devel@nongnu.org; Thu, 06 Nov 2014 07:52:57 -0500 Received: from hades.sw.ru ([10.30.8.132]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id sA6CqJSU030627; Thu, 6 Nov 2014 16:52:22 +0400 (MSK) From: "Denis V. Lunev" To: Date: Thu, 6 Nov 2014 15:54:32 +0300 Message-Id: <1415278478-19384-2-git-send-email-den@openvz.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415278478-19384-1-git-send-email-den@openvz.org> References: <1415278478-19384-1-git-send-email-den@openvz.org> X-detected-operating-system: by eggs.gnu.org: OpenBSD 3.x X-Received-From: 195.214.232.25 Cc: Kevin Wolf , Jeff Cody , Michael Tokarev , qemu-devel@nongnu.org, Stefan Hajnoczi , Paolo Bonzini , "Denis V. Lunev" Subject: [Qemu-devel] [PATCH 1/7] configure: add dependency from libxml2 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This dependency is required for adequate Parallels images support. Typically the disk consists of several images which are glued by XML disk descriptor. Also XML hides inside several important parameters which are not available in the image header. The patch also adds clause to checkpatch.pl to understand libxml2 types. In the other case there is the following false positive: ERROR: need consistent spacing around '*' (ctx:WxB) #210: FILE: block/parallels.c:232: + !xmlStrcmp(root->name, (const xmlChar *)"Parallels_disk_image")) Signed-off-by: Denis V. Lunev Acked-by: Roman Kagan CC: Jeff Cody CC: Kevin Wolf CC: Stefan Hajnoczi CC: Paolo Bonzini CC: Michael Tokarev --- block/Makefile.objs | 2 ++ configure | 28 ++++++++++++++++++++++++++++ scripts/checkpatch.pl | 1 + 3 files changed, 31 insertions(+) diff --git a/block/Makefile.objs b/block/Makefile.objs index 04b0e43..3040c33 100644 --- a/block/Makefile.objs +++ b/block/Makefile.objs @@ -38,3 +38,5 @@ ssh.o-libs := $(LIBSSH2_LIBS) archipelago.o-libs := $(ARCHIPELAGO_LIBS) qcow.o-libs := -lz linux-aio.o-libs := -laio +parallels.o-cflags := $(LIBXML2_CFLAGS) +parallels.o-libs := $(LIBXML2_LIBS) diff --git a/configure b/configure index 2f17bf3..391a64d 100755 --- a/configure +++ b/configure @@ -335,6 +335,7 @@ libssh2="" vhdx="" quorum="" numa="" +libxml2="" # parse CC options first for opt do @@ -1129,6 +1130,10 @@ for opt do ;; --enable-numa) numa="yes" ;; + --disable-libxml2) libxml2="no" + ;; + --enable-libxml2) libxml2="yes" + ;; *) echo "ERROR: unknown option $opt" echo "Try '$0 --help' for more information" @@ -1400,6 +1405,8 @@ Advanced options (experts only): --enable-quorum enable quorum block filter support --disable-numa disable libnuma support --enable-numa enable libnuma support + --disable-libxml2 disable libxml2 (for Parallels image format) + --enable-libxml2 enable libxml2 (for Parallels image format) NOTE: The object files are built at the place where configure is launched EOF @@ -4097,6 +4104,20 @@ if test -z "$zero_malloc" ; then fi fi +# check for libxml2 +if test "$libxml2" != "no" ; then + if $pkg_config --exists libxml-2.0; then + libxml2="yes" + libxml2_cflags=$($pkg_config --cflags libxml-2.0) + libxml2_libs=$($pkg_config --libs libxml-2.0) + else + if test "$libxml2" = "yes"; then + feature_not_found "libxml2" "Install libxml2 devel" + fi + libxml2="no" + fi +fi + # Now we've finished running tests it's OK to add -Werror to the compiler flags if test "$werror" = "yes"; then QEMU_CFLAGS="-Werror $QEMU_CFLAGS" @@ -4340,6 +4361,7 @@ echo "Quorum $quorum" echo "lzo support $lzo" echo "snappy support $snappy" echo "NUMA host support $numa" +echo "libxml2 $libxml2" if test "$sdl_too_old" = "yes"; then echo "-> Your SDL version is too old - please upgrade to have SDL support" @@ -4846,6 +4868,12 @@ if test "$rdma" = "yes" ; then echo "CONFIG_RDMA=y" >> $config_host_mak fi +if test "$libxml2" = "yes" ; then + echo "CONFIG_LIBXML2=y" >> $config_host_mak + echo "LIBXML2_CFLAGS=$libxml2_cflags" >> $config_host_mak + echo "LIBXML2_LIBS=$libxml2_libs" >> $config_host_mak +fi + # Hold two types of flag: # CONFIG_THREAD_SETNAME_BYTHREAD - we've got a way of setting the name on # a thread we have a handle to diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 053e432..3ddb097 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -242,6 +242,7 @@ our @typeList = ( qr{${Ident}_t}, qr{${Ident}_handler}, qr{${Ident}_handler_fn}, + qr{xml${Ident}}, ); our @modifierList = ( qr{fastcall},