All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Richard W.M. Jones" <rjones@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: berrange@redhat.com, qemu-block@nongnu.org,
	qemu-devel@nongnu.org, ptoscano@redhat.com, marnold@redhat.com,
	mkletzan@redhat.com
Subject: Re: qemu-img convert vs writing another copy tool
Date: Thu, 23 Jan 2020 19:17:09 +0000	[thread overview]
Message-ID: <20200123191709.GM3888@redhat.com> (raw)
In-Reply-To: <ef3492f5-b1ab-52d2-9484-3c42e2b6af87@redhat.com>

On Thu, Jan 23, 2020 at 07:53:57PM +0100, Max Reitz wrote:
> On 23.01.20 19:35, Richard W.M. Jones wrote:
> >  - NBD multi-conn.  In my tests this makes a really massive
> >    performance difference in certain situations.  Again, virt-v2v has
> >    a lot of information that we cannot pass to qemu: we know, for
> >    example, exactly if the server supports the feature, how many
> >    threads are available, in some situations even have information
> >    about the network and backing disks that the data will travel over
> >    / be stored on.
> 
> As far as I understand it, you use qemu-img convert with an NBD source
> or target, too?

Virt-v2v has many modes, but yes generally there will be either an NBD
source & target, or an NBD source to a local file target.

> I suppose it’s always easier to let a specialized and freshly written
> tool handle such information.  But it sounds like if such information is
> useful and makes that big of a difference, then it would be good to be
> able to specify it to qemu’s NBD block driver, too.

qemu-img convert has worked really well for us, and I'm actually _not_
confident that I could do better with a specialized tool.  But there's
definitely more info we could pass, such as the amount of parallelism
we believe is available in the NBD server / processors / disks.

> >  - Machine-parsable progress bars.  You can, sort of, parse the
> >    progress bar from qemu-img convert, but it's not as easy as it
> >    could be.  In particular it would be nice if the format was treated
> >    as ABI, and if there was a way to have the tool write the progress
> >    bar info to a precreated file descriptor.
> 
> It doesn’t seem impossible to add this feature to qemu-img, although I
> wonder about the interface.  I suppose we could make it an alternative
> progress output mode (with some command-line flag), and then the
> information would be emitted to stdout (just like the existing progress
> report).  You can of course redirect stdout to whatever fd you’d like,
> so I don’t know whether qemu-img itself needs that specific capability.
> 
> OTOH, if you need this feature, why not just use qemu itself?  That is,
> a mirror or a backup block job in an otherwise empty VM.

I don't think we've really thought before about this approach.  Maybe
the launching of a VM (even an empty / stopped one) could be a
problem.  I guess this is what the new tool that was recently proposed
upstream might help with?  (Was it called qemu-block-storage?  I can't
find it right this minute)

> >  - External block lists.  This is a rather obscure requirement, but
> >    it's necessary in the case where we can get the allocated block map
> >    from another source (eg. pyvmomi) and then want to use that with an
> >    NBD source that does not support extents (eg. nbdkit-ssh-plugin /
> >    libssh / sftp).  [Having said that, it may be possible to implement
> >    this as an nbdkit filter, so maybe this is not a blocking feature.]
> 
> That too seems like a feature that’s easily implementable in a
> specialized tool, but hard to implement in qemu-img.
> 
> I suppose we’d want a dirty bitmap copy mode which copies only the
> regions that the bitmap reports as dirty – but at that point you’re
> probably again better off not using qemu-img, but qemu itself.  Then
> we’d need some way to import bitmaps, and I actually don’t think we have
> that yet.
> 
> But again, if this is a generally useful feature, I think we want it in
> qemu anyway.

I think this is actually one we can more easily implement as an nbdkit
filter.  I'm going to try this and see.

> > One thing which qemu-img convert can do which nbdcp could not:
> > 
> >  - Read or write from qcow2 files.
> > 
> > So instead of splitting the ecosystem and writing a new tool that
> > doesn't do as much as qemu-img convert, I wonder what qemu developers
> > think about the above missing features?  For example, are they in
> > scope for qemu-img convert?
> 
> What I think is that there may be features that we don’t want in
> qemu-img, because they are more appropriate for the mirror or backup
> block job.  For example, I don’t think we want to let qemu-img convert
> mess around with dirty bitmaps.
> 
> But apart from that, the features you propose all seem useful to have in
> qemu itself.  Maybe some of them are too hard to implement (specifically
> importing bitmaps from external sources), then it might be pragmatic to
> write a new tool where such features can be easily implemented because
> they don’t need to be integrated into an existing API.
> 
> As for performance, well, if qemu’s NBD driver is slow, then naively I’d
> think that’s a bug, isn’t it?  And if improving performance requires
> knobs, then that’s how it is.

Thanks,

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/



  reply	other threads:[~2020-01-23 19:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-23 18:35 qemu-img convert vs writing another copy tool Richard W.M. Jones
2020-01-23 18:53 ` Max Reitz
2020-01-23 19:17   ` Richard W.M. Jones [this message]
2020-01-24  5:45     ` Markus Armbruster
2020-01-23 19:21 ` Eric Blake
2020-01-24  9:55   ` Richard W.M. Jones
2020-01-24 13:49     ` Richard W.M. Jones

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=20200123191709.GM3888@redhat.com \
    --to=rjones@redhat.com \
    --cc=berrange@redhat.com \
    --cc=marnold@redhat.com \
    --cc=mkletzan@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=ptoscano@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.