From nobody Tue Feb 10 09:01:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1532004876696768.847907334175; Thu, 19 Jul 2018 05:54:36 -0700 (PDT) Received: from localhost ([::1]:42100 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fg7wy-0006kR-38 for importer@patchew.org; Thu, 19 Jul 2018 08:22:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fg7qi-0002Cz-9e for qemu-devel@nongnu.org; Thu, 19 Jul 2018 08:16:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fg7qh-0005Th-7G for qemu-devel@nongnu.org; Thu, 19 Jul 2018 08:16:00 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:40342) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fg7qh-0005TE-0u for qemu-devel@nongnu.org; Thu, 19 Jul 2018 08:15:59 -0400 Received: by mail-pg1-x52e.google.com with SMTP id x5-v6so3581247pgp.7 for ; Thu, 19 Jul 2018 05:15:58 -0700 (PDT) Received: from localhost.localdomain ([203.205.141.37]) by smtp.gmail.com with ESMTPSA id h190-v6sm21270456pge.85.2018.07.19.05.15.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Jul 2018 05:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=O4pS8gEbytTb3R6OrpbGMegiK9SBuvi/9NY49ZO68JM=; b=FrMvyd7Q7U39M2UMpk1/Z9FnL+O3cXYT2o2RdDJm+iBuO/adoewJtRNafJtAosugma 8dRONdwV2zzWpr2Y9BjNMHd9JpaqCd4vsKaq/hE2Ud4q0RvWmoiK8n1sqpuUJgcE9Z9C 369gIBwfIvK/ybHuHWytUnF4IailT4D8y+lcimqXnfJQ7TAcV/DAqes4eBh5EPIDwWww tC553UE8k+EZy23L5n6QzCk+N0jINZpuEF5VpYtEefZ3rdzXYhIPBwVBSulOJgdeY8Id PwU2GxSv3ibob8plLeQpXakLY65dvpLSrfek8uJ/K2k7jXJ8AICKBTQY143kotf+UJK+ WFHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=O4pS8gEbytTb3R6OrpbGMegiK9SBuvi/9NY49ZO68JM=; b=XVG+OQO4HN4rOODkzMWmqgAhW8mJwz+qY/NsAAg9yej4jglS1vscvyxVPBd04N3aMl 8D8IX1LeCnAH06uBhPgkB1xaQuuE512A0KaDsxd2C8Rtz1RQ6yBD23KTHe9rJbO3M+rF D88tR7yumq9o8LFWfsNU62PTMcuk7PEW9scCK7/bK9Pqz0nzl1OT/g7bdgqEZejkvVIJ GbuBl8M2ylo/cW948BbbSnhyyfdZxUmAtDlJSsBtimxmOBL055h1ZaF9hFmi84dxsomp SJ4/Hl4HfamU1NQ5vLM7AAoO3atAWLw60R9Y9JvJli5sCLz2WfSqjd8qBK60VNBwPH1B 3dqA== X-Gm-Message-State: AOUpUlHEPFdDt2mcQoNdlb58XRjUfXmiFt1sc29eNBWW8l7e37UOCQ/n tuiOqakZt20xpN6QjhGeLv5eDBdd X-Google-Smtp-Source: AAOMgpc6VOOU7c+cwupZ30jiyiXRDsQuG/g3rdB69VSLgHD/zzmILV5+EPYetm/S9aGt523YBCQq3Q== X-Received: by 2002:a63:ba10:: with SMTP id k16-v6mr9933305pgf.145.1532002558249; Thu, 19 Jul 2018 05:15:58 -0700 (PDT) From: guangrong.xiao@gmail.com X-Google-Original-From: xiaoguangrong@tencent.com To: pbonzini@redhat.com, mst@redhat.com, mtosatti@redhat.com Date: Thu, 19 Jul 2018 20:15:17 +0800 Message-Id: <20180719121520.30026-6-xiaoguangrong@tencent.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180719121520.30026-1-xiaoguangrong@tencent.com> References: <20180719121520.30026-1-xiaoguangrong@tencent.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::52e Subject: [Qemu-devel] [PATCH v2 5/8] migration: drop the return value of do_compress_ram_page 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: kvm@vger.kernel.org, Xiao Guangrong , qemu-devel@nongnu.org, peterx@redhat.com, dgilbert@redhat.com, wei.w.wang@intel.com, jiang.biao2@zte.com.cn Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Xiao Guangrong It is not used and cleans the code up a little Signed-off-by: Xiao Guangrong Reviewed-by: Peter Xu --- migration/ram.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index ce6e69b649..5aa624b3b9 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -392,8 +392,8 @@ static QemuThread *decompress_threads; static QemuMutex decomp_done_lock; static QemuCond decomp_done_cond; =20 -static int do_compress_ram_page(QEMUFile *f, z_stream *stream, RAMBlock *b= lock, - ram_addr_t offset, uint8_t *source_buf); +static void do_compress_ram_page(QEMUFile *f, z_stream *stream, RAMBlock *= block, + ram_addr_t offset, uint8_t *source_buf); =20 static void *do_data_compress(void *opaque) { @@ -1871,15 +1871,14 @@ static int ram_save_multifd_page(RAMState *rs, RAMB= lock *block, return 1; } =20 -static int do_compress_ram_page(QEMUFile *f, z_stream *stream, RAMBlock *b= lock, - ram_addr_t offset, uint8_t *source_buf) +static void do_compress_ram_page(QEMUFile *f, z_stream *stream, RAMBlock *= block, + ram_addr_t offset, uint8_t *source_buf) { RAMState *rs =3D ram_state; - int bytes_sent, blen; uint8_t *p =3D block->host + (offset & TARGET_PAGE_MASK); + int ret; =20 - bytes_sent =3D save_page_header(rs, f, block, offset | - RAM_SAVE_FLAG_COMPRESS_PAGE); + save_page_header(rs, f, block, offset | RAM_SAVE_FLAG_COMPRESS_PAGE); =20 /* * copy it to a internal buffer to avoid it being modified by VM @@ -1887,17 +1886,14 @@ static int do_compress_ram_page(QEMUFile *f, z_stre= am *stream, RAMBlock *block, * decompression */ memcpy(source_buf, p, TARGET_PAGE_SIZE); - blen =3D qemu_put_compression_data(f, stream, source_buf, TARGET_PAGE_= SIZE); - if (blen < 0) { - bytes_sent =3D 0; - qemu_file_set_error(migrate_get_current()->to_dst_file, blen); + ret =3D qemu_put_compression_data(f, stream, source_buf, TARGET_PAGE_S= IZE); + if (ret < 0) { + qemu_file_set_error(migrate_get_current()->to_dst_file, ret); error_report("compressed data failed!"); - } else { - bytes_sent +=3D blen; - ram_release_pages(block->idstr, offset & TARGET_PAGE_MASK, 1); + return; } =20 - return bytes_sent; + ram_release_pages(block->idstr, offset & TARGET_PAGE_MASK, 1); } =20 static void flush_compressed_data(RAMState *rs) --=20 2.14.4