qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Nir Soffer <nsoffer@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: Kevin Wolf <kwolf@redhat.com>, qemu-block <qemu-block@nongnu.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Max Reitz <mreitz@redhat.com>, John Snow <jsnow@redhat.com>,
	Markus Armbruster <armbru@redhat.com>
Subject: Re: [PATCH v5 2/5] qcow2: Expose bitmaps' size during measure
Date: Thu, 21 May 2020 16:29:42 +0300	[thread overview]
Message-ID: <CAMRbyyvrYmhh9OK+6-nBVs1wqbHruYTq7Stn8iBZ17a_V_4wkQ@mail.gmail.com> (raw)
In-Reply-To: <295f514d-f4c8-551a-d828-77a70b4d6fa3@virtuozzo.com>

On Thu, May 21, 2020 at 2:40 PM Vladimir Sementsov-Ogievskiy
<vsementsov@virtuozzo.com> wrote:
>
> 21.05.2020 02:00, Nir Soffer wrote:
> > On Thu, May 21, 2020 at 1:01 AM Eric Blake <eblake@redhat.com> wrote:
> >>
> >> It's useful to know how much space can be occupied by qcow2 persistent
> >> bitmaps, even though such metadata is unrelated to the guest-visible
> >> data.  Report this value as an additional QMP field, present when
> >> measuring an existing image and output format that both support
> >> bitmaps.  Update iotest 178 and 190 to updated output, as well as new
> >> coverage in 190 demonstrating non-zero values made possible with the
> >> recently-added qemu-img bitmap command.
> >>
> >> On the command-line side, 'qemu-img measure' gains a new --bitmaps
> >> flag.  When present, the bitmap size is rolled into the two existing
> >> measures (or errors if either the source image or destination format
> >> lacks bitmaps); when absent, there is never an error (for
> >> back-compat), but the output will instead include a new line item for
> >> bitmaps (which you would have to manually add), with that line being
> >> omitted in the same cases where passing --bitmaps would error.
> >
> > Supporting 2 ways to measure, one by specifying --bitmaps, and another
> > by adding bitmaps key is not a good idea. We really need one way.
> >
> > Each one has advantages. adding --bitmaps flag is consistent with
> > "qemu-img convert"
> > and future extensions that may require  new flag, and adding "bitmaps"
> > key is consistent
> > with "qmeu-img info", showing bitmaps when they exist.
> >
> > Adding a "bitmaps" key has an advantage that we can use it to test if qemu-img
> > supports measuring and copying bitmaps (since both features are expected to
> > be delivered at the same time). So we can avoid checking --help learn about
> > the capabilities.
> >
> > I'm ok with both options, can we have only one?
>
> Hi! What are your scenarios? Are you using qemu-img by hand, or it is used from some management tool? For management tool, I'd recommend to use qmp interface, which is a lot more strict, reliable and stable, and documented. You just need to run qemu binary in stopped mode for it.

The use case is oVirt - it is a management system but it uses qemu-img
to perform various
operations, like copying disks around. The specific use case is
cloning qcow2 image chain
from one server to another, or cloning on the same server.

In the case of qcow2 images on logical volumes, we need to create a
large enough  logical
volume to copy an image, and for this we use "qemu-img measure". With
the current patches
we will be able to create large enough logical volume and copy the
image data and the bitmps
to the destination.

qmp interface is nice but to use it we have to rewrite all the code
using qemu-img to start qemu
with the relevant disks and perform operation via qmp or via libvirt.
This a huge rewrite and I'm
not sure it's worth the effort.

This approach also has limitations, for example using qemu-img we can
copy disks in parallel on
multiple hosts, while using libvirt and qemu will limit us to using
one host since qemu takes locks
that we control.

Also using libvirt means that all new features take more time to
complete since now we have
a new layer between oVirt and qemu.



  reply	other threads:[~2020-05-21 13:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-20 22:01 [PATCH v5 0/5] qemu-img: Add convert --bitmaps Eric Blake
2020-05-20 22:01 ` [PATCH v5 1/5] iotests: Fix test 178 Eric Blake
2020-05-21 11:31   ` Vladimir Sementsov-Ogievskiy
2020-05-20 22:01 ` [PATCH v5 2/5] qcow2: Expose bitmaps' size during measure Eric Blake
2020-05-20 23:00   ` Nir Soffer
2020-05-21 11:40     ` Vladimir Sementsov-Ogievskiy
2020-05-21 13:29       ` Nir Soffer [this message]
2020-05-21 15:09         ` Vladimir Sementsov-Ogievskiy
2020-05-21 16:28           ` Nir Soffer
2020-05-21 13:08     ` Eric Blake
2020-05-21 13:17       ` Nir Soffer
2020-05-21 13:29         ` Eric Blake
2020-05-20 22:01 ` [PATCH v5 3/5] qemu-img: Factor out code for merging bitmaps Eric Blake
2020-05-20 22:01 ` [PATCH v5 4/5] qemu-img: Add convert --bitmaps option Eric Blake
2020-05-21 15:11   ` Nir Soffer
2020-05-21 15:19     ` Eric Blake
2020-05-20 22:01 ` [PATCH v5 5/5] iotests: Add test 291 to for qemu-img bitmap coverage Eric Blake

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=CAMRbyyvrYmhh9OK+6-nBVs1wqbHruYTq7Stn8iBZ17a_V_4wkQ@mail.gmail.com \
    --to=nsoffer@redhat.com \
    --cc=armbru@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).