All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Jeff Cody <jcody@redhat.com>
Cc: Michael Tokarev <mjt@tls.msk.ru>,
	qemu-devel <qemu-devel@nongnu.org>,
	qemu-block@nongnu.org
Subject: Re: [Qemu-devel] block-commit & dropping privs
Date: Tue, 7 Apr 2015 11:18:20 +0200	[thread overview]
Message-ID: <20150407091820.GD4635@noname.str.redhat.com> (raw)
In-Reply-To: <20150403035939.GD27096@localhost.localdomain>

Am 03.04.2015 um 05:59 hat Jeff Cody geschrieben:
> On Thu, Apr 02, 2015 at 01:24:02PM +0200, Kevin Wolf wrote:
> > Am 02.04.2015 um 12:58 hat Michael Tokarev geschrieben:
> > > When performing commit, does qemu mark the areas in the
> > > overlay file as free after writing contents to the backing
> > > file, or will these areas be written again by a subsequent
> > > commit?  Somehow it smells like each next commit writes
> > > more and more data and completes in more and more time.
> > 
> > With qcow2 and qcow, the committed data is discarded with HMP 'commit'.
> > Other image formats keep the copy.
> > 
> > Live commit always keeps the data in the parent image, but it drops that
> > image from the backing file chain, so effectively it is dropped as well
> > (but you need to remove the file manually to reclaim the space).
> > 
> > Jeff, this sounds like we need to make some changes to unify this. That
> > might mean introducing an option that decides whether an image should be
> > dropped from the chain or emptied.
> 
> Yes, I think this would be a good idea.  I can think of scenarios
> where we would want to keep the original overlay around (i.e., we
> still want a snapshot overlay, but just want to consolidate data).
> But I can't think of any reason we would want to keep a stale
> populated overlay file around.

Well, I can think of a reason, I just don't know if it's relevant in
practice. Imagine a remote backing file where the local file serves
mostly as a cache, perhaps with copy-on-read enabled. Dropping all the
local content just to copy it again on the next access wouldn't be very
useful.

> > Once live commit can provide the same
> > as HMP commit, we should change HMP commit to reuse the live commit
> > code.
> > 
> 
> Hmm. My concern here is there may be times we want the behavior that
> HMP commit provides - faster offline active layer commit, rather than
> a mirror-like operation.  I guess if we do want that behavior,
> however, we could always introduce it as an option to block-commit.
> So yes, let's provide an option to remove or empty the committed
> overlays (applies to all overlays, if there are multiple overlays
> being committed in the chain), and then have HMP commit reuse the live
> commit code.

HMP commit should behave similar enough to vm_stop(), start commit block
job, nested event loop until commit completes, vm_start().

Except maybe if there is already a block job running. You wouldn't be
able to commit then until we support multiple block jobs per device.
(And once we do, you probably want to pause all of the block jobs while
committing to retain the original HMP behaviour.)

Kevin

      reply	other threads:[~2015-04-07  9:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-27  9:07 [Qemu-devel] block-commit & dropping privs Michael Tokarev
2015-03-27 14:49 ` Eric Blake
2015-03-27 15:36   ` Michael Tokarev
2015-03-27 17:12     ` Eric Blake
2015-03-30 15:36       ` Kevin Wolf
2015-04-01  9:26         ` Michael Tokarev
2015-04-01  9:54           ` Michael Tokarev
2015-04-01 12:34             ` Kevin Wolf
2015-04-02 10:58               ` Michael Tokarev
2015-04-02 11:24                 ` Kevin Wolf
2015-04-02 12:04                   ` Michael Tokarev
2015-04-02 13:07                     ` Eric Blake
2015-04-03  4:28                       ` Jeff Cody
2015-04-03 19:49                         ` Eric Blake
2015-04-03 19:57                           ` Jeff Cody
2015-04-02 13:19                     ` Kevin Wolf
2015-04-06 15:37                       ` Michael Tokarev
2015-04-07  9:24                         ` Kevin Wolf
2015-04-03  3:59                   ` Jeff Cody
2015-04-07  9:18                     ` Kevin Wolf [this message]

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=20150407091820.GD4635@noname.str.redhat.com \
    --to=kwolf@redhat.com \
    --cc=jcody@redhat.com \
    --cc=mjt@tls.msk.ru \
    --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.