From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39411) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXw2n-0001qk-58 for qemu-devel@nongnu.org; Fri, 25 May 2012 11:03:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXw2f-0005YD-Eo for qemu-devel@nongnu.org; Fri, 25 May 2012 11:03:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22412) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXw2f-0005XU-7q for qemu-devel@nongnu.org; Fri, 25 May 2012 11:03:01 -0400 Message-ID: <4FBF9F05.8000605@redhat.com> Date: Fri, 25 May 2012 09:02:29 -0600 From: Eric Blake MIME-Version: 1.0 References: <4FB6821A.1080902@redhat.com> <4FBE3A89.8020702@redhat.com> <4FBE6861.2040503@redhat.com> <4FBF4775.5020505@redhat.com> In-Reply-To: <4FBF4775.5020505@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigC671A767BCCAB6EF1AB19A9A" Subject: Re: [Qemu-devel] Block job commands in QEMU 1.2 [v2, including support for replication] List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , Luiz Capitulino , qemu-devel , Ori Mamluk , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC671A767BCCAB6EF1AB19A9A Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 05/25/2012 02:48 AM, Paolo Bonzini wrote: >>> * block-job-complete: force completion of mirroring and switching of = the >>> device to the target, not related to the rest of the proposal. >>> Synchronously opens backing files if needed, asynchronously completes= >>> the job. >> >> Can this be made part of a 'transaction'? Likewise, can >> 'block-job-cancel' be made part of a 'transaction'? >=20 > Both of them are asynchronous so they would not create an atomic > snapshot. We could add it later, in the meanwhile you can wrap with > fsfreeze/fsthaw. It doesn't have to be right away, I just want to make sure that we aren't excluding it from a possible future extension, because it _does_ sound useful. >=20 >> But now that you are adding the possibility of mirroring reverting >> to copying, there is a race where I can probe and see that we are >> in mirroring, then issue a 'block-job-cancel' to affect a copy operati= on, >> but in the meantime things reverted, and the cancel ends up leaving me= >> with an incomplete copy. >=20 > Hmm, that's right. But then this can only happen if you have an error > in the target. I can make block-job-cancel _not_ resume a paused job. > Would that satisfy your needs? I'm not sure I follow what you are asking. My scenario is: call 'drive-mirror' to start a job 'block-job-complete' fails because job is not ready, but the job is not affected wait for the event telling me we are in mirroring phase start issuing my call to 'block-job-complete' to pivot something happens where we are no longer mirroring 'block-job-complete' fails because we are not mirroring - good call 'drive-mirror' to start a job calling 'block-job-cancel' would abort the job, which is not what I want wait for the event telling me we are in mirroring phase start issuing my call to 'block-job-cancel' to cleanly leave the copy beh= ind something happens where we are no longer mirroring 'block-job-cancel' completes, but did not leave a complete mirror - bad On the other hand, if I'm _not_ trying to make a clean copy, then I want 'block-job-cancel' to work as fast as possible, no matter what. I'm not sure why having block-job-cancel resume or not resume a job would make a difference. What I really am asking for here is a way to have some command (perhaps 'block-job-complete' but with an optional flag set to a non-default value) that says I want to complete the job as a clean copy, but revert back to the source rather than pivot to the destination, and to cleanly fail with the job still around for additional actions if I cannot get a clean copy at the current moment, in the same way that the default 'block-job-complete' cleanly fails but does not kill the job if I'm not mirroring yet. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigC671A767BCCAB6EF1AB19A9A 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.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJPv58FAAoJEKeha0olJ0NqUK8H/0dVKEYGI9rOJrFCSFd+Ysoc bwHJjpztZdLerHzxDZ+VYTCx4lXCHd0o8GbiOtqikp0Nhq7IQBqN+HRhGIiCXgE/ 6j4h4HB9tY0V6KipW6Pbsmay4cku06Tl9x3EEMnT1guMrei2xoq86QjSP9FdeNq8 +V7TyzZsIYsSAZpagH6O/qXxKglYs5ooqfXnZh8uubMMwJBV87XiLplymVJbnzvW 8sa+0zIRsets9l2JKn50qNwAajQHSmEckyjHNHePrWS0tN6muSdNyfuNoseUFgar UjXbqwyRhntrvcvWp5LFYEqiziF+fuUQM8mPO5NhE3RIKAyNC7BIMnbAO/FFPto= =ZIpb -----END PGP SIGNATURE----- --------------enigC671A767BCCAB6EF1AB19A9A--