All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC] Intermediate block mirroring
@ 2018-04-12 17:07 Alberto Garcia
  2018-04-13 14:23 ` Max Reitz
  0 siblings, 1 reply; 21+ messages in thread
From: Alberto Garcia @ 2018-04-12 17:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-block, Kevin Wolf, Max Reitz, Eric Blake, Stefan Hajnoczi

Hello,

I mentioned this some time ago, but I'd like to retake it now: I'm
checking how to copy arbitrary nodes on a backing chain, so if I have
e.g.

   [A] <- [B] <- [C] <- [D]

I'd like to end up with

   [A] <- [E] <- [C] <- [D]

where [E] is a copy of [B]. The most obvious use case is to move [B]
to a different storage backend.

At the moment we can already copy [B] into [E] (outside QEMU) and then
do

   change-backing-file device=[D] image-node-name=[C] backing-file=[E]

However this only changes the image on disk and the bs->backing_file
string in memory. QEMU keeps using the [B] BlockDriverState, and we
need to make it switch to [E].

One possible way to do this would be to modify blockdev-mirror so the
source image can be located anywhere on a chain. Currently there's
bs->backing_blocker preventing that, plus qmp_blockdev_mirror()
refuses to take any non-root source node. Other than permission
changes I don't think the algorithm itself needs any additional
modification, although I suppose we'd like to change the backing file
as part of the same job, and that would require API changes.

One other way is to have a more generic replace-node command which
would call bdrv_replace_node(), but I don't know if we want to expose
that and I don't have any other use case for it at the moment.

Opinions, comments?

Berto

^ permalink raw reply	[flat|nested] 21+ messages in thread
* [Qemu-devel] [RFC] Intermediate block mirroring
@ 2015-04-02 13:28 Alberto Garcia
  2015-04-02 16:56 ` Eric Blake
  0 siblings, 1 reply; 21+ messages in thread
From: Alberto Garcia @ 2015-04-02 13:28 UTC (permalink / raw)
  To: qemu-devel, qemu-block

Hi,

I'm interested in adding the possibility to mirror an intermediate
node in a disk image chain, but I would like to have some feedback
before sending any patches.

The goal would be to convert this:

   [A] -> [B] -> [C] -> [D]

into this:

   [A] -> [B] -> [X] -> [D]

where [D] is the active image and [X] would be a copy of [C]. The
latter would be unlinked from the chain.

A use case would be to move disk images across different storage
backends.

My idea is to extend the drive-mirror command. Similar to what we
discussed in the case of the intermediate block streaming, I can reuse
the 'device' parameter to refer to a node name. So the API doesn't
need any changes other than the extended semantics for this parameter.

One difference with the current functionality is that once the block
job is completed, the node above the mirrored one would have to change
its backing image to point to the new one. One solution is to iterate
over all devices (bdrv_next()) and check which ones are connected
directly or indirectly to the mirrored node (bdrv_find_overlay()).

drive-mirror has three different sync modes: top, full and none. This
would be the chain from the example using each one of these modes:

  top:

     [A] -> [B] -> [X] -> [D]

  full:

     [X] -> [D]

  none:

     [A] -> [B] -> [C] -> [X] -> [D]

My understanding is that in the 'sync=full' case, [A] and [B] would
also need to be blocked during the operation since they are going to
disappear from the chain.

I have some code and in principle everything seems to be working fine,
but I'd like to test it a bit more.

What's anyway your opinion about this proposal?

Thanks,

Berto

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2018-06-11 12:24 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-12 17:07 [Qemu-devel] [RFC] Intermediate block mirroring Alberto Garcia
2018-04-13 14:23 ` Max Reitz
2018-04-16 14:59   ` Alberto Garcia
2018-04-16 15:15     ` Max Reitz
2018-04-18 15:34       ` Alberto Garcia
2018-04-20 13:13         ` Max Reitz
2018-04-25 12:58           ` Alberto Garcia
2018-04-25 13:06             ` Max Reitz
2018-04-25 13:42               ` Alberto Garcia
2018-04-25 14:03                 ` Max Reitz
2018-05-02 13:07                   ` Alberto Garcia
2018-05-02 14:12                     ` Max Reitz
2018-05-03 10:32                       ` Alberto Garcia
2018-05-03 12:22                       ` Kevin Wolf
2018-05-03 12:33                         ` Alberto Garcia
2018-05-09 14:22                         ` Alberto Garcia
2018-06-01 10:51                         ` Alberto Garcia
2018-06-11 12:20                           ` Kevin Wolf
2018-06-11 12:23                             ` Alberto Garcia
  -- strict thread matches above, loose matches on Subject: below --
2015-04-02 13:28 Alberto Garcia
2015-04-02 16:56 ` Eric Blake

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.