qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/13] QED image streaming
@ 2011-06-14 18:18 Stefan Hajnoczi
  2011-06-14 18:18 ` [Qemu-devel] [PATCH 01/13] qemu-config: }, { -> }, { to please checkpatch.pl Stefan Hajnoczi
                   ` (14 more replies)
  0 siblings, 15 replies; 43+ messages in thread
From: Stefan Hajnoczi @ 2011-06-14 18:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Anthony Liguori, Stefan Hajnoczi, Adam Litke

Overview
--------

This patch series adds image streaming support for QED image files.  Other
image formats can also be supported in the future.

Image streaming populates the file in the background while the guest is
running.  This makes it possible to start the guest before its image file has
been fully provisioned.

Example use cases include:
 * Providing small virtual appliances for download that can be launched
   immediately but provision themselves in the background.
 * Reducing guest provisioning time by creating local image files but backing
   them with shared master images which will be streamed.

When image streaming is enabled, the unallocated regions of the image file are
populated with the data from the backing file.  This occurs in the background
and the guest can perform regular I/O in the meantime.  Once the entire backing
file has been streamed, the image no longer requires a backing file and will
drop its reference.

Example invocation
------------------

$ # my_fedora.qed is a tiny file initially but will be streamed when the guest starts
$ ./qemu-img create -f qed -o backing_file=fedora-14.img my_fedora.qed
Formatting 'my_fedora.qed', fmt=qed size=10737418240 backing_file='fedora-14.img' cluster_size=0 table_size=0

$ # run the guest and stream fedora-14.img into my_fedora.qed
$ x86_64-softmmu/qemu-system-x86_64 -m 512 -enable-kvm -drive if=virtio,file=my_fedora.qed,cache=none,stream=on

Details on changes
------------------

Image streaming introduces a new bdrv_aio_copy_backing() interface.  Block
drivers that implement this interface support streaming.  This function scans
for an unallocated cluster and populates it with data from the backing file.

The details of populating the image file are actually best implemented as a
copy-on-read operation.  Copy-on-read means that a read request will populate
the image file if it needs to fetch data from the backing file.  The
copy-on-read feature can be used outside the context of streaming and this
patch series therefore introduces the -drive copy-on-read=on option for that
purpose.

Two new monitor interfaces are introduced: block_stream and query-block-stream.
They can be used to start streaming a block device and to poll progress.  QMP
events are raised on completion and failure so that polling is not required.
Adam Litke <agl@us.ibm.com> has implemented the libvirt APIs for image
streaming:
http://permalink.gmane.org/gmane.comp.emulators.libvirt/40080

Patches 1-2
qemu-config: },{ -> }, { to please checkpatch.pl
block: add -drive copy-on-read=on|off

  These patches add the -drive copy-on-read=on|off option although no block
  driver supports it yet.

Patches 3-7
qed: replace is_write with flags field
qed: extract qed_start_allocating_write()
qed: make qed_aio_write_alloc() reusable
qed: add support for copy-on-read
qed: avoid deadlock on emulated synchronous I/O

  These patches add copy-on-read support to the QED block driver.

Patches 8-11
qerror: add qerror_from_args() to create qerror objects
block: add bdrv_aio_copy_backing()
qmp: add QMP support for stream commands
block: add -drive stream=on|off

  These patches add the -drive stream=on|off and monitor commands for image
  streaming.

Patch 12
qed: intelligent streaming implementation

  This patch adds image streaming support to the QED block driver.

Patch 13
trace: trace bdrv_aio_readv/writev error paths

  This patch adds helpful trace events for block layer debugging.

v1:
 * -drive copy-on-read=on|off,stream=on|off instead of image header bits
 * Latest libvirt API compatibility
 * Workaround and assert for synchronous I/O emulation deadlock

Anthony Liguori (4):
  qed: add support for copy-on-read
  block: add bdrv_aio_copy_backing()
  qmp: add QMP support for stream commands
  qed: intelligent streaming implementation

Stefan Hajnoczi (9):
  qemu-config: },{ -> }, { to please checkpatch.pl
  block: add -drive copy-on-read=on|off
  qed: replace is_write with flags field
  qed: extract qed_start_allocating_write()
  qed: make qed_aio_write_alloc() reusable
  qed: avoid deadlock on emulated synchronous I/O
  qerror: add qerror_from_args() to create qerror objects
  block: add -drive stream=on|off
  trace: trace bdrv_aio_readv/writev error paths

 block.c         |   66 +++++++++-
 block.h         |    6 +
 block/qed.c     |  363 ++++++++++++++++++++++++++++++++++++++++++++++--------
 block/qed.h     |    8 +-
 block_int.h     |    3 +
 blockdev.c      |  286 +++++++++++++++++++++++++++++++++++++++++++
 blockdev.h      |    6 +
 hmp-commands.hx |   24 ++++-
 monitor.c       |   23 ++++
 monitor.h       |    1 +
 qemu-config.c   |  166 +++++++++++++------------
 qemu-options.hx |   12 ++-
 qerror.c        |   30 +++++
 qerror.h        |   12 ++
 qmp-commands.hx |   68 ++++++++++
 trace-events    |   10 ++-
 16 files changed, 940 insertions(+), 144 deletions(-)

-- 
1.7.5.3

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

end of thread, other threads:[~2011-06-27  9:13 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-14 18:18 [Qemu-devel] [PATCH 00/13] QED image streaming Stefan Hajnoczi
2011-06-14 18:18 ` [Qemu-devel] [PATCH 01/13] qemu-config: }, { -> }, { to please checkpatch.pl Stefan Hajnoczi
2011-06-14 18:18 ` [Qemu-devel] [PATCH 02/13] block: add -drive copy-on-read=on|off Stefan Hajnoczi
2011-06-14 18:18 ` [Qemu-devel] [PATCH 03/13] qed: replace is_write with flags field Stefan Hajnoczi
2011-06-14 18:18 ` [Qemu-devel] [PATCH 04/13] qed: extract qed_start_allocating_write() Stefan Hajnoczi
2011-06-14 18:18 ` [Qemu-devel] [PATCH 05/13] qed: make qed_aio_write_alloc() reusable Stefan Hajnoczi
2011-06-14 18:18 ` [Qemu-devel] [PATCH 06/13] qed: add support for copy-on-read Stefan Hajnoczi
2011-06-14 18:18 ` [Qemu-devel] [PATCH 07/13] qed: avoid deadlock on emulated synchronous I/O Stefan Hajnoczi
2011-06-14 18:18 ` [Qemu-devel] [PATCH 08/13] qerror: add qerror_from_args() to create qerror objects Stefan Hajnoczi
2011-06-14 18:18 ` [Qemu-devel] [PATCH 09/13] block: add bdrv_aio_copy_backing() Stefan Hajnoczi
2011-06-14 18:18 ` [Qemu-devel] [PATCH 10/13] qmp: add QMP support for stream commands Stefan Hajnoczi
2011-06-14 18:18 ` [Qemu-devel] [PATCH 11/13] block: add -drive stream=on|off Stefan Hajnoczi
2011-06-14 18:18 ` [Qemu-devel] [PATCH 12/13] qed: intelligent streaming implementation Stefan Hajnoczi
2011-06-14 18:18 ` [Qemu-devel] [PATCH 13/13] trace: trace bdrv_aio_readv/writev error paths Stefan Hajnoczi
2011-06-15 10:46 ` [Qemu-devel] [PATCH 00/13] QED image streaming Philipp Hahn
2011-06-15 12:18   ` Stefan Hajnoczi
2011-06-16 12:35 ` [Qemu-devel] Image streaming and live block copy (was: [PATCH 00/13] QED image streaming) Kevin Wolf
2011-06-16 12:49   ` [Qemu-devel] Image streaming and live block copy Avi Kivity
2011-06-16 13:08     ` Kevin Wolf
2011-06-16 13:38       ` Avi Kivity
2011-06-16 14:52       ` Marcelo Tosatti
2011-06-16 15:30         ` Stefan Hajnoczi
2011-06-17 12:31           ` Marcelo Tosatti
2011-06-18  9:15             ` Stefan Hajnoczi
2011-06-18  9:17               ` Stefan Hajnoczi
2011-06-19 16:02                 ` Dor Laor
2011-06-24  9:28                   ` Stefan Hajnoczi
2011-06-26 12:50                     ` Dor Laor
2011-06-27  7:48                       ` Kevin Wolf
2011-06-27  9:13                         ` Dor Laor
2011-06-17 13:54           ` Marcelo Tosatti
2011-06-17  8:36         ` Kevin Wolf
2011-06-17  8:57           ` Stefan Hajnoczi
2011-06-17  9:22             ` Kevin Wolf
2011-06-17 10:11               ` Stefan Hajnoczi
2011-06-17 12:21           ` Anthony Liguori
2011-06-17 13:04           ` Marcelo Tosatti
2011-06-17 13:50           ` Marcelo Tosatti
2011-06-16 13:10   ` Anthony Liguori
2011-06-16 13:50     ` Kevin Wolf
2011-06-16 14:38   ` [Qemu-devel] Image streaming and live block copy (was: [PATCH 00/13] QED image streaming) Marcelo Tosatti
2011-06-16 14:55     ` Marcelo Tosatti
2011-06-17  8:21     ` [Qemu-devel] Image streaming and live block copy 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).