All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: John Snow <jsnow@redhat.com>,
	Kashyap Chamarthy <kchamart@redhat.com>,
	qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-block] Making QMP 'block-job-cancel' transactionable
Date: Mon, 3 Apr 2017 15:38:36 -0500	[thread overview]
Message-ID: <ef9e10c4-3986-32ba-da2d-1b8f71d58319@redhat.com> (raw)
In-Reply-To: <0e1c78f3-1b82-58e4-035e-944484e66f29@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2735 bytes --]

On 04/03/2017 03:29 PM, John Snow wrote:
> 
> 
> On 03/24/2017 08:34 AM, Kashyap Chamarthy wrote:
>> While debugging some other issue, I happened to stumble across an old
>> libvirt commit[*] that adds support for pivot (whether QEMU should
>> switch to a target copy or not) operation as a result of issuing QMP
>> 'block-job-cancel' to a 'drive-mirror' (in libvirt parlance, "block
>> copy").
>>
>> In the libvirt commit message[*] Eric Blake writes:
>>
>>     "[...] There may be potential improvements to the snapshot code to
>>     exploit block copy over multiple disks all at one point in time.
>>     And, if 'block-job-cancel' were made part of 'transaction', you
>>     could copy multiple disks at the same point in time without pausing
>>     the domain. [...]"
>>
> 
> Oh, you want a transactional cancel to basically capitalize on the
> second completion mode of the mirror job.
> 
> I have never really cared for the way this job works, because I don't
> think "canceling" a ready job is semantically valid (it's not canceled!
> We completed successfully, just using a different completion mode) --
> but if I am in the minority here I would cede that a transactional
> cancel would be a worthwhile thing to have.
> 
> I think at other points we have discussed the concept of having a
> configurable completion mode that jobs could have (and allowing this
> setting to be adjusted at runtime) that changes which completion mode
> they'll pursue.

Indeed, having a runtime-adjustable completion mode would allow what
libvirt wants: libvirt doesn't know what mode the user wants until they
request virDomainBlockJobAbort() (the name is scary, but it merely means
that they are stopping what is otherwise an unending job), and pass a
flag that says whether they want pivot or end-point-in-time copy
semantics.  If they request pivot semantics, libvirt invokes
block-job-complete to do its default completion mode, if they request
copy semantics, libvirt then switches the completion mode and still
calls block-job-complete (which _is_ valid in a transaction).

> 
> This would make a cancel unambiguously a cancellation. It would make a
> non-pivot completion to a mirror action an unambiguous success, too.
> 
> Minor nit, perhaps, but I want to be sure before we cement the semantics
> of how mirror can be "successful."

Minor or not, it is a useful viewpoint. Either way, as long as the new
way of getting a transactional non-pivot successful completion is
something that libvirt can learn via introspection, it should solve what
we are hoping for here.

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2017-04-03 20:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-24 12:34 [Qemu-devel] Making QMP 'block-job-cancel' transactionable Kashyap Chamarthy
2017-03-28 14:49 ` Eric Blake
2017-03-28 15:29   ` Kashyap Chamarthy
2017-04-03 14:38     ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-04-03 20:29 ` John Snow
2017-04-03 20:38   ` Eric Blake [this message]
2017-04-04 13:28     ` Kashyap Chamarthy
2017-04-04 13:54       ` Eric Blake
2017-04-11  9:42         ` Markus Armbruster
2017-04-11 10:30           ` Kashyap Chamarthy
2017-04-11 12:05   ` Kevin Wolf
2017-04-11 13:14     ` Eric Blake
2017-04-11 13:30       ` Kevin Wolf
2017-04-12  8:42         ` Fam Zheng
2017-04-12  8:59           ` Kevin Wolf
2017-04-12  9:12             ` Fam Zheng

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=ef9e10c4-3986-32ba-da2d-1b8f71d58319@redhat.com \
    --to=eblake@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kchamart@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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.