From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpiwF-0004KU-O0 for qemu-devel@nongnu.org; Thu, 20 Jun 2013 13:46:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UpiwD-0001vH-Fe for qemu-devel@nongnu.org; Thu, 20 Jun 2013 13:46:27 -0400 Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:42820) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpiwD-0001uv-7E for qemu-devel@nongnu.org; Thu, 20 Jun 2013 13:46:25 -0400 Received: by mail-wi0-f182.google.com with SMTP id m6so1960035wiv.9 for ; Thu, 20 Jun 2013 10:46:24 -0700 (PDT) From: "=?UTF-8?q?Marc-Andr=C3=A9=20Lureau?=" Date: Thu, 20 Jun 2013 19:45:59 +0200 Message-Id: <1371750371-18491-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH 00/12] RFC: add Spice block device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: spice-devel@lists.freedesktop.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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. 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. The backend only support read-only device atm (although it shouldn't be hard to add write support if necessary). Migration hasn't been tested yet. 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-June/013609.html http://lists.freedesktop.org/archives/spice-devel/2013-June/013610.html Marc-André Lureau (12): include: add missing config-host.h include char: add qemu_chr_fe_event() nbd: don't change socket block during negotiate Split nbd block client code nbd: pass export name as init argument nbd: make session_close() idempotent block: save the associated child in BlockDriverState 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: add spice block device backend block.c | 191 ++++++++++------- block/Makefile.objs | 3 +- block/nbd-client.c | 391 ++++++++++++++++++++++++++++++++++ block/nbd-client.h | 51 +++++ block/nbd.c | 394 ++++------------------------------ block/spice.c | 523 ++++++++++++++++++++++++++++++++++++++++++++++ include/block/block_int.h | 1 + include/sysemu/char.h | 10 + include/ui/qemu-spice.h | 2 + nbd.c | 1 - qemu-char.c | 7 + spice-qemu-char.c | 10 + 12 files changed, 1151 insertions(+), 433 deletions(-) create mode 100644 block/nbd-client.c create mode 100644 block/nbd-client.h create mode 100644 block/spice.c -- 1.8.3.rc1.49.g8d97506