From patchwork Wed Mar 14 01:20:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: junyan.he@hotmail.com X-Patchwork-Id: 10281343 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CD627601A0 for ; Wed, 14 Mar 2018 01:26:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD946285DE for ; Wed, 14 Mar 2018 01:26:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B2592285FE; Wed, 14 Mar 2018 01:26:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0A9A4285DE for ; Wed, 14 Mar 2018 01:26:08 +0000 (UTC) Received: from localhost ([::1]:43925 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evvB9-0005Ga-TS for patchwork-qemu-devel@patchwork.kernel.org; Tue, 13 Mar 2018 21:26:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evv5t-0000WK-4y for qemu-devel@nongnu.org; Tue, 13 Mar 2018 21:20:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evv5r-0006VX-RP for qemu-devel@nongnu.org; Tue, 13 Mar 2018 21:20:41 -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 1evv5r-0006Hx-F2 for qemu-devel@nongnu.org; Tue, 13 Mar 2018 21:20:39 -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:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,466,1515484800"; d="scan'208";a="38632868" 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:37 -0700 From: junyan.he@hotmail.com To: qemu-devel@nongnu.org Date: Wed, 14 Mar 2018 09:20:16 +0800 Message-Id: <1520990418-28258-9-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 08/10] RFC: Add a section_id parameter to save_live_iterate call. 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Junyan He We need to know the section_id when we do snapshot saving. Add a parameter to save_live_iterate function call. Signed-off-by: Junyan He --- hw/ppc/spapr.c | 2 +- hw/s390x/s390-stattrib.c | 2 +- include/migration/register.h | 2 +- migration/block.c | 2 +- migration/ram.c | 2 +- migration/savevm.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 7e1c858..4cde4f4 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1974,7 +1974,7 @@ static int htab_save_later_pass(QEMUFile *f, sPAPRMachineState *spapr, #define MAX_ITERATION_NS 5000000 /* 5 ms */ #define MAX_KVM_BUF_SIZE 2048 -static int htab_save_iterate(QEMUFile *f, void *opaque) +static int htab_save_iterate(QEMUFile *f, void *opaque, int section_id) { sPAPRMachineState *spapr = opaque; int fd; diff --git a/hw/s390x/s390-stattrib.c b/hw/s390x/s390-stattrib.c index adf07ef..18ece84 100644 --- a/hw/s390x/s390-stattrib.c +++ b/hw/s390x/s390-stattrib.c @@ -246,7 +246,7 @@ static int cmma_save(QEMUFile *f, void *opaque, int final) return ret; } -static int cmma_save_iterate(QEMUFile *f, void *opaque) +static int cmma_save_iterate(QEMUFile *f, void *opaque, int section_id) { return cmma_save(f, opaque, 0); } diff --git a/include/migration/register.h b/include/migration/register.h index f4f7bdc..7f7df2c 100644 --- a/include/migration/register.h +++ b/include/migration/register.h @@ -31,7 +31,7 @@ typedef struct SaveVMHandlers { * use data that is local to the migration thread or protected * by other locks. */ - int (*save_live_iterate)(QEMUFile *f, void *opaque); + int (*save_live_iterate)(QEMUFile *f, void *opaque, int section_id); /* This runs outside the iothread lock! */ int (*save_setup)(QEMUFile *f, void *opaque); diff --git a/migration/block.c b/migration/block.c index 1f03946..6d4c8a3 100644 --- a/migration/block.c +++ b/migration/block.c @@ -755,7 +755,7 @@ static int block_save_setup(QEMUFile *f, void *opaque) return ret; } -static int block_save_iterate(QEMUFile *f, void *opaque) +static int block_save_iterate(QEMUFile *f, void *opaque, int section_id) { int ret; int64_t last_ftell = qemu_ftell(f); diff --git a/migration/ram.c b/migration/ram.c index 3b6c077..d1db422 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2249,7 +2249,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque) * @f: QEMUFile where to send the data * @opaque: RAMState pointer */ -static int ram_save_iterate(QEMUFile *f, void *opaque) +static int ram_save_iterate(QEMUFile *f, void *opaque, int section_id) { RAMState **temp = opaque; RAMState *rs = *temp; diff --git a/migration/savevm.c b/migration/savevm.c index 3a9b904..ce4133a 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1072,7 +1072,7 @@ int qemu_savevm_state_iterate(QEMUFile *f, bool postcopy) save_section_header(f, se, QEMU_VM_SECTION_PART); - ret = se->ops->save_live_iterate(f, se->opaque); + ret = se->ops->save_live_iterate(f, se->opaque, se->section_id); trace_savevm_section_end(se->idstr, se->section_id, ret); save_section_footer(f, se);