From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJRoC-0001LB-7K for qemu-devel@nongnu.org; Thu, 27 Oct 2011 11:23:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RJRoA-0005NI-3V for qemu-devel@nongnu.org; Thu, 27 Oct 2011 11:23:56 -0400 Received: from mtagate1.uk.ibm.com ([194.196.100.161]:43228) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJRo9-0005DO-M0 for qemu-devel@nongnu.org; Thu, 27 Oct 2011 11:23:54 -0400 Received: from d06nrmr1307.portsmouth.uk.ibm.com (d06nrmr1307.portsmouth.uk.ibm.com [9.149.38.129]) by mtagate1.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p9RFN5bX024134 for ; Thu, 27 Oct 2011 15:23:05 GMT Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by d06nrmr1307.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p9RFN5ha2134190 for ; Thu, 27 Oct 2011 16:23:05 +0100 Received: from d06av03.portsmouth.uk.ibm.com (localhost.localdomain [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p9RFN4pR007636 for ; Thu, 27 Oct 2011 09:23:04 -0600 From: Stefan Hajnoczi Date: Thu, 27 Oct 2011 16:22:47 +0100 Message-Id: <1319728975-6069-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 0/8] block: generic image streaming List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Anthony Liguori , Marcelo Tosatti , Stefan Hajnoczi This series adds the 'block_stream' command which copies the contents of a backing file into the image file while the VM is running. The series builds on copy-on-read and zero detection features which I sent out recently and I suggest grabbing my git tree to try it out without merging these dependencies yourself: http://repo.or.cz/w/qemu/stefanha.git/shortlog/refs/heads/image-streaming-api The image streaming HMP/QMP commands are documented in the patch and also described here: http://wiki.qemu.org/Features/LiveBlockMigration/ImageStreamingAPI The basic idea is to execute 'block_stream virtio0' while the guest is running. Progress can be monitored using 'info block-jobs'. When the streaming operation completes it raises a QMP event. This series includes a Python test script called test-stream.py. When run in a QEMU source tree it performs basic image streaming QMP tests. TODO: * support 'base' argument for stream partial backing file chains * rate-limiting support, currently a NotSupported error is raised My plan is to add rate-limiting shortly but the 'base' argument will require more work later. I'm sending these patches out to share the general direction and let folks know what to expect as I continue to test this code. Stefan Hajnoczi (8): coroutine: add co_sleep_ns() coroutine sleep function block: add BlockJob interface for long-running operations block: add image streaming block job qmp: add block_stream command qmp: add block_job_set_speed command qmp: add block_job_cancel command qmp: add query-block-jobs test: add image streaming test cases Makefile.objs | 3 +- block/stream.c | 135 ++++++++++++++++++++++++++++++++ block_int.h | 98 +++++++++++++++++++++++ blockdev.c | 183 +++++++++++++++++++++++++++++++++++++++++++ blockdev.h | 8 ++ hmp-commands.hx | 45 +++++++++++ monitor.c | 19 +++++ monitor.h | 1 + qemu-coroutine-sleep.c | 38 +++++++++ qemu-coroutine.h | 6 ++ qerror.c | 4 + qerror.h | 3 + qmp-commands.hx | 173 +++++++++++++++++++++++++++++++++++++++++ test-stream.py | 200 ++++++++++++++++++++++++++++++++++++++++++++++++ trace-events | 10 +++ 15 files changed, 925 insertions(+), 1 deletions(-) create mode 100644 block/stream.c create mode 100644 qemu-coroutine-sleep.c create mode 100644 test-stream.py -- 1.7.7