All of lore.kernel.org
 help / color / mirror / Atom feed
* Qemu block filter insertion/removal API
@ 2021-05-17 12:44 Vladimir Sementsov-Ogievskiy
  2021-05-18 16:49 ` Max Reitz
  2021-05-19 11:44 ` Kevin Wolf
  0 siblings, 2 replies; 9+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2021-05-17 12:44 UTC (permalink / raw)
  To: qemu-block
  Cc: qemu-devel, Eric Blake, Stefan Hajnoczi, Kevin Wolf, Max Reitz,
	Denis V. Lunev, Nikolay Shirokovskiy, yur, Dmitry Mishin,
	Igor Sukhih, Peter Krempa, libvir-list

Hi all!

I'd like to be sure that we know where we are going to.

In blockdev-era where qemu user is aware about block nodes, all nodes have good names and controlled by user we can efficiently use block filters.

We already have some useful filters: copy-on-read, throttling, compress. In my parallel series I make backup-top filter public and useful without backup block jobs. But now filters could be inserted only together with opening their child. We can specify filters in qemu cmdline, or filter can take place in the block node chain created by blockdev-add.

Still, it would be good to insert/remove filters on demand.

Currently we are going to use x-blockdev-reopen for this. Still it can't be used to insert a filter above root node (as x-blockdev-reopen can change only block node options and their children). In my series "[PATCH 00/21] block: publish backup-top filter" I propose (as Kevin suggested) to modify qom-set, so that it can set drive option of running device. That's not difficult, but it means that we have different scenario of inserting/removing filters:

1. filter above root node X:

inserting:

   - do blockdev-add to add a filter (and specify X as its child)
   - do qom-set to set new filter as a rood node instead of X

removing

   - do qom-set to make X a root node again
   - do blockdev-del to drop a filter

2. filter between two block nodes P and X. (For example, X is a backing child of P)

inserting

   - do blockdev-add to add a filter (and specify X as its child)
   - do blockdev-reopen to set P.backing = filter

remvoing

   - do blockdev-reopen to set P.backing = X
   - do blockdev-del to drop a filter


And, probably we'll want transaction support for all these things.


Is it OK? Or do we need some kind of additional blockdev-replace command, that can replace one node by another, so in both cases we will do

inserting:
  
   - blockdev-add filter
   - blockdev-replace (make all parents of X to point to the new filter instead (except for the filter itself of course)

removing
   
   - blockdev-replace (make all parante of filter to be parents of X instead)
   - blockdev-del filter


It's simple to implement, and it seems for me that it is simpler to use. Any thoughts?

-- 
Best regards,
Vladimir


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

end of thread, other threads:[~2021-05-21 18:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-17 12:44 Qemu block filter insertion/removal API Vladimir Sementsov-Ogievskiy
2021-05-18 16:49 ` Max Reitz
2021-05-19  6:37   ` Vladimir Sementsov-Ogievskiy
2021-05-19 11:44 ` Kevin Wolf
2021-05-19 12:19   ` Vladimir Sementsov-Ogievskiy
2021-05-19 13:02     ` Kevin Wolf
2021-05-19 14:14       ` Vladimir Sementsov-Ogievskiy
2021-05-21 18:32         ` Vladimir Sementsov-Ogievskiy
2021-05-21 18:38           ` Vladimir Sementsov-Ogievskiy

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.