qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/10] block: replace .bdrv_is_allocated() with .bdrv_co_is_allocated()
@ 2011-11-11 16:47 Stefan Hajnoczi
  2011-11-11 16:47 ` [Qemu-devel] [PATCH 01/10] block: use public bdrv_is_allocated() interface Stefan Hajnoczi
                   ` (9 more replies)
  0 siblings, 10 replies; 20+ messages in thread
From: Stefan Hajnoczi @ 2011-11-11 16:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Paolo Bonzini, Marcelo Tosatti, Stefan Hajnoczi

The bdrv_is_allocated() interface is not suitable for use while the VM is
running.  It is a synchronous interface so it may block the running VM for
arbitrary amounts of time.  It also assumes it is the only block driver
operation and there is a risk that internal state could be corrupted if
asynchronous I/O is currently pending.

This patch series refactors the block layer so that the bdrv_is_allocated()
operation is performed internally in coroutine context.  We can then introduce
a new public bdrv_co_is_allocated() function that is suitable for use when the
VM is running.

Making these changes without breaking git bisect means we need to first
introduce BlockDriver .bdrv_co_is_allocated() and add wrapper code into
bdrv_is_allocated() so existing callers can use converted BlockDrivers.

After converting all block drivers there are no .bdrv_is_allocated() functions
left and the interface can be removed from BlockDriver.

Finally, we can add the new public bdrv_co_is_allocated() public interface and
turn the old bdrv_is_allocated() into a wrapper.

This series is a prerequisite for copy-on-read, which needs to check whether
sectors are allocated while the VM is running.

Stefan Hajnoczi (10):
  block: use public bdrv_is_allocated() interface
  block: add .bdrv_co_is_allocated()
  qed: convert to .bdrv_co_is_allocated()
  block: convert qcow2, qcow2, and vmdk to .bdrv_co_is_allocated()
  vvfat: use public block layer interface
  vvfat: convert to .bdrv_co_is_allocated()
  vdi: convert to .bdrv_co_is_allocated()
  cow: convert to .bdrv_co_is_allocated()
  block: drop .bdrv_is_allocated() interface
  block: add bdrv_co_is_allocated() interface

 block.c       |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++-----
 block.h       |    2 +
 block/cow.c   |    8 +++---
 block/qcow.c  |    8 ++++--
 block/qcow2.c |   13 +++++++----
 block/qed.c   |   15 ++++++++++---
 block/vdi.c   |    6 ++--
 block/vmdk.c  |    8 ++++--
 block/vvfat.c |   19 +++++++----------
 block_int.h   |    4 +-
 10 files changed, 100 insertions(+), 41 deletions(-)

-- 
1.7.7.1

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

end of thread, other threads:[~2011-11-14 11:47 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-11 16:47 [Qemu-devel] [PATCH 00/10] block: replace .bdrv_is_allocated() with .bdrv_co_is_allocated() Stefan Hajnoczi
2011-11-11 16:47 ` [Qemu-devel] [PATCH 01/10] block: use public bdrv_is_allocated() interface Stefan Hajnoczi
2011-11-11 16:47 ` [Qemu-devel] [PATCH 02/10] block: add .bdrv_co_is_allocated() Stefan Hajnoczi
2011-11-14  3:04   ` Zhi Yong Wu
2011-11-14  7:32     ` Paolo Bonzini
2011-11-14  8:10       ` Zhi Yong Wu
2011-11-14  8:37         ` Paolo Bonzini
2011-11-14  8:53           ` Zhi Yong Wu
2011-11-14  8:50     ` Kevin Wolf
2011-11-14  8:50       ` Zhi Yong Wu
2011-11-11 16:47 ` [Qemu-devel] [PATCH 03/10] qed: convert to .bdrv_co_is_allocated() Stefan Hajnoczi
2011-11-11 16:47 ` [Qemu-devel] [PATCH 04/10] block: convert qcow2, qcow2, and vmdk " Stefan Hajnoczi
2011-11-11 16:47 ` [Qemu-devel] [PATCH 05/10] vvfat: use public block layer interface Stefan Hajnoczi
2011-11-11 16:59   ` Kevin Wolf
2011-11-14 11:47     ` Stefan Hajnoczi
2011-11-11 16:47 ` [Qemu-devel] [PATCH 06/10] vvfat: convert to .bdrv_co_is_allocated() Stefan Hajnoczi
2011-11-11 16:47 ` [Qemu-devel] [PATCH 07/10] vdi: " Stefan Hajnoczi
2011-11-11 16:47 ` [Qemu-devel] [PATCH 08/10] cow: " Stefan Hajnoczi
2011-11-11 16:47 ` [Qemu-devel] [PATCH 09/10] block: drop .bdrv_is_allocated() interface Stefan Hajnoczi
2011-11-11 16:47 ` [Qemu-devel] [PATCH 10/10] block: add bdrv_co_is_allocated() interface Stefan Hajnoczi

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