qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 00/14] blockdev: Further BlockBackend work
@ 2016-02-16 18:08 Max Reitz
  2016-02-16 18:08 ` [Qemu-devel] [PATCH v3 01/14] monitor: Use BB list for BB name completion Max Reitz
                   ` (14 more replies)
  0 siblings, 15 replies; 39+ messages in thread
From: Max Reitz @ 2016-02-16 18:08 UTC (permalink / raw)
  To: qemu-block
  Cc: Kevin Wolf, Markus Armbruster, qemu-devel, Stefan Hajnoczi,
	Max Reitz

At this point, the main merit of this series is to remove
blk_hide_on_behalf_of_hmp_drive_del() and the bdrv_states list. A
follow-up to it will make bdrv_open() return a BDS pointer.


v3:
It certainly feels like pretty much a rewrite, and git-backport-diff
thinks so, too.

The general idea was to be less strict about making everyone use
blk_next() instead of bdrv_next(), which is for instance why patch 4
shrunk by a lot. Also, some functions do not make any sense on the BB
level (such as blk_invalidate_cache_all()), so they are no longer added
here.

I'll try my best to give a patch-by-patch diff (patch indices are given
as [this series]/[last series]):
- Patch  1/4: I split the original patch 4 into multiple patches and
              dropped the largest portion. This is the first patch of
              what is left.
- Patch  2/4: Second part of the original patch 4.
- Patch  3/-: Added, because it's needed for patch 11. Comes so early
              because we can use it in patches 4 and 9, too.
- Patch  4/1: Use blk_all_next() instead of QTAILQ_FOREACH() over
              blk_backends.
- Patch  -/2: Dropped. With all the modifications, I did not have any
              user left.
- Patch  5/3: blk_invalidate_cache_all() is no longer added by this
              series [Kevin], so this patch does not need to add it; it
              only needs to add blk_commit_all().
- Patch  6/4: Third and final part of the original patch 4.
- Patch  7/5: Actually pretty much unchanged, there is only a contextual
              conflict because blk_next_inserted() is missing now which
              git-backport-diff decided to consider a functional
              conflict.
- Patch  8/6: Unchanged, except I updated the comment in hmp_drive_del()
              now.
- Patch  9/7: Only bdrv_commit_all() and bdrv_flush_all() are moved;
              bdrv_invalidate_cache_all() and bdrv_drain_all() are kept
              where they are. [Kevin]
- Patch 10/-: Added, because it's needed for patch 12.
- Patch 11/-: Added, because it's needed for patch 12.
- Patch 12/-: Because we have to keep bdrv_invalidate_cache_all() and
              bdrv_drain_all() on the root BDS level, we will have to
              keep some form of bdrv_next(). Managing bdrv_states is
              ugly and error-prone, though, so it would be nicer if
              all root BDSs were visible through bdrv_next() without
              having to explicitly register them in a special list. This
              patch rewrites bdrv_next() so it iterates over all
              BB-attached and all monitor-owned BDSs, which I hope are
              then all the root BDSs we need.
- Patch 13/-: Now I decided to keep bdrv_next() but still remove
              bdrv_states, so this patch makes the remaining users of
              bdrv_states use bdrv_next() and thus makes patch 14
              possible.
- Patch 14/8: Rebase conflicts and no longer removes bdrv_next().


For the sake of completeness, here is the backport-diff against v2:

Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch
[down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively

001/14:[down] 'monitor: Use BB list for BB name completion'
002/14:[down] 'block: Use blk_next() where appropriate'
003/14:[down] 'block: Add blk_all_next()'
004/14:[0004] [FC] 'block: Add blk_name_taken()'
005/14:[down] 'block: Add blk_commit_all()'
006/14:[down] 'block: Use blk_{commit,flush}_all() consistently'
007/14:[0006] [FC] 'blockdev: Add list of monitor-owned BlockBackends'
008/14:[0006] [FC] 'blockdev: Remove blk_hide_on_behalf_of_hmp_drive_del()'
009/14:[0204] [FC] 'block: Move some bdrv_*_all() functions to BB'
010/14:[down] 'block: Add bdrv_next_monitor_owned()'
011/14:[down] 'block: Add blk_next_root_bs()'
012/14:[down] 'block: Rewrite bdrv_next()'
013/14:[down] 'block: Use bdrv_next() instead of bdrv_states'
014/14:[down] 'block: Remove bdrv_states list'


Max Reitz (14):
  monitor: Use BB list for BB name completion
  block: Use blk_next() where appropriate
  block: Add blk_all_next()
  block: Add blk_name_taken()
  block: Add blk_commit_all()
  block: Use blk_{commit,flush}_all() consistently
  blockdev: Add list of monitor-owned BlockBackends
  blockdev: Remove blk_hide_on_behalf_of_hmp_drive_del()
  block: Move some bdrv_*_all() functions to BB
  block: Add bdrv_next_monitor_owned()
  block: Add blk_next_root_bs()
  block: Rewrite bdrv_next()
  block: Use bdrv_next() instead of bdrv_states
  block: Remove bdrv_states list

 block.c                                       |  84 ++++---------
 block/block-backend.c                         | 171 ++++++++++++++++++++------
 block/io.c                                    |  20 ---
 blockdev.c                                    |  31 +++--
 cpus.c                                        |   5 +-
 include/block/block.h                         |   4 +-
 include/block/block_int.h                     |   4 -
 include/sysemu/block-backend.h                |   7 +-
 monitor.c                                     |   7 +-
 qemu-char.c                                   |   3 +-
 stubs/Makefile.objs                           |   3 +-
 stubs/bdrv-next-monitor-owned.c               |   6 +
 stubs/{bdrv-commit-all.c => blk-commit-all.c} |   4 +-
 13 files changed, 203 insertions(+), 146 deletions(-)
 create mode 100644 stubs/bdrv-next-monitor-owned.c
 rename stubs/{bdrv-commit-all.c => blk-commit-all.c} (53%)

-- 
2.7.1

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

end of thread, other threads:[~2016-02-24 15:25 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-16 18:08 [Qemu-devel] [PATCH v3 00/14] blockdev: Further BlockBackend work Max Reitz
2016-02-16 18:08 ` [Qemu-devel] [PATCH v3 01/14] monitor: Use BB list for BB name completion Max Reitz
2016-02-17 10:09   ` Kevin Wolf
2016-02-17 15:35     ` Max Reitz
2016-02-16 18:08 ` [Qemu-devel] [PATCH v3 02/14] block: Use blk_next() where appropriate Max Reitz
2016-02-16 18:08 ` [Qemu-devel] [PATCH v3 03/14] block: Add blk_all_next() Max Reitz
2016-02-16 18:08 ` [Qemu-devel] [PATCH v3 04/14] block: Add blk_name_taken() Max Reitz
2016-02-17 10:29   ` Kevin Wolf
2016-02-17 15:36     ` Max Reitz
2016-02-16 18:08 ` [Qemu-devel] [PATCH v3 05/14] block: Add blk_commit_all() Max Reitz
2016-02-16 18:08 ` [Qemu-devel] [PATCH v3 06/14] block: Use blk_{commit, flush}_all() consistently Max Reitz
2016-02-16 18:08 ` [Qemu-devel] [PATCH v3 07/14] blockdev: Add list of monitor-owned BlockBackends Max Reitz
2016-02-17 10:53   ` Kevin Wolf
2016-02-17 15:41     ` Max Reitz
2016-02-17 16:20       ` Kevin Wolf
2016-02-20 13:34         ` Max Reitz
2016-02-20 13:36           ` Max Reitz
2016-02-22  8:24           ` Markus Armbruster
2016-02-22 16:29             ` Max Reitz
2016-02-23  9:48               ` Markus Armbruster
2016-02-23 13:52                 ` Max Reitz
2016-02-23 14:10                   ` Kevin Wolf
2016-02-24  9:28                   ` Markus Armbruster
2016-02-24  9:56                     ` Kevin Wolf
2016-02-24 15:25                     ` Max Reitz
2016-02-16 18:08 ` [Qemu-devel] [PATCH v3 08/14] blockdev: Remove blk_hide_on_behalf_of_hmp_drive_del() Max Reitz
2016-02-17 14:18   ` Kevin Wolf
2016-02-17 15:47     ` Max Reitz
2016-02-17 16:22       ` Kevin Wolf
2016-02-16 18:08 ` [Qemu-devel] [PATCH v3 09/14] block: Move some bdrv_*_all() functions to BB Max Reitz
2016-02-17 15:51   ` Kevin Wolf
2016-02-20 13:46     ` Max Reitz
2016-02-16 18:08 ` [Qemu-devel] [PATCH v3 10/14] block: Add bdrv_next_monitor_owned() Max Reitz
2016-02-16 18:08 ` [Qemu-devel] [PATCH v3 11/14] block: Add blk_next_root_bs() Max Reitz
2016-02-17 16:06   ` Kevin Wolf
2016-02-16 18:08 ` [Qemu-devel] [PATCH v3 12/14] block: Rewrite bdrv_next() Max Reitz
2016-02-16 18:08 ` [Qemu-devel] [PATCH v3 13/14] block: Use bdrv_next() instead of bdrv_states Max Reitz
2016-02-16 18:08 ` [Qemu-devel] [PATCH v3 14/14] block: Remove bdrv_states list Max Reitz
2016-02-17 16:12 ` [Qemu-devel] [PATCH v3 00/14] blockdev: Further BlockBackend work Kevin Wolf

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).