From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7WWv-0007Z8-Dn for qemu-devel@nongnu.org; Wed, 16 Jul 2014 17:14:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7WWt-00035y-Ua for qemu-devel@nongnu.org; Wed, 16 Jul 2014 17:14:25 -0400 Received: from mail-ie0-x22f.google.com ([2607:f8b0:4001:c03::22f]:48841) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7WWt-00035d-PD for qemu-devel@nongnu.org; Wed, 16 Jul 2014 17:14:23 -0400 Received: by mail-ie0-f175.google.com with SMTP id x19so1532703ier.34 for ; Wed, 16 Jul 2014 14:14:22 -0700 (PDT) MIME-Version: 1.0 Sender: yuanzhengu@gmail.com From: Yuanzhen Gu Date: Wed, 16 Jul 2014 17:13:52 -0400 Message-ID: Content-Type: multipart/alternative; boundary=089e0158ab9a1a726d04fe56025b Subject: [Qemu-devel] pause and restore function before and after QEMU Live Snapshot List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --089e0158ab9a1a726d04fe56025b Content-Type: text/plain; charset=UTF-8 Hi folks, I am going to make a patch, and need to find the pause and thaw(restore) function before and after taking Live QEMU Snapshot respectively. Basically, I'm using # (qemu) snapshot_blkdev taking snapshot, http://wiki.qemu.org/Features/Snapshots my profile tool didn't work when giving command inside QMP. Does anyone know how to find the pause (freeze) and restore(thaw) function before and after taking snapshot? Or anyway using snapshot_blkdev command outside QEMU console? Thanks a lot in advance! Best, Yuanzhen Best, Yuanzhen --089e0158ab9a1a726d04fe56025b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Hi folks,


I am going = to make a patch, and need to find the pause and thaw(restore) function before and after taking Live QEMU Snapshot respectively.=20


Basically, I'm using # (qemu) snapshot_blkdev <blockX> <snapshot-file><format> taking snapshot, http:/= /wiki.qemu.org/Features/Snapshots=C2=A0=C2=A0=C2=A0 my profile tool didn't work when giving command inside QMP.


Does anyone know how to find the pause (freeze) and restore(thaw) function before and after taking snapshot?=20 Or anyway using snapshot_blkdev command outside QEMU console? Thanks a lot in advance!


Best,

Yuanzhen



Best,
Yuanzhen
--089e0158ab9a1a726d04fe56025b-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7Wbk-0000XK-Bl for qemu-devel@nongnu.org; Wed, 16 Jul 2014 17:19:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7Wbg-0004dd-0l for qemu-devel@nongnu.org; Wed, 16 Jul 2014 17:19:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31196) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7Wbf-0004dY-OM for qemu-devel@nongnu.org; Wed, 16 Jul 2014 17:19:19 -0400 Message-ID: <53C6EC43.40507@redhat.com> Date: Wed, 16 Jul 2014 15:18:59 -0600 From: Eric Blake MIME-Version: 1.0 References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="TgIFe4a6spwAs6V04fw9BBglnWB70sw1j" Subject: Re: [Qemu-devel] pause and restore function before and after QEMU Live Snapshot List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yuanzhen Gu , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --TgIFe4a6spwAs6V04fw9BBglnWB70sw1j Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/16/2014 03:13 PM, Yuanzhen Gu wrote: > Hi folks, >=20 >=20 > I am going to make a patch, and need to find the pause and thaw(restore= ) > function before and after taking Live QEMU Snapshot respectively. Libvirt has the ability to do just that, when taking external disk-only snapshots. You can turn on libvirt debugging to trace what QMP/agent commands are sent during the overall snapshot operation. >=20 >=20 > Basically, I'm using # (qemu) snapshot_blkdev > taking snapshot, > http://wiki.qemu.org/Features/Snapshots my profile tool didn't work = when > giving command inside QMP. >=20 >=20 > Does anyone know how to find the pause (freeze) and restore(thaw) func= tion > before and after taking snapshot? Or anyway using snapshot_blkdev comma= nd > outside QEMU console? Thanks a lot in advance! You have to coordinate multiple commands: freeze to the guest agent, then snapshot to QMP, then thaw to the guest agent. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --TgIFe4a6spwAs6V04fw9BBglnWB70sw1j Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTxuxDAAoJEKeha0olJ0NqIssH/iljSt0sZyCPR6oVmNe2larI 7QhK2fE4bP9aGSMkXc/5RtQlrkF/DDhNSVy8j/JNdULGGeN92cn73VV8QPQPeR1G f0G+M0rVY+7eKAN/wPq5r8BdLg5EGruB5ZCBGYo14BKWuwl15GuW+cb45SqCG2dt QaDoWL99GVmLUdE1TOED5iIkw6vnaMSAOFmqzL+oxgLc8nXQ1CUQjoaFnnungaO2 lk6caf1nnNqIOySlA0f+gzCmeD0wiZMp9wIKhtvYaj+5nVwR4e/Ao6pCJ5MKP4q8 5w6NiA4SgTaMgmw0CHVvtNfTZ2SAevALDvBDgv5GVRWoWOCXVXoRCYBejtwsr/w= =2128 -----END PGP SIGNATURE----- --TgIFe4a6spwAs6V04fw9BBglnWB70sw1j-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7WiL-0002Wb-C0 for qemu-devel@nongnu.org; Wed, 16 Jul 2014 17:26:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7WiI-0006bC-1t for qemu-devel@nongnu.org; Wed, 16 Jul 2014 17:26:13 -0400 Received: from mail-ie0-x22d.google.com ([2607:f8b0:4001:c03::22d]:48656) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7WiG-0006Zl-Is for qemu-devel@nongnu.org; Wed, 16 Jul 2014 17:26:09 -0400 Received: by mail-ie0-f173.google.com with SMTP id tr6so1548335ieb.32 for ; Wed, 16 Jul 2014 14:26:07 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <53C6EC43.40507@redhat.com> References: <53C6EC43.40507@redhat.com> From: Andrey Korolyov Date: Thu, 17 Jul 2014 01:25:47 +0400 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] pause and restore function before and after QEMU Live Snapshot List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: "qemu-devel@nongnu.org" , Yuanzhen Gu On Thu, Jul 17, 2014 at 1:18 AM, Eric Blake wrote: > On 07/16/2014 03:13 PM, Yuanzhen Gu wrote: >> Hi folks, >> >> >> I am going to make a patch, and need to find the pause and thaw(restore) >> function before and after taking Live QEMU Snapshot respectively. > > Libvirt has the ability to do just that, when taking external disk-only > snapshots. You can turn on libvirt debugging to trace what QMP/agent > commands are sent during the overall snapshot operation. > >> >> >> Basically, I'm using # (qemu) snapshot_blkdev >> taking snapshot, >> http://wiki.qemu.org/Features/Snapshots my profile tool didn't work when >> giving command inside QMP. >> >> >> Does anyone know how to find the pause (freeze) and restore(thaw) function >> before and after taking snapshot? Or anyway using snapshot_blkdev command >> outside QEMU console? Thanks a lot in advance! > > You have to coordinate multiple commands: freeze to the guest agent, > then snapshot to QMP, then thaw to the guest agent. > > -- > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org > Just 2c: fsfreeze will not succeed if there are any container instances, for example Docker, running in the VM on same filesystem. This exact case can be fixed by extending agent` logic but it looks that the putting a note is enough. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7X0I-00075N-8D for qemu-devel@nongnu.org; Wed, 16 Jul 2014 17:44:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7X0H-0003TE-2p for qemu-devel@nongnu.org; Wed, 16 Jul 2014 17:44:46 -0400 Received: from mail-ie0-x230.google.com ([2607:f8b0:4001:c03::230]:41248) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7X0G-0003T9-RQ for qemu-devel@nongnu.org; Wed, 16 Jul 2014 17:44:44 -0400 Received: by mail-ie0-f176.google.com with SMTP id tr6so1589974ieb.35 for ; Wed, 16 Jul 2014 14:44:44 -0700 (PDT) MIME-Version: 1.0 Sender: yuanzhengu@gmail.com In-Reply-To: <53C6EC43.40507@redhat.com> References: <53C6EC43.40507@redhat.com> From: Yuanzhen Gu Date: Wed, 16 Jul 2014 17:44:14 -0400 Message-ID: Content-Type: multipart/alternative; boundary=089e0118313aa9d77d04fe566e9a Subject: Re: [Qemu-devel] pause and restore function before and after QEMU Live Snapshot List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org --089e0118313aa9d77d04fe566e9a Content-Type: text/plain; charset=UTF-8 Thank you very much, Eric! So do you mean, if I turn on libvirt debugging to trace QMP/agent commands, I can find the pause and thaw functions in the source code, is it right ? and is there any way that I freeze and thaw outside guest agent via command line? or profiling tools suggest for freeze and thaw in guest agent? thanks a lot! Best, Yuanzhen On Wed, Jul 16, 2014 at 5:18 PM, Eric Blake wrote: > On 07/16/2014 03:13 PM, Yuanzhen Gu wrote: > > Hi folks, > > > > > > I am going to make a patch, and need to find the pause and thaw(restore) > > function before and after taking Live QEMU Snapshot respectively. > > Libvirt has the ability to do just that, when taking external disk-only > snapshots. You can turn on libvirt debugging to trace what QMP/agent > commands are sent during the overall snapshot operation. > So do you mean, if I turn on libvirt debugging to trace QMP/agent commands, I can find the pause and thaw functions in the source code, is it right ? > > > > > > > Basically, I'm using # (qemu) snapshot_blkdev > > taking snapshot, > > http://wiki.qemu.org/Features/Snapshots my profile tool didn't work > when > > giving command inside QMP. > > > > > > Does anyone know how to find the pause (freeze) and restore(thaw) > function > > before and after taking snapshot? Or anyway using snapshot_blkdev command > > outside QEMU console? Thanks a lot in advance! > > You have to coordinate multiple commands: freeze to the guest agent, > then snapshot to QMP, then thaw to the guest agent. > > -- > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org > > --089e0118313aa9d77d04fe566e9a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thank you very much, Eric!

So do yo= u mean, if I turn on libvirt debugging to trace QMP/agent=20 commands, I can find the pause and thaw functions in the source code, is it right ?

and is there any way that I freeze and thaw outside guest agent via command= line?=C2=A0=C2=A0 or profiling tools suggest for freeze and thaw in guest = agent? thanks a lot!

Best,
Yuanzhen


On Wed, Jul 16, 2014 at 5:18 PM, Eric Bl= ake <eblake@redhat.com> wrote:
On 07/16/2014 03:13 PM, Yuanzhen Gu wrote:
> Hi folks,
>
>
> I am going to make a patch, and need to find the pause and thaw(restor= e)
> function before and after taking Live QEMU Snapshot respectively.

Libvirt has the ability to do just that, when taking external disk-on= ly
snapshots. =C2=A0You can turn on libvirt debugging to trace what QMP/agent<= br> commands are sent during the overall snapshot operation.

=C2=A0 =C2=A0 So do you mean, if I turn on libvirt debugg= ing to trace QMP/agent commands, I can find the pause and thaw functions in= the source code, is it right ?

>
>
> =C2=A0Basically, I'm using # (qemu) snapshot_blkdev <blockX>=
> <snapshot-file><format> taking snapshot,
> = http://wiki.qemu.org/Features/Snapshots =C2=A0 =C2=A0my profile tool di= dn't work when
> giving command inside QMP.
>
>
> =C2=A0Does anyone know how to find the pause (freeze) and restore(thaw= ) function
> before and after taking snapshot? Or anyway using snapshot_blkdev comm= and
> outside QEMU console? Thanks a lot in advance!

You have to coordinate multiple commands: freeze to the guest agent,<= br> then snapshot to QMP, then thaw to the guest agent.

--
Eric Blake =C2=A0 eblake redhat com =C2=A0 =C2=A0+1-919-301-3266
Libvirt virtualization library http://libvirt.org


--089e0118313aa9d77d04fe566e9a-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7X4W-0000d8-0g for qemu-devel@nongnu.org; Wed, 16 Jul 2014 17:49:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7X4S-0004rJ-44 for qemu-devel@nongnu.org; Wed, 16 Jul 2014 17:49:07 -0400 Received: from mail-ie0-x22a.google.com ([2607:f8b0:4001:c03::22a]:40707) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7X4R-0004r8-TG for qemu-devel@nongnu.org; Wed, 16 Jul 2014 17:49:04 -0400 Received: by mail-ie0-f170.google.com with SMTP id rl12so1599961iec.1 for ; Wed, 16 Jul 2014 14:49:03 -0700 (PDT) MIME-Version: 1.0 Sender: yuanzhengu@gmail.com In-Reply-To: References: <53C6EC43.40507@redhat.com> From: Yuanzhen Gu Date: Wed, 16 Jul 2014 17:48:32 -0400 Message-ID: Content-Type: multipart/alternative; boundary=001a11c20d021a3d1104fe567e3c Subject: Re: [Qemu-devel] pause and restore function before and after QEMU Live Snapshot List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andrey Korolyov Cc: "qemu-devel@nongnu.org" --001a11c20d021a3d1104fe567e3c Content-Type: text/plain; charset=UTF-8 Thanks very much Andrey! how can I figure out whether fsfreeze not succeed while taking snapshot, if I run a simple application inside VM, say mysql? thanks! Best, Yuanzhen On Wed, Jul 16, 2014 at 5:25 PM, Andrey Korolyov wrote: > On Thu, Jul 17, 2014 at 1:18 AM, Eric Blake wrote: > > On 07/16/2014 03:13 PM, Yuanzhen Gu wrote: > >> Hi folks, > >> > >> > >> I am going to make a patch, and need to find the pause and thaw(restore) > >> function before and after taking Live QEMU Snapshot respectively. > > > > Libvirt has the ability to do just that, when taking external disk-only > > snapshots. You can turn on libvirt debugging to trace what QMP/agent > > commands are sent during the overall snapshot operation. > > > >> > >> > >> Basically, I'm using # (qemu) snapshot_blkdev > >> taking snapshot, > >> http://wiki.qemu.org/Features/Snapshots my profile tool didn't work > when > >> giving command inside QMP. > >> > >> > >> Does anyone know how to find the pause (freeze) and restore(thaw) > function > >> before and after taking snapshot? Or anyway using snapshot_blkdev > command > >> outside QEMU console? Thanks a lot in advance! > > > > You have to coordinate multiple commands: freeze to the guest agent, > > then snapshot to QMP, then thaw to the guest agent. > > > > -- > > Eric Blake eblake redhat com +1-919-301-3266 > > Libvirt virtualization library http://libvirt.org > > > > Just 2c: > > fsfreeze will not succeed if there are any container instances, for > example Docker, running in the VM on same filesystem. This exact case > can be fixed by extending agent` logic but it looks that the putting a > note is enough. > > --001a11c20d021a3d1104fe567e3c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks very much Andrey!

how can I figur= e out whether fsfreeze not succeed while taking snapshot, if I run a simple= application inside VM, say mysql? thanks!

Best,
Yuanzhen


On Wed, Jul 16, 2014 at 5:25 PM, Andrey = Korolyov <andrey@xdel.ru> wrote:
On Thu, Jul 17, 2014 at 1:18 AM, Er= ic Blake <eblake@redhat.com>= wrote:
> On 07/16/2014 03:13 PM, Yuanzhen Gu wrote:
>> Hi folks,
>>
>>
>> I am going to make a patch, and need to find the pause and thaw(re= store)
>> function before and after taking Live QEMU Snapshot respectively.<= br> >
> Libvirt has the ability to do just that, when taking external disk-onl= y
> snapshots. =C2=A0You can turn on libvirt debugging to trace what QMP/a= gent
> commands are sent during the overall snapshot operation.
>
>>
>>
>> =C2=A0Basically, I'm using # (qemu) snapshot_blkdev <blockX= >
>> <snapshot-file><format> taking snapshot,
>> http://wiki.qemu.org/Features/Snapshots =C2=A0 =C2=A0my profile too= l didn't work when
>> giving command inside QMP.
>>
>>
>> =C2=A0Does anyone know how to find the pause (freeze) and restore(= thaw) function
>> before and after taking snapshot? Or anyway using snapshot_blkdev = command
>> outside QEMU console? Thanks a lot in advance!
>
> You have to coordinate multiple commands: freeze to the guest agent, > then snapshot to QMP, then thaw to the guest agent.
>
> --
> Eric Blake =C2=A0 eblake redhat com =C2=A0 =C2=A0+1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>

Just 2c:

fsfreeze will not succeed if there are any container instances, for
example Docker, running in the VM on same filesystem. This exact case
can be fixed by extending agent` logic but it looks that the putting a
note is enough.


--001a11c20d021a3d1104fe567e3c-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7X6z-0002F9-Ct for qemu-devel@nongnu.org; Wed, 16 Jul 2014 17:51:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7X6y-0005bX-9L for qemu-devel@nongnu.org; Wed, 16 Jul 2014 17:51:41 -0400 Received: from mail-ig0-x22a.google.com ([2607:f8b0:4001:c05::22a]:47810) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7X6x-0005bT-Vw for qemu-devel@nongnu.org; Wed, 16 Jul 2014 17:51:40 -0400 Received: by mail-ig0-f170.google.com with SMTP id h3so4686484igd.3 for ; Wed, 16 Jul 2014 14:51:39 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <53C6EC43.40507@redhat.com> From: Andrey Korolyov Date: Thu, 17 Jul 2014 01:51:19 +0400 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] pause and restore function before and after QEMU Live Snapshot List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yuanzhen Gu Cc: "qemu-devel@nongnu.org" On Thu, Jul 17, 2014 at 1:48 AM, Yuanzhen Gu wrote: > Thanks very much Andrey! > > how can I figure out whether fsfreeze not succeed while taking snapshot, if > I run a simple application inside VM, say mysql? thanks! > > Best, > Yuanzhen > > > On Wed, Jul 16, 2014 at 5:25 PM, Andrey Korolyov wrote: >> >> On Thu, Jul 17, 2014 at 1:18 AM, Eric Blake wrote: >> > On 07/16/2014 03:13 PM, Yuanzhen Gu wrote: >> >> Hi folks, >> >> >> >> >> >> I am going to make a patch, and need to find the pause and >> >> thaw(restore) >> >> function before and after taking Live QEMU Snapshot respectively. >> > >> > Libvirt has the ability to do just that, when taking external disk-only >> > snapshots. You can turn on libvirt debugging to trace what QMP/agent >> > commands are sent during the overall snapshot operation. >> > >> >> >> >> >> >> Basically, I'm using # (qemu) snapshot_blkdev >> >> taking snapshot, >> >> http://wiki.qemu.org/Features/Snapshots my profile tool didn't work >> >> when >> >> giving command inside QMP. >> >> >> >> >> >> Does anyone know how to find the pause (freeze) and restore(thaw) >> >> function >> >> before and after taking snapshot? Or anyway using snapshot_blkdev >> >> command >> >> outside QEMU console? Thanks a lot in advance! >> > >> > You have to coordinate multiple commands: freeze to the guest agent, >> > then snapshot to QMP, then thaw to the guest agent. >> > >> > -- >> > Eric Blake eblake redhat com +1-919-301-3266 >> > Libvirt virtualization library http://libvirt.org >> > >> >> Just 2c: >> >> fsfreeze will not succeed if there are any container instances, for >> example Docker, running in the VM on same filesystem. This exact case >> can be fixed by extending agent` logic but it looks that the putting a >> note is enough. >> > Just non-zero exit code from agent`s operation, not matter if you communicating directly via json exchange or via libvirt. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7sB0-0000GT-13 for qemu-devel@nongnu.org; Thu, 17 Jul 2014 16:21:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7sAy-0003qx-Ef for qemu-devel@nongnu.org; Thu, 17 Jul 2014 16:21:13 -0400 Received: from mail-oa0-x231.google.com ([2607:f8b0:4003:c02::231]:47606) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7sAy-0003qp-7C for qemu-devel@nongnu.org; Thu, 17 Jul 2014 16:21:12 -0400 Received: by mail-oa0-f49.google.com with SMTP id eb12so1477664oac.8 for ; Thu, 17 Jul 2014 13:21:11 -0700 (PDT) MIME-Version: 1.0 Sender: yuanzhengu@gmail.com In-Reply-To: <53C6EC43.40507@redhat.com> References: <53C6EC43.40507@redhat.com> From: Yuanzhen Gu Date: Thu, 17 Jul 2014 16:20:41 -0400 Message-ID: Content-Type: multipart/alternative; boundary=089e013c5eccb7e64d04fe696150 Subject: Re: [Qemu-devel] pause and restore function before and after QEMU Live Snapshot List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: "qemu-devel@nongnu.org" --089e013c5eccb7e64d04fe696150 Content-Type: text/plain; charset=UTF-8 Hi Eric, Thank you very much for your suggestion, it do help. I enabled libvirt debugging, and saw the log file under /var/log/libvirt/libvirtd.log, for example, I saw 2014-07-17 20:06:55.992+0000: 4391: debug : qemuProcessHandleResume:575 : Transitioned guest ubuntu out of paused into resumed state my further question is, is there any way to locate the function call for pause and resume from source code, based on the log info? thanks! Best, Yuanzhen On Wed, Jul 16, 2014 at 5:18 PM, Eric Blake wrote: > On 07/16/2014 03:13 PM, Yuanzhen Gu wrote: > > Hi folks, > > > > > > I am going to make a patch, and need to find the pause and thaw(restore) > > function before and after taking Live QEMU Snapshot respectively. > > Libvirt has the ability to do just that, when taking external disk-only > snapshots. You can turn on libvirt debugging to trace what QMP/agent > commands are sent during the overall snapshot operation. > > > > > > > Basically, I'm using # (qemu) snapshot_blkdev > > taking snapshot, > > http://wiki.qemu.org/Features/Snapshots my profile tool didn't work > when > > giving command inside QMP. > > > > > > Does anyone know how to find the pause (freeze) and restore(thaw) > function > > before and after taking snapshot? Or anyway using snapshot_blkdev command > > outside QEMU console? Thanks a lot in advance! > > You have to coordinate multiple commands: freeze to the guest agent, > then snapshot to QMP, then thaw to the guest agent. > > -- > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org > > --089e013c5eccb7e64d04fe696150 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Eric,

Thank you very = much for your suggestion, it do help.

I enabled libvirt debugg= ing, and saw the log file under /var/log/libvirt/libvirtd.log,

for example, I saw
2014-07-17 20:06:55.992+0000: 4391: debug : qemuProce= ssHandleResume:575 : Transitioned guest ubuntu out of paused into resumed s= tate

my further question is, is there any way to locate the fu= nction call for pause and resume from source code, based on the log info? t= hanks!

Be= st,
Yuanzhen


On Wed, Jul 16, 2014 at 5:18 PM, Eric Bl= ake <eblake@redhat.com> wrote:
On 07/16/2014 03:13 PM, Yuanzhen Gu wrote:
> Hi folks,
>
>
> I am going to make a patch, and need to find the pause and thaw(restor= e)
> function before and after taking Live QEMU Snapshot respectively.

Libvirt has the ability to do just that, when taking external disk-on= ly
snapshots. =C2=A0You can turn on libvirt debugging to trace what QMP/agent<= br> commands are sent during the overall snapshot operation.

>
>
> =C2=A0Basically, I'm using # (qemu) snapshot_blkdev <blockX>=
> <snapshot-file><format> taking snapshot,
> = http://wiki.qemu.org/Features/Snapshots =C2=A0 =C2=A0my profile tool di= dn't work when
> giving command inside QMP.
>
>
> =C2=A0Does anyone know how to find the pause (freeze) and restore(thaw= ) function
> before and after taking snapshot? Or anyway using snapshot_blkdev comm= and
> outside QEMU console? Thanks a lot in advance!

You have to coordinate multiple commands: freeze to the guest agent,<= br> then snapshot to QMP, then thaw to the guest agent.

--
Eric Blake =C2=A0 eblake redhat com =C2=A0 =C2=A0+1-919-301-3266
Libvirt virtualization library http://libvirt.org


--089e013c5eccb7e64d04fe696150-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7tCZ-0000FM-Ml for qemu-devel@nongnu.org; Thu, 17 Jul 2014 17:27:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7tCT-0000wX-QV for qemu-devel@nongnu.org; Thu, 17 Jul 2014 17:26:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21295) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7tCT-0000wE-H4 for qemu-devel@nongnu.org; Thu, 17 Jul 2014 17:26:49 -0400 Message-ID: <53C83F82.5020104@redhat.com> Date: Thu, 17 Jul 2014 15:26:26 -0600 From: Eric Blake MIME-Version: 1.0 References: <53C6EC43.40507@redhat.com> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MmegmlAoOnc21SBqJLdbep9odpHNNuv1M" Subject: Re: [Qemu-devel] pause and restore function before and after QEMU Live Snapshot List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yuanzhen Gu Cc: "qemu-devel@nongnu.org" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --MmegmlAoOnc21SBqJLdbep9odpHNNuv1M Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/17/2014 02:20 PM, Yuanzhen Gu wrote: > Hi Eric, [please don't top-post on technical lists] > I enabled libvirt debugging, and saw the log file under > /var/log/libvirt/libvirtd.log, Which debugging filters did you enable? In particular, you'll want to turn on LIBVIRT_LOG_FILTERS=3D"1:qemu" for full libvirt logging of qemu interaction (see http://libvirt.org/logging.html for details); at which point you can then search for QEMU_MONITOR_IO_PROCESS lines to see when libvirt sends commands to QMP and gets replies back. This sort of question may be better asked on the libvirt-users@redhat.com list. >=20 > for example, I saw > 2014-07-17 20:06:55.992+0000: 4391: debug : qemuProcessHandleResume:575= : > Transitioned guest ubuntu out of paused into resumed state >=20 > my further question is, is there any way to locate the function call fo= r > pause and resume from source code, based on the log info? thanks! Are you looking for where in the libvirt source code a snapshot manages qemu commands? Look for src/qemu/qemu_driver.c:qemuDomainSnapshotCreateActiveExternal, and trace through the code it calls for qemuDomainSnapshotFSFreeze and qemuMonitorTransaction. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --MmegmlAoOnc21SBqJLdbep9odpHNNuv1M Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTyD+CAAoJEKeha0olJ0Nq48AH/1wJr9YG3cSMNnMe1qVWjZtp djElLPZ0zV3/8m652tVs1kOPwhH8/Sg9PQ680n4uHiZ0eUiCEkXzBg+nb4V0zGu7 6Yw/ILZTqoLMVPOwKQav2wPHZFkSkYf9BJ66tRJGZzhktMuCQAY7KQStE+1GHRTo 57Pq7oRme9F89ctAZbStkO4l5ey188rFOX3grvxDb61mhIk2kxaFTywdD3kgRK0E oWDTS7SWfa368B0wWhVnETPoFRWzZHzKC+sdWuuTLN06nJAzVAP5WTDw/Hwi4edg uK5MFZ7oEZqUEOGNvvV7EPRMcuwikJSfuGHr8/2kZPS1TDxanytnmY+EZ2tnu7E= =1UT1 -----END PGP SIGNATURE----- --MmegmlAoOnc21SBqJLdbep9odpHNNuv1M-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7tVF-0005fW-Kp for qemu-devel@nongnu.org; Thu, 17 Jul 2014 17:46:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7tVE-00088R-80 for qemu-devel@nongnu.org; Thu, 17 Jul 2014 17:46:13 -0400 Received: from mail-oa0-x22d.google.com ([2607:f8b0:4003:c02::22d]:46014) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7tVE-00088L-0L for qemu-devel@nongnu.org; Thu, 17 Jul 2014 17:46:12 -0400 Received: by mail-oa0-f45.google.com with SMTP id i7so1700221oag.32 for ; Thu, 17 Jul 2014 14:46:11 -0700 (PDT) MIME-Version: 1.0 Sender: yuanzhengu@gmail.com In-Reply-To: <53C83F82.5020104@redhat.com> References: <53C6EC43.40507@redhat.com> <53C83F82.5020104@redhat.com> From: Yuanzhen Gu Date: Thu, 17 Jul 2014 17:45:41 -0400 Message-ID: Content-Type: multipart/alternative; boundary=e89a8f83a7c9b2c5e004fe6a9112 Subject: Re: [Qemu-devel] pause and restore function before and after QEMU Live Snapshot List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: "qemu-devel@nongnu.org" --e89a8f83a7c9b2c5e004fe6a9112 Content-Type: text/plain; charset=UTF-8 I see, thank you very much, Eric! Best, Yuanzhen On Thu, Jul 17, 2014 at 5:26 PM, Eric Blake wrote: > On 07/17/2014 02:20 PM, Yuanzhen Gu wrote: > > Hi Eric, > > [please don't top-post on technical lists] > > > I enabled libvirt debugging, and saw the log file under > > /var/log/libvirt/libvirtd.log, > > Which debugging filters did you enable? In particular, you'll want to > turn on LIBVIRT_LOG_FILTERS="1:qemu" for full libvirt logging of qemu > interaction (see http://libvirt.org/logging.html for details); at which > point you can then search for QEMU_MONITOR_IO_PROCESS lines to see when > libvirt sends commands to QMP and gets replies back. This sort of > question may be better asked on the libvirt-users@redhat.com list. > > > > > for example, I saw > > 2014-07-17 20:06:55.992+0000: 4391: debug : qemuProcessHandleResume:575 : > > Transitioned guest ubuntu out of paused into resumed state > > > > my further question is, is there any way to locate the function call for > > pause and resume from source code, based on the log info? thanks! > > Are you looking for where in the libvirt source code a snapshot manages > qemu commands? Look for > src/qemu/qemu_driver.c:qemuDomainSnapshotCreateActiveExternal, and trace > through the code it calls for qemuDomainSnapshotFSFreeze and > qemuMonitorTransaction. > > -- > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org > > --e89a8f83a7c9b2c5e004fe6a9112 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I see, thank you very much, Eric!

Best,
Yuanzhen


On Thu, Jul 17, 2014 at 5:26 PM, Eric Bl= ake <eblake@redhat.com> wrote:
On 07/17/2014 02:20 PM, Yuanzhen Gu wrote:
> Hi Eric,

[please don't top-post on technical lists]

> I enabled libvirt debugging, and saw the log file under
> /var/log/libvirt/libvirtd.log,

Which debugging filters did you enable? In particular, you'll wan= t to
turn on LIBVIRT_LOG_FILTERS=3D"1:qemu" for full libvirt logging o= f qemu
interaction (see http://libvirt.org/logging.html for details); at which
point you can then search for QEMU_MONITOR_IO_PROCESS lines to see when
libvirt sends commands to QMP and gets replies back. =C2=A0This sort of
question may be better asked on the libvirt-users@redhat.com list.

>
> for example, I saw
> 2014-07-17 20:06:55.992+0000: 4391: debug : qemuProcessHandleResume:57= 5 :
> Transitioned guest ubuntu out of paused into resumed state
>
> my further question is, is there any way to locate the function call f= or
> pause and resume from source code, based on the log info? thanks!

Are you looking for where in the libvirt source code a snapshot manag= es
qemu commands? =C2=A0Look for
src/qemu/qemu_driver.c:qemuDomainSnapshotCreateActiveExternal, and trace through the code it calls for qemuDomainSnapshotFSFreeze and
qemuMonitorTransaction.

--
Eric Blake =C2=A0 eblake redhat com =C2=A0 =C2=A0+1-919-301-3266
Libvirt virtualization library http://libvirt.org


--e89a8f83a7c9b2c5e004fe6a9112--