From: Jeff Cody <jcody@redhat.com>
To: Tomoki Sekiyama <tomoki.sekiyama@hds.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@gmail.com>,
"mdroth@linux.vnet.ibm.com" <mdroth@linux.vnet.ibm.com>,
"lcapitulino@redhat.com" <lcapitulino@redhat.com>,
"vrozenfe@redhat.com" <vrozenfe@redhat.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
Seiji Aguchi <seiji.aguchi@hds.com>,
"areis@redhat.com" <areis@redhat.com>
Subject: Re: [Qemu-devel] [RFC PATCH v3 05/11] qemu-ga: Add Windows VSS provider to quiesce applications on fsfreeze
Date: Tue, 28 May 2013 17:01:25 -0400 [thread overview]
Message-ID: <20130528210125.GB7662@localhost.localdomain> (raw)
In-Reply-To: <CDC3D58B.2954%Tomoki.Sekiyama@hds.com>
On Thu, May 23, 2013 at 06:36:35PM +0000, Tomoki Sekiyama wrote:
> On 5/23/13 8:22 , "Stefan Hajnoczi" <stefanha@gmail.com> wrote:
>
> >On Tue, May 21, 2013 at 11:33:52AM -0400, Tomoki Sekiyama wrote:
> >> Implements a basic stub of software VSS provider. Currently, this
> >>modules
> >> only provides a relay function of events between qemu-guest-agent and
> >> Windows VSS when VSS finished filesystem freeze and when qemu snapshot
> >> is done.
> >>
> >> In the future, this module could be extended to support the other VSS
> >> functions, such as query for snapshot volumes and recovery.
> >>
> >> Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@hds.com>
> >> ---
> >> Makefile.objs | 2
> >> configure | 5
> >> qga/Makefile.objs | 6
> >> qga/vss-win32-provider.h | 26 ++
> >> qga/vss-win32-provider/Makefile.objs | 21 +
> >> qga/vss-win32-provider/install.cpp | 494
> >>+++++++++++++++++++++++++++++++
> >> qga/vss-win32-provider/provider.cpp | 474
> >>++++++++++++++++++++++++++++++
> >> qga/vss-win32-provider/qga-provider.def | 10 +
> >> qga/vss-win32-provider/qga-provider.idl | 20 +
> >> qga/vss-win32.h | 85 +++++
> >> 10 files changed, 1142 insertions(+), 1 deletion(-)
> >> create mode 100644 qga/vss-win32-provider.h
> >> create mode 100644 qga/vss-win32-provider/Makefile.objs
> >> create mode 100644 qga/vss-win32-provider/install.cpp
> >> create mode 100644 qga/vss-win32-provider/provider.cpp
> >> create mode 100644 qga/vss-win32-provider/qga-provider.def
> >> create mode 100644 qga/vss-win32-provider/qga-provider.idl
> >> create mode 100644 qga/vss-win32.h
> >
> >Please run scripts/checkpatch.pl and use QEMU coding style (see
> >./CODING_STYLE and ./HACKING).
>
> Ah, actually this passes checkpatch.pl, but I notice that
> checkpatch.pl skips some checks for .cpp files ...
> I will enable them for .cpp files and fix some style errors.
>
> >> diff --git a/qga/vss-win32-provider/Makefile.objs
> >>b/qga/vss-win32-provider/Makefile.objs
> >> new file mode 100644
> >> index 0000000..73ef752
> >> --- /dev/null
> >> +++ b/qga/vss-win32-provider/Makefile.objs
> >> @@ -0,0 +1,21 @@
> >> +# rules to build qga-provider.dll
> >> +
> >> +qga-obj-y += qga-provider.dll
> >> +qga-prv-obj-y += provider.o install.o
> >> +
> >> +obj-qga-prv-obj-y = $(addprefix $(obj)/, $(qga-prv-obj-y))
> >> +$(obj-qga-prv-obj-y): QEMU_CXXFLAGS = $(filter-out -Wstrict-prototypes
> >>-Wmissing-prototypes -Wnested-externs -Wold-style-declaration
> >>-Wold-style-definition -Wredundant-decls -fstack-protector-all,
> >>$(QEMU_CFLAGS)) -Wno-unknown-pragmas -Wno-delete-non-virtual-dtor
> >> +
> >> +$(obj)/qga-provider.dll: LDFLAGS = -shared
> >>-Wl,--add-stdcall-alias,--enable-stdcall-fixup -lole32 -loleaut32
> >>-lshlwapi -luuid -static
> >> +$(obj)/qga-provider.dll: $(obj-qga-prv-obj-y)
> >>$(SRC_PATH)/$(obj)/qga-provider.def $(obj)/qga-provider.tlb
> >> + $(call quiet-command,$(CXX) -o $@ $(qga-prv-obj-y)
> >>$(SRC_PATH)/qga/vss-win32-provider/qga-provider.def $(CXXFLAGS)
> >>$(LDFLAGS)," LINK $(TARGET_DIR)$@")
> >> +
> >> +
> >> +# rules to build qga-provider.tlb
> >> +# Currently, only native build is supported because building .tlb
> >> +# (TypeLibrary) from .idl requires WindowsSDK and MIDL (included in
> >>VC++).
> >> +MIDL=midl
> >> +WINSDK="C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\Include"
> >
> >This needs to be a ./configure option.
>
> OK. I will add something like --with-winsdk="\\path\to\windows\sdk" to
> configure this.
>
Patch 9/11 adds a binary tlb in, so that midl is not required. I would
like to see patch 09/11 just be squashed into this patch, so the build
will always work without requiring midl. Otherwise, from this patch
up through patch 9, qemu-ga.exe will fail to build unless you have the
Windows SDK installed.
And if that is done, I don't know if this needs a ./configure option
or not, because you will only build the .tlb if you explicitly purge
the existing binary. Stefan, would you still like to see it in
./configure option, in that case?
> >> diff --git a/qga/vss-win32.h b/qga/vss-win32.h
> >> new file mode 100644
> >> index 0000000..7600087
> >> --- /dev/null
> >> +++ b/qga/vss-win32.h
> >> @@ -0,0 +1,85 @@
> >> +/*
> >> + * QEMU Guest Agent win32 VSS common declarations
> >> + *
> >> + * Copyright Hitachi Data Systems Corp. 2013
> >> + *
> >> + * Authors:
> >> + * Tomoki Sekiyama <tomoki.sekiyama@hds.com>
> >> + *
> >> + * This work is licensed under the terms of the GNU GPL, version 2 or
> >>later.
> >> + * See the COPYING file in the top-level directory.
> >> + */
> >> +
> >> +#ifndef VSS_WIN32_H
> >> +#define VSS_WIN32_H
> >> +
> >> +#define __MIDL_user_allocate_free_DEFINED__
> >> +#include "config-host.h"
> >> +#include <windows.h>
> >> +#include <shlwapi.h>
> >> +
> >> +/* Reduce warnings to include vss.h */
> >> +#define __in IN
> >> +#define __out OUT
> >> +#define __RPC_unique_pointer
> >> +#define __RPC_string
> >> +#define __RPC__deref_inout_opt
> >> +#define __RPC__out
> >> +#ifndef __RPC__out_ecount_part
> >> +#define __RPC__out_ecount_part(x, y)
> >> +#endif
> >> +#define _declspec(x)
> >> +#undef uuid
> >> +#define uuid(x)
> >
> >This looks hacky. Why are you stubbing out macros that vss.h uses?
>
> Because these macros are internally defined/used by windows SDK's
> headers and not fully covered by mingw (some of them is only
> meaningful with Microsoft IDE), so it don't compile without
> these define's.
>
> This could be better if mingw supports these VSS headers, but
> I have no idea how to achieve that...
>
> Thanks,
> Tomoki Sekiyama
>
>
next prev parent reply other threads:[~2013-05-28 21:01 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-21 15:33 [Qemu-devel] [RFC PATCH v3 00/11] qemu-ga: fsfreeze on Windows using VSS Tomoki Sekiyama
2013-05-21 15:33 ` [Qemu-devel] [RFC PATCH v3 01/11] configure: Support configuring c++ compiler Tomoki Sekiyama
2013-05-21 16:42 ` Eric Blake
2013-05-21 21:02 ` Tomoki Sekiyama
2013-05-21 16:56 ` Peter Maydell
2013-05-21 21:01 ` Tomoki Sekiyama
2013-05-21 15:33 ` [Qemu-devel] [RFC PATCH v3 02/11] Fix errors and warnings while compiling with c++ compilier Tomoki Sekiyama
2013-05-23 12:12 ` Stefan Hajnoczi
2013-05-23 18:34 ` Tomoki Sekiyama
2013-05-24 8:52 ` Stefan Hajnoczi
2013-05-24 14:20 ` Tomoki Sekiyama
2013-05-24 15:25 ` Markus Armbruster
2013-05-27 11:43 ` Stefan Hajnoczi
2013-05-24 13:01 ` Laszlo Ersek
2013-05-24 14:33 ` Tomoki Sekiyama
2013-05-21 15:33 ` [Qemu-devel] [RFC PATCH v3 03/11] Add a script to extract VSS SDK headers on POSIX system Tomoki Sekiyama
2013-05-21 16:48 ` Eric Blake
2013-05-21 21:02 ` Tomoki Sekiyama
2013-05-24 13:14 ` Laszlo Ersek
2013-05-24 13:38 ` Laszlo Ersek
2013-05-24 15:59 ` Eric Blake
2013-05-24 18:27 ` Laszlo Ersek
2013-05-21 15:33 ` [Qemu-devel] [RFC PATCH v3 04/11] qemu-ga: Add an configure option to specify path to Windows VSS SDK Tomoki Sekiyama
2013-05-21 16:53 ` Eric Blake
2013-05-21 21:02 ` Tomoki Sekiyama
2013-05-24 13:48 ` Laszlo Ersek
2013-05-24 14:03 ` Laszlo Ersek
2013-05-21 15:33 ` [Qemu-devel] [RFC PATCH v3 05/11] qemu-ga: Add Windows VSS provider to quiesce applications on fsfreeze Tomoki Sekiyama
2013-05-23 12:22 ` Stefan Hajnoczi
2013-05-23 18:36 ` Tomoki Sekiyama
2013-05-24 8:54 ` Stefan Hajnoczi
2013-05-24 14:30 ` Tomoki Sekiyama
2013-05-28 21:01 ` Jeff Cody [this message]
2013-05-29 7:39 ` Stefan Hajnoczi
2013-05-31 2:15 ` Tomoki Sekiyama
2013-05-21 15:33 ` [Qemu-devel] [RFC PATCH v3 06/11] qemu-ga: Add Windows VSS requester to quisce applications and filesystems Tomoki Sekiyama
2013-05-21 16:56 ` Eric Blake
2013-05-21 21:02 ` Tomoki Sekiyama
2013-05-28 20:17 ` Jeff Cody
2013-05-31 5:06 ` Tomoki Sekiyama
2013-05-21 15:34 ` [Qemu-devel] [RFC PATCH v3 07/11] qemu-ga: call Windows VSS requester in fsfreeze command handler Tomoki Sekiyama
2013-05-21 15:34 ` [Qemu-devel] [RFC PATCH v3 08/11] qemu-ga: install Windows VSS provider on `qemu-ga -s install' Tomoki Sekiyama
2013-05-21 15:34 ` [Qemu-devel] [RFC PATCH v3 09/11] qemu-ga: Add VSS provider .tlb file in the repository Tomoki Sekiyama
2013-05-28 21:07 ` Jeff Cody
2013-05-21 15:34 ` [Qemu-devel] [RFC PATCH v3 10/11] QMP/qemu-ga-client: make timeout longer for guest-fsfreeze-freeze command Tomoki Sekiyama
2013-05-21 15:34 ` [Qemu-devel] [RFC PATCH v3 11/11] QMP/qmp.py: set locale for exceptions to display non-ascii messages correctly Tomoki Sekiyama
2013-05-23 12:30 ` Stefan Hajnoczi
2013-05-24 18:55 ` Tomoki Sekiyama
2013-05-27 12:06 ` Stefan Hajnoczi
2013-05-23 11:05 ` [Qemu-devel] [RFC PATCH v3 00/11] qemu-ga: fsfreeze on Windows using VSS Laszlo Ersek
2013-05-23 17:11 ` Tomoki Sekiyama
2013-05-23 12:15 ` Stefan Hajnoczi
2013-05-23 13:20 ` Paolo Bonzini
2013-05-23 13:28 ` Stefan Hajnoczi
2013-05-23 13:50 ` Paolo Bonzini
2013-05-24 8:59 ` Stefan Hajnoczi
2013-05-24 12:08 ` Paolo Bonzini
2013-05-24 9:20 ` Stefan Hajnoczi
2013-05-27 4:13 ` Libaiqing
2013-05-27 7:01 ` Tomoki Sekiyama
2013-05-27 10:00 ` Libaiqing
2013-05-31 1:30 ` Libaiqing
2013-05-31 2:20 ` Tomoki Sekiyama
2013-06-03 9:12 ` Libaiqing
2013-06-03 12:20 ` Luiz Capitulino
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130528210125.GB7662@localhost.localdomain \
--to=jcody@redhat.com \
--cc=areis@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=seiji.aguchi@hds.com \
--cc=stefanha@gmail.com \
--cc=tomoki.sekiyama@hds.com \
--cc=vrozenfe@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).