From patchwork Tue May 21 15:33:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomoki Sekiyama X-Patchwork-Id: 245336 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3CAAA2C00AB for ; Wed, 22 May 2013 01:53:23 +1000 (EST) Received: from localhost ([::1]:49109 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ueodd-0007aL-AM for incoming@patchwork.ozlabs.org; Tue, 21 May 2013 11:38:09 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ueoaa-00033Y-Ro for qemu-devel@nongnu.org; Tue, 21 May 2013 11:35:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UeoaU-0002jK-74 for qemu-devel@nongnu.org; Tue, 21 May 2013 11:35:00 -0400 Received: from usindpps05.hds.com ([207.126.252.18]:52140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UeoaU-0002jE-1I for qemu-devel@nongnu.org; Tue, 21 May 2013 11:34:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hds.com; h=subject : to : from : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=mail1; bh=lQ+O1jR4PAw7u7AfBQceqIEqE+nrbKUiNmO20L8ZL5o=; b=WQ3LlgBdvx3eUGHEvk5U96bxxHtzXotA0lIdKXcBHtKz7hy9n7hipvYWbg4k/kp8z+cx otMytTxSFEV126gmafvw89q5XqOwT5D88Qd2pdUjlM6Fyg4CFOjU5vt7EKyBqjzK5YJB zo+1rMSt176+hfEO0ToCvYsAtVLwOFOYCaQZiYmRAefyZLjiLV5viEA7QwHfP3ZAtgN6 H8RD/4eknopQCNPXXBUyv0Am4frGByPk1/IbxKvkVonPoL3mD7GbaUjAAsprVI7nFY+p gXhu9oQdS1iy+qeyKow3T2YCZiwifUlVvMnQ2O1iqXD6G/WFeL+ZqxQID5piklm1Y72u Zw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hdsstg.com; h=subject : to : from : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=mail1; bh=lQ+O1jR4PAw7u7AfBQceqIEqE+nrbKUiNmO20L8ZL5o=; b=LXs01ap36Wnftm+PSoCGW+p8/YqwR+cy+4jaXFkn0NC+0U3kj+lukVesQ2SxMF9lpzKL ky3e6HKHuaNBQFeSVWCJcFnMUInw6u5WV76b2/MzzM8big9tEFwlIGPiYX+2yGKNCiek 8u/Bu+bgJ4TIKNx2K3E4aEpFDUAUddwcBJj17wVOW6KynJjljmnS2FdVvqwJ88wHh3xj 8yN0Hn71BNne0QDA4Hgnbn1mnLcgGGfT7dpo2CmYmR8dSednPiqxmwc6zHM8xhsO6GOf BBsMxIdltBms7OY2Id1CgW6N67J/ZFeSkdPoEIWcbBgyenmTK+xO1Gy0d84qmdJS+Hf9 PQ== Received: from usindmail02.hds.com (usindmail02 [207.126.252.21]) by usindpps05.hds.com (8.14.4/8.14.4) with ESMTP id r4LFXoXg016623; Tue, 21 May 2013 11:33:50 -0400 Received: from hds.com (usindnetf5d-vlan47float.corp.hds.com [10.74.73.11]) by usindmail02.hds.com (8.14.1/8.14.1) with ESMTP id r4LFXn8B012489; Tue, 21 May 2013 11:33:49 -0400 (EDT) To: qemu-devel@nongnu.org From: Tomoki Sekiyama Date: Tue, 21 May 2013 11:33:49 -0400 Message-ID: <20130521153349.4880.13431.stgit@hds.com> In-Reply-To: <20130521153333.4880.74390.stgit@hds.com> References: <20130521153333.4880.74390.stgit@hds.com> User-Agent: StGit/0.16 MIME-Version: 1.0 X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 mx ip4:207.126.244.0/26 ip4:207.126.252.0/25 include:mktomail.com ~all X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8626, 1.0.431, 0.0.0000 definitions=2013-05-21_04:2013-05-21, 2013-05-21, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=outbound_policy score=0 spamscore=0 ipscore=0 suspectscore=4 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1211240000 definitions=main-1305210137 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 207.126.252.18 Cc: mdroth@linux.vnet.ibm.com, lcapitulino@redhat.com, vrozenfe@redhat.com, pbonzini@redhat.com, seiji.aguchi@hds.com, areis@redhat.com Subject: [Qemu-devel] [RFC PATCH v3 04/11] qemu-ga: Add an configure option to specify path to Windows VSS SDK 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 To enable VSS support in qemu-ga for Windows, header files included in VSS SDK is required. The VSS support is enabled when the option like below: ./configure --with-vss-sdk="/pass/to/VSS SDK" VSS SDK is available from: http://www.microsoft.com/en-us/download/details.aspx?id=23490 To cross-compilie using mingw32 for Linux, you need to setup the SDK on Windows environments to extract headers. You can also extract the SDK headers using scripts/extract-vss-headers, written by Paolo Bonzini. Signed-off-by: Tomoki Sekiyama --- .gitignore | 1 + Makefile | 1 + configure | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) diff --git a/.gitignore b/.gitignore index 64e9466..67facd3 100644 --- a/.gitignore +++ b/.gitignore @@ -79,6 +79,7 @@ fsdev/virtfs-proxy-helper.pod *.la *.pc .libs +.sdk *.swp *.orig .pc diff --git a/Makefile b/Makefile index 7dc0204..b87cc5a 100644 --- a/Makefile +++ b/Makefile @@ -272,6 +272,7 @@ distclean: clean for d in $(TARGET_DIRS); do \ rm -rf $$d || exit 1 ; \ done + rm -Rf .sdk if test -f pixman/config.log; then make -C pixman distclean; fi if test -f dtc/version_gen.h; then make $(DTC_MAKE_ARGS) clean; fi diff --git a/configure b/configure index 1af2f37..981561f 100755 --- a/configure +++ b/configure @@ -231,6 +231,8 @@ usb_redir="" glx="" zlib="yes" guest_agent="yes" +guest_agent_with_vss="no" +vss_win32_sdk="" want_tools="yes" libiscsi="" coroutine="" @@ -910,6 +912,12 @@ for opt do ;; --disable-guest-agent) guest_agent="no" ;; + --with-vss-sdk) vss_win32_sdk="" + ;; + --with-vss-sdk=*) vss_win32_sdk="$optarg" + ;; + --without-vss-sdk) vss_win32_sdk="no" + ;; --enable-tools) want_tools="yes" ;; --disable-tools) want_tools="no" @@ -1193,6 +1201,7 @@ echo " --disable-usb-redir disable usb network redirection support" echo " --enable-usb-redir enable usb network redirection support" echo " --disable-guest-agent disable building of the QEMU Guest Agent" echo " --enable-guest-agent enable building of the QEMU Guest Agent" +echo " --with-vss-sdk=SDK-path enable Windows VSS support in QEMU Guest Agent" echo " --disable-seccomp disable seccomp support" echo " --enable-seccomp enables seccomp support" echo " --with-coroutine=BACKEND coroutine backend. Supported options:" @@ -3098,6 +3107,41 @@ if test "$usb_redir" != "no" ; then fi ########################################## +# check if we have VSS SDK headers for win + +if test "$mingw32" = "yes" -a "$guest_agent" = "yes" -a "$vss_win32_sdk" != "no" ; then + case "$vss_win32_sdk" in + "") vss_win32_include="-I$source_path" ;; + *\ *) # The SDK is installed in "Program Files" by default, but we cannot + # handle path with spaces. So we symlink the headers into ".sdk/vss". + vss_win32_include="-I$source_path/.sdk/vss" + symlink "$vss_win32_sdk/inc" "$source_path/.sdk/vss/inc" + ;; + *) vss_win32_include="-I$vss_win32_sdk" + esac + cat > $TMPC << EOF +#define __MIDL_user_allocate_free_DEFINED__ +#include +int main(void) { return VSS_CTX_BACKUP; } +EOF + if compile_prog "$vss_win32_include" "" ; then + guest_agent_with_vss="yes" + QEMU_CFLAGS="$QEMU_CFLAGS $vss_win32_include" + libs_qga="-lole32 -loleaut32 -lshlwapi -luuid -lstdc++ -Wl,--enable-stdcall-fixup $libs_qga" + else + if test "$vss_win32_sdk" != "" ; then + echo "ERROR: Please download and install Microsoft VSS SDK:" + echo "ERROR: http://www.microsoft.com/en-us/download/details.aspx?id=23490" + echo "ERROR: On POSIX-systems, you can extract the SDK headers by:" + echo "ERROR: scripts/extract-vsssdk-headers setup.exe" + echo "ERROR: The headers are extracted in the directory \`inc'." + feature_not_found "VSS support" + fi + guest_agent_with_vss="no" + fi +fi + +########################################## ########################################## # check if we have fdatasync @@ -3581,6 +3625,7 @@ echo "usb net redir $usb_redir" echo "GLX support $glx" echo "libiscsi support $libiscsi" echo "build guest agent $guest_agent" +echo "QGA VSS support $guest_agent_with_vss" echo "seccomp support $seccomp" echo "coroutine backend $coroutine" echo "GlusterFS support $glusterfs" @@ -3654,6 +3699,9 @@ if test "$mingw32" = "yes" ; then version_micro=0 echo "CONFIG_FILEVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak echo "CONFIG_PRODUCTVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak + if test "$guest_agent_with_vss" = "yes" ; then + echo "CONFIG_QGA_VSS=y" >> $config_host_mak + fi else echo "CONFIG_POSIX=y" >> $config_host_mak fi