All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomoki Sekiyama <tomoki.sekiyama@hds.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: "libaiqing@huawei.com" <libaiqing@huawei.com>,
	"mdroth@linux.vnet.ibm.com" <mdroth@linux.vnet.ibm.com>,
	"stefanha@gmail.com" <stefanha@gmail.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"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] [PATCH v4 06/10] qemu-ga: Add Windows VSS provider to quiesce applications on fsfreeze
Date: Tue, 25 Jun 2013 18:23:33 +0000	[thread overview]
Message-ID: <CDEF3953.2E1E%Tomoki.Sekiyama@hds.com> (raw)
In-Reply-To: <51C9BF54.6000008@redhat.com>

Thanks for your review.

On 6/25/13 12:03 , "Laszlo Ersek" <lersek@redhat.com> wrote:
>I'm trying to wrap my head around the build changes first.

>> diff --git a/configure b/configure
>> index cafe830..8e45fad 100755
>> --- a/configure
>> +++ b/configure
>> @@ -3490,9 +3490,12 @@ if test "$softmmu" = yes ; then
>>        virtfs=no
>>      fi
>>    fi
>> -  if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ;
>>then
>> +  if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" -o
>>"$mingw32" = "yes" ] ; then
>>      if [ "$guest_agent" = "yes" ]; then
>>        tools="qemu-ga\$(EXESUF) $tools"
>> +      if [ "$mingw32" = "yes" ]; then
>> +        tools="qga/vss-win32-provider/qga-provider.dll
>>qga/vss-win32-provider/qga-provider.tlb $tools"
>> +      fi
>>      fi
>>    fi
>>  fi
>
>This adds three targets to "tools" on mingw32 -- "qemu-ga" hasn't been
>there until now. Is this actually a small, unrelated bugfix?

That is true, it is not necessary to build qemu-ga.exe.
The intention was to do everything by just `make`.

>I'm asking because I build upstream qemu-ga.exe on my RHEL-6 laptop as
>follows -- I don't have pixman installed, and configure forces me to
>specify --disable-tools as well:
> 
>$ ./configure --without-pixman --disable-system --disable-tools \
>      --cross-prefix=i686-pc-mingw32-
>$ make qemu-ga.exe
>
>Plain "make" after the above ./configure doesn't produce anything
>useful. Will I have to specify the DLL and TLB targets too on the
>command line? (Apologies, I can't try it out now, msiextract doesn't
>work for me.)

You don't have to specify DLL and TLB targets because qemu-ga.exe
has dependencies to them.

>> diff --git a/Makefile.objs b/Makefile.objs
>> index 286ce06..b6c1505 100644
>> --- a/Makefile.objs
>> +++ b/Makefile.objs
>> @@ -102,6 +102,7 @@ common-obj-y += disas/
>>  # FIXME: a few definitions from qapi-types.o/qapi-visit.o are needed
>>  # by libqemuutil.a.  These should be moved to a separate .json schema.
>>  qga-obj-y = qga/ qapi-types.o qapi-visit.o
>> +qga-prv-obj-y = qga/
>>
>>  vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
>>
>> @@ -113,6 +114,7 @@ nested-vars += \
>>  	stub-obj-y \
>>  	util-obj-y \
>>  	qga-obj-y \
>> +	qga-prv-obj-y \
>>  	block-obj-y \
>>  	common-obj-y
>>  dummy := $(call unnest-vars)
>
>What does this do? Does "qga-prv-obj-y" stand for "all objects under
>'qga'"?

No, these are objects for qga/vss-win32-provider/, used to build
qga-provider.dll. It looks better to be fully spelled as Paolo
said in another mail.


>Or does it mean "look into qga/Makefile.objs for further objects"?

Yes...

>>diff --git a/qga/Makefile.objs b/qga/Makefile.objs
>> index b8d7cd0..8d93866 100644
>> --- a/qga/Makefile.objs
>> +++ b/qga/Makefile.objs
>> @@ -3,3 +3,9 @@ qga-obj-$(CONFIG_POSIX) += commands-posix.o
>>channel-posix.o
>>  qga-obj-$(CONFIG_WIN32) += commands-win32.o channel-win32.o
>>service-win32.o
>>  qga-obj-y += qapi-generated/qga-qapi-types.o
>>qapi-generated/qga-qapi-visit.o
>>  qga-obj-y += qapi-generated/qga-qmp-marshal.o
>> +
>> +ifeq ($(CONFIG_QGA_VSS),y)
>> +QEMU_CFLAGS += -DHAS_VSS_SDK
>
>Isn't this superfluous? First, I can find no other reference to
>HAS_VSS_SDK in the series, second, CONFIG_QGA_VSS would be available
>directly as a macro to source files.

It is referenced in e.g. qga/commands-win32.c in patch 8/10.
But as you say, I will omit this, by the second reason.

>> +qga-obj-y += vss-win32-provider/
>> +qga-prv-obj-y += vss-win32-provider/
>> +endif
>
>So we're probably just saying "look into
>vss-win32-provider/Makefile.objs for further object files", for both
>variables.

Yes...

>> diff --git a/qga/vss-win32-provider/Makefile.objs
>>b/qga/vss-win32-provider/Makefile.objs
>> new file mode 100644
>> index 0000000..1fe1f8f
>> --- /dev/null
>> +++ b/qga/vss-win32-provider/Makefile.objs
>> @@ -0,0 +1,24 @@
>> +# 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)$@")
>
>I'm having a hard time following this.
>
>Looks like "qga-prv-obj-y" consists of nothing more than "provider.o"
>and "install.o", and that "qga-provider.dll" depends on them. In theory,
>would it be possible *not* to introduce "qga-prv-obj-y" in the
>higher-level Makefile.obj files, only here?

Unfortunately, we need this at all levels to handle nested directories
correctly, otherwise it fails on out-tree build.

>Why does "qga-provider.dll" depend on ""qga-provider.tlb"? It is not
>used in the link command.

This was because .tlb is required to install .dll correctly.
But it is not dependent on build time, so shouldn't be specified here.

>Also, why is it necessary to collect the files "provider.o", "install.o"
>and "qga-provider.def" into a DLL, and link qemu-ga.exe against that DLL
>(via qga-obj-y)? Is this a VSS requirement? Can't we simply link these
>objects into qemu-ga.exe statically, like the rest of "qga-obj-y"?
>
>Will some VSS service load the provider DLL independently of
>qemu-ga.exe?

Yes, VSS provider DLL is registered to VSS on installation of qemu-ga
service (using .TLB), and loaded into VSS service component when
snapshot is started.

>If so, (a) how will they communicate

Using COM interface.

>(b) shouldn't "qga-obj-y" be independent of "qga-provider.dll"

The DLL is linked to qemu-ga.exe because qemu-ga.exe kicks the
registration of the DLL (COMRegister(), which depends on the DLL's
Internal variable) at the installation of the qemu-ga service.

>Could you please draw a dependency graph between these files? Like
>
>  idl --> tlb
>  def --> dll <-- (provider.o, install.o)
> 
> Does one of "tlb" and "dll" depend on the other, or are they needed "in
> parallel"?

This graph is describing build dependencies correctly.
At runtime, DLL needs TLB, otherwise it cannot be loaded into VSS.

>... I'll try to continue here. I've peaked forward a little bit, and
>CQGAVssProvider::CommitSnapshots() seems to be the central method. It
>kicks the "frozen" event, then blocks until the "thaw" event is kicked
>back. I wonder how those will translate to QMP communication with
>libvirt.

CommitSnapshots() is called by VSS, when the requestor of qemu-ga
(introduced in next patch) initiates snapshot receiving
"guest-fsfreeze-freeze" command.
"frozen" event is used to tell qemu-ga.exe that the fs is frozen,
then qemu-ga.exe will tell libvirt to "guest-fsfreeze-freeze" is done.

"thaw" event is kicked by qemnu-ga.exe when it receives
"guest-fsfreeze-thaw" command. The command is finished when VSS notify
qeum-ga.exe requestor that VSS snapshot process is completed.

>Thanks!
>Laszlo

Again, thank you for taking your time for this!

Thanks,
Tomoki Sekiyama

  parent reply	other threads:[~2013-06-25 18:26 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-06 15:06 [Qemu-devel] [PATCH v4 00/10] qemu-ga: fsfreeze on Windows using VSS Tomoki Sekiyama
2013-06-06 15:06 ` [Qemu-devel] [PATCH v4 01/10] configure: Support configuring c++ compiler Tomoki Sekiyama
2013-06-18 10:17   ` Paolo Bonzini
2013-06-25  8:15   ` Laszlo Ersek
2013-06-06 15:06 ` [Qemu-devel] [PATCH v4 02/10] Add c++ keywords to QAPI helper script Tomoki Sekiyama
2013-06-25  8:16   ` Laszlo Ersek
2013-06-06 15:06 ` [Qemu-devel] [PATCH v4 03/10] checkpatch.pl: check .cpp files Tomoki Sekiyama
2013-06-25  8:17   ` Laszlo Ersek
2013-06-06 15:06 ` [Qemu-devel] [PATCH v4 04/10] Add a script to extract VSS SDK headers on POSIX system Tomoki Sekiyama
2013-06-25  8:30   ` Laszlo Ersek
2013-06-25 15:01   ` Laszlo Ersek
2013-06-25 15:01     ` Paolo Bonzini
2013-06-26 10:52       ` Laszlo Ersek
2013-06-06 15:06 ` [Qemu-devel] [PATCH v4 05/10] qemu-ga: Add configure options to specify path to Windows/VSS SDK Tomoki Sekiyama
2013-06-25 11:16   ` Laszlo Ersek
2013-06-28 10:43     ` Daniel P. Berrange
2013-06-28 10:54       ` Paolo Bonzini
2013-06-28 11:01         ` Daniel P. Berrange
2013-06-28 11:18           ` Paolo Bonzini
2013-06-28 11:30             ` Daniel P. Berrange
2013-06-28 12:18               ` Paolo Bonzini
2013-06-28 11:05       ` Laszlo Ersek
2013-06-06 15:06 ` [Qemu-devel] [PATCH v4 06/10] qemu-ga: Add Windows VSS provider to quiesce applications on fsfreeze Tomoki Sekiyama
2013-06-25 16:03   ` Laszlo Ersek
2013-06-25 16:19     ` Paolo Bonzini
2013-06-25 18:23     ` Tomoki Sekiyama [this message]
2013-06-25 18:59       ` Paolo Bonzini
2013-06-25 19:28         ` Tomoki Sekiyama
2013-06-25 19:52       ` Laszlo Ersek
2013-06-26 14:32     ` Laszlo Ersek
2013-06-26 21:27       ` Paolo Bonzini
2013-06-26 22:09       ` Tomoki Sekiyama
2013-06-27 15:01       ` Laszlo Ersek
2013-06-27 22:25         ` Tomoki Sekiyama
2013-06-28  7:05           ` Paolo Bonzini
2013-06-28 10:40             ` Laszlo Ersek
2013-06-28 10:40               ` Paolo Bonzini
2013-06-28 17:18                 ` Tomoki Sekiyama
2013-06-28 10:44           ` Laszlo Ersek
2013-06-25 21:15   ` Paolo Bonzini
2013-06-25 22:31     ` Tomoki Sekiyama
2013-06-26  5:59       ` Paolo Bonzini
2013-06-26 14:13         ` Tomoki Sekiyama
2013-06-30 13:16       ` Gal Hammer
2013-07-01 18:57         ` Tomoki Sekiyama
2013-07-02 12:36           ` Gal Hammer
2013-06-06 15:06 ` [Qemu-devel] [PATCH v4 07/10] qemu-ga: Add Windows VSS requester to quiesce applications and filesystems Tomoki Sekiyama
2013-06-28 18:01   ` Laszlo Ersek
2013-06-28 18:34     ` Laszlo Ersek
2013-06-30  1:21     ` Tomoki Sekiyama
2013-07-01  8:31       ` Laszlo Ersek
2013-06-06 15:06 ` [Qemu-devel] [PATCH v4 08/10] qemu-ga: call Windows VSS requester in fsfreeze command handler Tomoki Sekiyama
2013-07-01 13:29   ` Laszlo Ersek
2013-07-01 17:48     ` Eric Blake
2013-07-01 17:59     ` Tomoki Sekiyama
2013-07-02  6:36       ` Laszlo Ersek
2013-07-02 14:09         ` Luiz Capitulino
2013-07-02 14:44           ` Laszlo Ersek
2013-07-02 15:16             ` Luiz Capitulino
2013-07-02 15:28               ` Laszlo Ersek
2013-07-02 14:58         ` Michael Roth
2013-06-06 15:06 ` [Qemu-devel] [PATCH v4 09/10] qemu-ga: install Windows VSS provider on `qemu-ga -s install' Tomoki Sekiyama
2013-07-01 14:50   ` Laszlo Ersek
2013-07-01 17:59     ` Tomoki Sekiyama
2013-06-06 15:07 ` [Qemu-devel] [PATCH v4 10/10] QMP/qemu-ga-client: make timeout longer for guest-fsfreeze-freeze command Tomoki Sekiyama
2013-06-18 10:17   ` Paolo Bonzini
2013-07-01 15:02   ` Laszlo Ersek
2013-06-10  9:26 ` [Qemu-devel] [PATCH v4 00/10] qemu-ga: fsfreeze on Windows using VSS Stefan Hajnoczi
2013-06-24 19:30 ` Tomoki Sekiyama
2013-06-24 21:13   ` Laszlo Ersek

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=CDEF3953.2E1E%Tomoki.Sekiyama@hds.com \
    --to=tomoki.sekiyama@hds.com \
    --cc=areis@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=lersek@redhat.com \
    --cc=libaiqing@huawei.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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.