From patchwork Wed Mar 14 01:20:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junyan He X-Patchwork-Id: 885561 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=hotmail.com Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 401DSv5GGFz9sTy for ; Wed, 14 Mar 2018 12:21:18 +1100 (AEDT) Received: from localhost ([::1]:43893 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evv6Q-0000Mf-Nv for incoming@patchwork.ozlabs.org; Tue, 13 Mar 2018 21:21:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evv5g-0000Ll-UK for qemu-devel@nongnu.org; Tue, 13 Mar 2018 21:20:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evv5c-0006KH-GI for qemu-devel@nongnu.org; Tue, 13 Mar 2018 21:20:28 -0400 Received: from mga18.intel.com ([134.134.136.126]:28906) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1evv5c-0006Hx-45 for qemu-devel@nongnu.org; Tue, 13 Mar 2018 21:20:24 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Mar 2018 18:20:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,466,1515484800"; d="scan'208";a="38632785" Received: from natrouter.sh.intel.com (HELO robinhe-hp.domain) ([10.239.13.3]) by orsmga001.jf.intel.com with ESMTP; 13 Mar 2018 18:20:21 -0700 From: junyan.he@hotmail.com To: qemu-devel@nongnu.org Date: Wed, 14 Mar 2018 09:20:09 +0800 Message-Id: <1520990418-28258-2-git-send-email-junyan.he@hotmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520990418-28258-1-git-send-email-junyan.he@hotmail.com> References: <1520990418-28258-1-git-send-email-junyan.he@hotmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.126 Subject: [Qemu-devel] [PATCH 01/10] RFC: Add save and support snapshot dependency function to block driver. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, famz@redhat.com, crosthwaite.peter@gmail.com, quintela@redhat.com, dgilbert@redhat.com, mreitz@redhat.com, Junyan He , pbonzini@redhat.com, rth@twiddle.net Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Junyan He We want to support incremental snapshot saving, this needs the file system support dependency saving. Later snapshots may ref the dependent snapshot's content, and most time should be cluster aligned. Add a query function to check whether the file system support this, and use the save_dependency function to do the real work. Signed-off-by: Junyan He --- include/block/block_int.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/block/block_int.h b/include/block/block_int.h index 64a5700..be1eca3 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -274,6 +274,15 @@ struct BlockDriver { const char *snapshot_id, const char *name, Error **errp); + int (*bdrv_snapshot_save_dependency)(BlockDriverState *bs, + const char *depend_snapshot_id, + int64_t depend_offset, + int64_t depend_size, + int64_t offset, + Error **errp); + int (*bdrv_snapshot_support_dependency)(BlockDriverState *bs, + int32_t *alignment); + int (*bdrv_get_info)(BlockDriverState *bs, BlockDriverInfo *bdi); ImageInfoSpecific *(*bdrv_get_specific_info)(BlockDriverState *bs);