From nobody Wed Nov 5 15:09:07 2025 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; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534940008998512.5596896746836; Wed, 22 Aug 2018 05:13:28 -0700 (PDT) Received: from localhost ([::1]:58699 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsS0q-0001i9-Co for importer@patchew.org; Wed, 22 Aug 2018 08:13:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsRpU-0006xp-63 for qemu-devel@nongnu.org; Wed, 22 Aug 2018 08:01:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsRpP-0000FJ-LI for qemu-devel@nongnu.org; Wed, 22 Aug 2018 08:01:38 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38244 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fsRpP-0000Ew-FJ for qemu-devel@nongnu.org; Wed, 22 Aug 2018 08:01:35 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1FBB787A82; Wed, 22 Aug 2018 12:01:35 +0000 (UTC) Received: from secure.mitica (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4CA16A9E69; Wed, 22 Aug 2018 12:01:32 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 22 Aug 2018 14:00:48 +0200 Message-Id: <20180822120050.12694-19-quintela@redhat.com> In-Reply-To: <20180822120050.12694-1-quintela@redhat.com> References: <20180822120050.12694-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 22 Aug 2018 12:01:35 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 22 Aug 2018 12:01:35 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'quintela@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 18/20] 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: lvivier@redhat.com, Xiao Guangrong , dgilbert@redhat.com, peterx@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 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 Reviewed-by: Peter Xu Signed-off-by: Xiao Guangrong Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/ram.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 8ffa0a6d55..11066df881 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -382,8 +382,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) { @@ -1849,15 +1849,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 @@ -1865,17 +1864,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.17.1