From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1NsT-00022d-MQ for qemu-devel@nongnu.org; Mon, 22 Jul 2013 17:42:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V1NsS-0004QC-8U for qemu-devel@nongnu.org; Mon, 22 Jul 2013 17:42:45 -0400 Received: from mail-oa0-x231.google.com ([2607:f8b0:4003:c02::231]:39390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1NsS-0004Px-2x for qemu-devel@nongnu.org; Mon, 22 Jul 2013 17:42:44 -0400 Received: by mail-oa0-f49.google.com with SMTP id n12so4983017oag.36 for ; Mon, 22 Jul 2013 14:42:43 -0700 (PDT) Sender: fluxion Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Roth In-Reply-To: <20130715162045.16676.64219.stgit@outback> References: <20130715162023.16676.87828.stgit@outback> <20130715162045.16676.64219.stgit@outback> Message-ID: <20130722214238.16294.92096@loki> Date: Mon, 22 Jul 2013 16:42:38 -0500 Subject: Re: [Qemu-devel] [PATCH v7 05/10] qemu-ga: Add configure options to specify path to Windows/VSS SDK List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Tomoki Sekiyama , qemu-devel@nongnu.org Cc: libaiqing@huawei.com, ghammer@redhat.com, stefanha@gmail.com, lcapitulino@redhat.com, vrozenfe@redhat.com, pbonzini@redhat.com, seiji.aguchi@hds.com, Laszlo Ersek , areis@redhat.com Quoting Tomoki Sekiyama (2013-07-15 11:20:45) > To enable VSS support in qemu-ga for Windows, header files included in > VSS SDK are required. > The VSS support is enabled by the configure option like below: > ./configure --with-vss-sdk=3D"/path/to/VSS SDK" > = > If the path is omitted, it tries to search the headers from default paths > and VSS support is enabled only if the SDK is found. > VSS support is disabled if --without-vss-sdk or --with-vss-sdk=3Dno is > specified. > = > VSS SDK is available from: > http://www.microsoft.com/en-us/download/details.aspx?id=3D23490 > = > To cross-compile using mingw, you need to setup the SDK on Windows > environments to extract headers. You can also extract the SDK headers on > POSIX environments using scripts/extract-vss-headers and msitools. > = > In addition, --with-win-sdk=3D"/path/to/Windows SDK" option is also added= to > specify path to Windows SDK, which may be used for native-compile of .tlb > file of qemu-ga VSS provider. However, this is usually unnecessary because > pre-compiled .tlb file is included. > = > Signed-off-by: Tomoki Sekiyama > Reviewed-by: Laszlo Ersek Reviewed-by: Michael Roth > --- > .gitignore | 1 + > Makefile | 1 + > configure | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++ > 3 files changed, 71 insertions(+) > = > diff --git a/.gitignore b/.gitignore > index 0fe114d..02d15f0 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 c06bfab..ec35a15 100644 > --- a/Makefile > +++ b/Makefile > @@ -273,6 +273,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 6923b65..8e1147f 100755 > --- a/configure > +++ b/configure > @@ -232,6 +232,8 @@ usb_redir=3D"" > glx=3D"" > zlib=3D"yes" > guest_agent=3D"yes" > +guest_agent_with_vss=3D"no" > +vss_win32_sdk=3D"" > want_tools=3D"yes" > libiscsi=3D"" > coroutine=3D"" > @@ -926,6 +928,14 @@ for opt do > ;; > --disable-guest-agent) guest_agent=3D"no" > ;; > + --with-vss-sdk) vss_win32_sdk=3D"" > + ;; > + --with-vss-sdk=3D*) vss_win32_sdk=3D"$optarg" > + ;; > + --without-vss-sdk) vss_win32_sdk=3D"no" > + ;; > + --with-win-sdk=3D*) win_sdk=3D"$optarg" > + ;; > --enable-tools) want_tools=3D"yes" > ;; > --disable-tools) want_tools=3D"no" > @@ -1158,6 +1168,8 @@ echo " --disable-usb-redir disable usb networ= k redirection support" > echo " --enable-usb-redir enable usb network redirection support" > echo " --disable-guest-agent disable building of the QEMU Guest Agen= t" > echo " --enable-guest-agent enable building of the QEMU Guest Agent" > +echo " --with-vss-sdk=3DSDK-path enable Windows VSS support in QEMU Gu= est Agent" > +echo " --with-win-sdk=3DSDK-path path to Windows Platform SDK (to buil= d VSS .tlb)" > echo " --disable-seccomp disable seccomp support" > echo " --enable-seccomp enables seccomp support" > echo " --with-coroutine=3DBACKEND coroutine backend. Supported options:" > @@ -3072,6 +3084,57 @@ if test "$usb_redir" !=3D "no" ; then > fi > = > ########################################## > +# check if we have VSS SDK headers for win > + > +if test "$mingw32" =3D "yes" -a "$guest_agent" =3D "yes" -a "$vss_win32_= sdk" !=3D "no" ; then > + case "$vss_win32_sdk" in > + "") vss_win32_include=3D"-I$source_path" ;; > + *\ *) # The SDK is installed in "Program Files" by default, but we c= annot > + # handle path with spaces. So we symlink the headers into ".sd= k/vss". > + vss_win32_include=3D"-I$source_path/.sdk/vss" > + symlink "$vss_win32_sdk/inc" "$source_path/.sdk/vss/inc" > + ;; > + *) vss_win32_include=3D"-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=3D"yes" > + QEMU_CFLAGS=3D"$QEMU_CFLAGS $vss_win32_include" > + libs_qga=3D"-lole32 -loleaut32 -lshlwapi -luuid -lstdc++ -Wl,--enabl= e-stdcall-fixup $libs_qga" > + else > + if test "$vss_win32_sdk" !=3D "" ; then > + echo "ERROR: Please download and install Microsoft VSS SDK:" > + echo "ERROR: http://www.microsoft.com/en-us/download/details.asp= x?id=3D23490" > + 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=3D"no" > + fi > +fi > + > +########################################## > +# lookup Windows platform SDK (if not specified) > +# The SDK is needed only to build .tlb (type library) file of guest agent > +# VSS provider from the source. It is usually unnecessary because the > +# pre-compiled .tlb file is included. > + > +if test "$mingw32" =3D "yes" -a "$guest_agent" =3D "yes" -a "$guest_agen= t_with_vss" =3D "yes" ; then > + if test -z "$win_sdk"; then > + programfiles=3D"$PROGRAMFILES" > + test -n "$PROGRAMW6432" && programfiles=3D"$PROGRAMW6432" > + if test -n "$programfiles"; then > + win_sdk=3D$(ls -d "$programfiles/Microsoft SDKs/Windows/v"* | tail= -1) 2>/dev/null > + fi > + fi > +fi > + > +########################################## > = > ########################################## > # check if we have fdatasync > @@ -3503,6 +3566,7 @@ echo "Manual directory `eval echo $mandir`" > echo "ELF interp prefix $interp_prefix" > else > echo "local state directory queried at runtime" > +echo "Windows SDK $win_sdk" > fi > echo "Source path $source_path" > echo "C compiler $cc" > @@ -3589,6 +3653,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" > @@ -3663,6 +3728,10 @@ if test "$mingw32" =3D "yes" ; then > version_micro=3D0 > echo "CONFIG_FILEVERSION=3D$version_major,$version_minor,$version_subm= inor,$version_micro" >> $config_host_mak > echo "CONFIG_PRODUCTVERSION=3D$version_major,$version_minor,$version_s= ubminor,$version_micro" >> $config_host_mak > + if test "$guest_agent_with_vss" =3D "yes" ; then > + echo "CONFIG_QGA_VSS=3Dy" >> $config_host_mak > + echo "WIN_SDK=3D\"$win_sdk\"" >> $config_host_mak > + fi > else > echo "CONFIG_POSIX=3Dy" >> $config_host_mak > fi