qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/21] RFCv2: add Spice block device
@ 2013-11-18 12:25 Marc-André Lureau
  2013-11-18 12:25 ` [Qemu-devel] [PATCH 01/21] vscclient: do not add a socket watch if there is not data to send Marc-André Lureau
                   ` (21 more replies)
  0 siblings, 22 replies; 28+ messages in thread
From: Marc-André Lureau @ 2013-11-18 12:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, jcody, Marc-André Lureau, kraxel, spice-devel

Hi,

The following patch series implement a Spice block device, which
allows the client to redirect a block device using the NBD protocol,
which greatly simplifies the Spice code by reusing an existing
protocol, and allows sharing existing qemu NBD implementation.

The backend only support read-only device atm (although it shouldn't
be hard to add write support if necessary)

Usage with a CDROM drive:
 -device ide-cd,drive=cd -drive if=none,id=cd,readonly,file=spicebd:

The associated server and client bits are:
http://lists.freedesktop.org/archives/spice-devel/2013-June/013608.html
http://lists.freedesktop.org/archives/spice-devel/2013-November/015452.html
http://lists.freedesktop.org/archives/spice-devel/2013-November/015431.html

Caveats: This block device driver is a bit special, since it is
successfully initialized with size 0, and once the client is connected
(or want to change block device) it re-opens itself. For this to work,
we allow a block driver to be open with an existing opaque data. We
also save the associate device name in the block drivers.

During migration, the source needs to be able to flush pending
operations, so the Spice channel context must be in a running loop. A
modification to the Spice server API allows to associate a particular
channel with the AIO loop, and may be used in the future to associate
channels with different context or athreads. However, the AIO context
doesn't have timers yet. Since they aren't really needed for the NBD
channel, it's not a problem. I have been told timers in AIO are on
their way, so this could be updated later.

Since the block driver state is not migrated, the destination needs to
wait until the block driver is initialized before the VM can run. This
is done with a simple hold count. It is also necessary to avoid extra
media changed notifications, which is easily done by checking
migration state.


Marc-André Lureau (21):
  vscclient: do not add a socket watch if there is not data to send
  spice-char: remove unused field
  qmp_change_blockdev() remove unused has_format
  include: add missing config-host.h include
  char: add qemu_chr_fe_event()
  Split nbd block client code
  nbd: don't change socket block during negotiate
  nbd: pass export name as init argument
  nbd: make session_close() idempotent
  nbd: finish any pending coroutine
  nbd: avoid uninitialized warnings
  block: save the associated child name in BlockDriverState
  blockdev: add qmp_change_blockdev_int()
  block: extract make_snapshot() from bdrv_open()
  block: add "snapshot.size" option to avoid extra bdrv_open()
  block: learn to open a driver with a given opaque
  block: allow to call bdrv_open() with an opaque
  block: do not notify change during migration
  sysemu: add vm_start_hold/release
  spice-core: allow an interface to be in AIO context
  block: add spice block device backend

 block.c                   | 225 ++++++++++++-------
 block/Makefile.objs       |   3 +-
 block/nbd-client.c        | 384 +++++++++++++++++++++++++++++++++
 block/nbd-client.h        |  50 +++++
 block/nbd.c               | 380 +++-----------------------------
 block/spicebd.c           | 536 ++++++++++++++++++++++++++++++++++++++++++++++
 blockdev.c                |  24 ++-
 hw/block/fdc.c            |   8 +-
 hw/ide/core.c             |  12 +-
 hw/scsi/scsi-disk.c       |  11 +-
 hw/sd/sd.c                |   6 +-
 include/block/block.h     |   2 +-
 include/block/block_int.h |   1 +
 include/sysemu/blockdev.h |   5 +-
 include/sysemu/char.h     |  10 +
 include/sysemu/sysemu.h   |   2 +
 include/ui/qemu-spice.h   |   4 +-
 libcacard/vscclient.c     |  10 +-
 nbd.c                     |   1 -
 qemu-char.c               |   9 +-
 qmp.c                     |   2 +-
 spice-qemu-char.c         |  20 +-
 stubs/vm-stop.c           |   5 +
 ui/spice-core.c           |  62 +++++-
 vl.c                      |  17 ++
 25 files changed, 1320 insertions(+), 469 deletions(-)
 create mode 100644 block/nbd-client.c
 create mode 100644 block/nbd-client.h
 create mode 100644 block/spicebd.c

-- 
1.8.3.1

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

end of thread, other threads:[~2013-11-29 10:30 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-18 12:25 [Qemu-devel] [PATCH 00/21] RFCv2: add Spice block device Marc-André Lureau
2013-11-18 12:25 ` [Qemu-devel] [PATCH 01/21] vscclient: do not add a socket watch if there is not data to send Marc-André Lureau
2013-11-18 12:25 ` [Qemu-devel] [PATCH 02/21] spice-char: remove unused field Marc-André Lureau
2013-11-18 12:25 ` [Qemu-devel] [PATCH 03/21] qmp_change_blockdev() remove unused has_format Marc-André Lureau
2013-11-18 12:25 ` [Qemu-devel] [PATCH 04/21] include: add missing config-host.h include Marc-André Lureau
2013-11-18 12:25 ` [Qemu-devel] [PATCH 05/21] char: add qemu_chr_fe_event() Marc-André Lureau
2013-11-18 12:36   ` Alon Levy
2013-11-18 12:25 ` [Qemu-devel] [PATCH 06/21] Split nbd block client code Marc-André Lureau
2013-11-18 12:25 ` [Qemu-devel] [PATCH 07/21] nbd: don't change socket block during negotiate Marc-André Lureau
2013-11-18 12:25 ` [Qemu-devel] [PATCH 08/21] nbd: pass export name as init argument Marc-André Lureau
2013-11-18 12:25 ` [Qemu-devel] [PATCH 09/21] nbd: make session_close() idempotent Marc-André Lureau
2013-11-18 12:25 ` [Qemu-devel] [PATCH 10/21] nbd: finish any pending coroutine Marc-André Lureau
2013-11-18 12:25 ` [Qemu-devel] [PATCH 11/21] nbd: avoid uninitialized warnings Marc-André Lureau
2013-11-18 12:25 ` [Qemu-devel] [PATCH 12/21] block: save the associated child name in BlockDriverState Marc-André Lureau
2013-11-18 12:25 ` [Qemu-devel] [PATCH 13/21] blockdev: add qmp_change_blockdev_int() Marc-André Lureau
2013-11-18 12:25 ` [Qemu-devel] [PATCH 14/21] block: extract make_snapshot() from bdrv_open() Marc-André Lureau
2013-11-18 12:25 ` [Qemu-devel] [PATCH 15/21] block: add "snapshot.size" option to avoid extra bdrv_open() Marc-André Lureau
2013-11-18 12:25 ` [Qemu-devel] [PATCH 16/21] block: learn to open a driver with a given opaque Marc-André Lureau
2013-11-18 12:25 ` [Qemu-devel] [PATCH 17/21] block: allow to call bdrv_open() with an opaque Marc-André Lureau
2013-11-18 12:25 ` [Qemu-devel] [PATCH 18/21] block: do not notify change during migration Marc-André Lureau
2013-11-18 12:25 ` [Qemu-devel] [PATCH 19/21] sysemu: add vm_start_hold/release Marc-André Lureau
2013-11-29 10:30   ` Paolo Bonzini
2013-11-18 12:25 ` [Qemu-devel] [PATCH 20/21] spice-core: allow an interface to be in AIO context Marc-André Lureau
2013-11-18 12:53   ` [Qemu-devel] [Spice-devel] " Alon Levy
2013-11-18 12:25 ` [Qemu-devel] [PATCH 21/21] block: add spice block device backend Marc-André Lureau
2013-11-20 11:00   ` Marc-André Lureau
2013-11-22 13:28 ` [Qemu-devel] [PATCH 00/21] RFCv2: add Spice block device Marc-André Lureau
2013-11-29  9:51   ` Gerd Hoffmann

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