Received: from eggs.gnu.org ([2001:4830:134:3::10]:54764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3f22-0005P2-14 for qemu-devel@nongnu.org; Mon, 29 Jul 2013 00:26:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3f1w-0005wZ-2t for qemu-devel@nongnu.org; Mon, 29 Jul 2013 00:26:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16359) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3f1v-0005wI-RO for qemu-devel@nongnu.org; Mon, 29 Jul 2013 00:25:56 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6T4Prxl011060 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 29 Jul 2013 00:25:54 -0400 From: Fam Zheng Date: Mon, 29 Jul 2013 12:25:28 +0800 Message-Id: <1375071932-31627-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [RFC PATCH 0/4] hmp/qmp: add snapshot option to nbd export List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, famz@redhat.com, imain@redhat.com, stefanha@redhat.com, pbonzini@redhat.com This implements another way of doing image fleecing: (HMP) nbd_server_add -s drive0 or (QMP) nbd-server-add device=drive0 snapshot=on It is one convenient command that starts drive-backup job on device for doing COW to a newly created temporary image, we don't need manually creating image, adding drive or overriding backing_hd of the target. The target_bs is internal to nbd-server-add implementation and the export is deleted when block job is cancelled or completed. Fam Zheng (4): block/backup: delete target after completion callback nbd: call drive_put_ref() only if dinfo exists qmp: Add "snapshot=" option to nbd-server-add hmp: add -s switch to nbd_server_add block/backup.c | 2 +- blockdev-nbd.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- hmp-commands.hx | 4 +-- hmp.c | 7 +++-- qapi-schema.json | 3 ++- qmp-commands.hx | 2 +- 6 files changed, 89 insertions(+), 10 deletions(-) -- 1.8.3.4