All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Peter Krempa <pkrempa@redhat.com>,
	qemu-block@nongnu.org, Juan Quintela <quintela@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-devel@nongnu.org, Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Max Reitz <mreitz@redhat.com>
Subject: Re: [PATCH 2/6] migration: introduce savevm, loadvm, delvm QMP commands
Date: Fri, 3 Jul 2020 18:26:34 +0100	[thread overview]
Message-ID: <20200703172634.GL6641@work-vm> (raw)
In-Reply-To: <20200703171000.GR2213227@redhat.com>

* Daniel P. Berrangé (berrange@redhat.com) wrote:
> On Fri, Jul 03, 2020 at 06:00:50PM +0100, Dr. David Alan Gilbert wrote:
> > * Daniel P. Berrangé (berrange@redhat.com) wrote:
> > > On Fri, Jul 03, 2020 at 05:22:46PM +0100, Dr. David Alan Gilbert wrote:
> > > > * Daniel P. Berrangé (berrange@redhat.com) wrote:
> > > > > On Fri, Jul 03, 2020 at 05:10:12PM +0100, Dr. David Alan Gilbert wrote:
> > > > > > * Daniel P. Berrangé (berrange@redhat.com) wrote:
> > > > > > > On Fri, Jul 03, 2020 at 04:49:33PM +0100, Dr. David Alan Gilbert wrote:
> > > > > > > > * Daniel P. Berrangé (berrange@redhat.com) wrote:
> > > > > > > > > On Thu, Jul 02, 2020 at 01:12:52PM -0500, Eric Blake wrote:
> > > > > > > > > > On 7/2/20 12:57 PM, Daniel P. Berrangé wrote:
> > > > > > > > > > > savevm, loadvm and delvm are some of the few commands that have never
> > > > > > > > > > > been converted to use QMP. The primary reason for this lack of
> > > > > > > > > > > conversion is that they block execution of the thread for as long as
> > > > > > > > > > > they run.
> > > > > > > > > > > 
> > > > > > > > > > > Despite this downside, however, libvirt and applications using libvirt
> > > > > > > > > > > has used these commands for as long as QMP has existed, via the
> > > > > > > > > > > "human-monitor-command" passthrough command. IOW, while it is clearly
> > > > > > > > > > > desirable to be able to fix the blocking problem, this is not an
> > > > > > > > > > > immediate obstacle to real world usage.
> > > > > > > > > > > 
> > > > > > > > > > > Meanwhile there is a need for other features which involve adding new
> > > > > > > > > > > parameters to the commands. This is possible with HMP passthrough, but
> > > > > > > > > > > it provides no reliable way for apps to introspect features, so using
> > > > > > > > > > > QAPI modelling is highly desirable.
> > > > > > > > > > > 
> > > > > > > > > > > This patch thus introduces trival savevm, loadvm, delvm commands
> > > > > > > > > > 
> > > > > > > > > > trivial
> > > > > > > > > > 
> > > > > > > > > > > to QMP that are functionally identical to the HMP counterpart, including
> > > > > > > > > > > the blocking problem.
> > > > > > > > > > 
> > > > > > > > > > Should we name them 'x-savevm', 'x-loadvm', 'x-delvm' to give ourselves room
> > > > > > > > > > to change them when we DO solve the blocking issue?  Or will the solution of
> > > > > > > > > > the blocking issue introduce new QMP commands, at which point we can add QMP
> > > > > > > > > > deprecation markers on these commands to eventually retire them?
> > > > > > > > > 
> > > > > > > > > I was in two minds about this, so I'm open to arguments either way.
> > > > > > > > > 
> > > > > > > > > The primary goal is for libvirt to consume the APIs as soon as possible,
> > > > > > > > > and generally libvirt doesn't want todo this is they are declared experimental
> > > > > > > > > via a "x-" prefix. So that pushes me away from "x-".
> > > > > > > > > 
> > > > > > > > > If we don't have an "x-" prefix and want to make changes, we can add extra
> > > > > > > > > parameters to trigger new behaviour in backwards compatible manner. Or we can
> > > > > > > > > simply deprecate these commands, deleting them 2 releases later, while adding
> > > > > > > > > completely new commands.
> > > > > > > > > 
> > > > > > > > > If we think the prposed design will definitely need incompatible changes in
> > > > > > > > > a very short time frame though, that would push towards "x-".
> > > > > > > > > 
> > > > > > > > > So IMHO the right answer largely depends on whether there is a credible
> > > > > > > > > strategy to implement the ideal non-blocking solution in a reasonable amount
> > > > > > > > > of time. I can't justify spending much time on this myself, but I'm willing
> > > > > > > > > to consider & try proposals for solving the blocking problem if they're not
> > > > > > > > > too complex / invasive.
> > > > > > > > 
> > > > > > > > Remind me, what was the problem with just making a block: migration
> > > > > > > > channel, and then we can migrate to it?
> > > > > > > 
> > > > > > > migration only does vmstate, not disks. The current blockdev commands
> > > > > > > are all related to external snapshots, nothing for internal snapshots
> > > > > > > AFAIK. So we still need commands to load/save internal snapshots of
> > > > > > > the disk data in the qcow2 files.
> > > > > > > 
> > > > > > > So we could look at loadvm/savevm conceptually as a syntax sugar above
> > > > > > > a migration transport that targets disk images, and blockdev QMP command
> > > > > > > that can do internal snapshots. Neither of these exist though and feel
> > > > > > > like a significantly larger amount of work than using existing functionality
> > > > > > > that is currently working.
> > > > > > 
> > > > > > I think that's what we should aim for; adding this wrapper isn't gaining
> > > > > > that much without moving a bit towards that; so I would stick with the
> > > > > > x- for now.
> > > > > 
> > > > > The question is how much work that approach will be and whether anyone can
> > > > > realistically commit to doing that ? It looks like a much larger piece of
> > > > > work in both QEMU and libvirt side to do that. I don't want to see us stuck
> > > > > with a x-savevm for years because no one has resource to work on the perfect
> > > > > solution. If we did get a perfect solution at a point in future, we can
> > > > > still deprecate and then remove any "savevm" command we add to QMP.
> > > > 
> > > > I'd at least like to understand that we've got a worklist for it though.
> > > > We've already got qemu_fopen_bdrv - what's actually wrong with that - is
> > > > that enough to do the migrate to a stream (given a tiny amount of
> > > > syntax) ?
> > > 
> > > It is close. The migration code works with the QEMUFile layer, but in terms
> > > of the monitor commands the current framework expects a QIOChannel based
> > > QEMUFile. It would be possible to add new helpers to work with the bdrv
> > > backed QEMUFile. The ideal would be to create a QIOChannel impl that is
> > > backed by a block device though. At that point there would only be a single
> > > QEMUFile impl based on QIOChannel. 
> > > 
> > > That would be another step closer to unlocking the ability to eliminate the
> > > QEMUFile wrapper entirely. QEMUFile does I/O buffering too for performance,
> > > that could be done in a QIOChannel layer too, as that's a concept useful
> > > for other QIOChannel users too.
> > 
> > There's some separate patches on list to do buffering in bdrv for
> > vmsave because apparently the qemufile ones don't play well with it.
> > 
> > > That's still only the vmstate part though, and a solution is needed for
> > > the internal snapshot handling.
> > 
> > Which bit is the bit that makes it block?
> 
> The entire  save_snapshot / load_snapshot methods really. They doing I/O
> operations throughout and this executes in context of the thread running
> the monitor, so their execution time is proportional to I/O time.

Is there any reason for the migrationy bit to run synchronously then?

Could those snapshotting things be done with any of the block copy
processes that run asynchronously?

Dave


> 
> Regards,
> Daniel
> -- 
> |: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org         -o-            https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK



  reply	other threads:[~2020-07-03 17:27 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-02 17:57 [PATCH 0/6] migration: bring savevm/loadvm/delvm over to QMP Daniel P. Berrangé
2020-07-02 17:57 ` [PATCH 1/6] migration: improve error reporting of block driver state name Daniel P. Berrangé
2020-07-02 18:36   ` Eric Blake
2020-07-02 19:13     ` Dr. David Alan Gilbert
2020-07-02 17:57 ` [PATCH 2/6] migration: introduce savevm, loadvm, delvm QMP commands Daniel P. Berrangé
2020-07-02 18:12   ` Eric Blake
2020-07-02 18:24     ` Daniel P. Berrangé
2020-07-03 15:49       ` Dr. David Alan Gilbert
2020-07-03 16:02         ` Daniel P. Berrangé
2020-07-03 16:10           ` Dr. David Alan Gilbert
2020-07-03 16:16             ` Daniel P. Berrangé
2020-07-03 16:22               ` Dr. David Alan Gilbert
2020-07-03 16:49                 ` Daniel P. Berrangé
2020-07-03 17:00                   ` Dr. David Alan Gilbert
2020-07-03 17:10                     ` Daniel P. Berrangé
2020-07-03 17:26                       ` Dr. David Alan Gilbert [this message]
2020-07-03 16:24             ` Peter Krempa
2020-07-03 16:26               ` Dr. David Alan Gilbert
2020-07-06 16:15           ` Kevin Wolf
2020-07-07  6:38             ` Peter Krempa
2020-07-07 10:33               ` Kevin Wolf
2020-07-07 10:41                 ` Peter Krempa
2020-07-03 17:22   ` Denis V. Lunev
2020-07-02 17:57 ` [PATCH 3/6] block: add ability to filter out blockdevs during snapshot Daniel P. Berrangé
2020-07-02 17:57 ` [PATCH 4/6] block: allow specifying name of block device for vmstate storage Daniel P. Berrangé
2020-07-02 17:57 ` [PATCH 5/6] migration: support excluding block devs in QMP snapshot commands Daniel P. Berrangé
2020-07-06 15:57   ` Kevin Wolf
2020-07-07  9:14     ` Daniel P. Berrangé
2020-07-07 10:11       ` Kevin Wolf
2020-07-02 17:57 ` [PATCH 6/6] migration: support picking vmstate disk " Daniel P. Berrangé
2020-07-02 18:19   ` Eric Blake
2020-07-03  8:37     ` Daniel P. Berrangé
2020-07-02 18:53 ` [PATCH 0/6] migration: bring savevm/loadvm/delvm over to QMP no-reply
2020-07-02 19:07 ` no-reply
2020-07-03 17:15 ` Denis V. Lunev
2020-07-03 17:22   ` Daniel P. Berrangé
2020-07-03 17:29     ` Denis V. Lunev
2020-07-06 14:28       ` Daniel P. Berrangé
2020-07-06 16:07         ` Denis V. Lunev
2020-07-06 15:27       ` Kevin Wolf
2020-07-06 15:29         ` Daniel P. Berrangé
2020-07-06 15:50           ` Kevin Wolf
2020-07-06 16:03             ` Daniel P. Berrangé
2020-07-06 16:10               ` Denis V. Lunev
2020-07-06 16:15                 ` Daniel P. Berrangé
2020-07-06 16:21               ` Kevin Wolf
2020-07-07  9:07                 ` Daniel P. Berrangé

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=20200703172634.GL6641@work-vm \
    --to=dgilbert@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pavel.dovgaluk@ispras.ru \
    --cc=pbonzini@redhat.com \
    --cc=pkrempa@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@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.