From nobody Sat May 18 10:48:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683247897; cv=none; d=zohomail.com; s=zohoarc; b=eivFZjXjUoofytOJ4poIMzxR3AUaN5jB2Jcc2Fq9/YOYMJAqtGYWCe6MIXOVW3EFGcZHMIvattChQLgew3qEisJPQNNRCvk6zig714l+Rpz83N8JbzlF+KTWLCmkcqwP3wKmAsAuUBpaMiKosKgJKo5ht+6BIA3G7L3zDz3l1ig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683247897; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6rB1KZ0u3Ndgy61yBxUx9qHqRuPMGVsTrUzb+7ibAEU=; b=GhtkuK0CvIZxyx4BXqo3zUvtIP5jSYPR6TkTas/GHW92nt8IbVCGngccBoFtw45zDa8jopv6T/Z1ZtWI7gGysAUh0mSmxMpOcZltqn8dWihlLeHD5hvsfdnB1Z2Ru7aaXDcw5CZIfG9RJjVwFN1rDljWRSK+IaU6KVBF1pOihK4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683247897677505.5664945364839; Thu, 4 May 2023 17:51:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pujcc-00043g-6M; Thu, 04 May 2023 20:48:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujca-0003zO-1m for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcU-0000hi-Pi for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:27 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-25-fBY4ljF3MZO3EHCINddg_A-1; Thu, 04 May 2023 20:48:19 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 065F91C068D2; Fri, 5 May 2023 00:48:18 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id 25130404B24D; Fri, 5 May 2023 00:48:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683247701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6rB1KZ0u3Ndgy61yBxUx9qHqRuPMGVsTrUzb+7ibAEU=; b=cgaFTGz88/e9Mv0RfMpClRK44/ughGOC5jbEvcjmnQA36PsLB5muI8LprY5pNclwHHK60K rzgIehDpo4ulwN76ffgUb99GwzhZXkUsffTkAHycMyj/N9I6zbEmpk6npJx/FdhyGMEGxD lxdGkFf1RI6EgKU983idT2PfCWyxoak= X-MC-Unique: fBY4ljF3MZO3EHCINddg_A-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Eric Blake , Vladimir Sementsov-Ogievskiy , Stefan Hajnoczi , John Snow , Juan Quintela , qemu-block@nongnu.org, Leonardo Bras , Fam Zheng , Peter Xu , Kevin Wolf Subject: [PULL 01/16] migration: Fix block_bitmap_mapping migration Date: Fri, 5 May 2023 02:47:57 +0200 Message-Id: <20230505004812.31583-2-quintela@redhat.com> In-Reply-To: <20230505004812.31583-1-quintela@redhat.com> References: <20230505004812.31583-1-quintela@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1683247897983100001 Content-Type: text/plain; charset="utf-8" It is valid that params->has_block_bitmap_mapping is true and params->block_bitmap_mapping is NULL. So we can't use the trick of having a single function. Move to two functions one for each value and the tests are fixed. Fixes: b804b35b1c8a0edfd127ac20819c234be55ac7fc migration: Create migrate_block_bitmap_mapping() function Reported-by: Kevin Wolf Reviewed-by: Vladimir Sementsov-Ogievskiy Message-Id: <20230503181036.14890-1-quintela@redhat.com> Signed-off-by: Juan Quintela --- migration/block-dirty-bitmap.c | 14 +++++--------- migration/options.c | 7 +++++++ migration/options.h | 2 ++ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c index 6624f39bc6..20f36e6bd8 100644 --- a/migration/block-dirty-bitmap.c +++ b/migration/block-dirty-bitmap.c @@ -606,11 +606,9 @@ static int init_dirty_bitmap_migration(DBMSaveState *s) GHashTable *handled_by_blk =3D g_hash_table_new(NULL, NULL); BlockBackend *blk; GHashTable *alias_map =3D NULL; - const BitmapMigrationNodeAliasList *block_bitmap_mapping =3D - migrate_block_bitmap_mapping(); =20 - if (block_bitmap_mapping) { - alias_map =3D construct_alias_map(block_bitmap_mapping, true, + if (migrate_has_block_bitmap_mapping()) { + alias_map =3D construct_alias_map(migrate_block_bitmap_mapping(), = true, &error_abort); } =20 @@ -1159,8 +1157,6 @@ static int dirty_bitmap_load_header(QEMUFile *f, DBML= oadState *s, static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id) { GHashTable *alias_map =3D NULL; - const BitmapMigrationNodeAliasList *block_bitmap_mapping =3D - migrate_block_bitmap_mapping(); DBMLoadState *s =3D &((DBMState *)opaque)->load; int ret =3D 0; =20 @@ -1172,9 +1168,9 @@ static int dirty_bitmap_load(QEMUFile *f, void *opaqu= e, int version_id) return -EINVAL; } =20 - if (block_bitmap_mapping) { - alias_map =3D construct_alias_map(block_bitmap_mapping, - false, &error_abort); + if (migrate_has_block_bitmap_mapping()) { + alias_map =3D construct_alias_map(migrate_block_bitmap_mapping(), = false, + &error_abort); } =20 do { diff --git a/migration/options.c b/migration/options.c index 53b7fc5d5d..7395787960 100644 --- a/migration/options.c +++ b/migration/options.c @@ -626,6 +626,13 @@ const BitmapMigrationNodeAliasList *migrate_block_bitm= ap_mapping(void) return s->parameters.block_bitmap_mapping; } =20 +bool migrate_has_block_bitmap_mapping(void) +{ + MigrationState *s =3D migrate_get_current(); + + return s->parameters.has_block_bitmap_mapping; +} + bool migrate_block_incremental(void) { MigrationState *s =3D migrate_get_current(); diff --git a/migration/options.h b/migration/options.h index 3c322867cd..09841d6a63 100644 --- a/migration/options.h +++ b/migration/options.h @@ -71,6 +71,8 @@ bool migrate_cap_set(int cap, bool value, Error **errp); /* parameters */ =20 const BitmapMigrationNodeAliasList *migrate_block_bitmap_mapping(void); +bool migrate_has_block_bitmap_mapping(void); + bool migrate_block_incremental(void); uint32_t migrate_checkpoint_delay(void); int migrate_compress_level(void); --=20 2.40.0 From nobody Sat May 18 10:48:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683247797; cv=none; d=zohomail.com; s=zohoarc; b=LW/jNxEga4fCs4vl3YOgEh8yuRnESYBvHXytOmpKywwUcmWqIwwRi8VOHzPirn8+KbXb/6EMPPqUxq7sdK9OGSzfuTmTmaSce+T8RXVH7XNvpp5tHjw5o4+N315hFIpHiKCGRSulsg2+btQmPggRyAVJfjHkMtw7hsABou0A5Us= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683247797; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qSD40xWNfPTPf1wjEdIspIhHw9ZYhW0r+X8+eKiKAIU=; b=TJB5MgNtq90JsKMizp4m5OwvkaNcnYbtwK/+FTdCzAhB5gkx9t/ktiRnPoLX+xYOeI3PXlby4pFveBIy18QXGKZ5PiN3BGJsatp6fd4oZ7cdVi7S5M390vIzqxamxIFZl0jHz+IAsUk9svi22HA1rRig8TMRmCgoPrM18mTt01M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683247797268816.1526690563828; Thu, 4 May 2023 17:49:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pujcZ-0003yW-PA; Thu, 04 May 2023 20:48:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcX-0003xe-PD for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcW-0000o4-8O for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:25 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-595-YSrEUao6MbyJRB4aFzQSLQ-1; Thu, 04 May 2023 20:48:20 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0C357185A7A2; Fri, 5 May 2023 00:48:20 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4A9AC404B24D; Fri, 5 May 2023 00:48:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683247703; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qSD40xWNfPTPf1wjEdIspIhHw9ZYhW0r+X8+eKiKAIU=; b=X7oMJ6vVTbij0HkpjAh8y0sVI1zbz2X4Hu+6w7oxUhBS7jiUEFgClSgw041s/8A/jl2DpD aqbJED2/XwhnCaZhkR34QvV8SL4t2aTuyQsWJ0sNdJD8M8upy1FuIl+4glOzrBa0Kc3QVm M1OENvP3COFG9tAnZBuWHWLdmtJyKJ8= X-MC-Unique: YSrEUao6MbyJRB4aFzQSLQ-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Eric Blake , Vladimir Sementsov-Ogievskiy , Stefan Hajnoczi , John Snow , Juan Quintela , qemu-block@nongnu.org, Leonardo Bras , Fam Zheng , Peter Xu , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 02/16] migration/rdma: Don't pass the QIOChannelRDMA as an opaque Date: Fri, 5 May 2023 02:47:58 +0200 Message-Id: <20230505004812.31583-3-quintela@redhat.com> In-Reply-To: <20230505004812.31583-1-quintela@redhat.com> References: <20230505004812.31583-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1683247797783100001 We can calculate it from the QEMUFile like the caller. Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20230503131847.11603-6-quintela@redhat.com> Signed-off-by: Juan Quintela --- migration/rdma.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index 7e747b2595..5b82085bd7 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -3527,7 +3527,7 @@ static int dest_ram_sort_func(const void *a, const vo= id *b) * * Keep doing this until the source tells us to stop. */ -static int qemu_rdma_registration_handle(QEMUFile *f, void *opaque) +static int qemu_rdma_registration_handle(QEMUFile *f) { RDMAControlHeader reg_resp =3D { .len =3D sizeof(RDMARegisterResult), .type =3D RDMA_CONTROL_REGISTER_RESULT, @@ -3539,7 +3539,7 @@ static int qemu_rdma_registration_handle(QEMUFile *f,= void *opaque) }; RDMAControlHeader blocks =3D { .type =3D RDMA_CONTROL_RAM_BLOCKS_RESUL= T, .repeat =3D 1 }; - QIOChannelRDMA *rioc =3D QIO_CHANNEL_RDMA(opaque); + QIOChannelRDMA *rioc =3D QIO_CHANNEL_RDMA(qemu_file_get_ioc(f)); RDMAContext *rdma; RDMALocalBlocks *local; RDMAControlHeader head; @@ -3852,7 +3852,7 @@ static int rdma_load_hook(QEMUFile *f, uint64_t flags= , void *data) return rdma_block_notification_handle(rioc, data); =20 case RAM_CONTROL_HOOK: - return qemu_rdma_registration_handle(f, rioc); + return qemu_rdma_registration_handle(f); =20 default: /* Shouldn't be called with any other values */ --=20 2.40.0 From nobody Sat May 18 10:48:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683247879; cv=none; d=zohomail.com; s=zohoarc; b=aB/DM4qthZPclFzaz29QVFZ3vFRyEIj8Ah1LQpI7Hj+RROHRafPJgqgE4K02cv/P1l0eJoYX+yiHH2BM7RdkTaIm86ABMdd1N0WMRDLBy+kJ8GtcMepP+kIuozqV+3HfqaBHgKM8P/XAf9JAL/Hjjvra5YBWxU3hOSJHIZQoutk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683247879; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NjWeSAwuFXK3lY7+hC3CU1kM8vnZ6nAS8j/XYnec7VA=; b=ahCYBx6/NBEiQ85AtzqgKqMyIXkzvUk9MPQejIjEmL/BSjXTrP8Q2GmKeJEhMl/+eCqkeZkNqkccQPIJ0T3uQhqrNhnWcDr8EhljbIhObD9E1/E1DMR+pmRvaGKncIZACWy6fi1Dxxp6h7U5QYi/alN815jGs3mJEXlAXosaqWw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683247879251410.5699501201394; Thu, 4 May 2023 17:51:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pujcc-00043m-EL; Thu, 04 May 2023 20:48:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujca-00040s-J7 for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcY-0000xd-NS for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:28 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-654-MEQrCG5LNjea-23pQMOdKg-1; Thu, 04 May 2023 20:48:22 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3755285D537; Fri, 5 May 2023 00:48:22 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id 50914404B24D; Fri, 5 May 2023 00:48:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683247705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NjWeSAwuFXK3lY7+hC3CU1kM8vnZ6nAS8j/XYnec7VA=; b=J6gVXH9BChUOldhlnKpdB+tZTduRHHpziG35I0Ek7yGNPdAmJEKO6QXSJdL0wPAZcqubck aYiISmWm7jbWnVnW4AdtTvHDD4b457xPA0CMUXfbBX5HtorVOPHTask3UqaFhCH/GwqB7h hBLAtrfeius0Bzd7rZ7j/5MD8rnv0Vk= X-MC-Unique: MEQrCG5LNjea-23pQMOdKg-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Eric Blake , Vladimir Sementsov-Ogievskiy , Stefan Hajnoczi , John Snow , Juan Quintela , qemu-block@nongnu.org, Leonardo Bras , Fam Zheng , Peter Xu , David Edmondson , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 03/16] migration: Document all migration_stats Date: Fri, 5 May 2023 02:47:59 +0200 Message-Id: <20230505004812.31583-4-quintela@redhat.com> In-Reply-To: <20230505004812.31583-1-quintela@redhat.com> References: <20230505004812.31583-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1683247880742100001 Message-Id: <20230504103357.22130-2-quintela@redhat.com> Reviewed-by: David Edmondson Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Juan Quintela --- migration/migration-stats.h | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/migration/migration-stats.h b/migration/migration-stats.h index 149af932d7..50966328b2 100644 --- a/migration/migration-stats.h +++ b/migration/migration-stats.h @@ -22,17 +22,60 @@ * one thread). */ typedef struct { + /* + * Number of bytes that were dirty last time that we synced with + * the guest memory. We use that to calculate the downtime. As + * the remaining dirty amounts to what we know that is still dirty + * since last iteration, not counting what the guest has dirtied + * since we synchronized bitmaps. + */ Stat64 dirty_bytes_last_sync; + /* + * Number of pages dirtied per second. + */ Stat64 dirty_pages_rate; + /* + * Number of times we have synchronized guest bitmaps. + */ Stat64 dirty_sync_count; + /* + * Number of times zero copy failed to send any page using zero + * copy. + */ Stat64 dirty_sync_missed_zero_copy; + /* + * Number of bytes sent at migration completion stage while the + * guest is stopped. + */ Stat64 downtime_bytes; + /* + * Number of pages transferred that were full of zeros. + */ Stat64 zero_pages; + /* + * Number of bytes sent through multifd channels. + */ Stat64 multifd_bytes; + /* + * Number of pages transferred that were not full of zeros. + */ Stat64 normal_pages; + /* + * Number of bytes sent during postcopy. + */ Stat64 postcopy_bytes; + /* + * Number of postcopy page faults that we have handled during + * postcopy stage. + */ Stat64 postcopy_requests; + /* + * Number of bytes sent during precopy stage. + */ Stat64 precopy_bytes; + /* + * Total number of bytes transferred. + */ Stat64 transferred; } MigrationAtomicStats; =20 --=20 2.40.0 From nobody Sat May 18 10:48:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683247750; cv=none; d=zohomail.com; s=zohoarc; b=kOsObOA0Vs1B+YvoDlUn6FIDfzqpoqYn5+CyC1ZSkNAD+apzjn4cfIIfH3dh0H9+KN0X6G3vSXhUJnrKbDvtHJb3jiBmjtsrblOFeOn+Iz1bpDkf218DTCTT7ubhY9ryzQSa3rr4mCvMF1iHuXfa6akVQONm5P9Crcf+/HvmmwA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683247750; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YtKvI1WJzYVsMbE/EK+nBjHl1ilu8w2PMv/EbvE8ANA=; b=Tc4BZEZgenl5go2L7WEIYhkdwOgNTMx7C4ujFKAXF9JXSrftNcyBWN0+QBC/A3X90qLKmyniGYE/LbInwPax1+ACiKhMM8aR9rSSswETfuAQJAMWKWs6VBq7jK1n3Mwiiptlu72/V/sxvoyaZZPTZVUMs466w/fhavu6IJN3MB4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683247750504425.64675798143344; Thu, 4 May 2023 17:49:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pujce-00044V-VP; Thu, 04 May 2023 20:48:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujce-000446-4O for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcc-00012j-Jq for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:31 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-82-zcvXMxCcOFa5jhuE40G9Aw-1; Thu, 04 May 2023 20:48:25 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5FE67811E7C; Fri, 5 May 2023 00:48:24 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C659404B24D; Fri, 5 May 2023 00:48:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683247709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YtKvI1WJzYVsMbE/EK+nBjHl1ilu8w2PMv/EbvE8ANA=; b=S6sb26xlpT5mIDTTUv0m9kyvZ3/qbngKyt3KvHdRxLGmvln06I4AbIwGDsQGQaO5Yy2sW9 diMD6mXalo85VZ1RpxLl2BW7lueokmvXWCfaCZW1yxzKfeA+RxRH8090GaNQ4sGBgMcoVQ BcmmYwxaqB6epTStjV6d47YvLaPwGO8= X-MC-Unique: zcvXMxCcOFa5jhuE40G9Aw-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Eric Blake , Vladimir Sementsov-Ogievskiy , Stefan Hajnoczi , John Snow , Juan Quintela , qemu-block@nongnu.org, Leonardo Bras , Fam Zheng , Peter Xu , David Edmondson , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 04/16] migration: Put zero_pages in alphabetical order Date: Fri, 5 May 2023 02:48:00 +0200 Message-Id: <20230505004812.31583-5-quintela@redhat.com> In-Reply-To: <20230505004812.31583-1-quintela@redhat.com> References: <20230505004812.31583-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1683247752826100001 I forgot to move it when I rename it from duplicated_pages. Message-Id: <20230504103357.22130-3-quintela@redhat.com> Reviewed-by: David Edmondson Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Juan Quintela --- migration/migration-stats.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/migration/migration-stats.h b/migration/migration-stats.h index 50966328b2..cf8a4f0410 100644 --- a/migration/migration-stats.h +++ b/migration/migration-stats.h @@ -48,10 +48,6 @@ typedef struct { * guest is stopped. */ Stat64 downtime_bytes; - /* - * Number of pages transferred that were full of zeros. - */ - Stat64 zero_pages; /* * Number of bytes sent through multifd channels. */ @@ -77,6 +73,10 @@ typedef struct { * Total number of bytes transferred. */ Stat64 transferred; + /* + * Number of pages transferred that were full of zeros. + */ + Stat64 zero_pages; } MigrationAtomicStats; =20 extern MigrationAtomicStats mig_stats; --=20 2.40.0 From nobody Sat May 18 10:48:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683247781; cv=none; d=zohomail.com; s=zohoarc; b=ja4RTOgsAm5YrjthZaUzEFCZNO/klm+dH36r7Al6QyltalMyqo7MXXR7yvIP4eRiFRPTE1BXxf1C5wwnWKNXjFqdsSozJuWNGE1bmZOqWtBHgB8ifoS2q9WROaGSTNcXP/DPu4waIX4A2q4ztT3Dy1GF+6NfDa3KmWA+ZjNOA34= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683247781; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gNm4DW82Z409YsJ9FpFzOwIpuLsjtKWKrcswq7zNp+Y=; b=Dch4Fi2oYGjoysdGjfzfvHFRookAj81xSY4he6ftCiy8ll3qmLJwcLRnBGL2NxU1YpCLzaQH4qtsRfQBq2/wb8eicoIx9FtlOT9EiJu2IMAvPX49wc0968cm7MdP0fkxAP1CVNqojrVH1++RmjJoRFodxK1L1AbWlzqaGM0MFHc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683247781309731.2160123701105; Thu, 4 May 2023 17:49:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pujcd-000442-Pl; Thu, 04 May 2023 20:48:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcc-00043n-Pf for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcb-00012V-A8 for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:30 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-96-qxKFEDzVPbmP3eIyIXOaAQ-1; Thu, 04 May 2023 20:48:27 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9A50485A588; Fri, 5 May 2023 00:48:26 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id A5412404B24D; Fri, 5 May 2023 00:48:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683247708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gNm4DW82Z409YsJ9FpFzOwIpuLsjtKWKrcswq7zNp+Y=; b=adiCfZI6FZTnZBgK27OIgRXyerB+0hT7rbZUB4BLfjBdqCwBQNSNsez+c+TdcgtxNU9rZJ pKQfGMWB7w4erkmQrC7h43sQyOCQ/jcE7J6ETttcRUV50BQlE8hWnAJpFTLC7rvu8mTKdt tFIVps9H28aLI6CtbmX6yl1+ujZdev0= X-MC-Unique: qxKFEDzVPbmP3eIyIXOaAQ-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Eric Blake , Vladimir Sementsov-Ogievskiy , Stefan Hajnoczi , John Snow , Juan Quintela , qemu-block@nongnu.org, Leonardo Bras , Fam Zheng , Peter Xu , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 05/16] migration: Rename xbzrle_enabled xbzrle_started Date: Fri, 5 May 2023 02:48:01 +0200 Message-Id: <20230505004812.31583-6-quintela@redhat.com> In-Reply-To: <20230505004812.31583-1-quintela@redhat.com> References: <20230505004812.31583-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1683247782772100007 Otherwise it is confusing with the function xbzrle_enabled(). Suggested-by: Daniel P. Berrang=C3=A9 Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Xu Signed-off-by: Juan Quintela Message-Id: <20230504115323.24407-1-quintela@redhat.com> --- migration/ram.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 7d81c4a39e..23ba1cefff 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -388,8 +388,8 @@ struct RAMState { uint64_t xbzrle_pages_prev; /* Amount of xbzrle encoded bytes since the beginning of the period */ uint64_t xbzrle_bytes_prev; - /* Start using XBZRLE (e.g., after the first round). */ - bool xbzrle_enabled; + /* Are we really using XBZRLE (e.g., after the first round). */ + bool xbzrle_started; /* Are we on the last stage of migration */ bool last_stage; /* compression statistics since the beginning of the period */ @@ -1420,7 +1420,7 @@ static int ram_save_page(RAMState *rs, PageSearchStat= us *pss) trace_ram_save_page(block->idstr, (uint64_t)offset, p); =20 XBZRLE_cache_lock(); - if (rs->xbzrle_enabled && !migration_in_postcopy()) { + if (rs->xbzrle_started && !migration_in_postcopy()) { pages =3D save_xbzrle_page(rs, pss, &p, current_addr, block, offset); if (!rs->last_stage) { @@ -1636,7 +1636,7 @@ static int find_dirty_block(RAMState *rs, PageSearchS= tatus *pss) pss->complete_round =3D true; /* After the first round, enable XBZRLE. */ if (migrate_xbzrle()) { - rs->xbzrle_enabled =3D true; + rs->xbzrle_started =3D true; } } /* Didn't find anything this time, but try again on the new block = */ @@ -2288,7 +2288,7 @@ static bool save_page_use_compression(RAMState *rs) * using the data compression. In theory, xbzrle can do better than * compression. */ - if (rs->xbzrle_enabled) { + if (rs->xbzrle_started) { return false; } =20 @@ -2357,7 +2357,7 @@ static int ram_save_target_page_legacy(RAMState *rs, = PageSearchStatus *pss) /* Must let xbzrle know, otherwise a previous (now 0'd) cached * page would be stale */ - if (rs->xbzrle_enabled) { + if (rs->xbzrle_started) { XBZRLE_cache_lock(); xbzrle_cache_zero_page(rs, block->offset + offset); XBZRLE_cache_unlock(); @@ -2738,7 +2738,7 @@ static void ram_state_reset(RAMState *rs) rs->last_seen_block =3D NULL; rs->last_page =3D 0; rs->last_version =3D ram_list.version; - rs->xbzrle_enabled =3D false; + rs->xbzrle_started =3D false; } =20 #define MAX_WAIT 50 /* ms, half buffered_file limit */ --=20 2.40.0 From nobody Sat May 18 10:48:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683247866; cv=none; d=zohomail.com; s=zohoarc; b=mFFpkYHDK4Feg23HNbza0b0yp810HzhvlTCsBv7OZudAftiC06eDF4BUioXM0DtH8B8XPAYIGW+WjlSEfc7/bf+IKCTZ0+4iGgrdig2cPLlkbtuMLbyQFBsscFV2nP4X9PbixTy2iiefMYUizlUPr4fFY1gLS6z0fyEYkmsycWg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683247866; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6B1+xsvYplNGHZ1v49pdyPklrv9iGmDzPhstbah1Q9Y=; b=OdlqujXVEW+poaWwDxe35NcuM/ExIgANNVJvOB7d/XYucHuapZFRr6yjUmShaEsjRQmiYNEHCvZnvM6pHD2/KvDOpxB68dLomvmlRGcu8+QltERy5w7lPsiDYhiYtL85x5ieMZBnsM7SU+4cE9T2a4PIwj/V1IhGvNWlUBRBCsg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16832478668881018.13112780844; Thu, 4 May 2023 17:51:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pujcl-0004Cn-3V; Thu, 04 May 2023 20:48:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcj-00049d-3p for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujch-0001Dv-Nq for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:36 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-125-Hi7QR1txMq-PKGWE4Ru8lg-1; Thu, 04 May 2023 20:48:29 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9A28128082AC; Fri, 5 May 2023 00:48:28 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB99B404B24D; Fri, 5 May 2023 00:48:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683247713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6B1+xsvYplNGHZ1v49pdyPklrv9iGmDzPhstbah1Q9Y=; b=bVpwZ0L6Vaui/75Ppsfx9XU9mbHd/KsxVQ46yLdc8THHGOwY639wIImI59Iut8wKop6qGA NZ5Yqj9snLxXRCAlpSSN9vq8G0QPT3WDK+5IqRv9vvQmNO/mmWmALyDflHOxXCLVCdqaK4 drjus13Vyj4CIq5hHLJalkdbWJxbNxw= X-MC-Unique: Hi7QR1txMq-PKGWE4Ru8lg-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Eric Blake , Vladimir Sementsov-Ogievskiy , Stefan Hajnoczi , John Snow , Juan Quintela , qemu-block@nongnu.org, Leonardo Bras , Fam Zheng , Peter Xu , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 06/16] migration: Make RAM_SAVE_FLAG_HOOK a normal case entry Date: Fri, 5 May 2023 02:48:02 +0200 Message-Id: <20230505004812.31583-7-quintela@redhat.com> In-Reply-To: <20230505004812.31583-1-quintela@redhat.com> References: <20230505004812.31583-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1683247867824100003 Fixes this commit, clearly a bad merge after a rebase or similar, it should have been its own case since that point. commit 5b0e9dd46fbda5152566a4a26fd96bc0d0452bf7 Author: Peter Lieven Date: Tue Jun 24 11:32:36 2014 +0200 migration: catch unknown flag combinations in ram_load Signed-off-by: Juan Quintela Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20230504114443.23891-2-quintela@redhat.com> --- migration/ram.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 23ba1cefff..5e7bf20ca5 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -4445,14 +4445,12 @@ static int ram_load_precopy(QEMUFile *f) multifd_recv_sync_main(); } break; + case RAM_SAVE_FLAG_HOOK: + ram_control_load_hook(f, RAM_CONTROL_HOOK, NULL); + break; default: - if (flags & RAM_SAVE_FLAG_HOOK) { - ram_control_load_hook(f, RAM_CONTROL_HOOK, NULL); - } else { - error_report("Unknown combination of migration flags: 0x%x= ", - flags); - ret =3D -EINVAL; - } + error_report("Unknown combination of migration flags: 0x%x", f= lags); + ret =3D -EINVAL; } if (!ret) { ret =3D qemu_file_get_error(f); --=20 2.40.0 From nobody Sat May 18 10:48:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683247920; cv=none; d=zohomail.com; s=zohoarc; b=Txffn+sUmpKhAAIw6v/WGJLDO6tULtkkVt0v0mPeA2TR5oyRSQZjFy4xexVhDh7lzlTPNeNikMJGSaQ3s5V4NwuXEdEOikc3lbQ0FkfaNp27SaQtqK41vMSB+qs6jhx4IHHRyv1fP5oBpOTCzGide/0vvv4oxGhSEoEPfG/y84o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683247920; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=s9CNUZXatzlFdaclSBdpejKOWg2kyZoK+ax00G7wKek=; b=WlcmyraBZWAAmpfBiCLNdHQF4sln+JIaSbvVf6Ug0q0oFDmiPTID+uNi3ICZzsLi0EyIBekBnKQ7s/e4vgd3jaYiZcZIHo0inPwOgU7uHtTLltOhAVTl7jfJMyPtMIcp5zxjlz5Y/ciVsfcQsqcHR+b4Jgt5O3Ev+dqoDoQP8gA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683247920347536.3961945929544; Thu, 4 May 2023 17:52:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pujcl-0004Cm-MQ; Thu, 04 May 2023 20:48:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcj-00049c-0j for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujch-0001Fg-Lw for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:36 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-283-vH3h913wMTqnYZtjwWfvBQ-1; Thu, 04 May 2023 20:48:31 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9BC6B85A588; Fri, 5 May 2023 00:48:30 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id DCAB1404B24D; Fri, 5 May 2023 00:48:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683247714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=s9CNUZXatzlFdaclSBdpejKOWg2kyZoK+ax00G7wKek=; b=VP1LqEQzYCX+YqTQcT/W9eMCJnX9OcJEAtWN0TVB26+s8nG+y2cNuqsLcVgYWFWA2excgV 2Fc7dye2yWjUQP8tulUYPZ8sDaIy2OKUd001Sx6yndfXwaOCH52YUSnN4tIgvG3nQPCU1S zW0bHrrLHgLCUuMg1A0dpAocZ5nYOwk= X-MC-Unique: vH3h913wMTqnYZtjwWfvBQ-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Eric Blake , Vladimir Sementsov-Ogievskiy , Stefan Hajnoczi , John Snow , Juan Quintela , qemu-block@nongnu.org, Leonardo Bras , Fam Zheng , Peter Xu , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 07/16] migration/rdma: simplify ram_control_load_hook() Date: Fri, 5 May 2023 02:48:03 +0200 Message-Id: <20230505004812.31583-8-quintela@redhat.com> In-Reply-To: <20230505004812.31583-1-quintela@redhat.com> References: <20230505004812.31583-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1683247921342100003 Signed-off-by: Juan Quintela Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20230504114443.23891-3-quintela@redhat.com> --- migration/qemu-file.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/migration/qemu-file.c b/migration/qemu-file.c index ee04240a21..b7afc8d498 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -340,10 +340,8 @@ void ram_control_after_iterate(QEMUFile *f, uint64_t f= lags) =20 void ram_control_load_hook(QEMUFile *f, uint64_t flags, void *data) { - int ret =3D -EINVAL; - if (f->hooks && f->hooks->hook_ram_load) { - ret =3D f->hooks->hook_ram_load(f, flags, data); + int ret =3D f->hooks->hook_ram_load(f, flags, data); if (ret < 0) { qemu_file_set_error(f, ret); } @@ -353,7 +351,7 @@ void ram_control_load_hook(QEMUFile *f, uint64_t flags,= void *data) * that expects there to be a hook on the destination. */ if (flags =3D=3D RAM_CONTROL_HOOK) { - qemu_file_set_error(f, ret); + qemu_file_set_error(f, -EINVAL); } } } --=20 2.40.0 From nobody Sat May 18 10:48:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683247934; cv=none; d=zohomail.com; s=zohoarc; b=mlbED7+XF8yTx+zwTfLbRV+5NRV+iYJPh0EFM/DJl5/+ua1pB4bAKc1UgR5sb41nuI6FWzfRrgix680G1yjgqK2lXSGkgWAWW5qfs8N8ozsAOZRuIIE5TlGQoE26aq+bUdhXeWAniDPxGJlamP2ruuAPK3n94bfP4L8hVeUShZo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683247934; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mPxXFniiEeOBEy+bw7vf6E6oOAZRTIb2S5dGuOdAWPg=; b=fCOFKEE8G2EjsuAzcFTSvSICbUZ3bvrNfbfDb7OCB3wEVhlkmj2Awww4+47X+2ULed4Ktn3f7Wv8u/6w54QncpQ5h1aTVYMujXBJF4o9fOr7b6LTsBcEhrL1doR6JN4XVBRAjPgh4jm9MqNzzHlICpVG2GquPS5nZbVz6xKDZjk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 168324793404028.346259930083875; Thu, 4 May 2023 17:52:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pujd1-0004MB-2j; Thu, 04 May 2023 20:48:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcz-0004KR-6c for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcj-0001Hg-QN for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:52 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-245-1d07Eiq4Okm7tnOQmKZxZQ-1; Thu, 04 May 2023 20:48:33 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A5B46811E7B; Fri, 5 May 2023 00:48:32 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id E1198404B24D; Fri, 5 May 2023 00:48:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683247717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mPxXFniiEeOBEy+bw7vf6E6oOAZRTIb2S5dGuOdAWPg=; b=XSgePEEhz4JDLZh/otFWLIXSREN+DQRqF4doLxMF1XcFOIdK24MPolMsaBa6TEJ6vvRBf2 vP0bqzWVVKAQHZt+8XMQT6VK0yjyzYHev6Om0KKNtkDWdTK8D0c2HNtKE7xbfFPIrbmtvF pZlHc+weLTvCoVWUZkyx92/9j44q9xE= X-MC-Unique: 1d07Eiq4Okm7tnOQmKZxZQ-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Eric Blake , Vladimir Sementsov-Ogievskiy , Stefan Hajnoczi , John Snow , Juan Quintela , qemu-block@nongnu.org, Leonardo Bras , Fam Zheng , Peter Xu , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 08/16] migration/rdma: We can calculate the rioc from the QEMUFile Date: Fri, 5 May 2023 02:48:04 +0200 Message-Id: <20230505004812.31583-9-quintela@redhat.com> In-Reply-To: <20230505004812.31583-1-quintela@redhat.com> References: <20230505004812.31583-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1683247935984100001 Signed-off-by: Juan Quintela Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20230504114443.23891-4-quintela@redhat.com> --- migration/rdma.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index 5b82085bd7..17c4b9206f 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -3811,9 +3811,10 @@ out: * the source. */ static int -rdma_block_notification_handle(QIOChannelRDMA *rioc, const char *name) +rdma_block_notification_handle(QEMUFile *f, const char *name) { RDMAContext *rdma; + QIOChannelRDMA *rioc =3D QIO_CHANNEL_RDMA(qemu_file_get_ioc(f)); int curr; int found =3D -1; =20 @@ -3846,10 +3847,9 @@ rdma_block_notification_handle(QIOChannelRDMA *rioc,= const char *name) =20 static int rdma_load_hook(QEMUFile *f, uint64_t flags, void *data) { - QIOChannelRDMA *rioc =3D QIO_CHANNEL_RDMA(qemu_file_get_ioc(f)); switch (flags) { case RAM_CONTROL_BLOCK_REG: - return rdma_block_notification_handle(rioc, data); + return rdma_block_notification_handle(f, data); =20 case RAM_CONTROL_HOOK: return qemu_rdma_registration_handle(f); --=20 2.40.0 From nobody Sat May 18 10:48:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683247843; cv=none; d=zohomail.com; s=zohoarc; b=U9rhyedogVDzU9bb6DT8ET0B843k2OyM7wmtg7+brDRY00q4AyBjqt3+w+0q/mzIakMRlwegUscy+aqkfBliYiCJV0Uj6OAR3azOLU3JivPahkPzuCd3D4/0ozEMeRMiA48Lwd4jY4ssd21cMTgQsPbPpy+BQ0O3yqCHOUck5wo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683247843; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VqkCIzdJ0odmZAUF7wqjNnZetGlQIu+d7qF0paaVt5Q=; b=NvGPsS9Wn3+DsheRnsKEWSJNNd53O885Zejy+vD2ZPkjKiFMRjuRTy+1bnnwQZW9iWmu1r9lhflmxjOJef43jVb/xkXmLs4ckLLhH6YM8ZlsSua3BWisdTo1UjV7QCHMk4Jbt3omj39MN5QM4cJDfKtIbFQJnzly9rEWeVKJbUY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683247843711872.6489068231064; Thu, 4 May 2023 17:50:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pujcn-0004Dv-Cx; Thu, 04 May 2023 20:48:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcl-0004DO-JE for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcj-0001HQ-8E for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:38 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-463-ETeIKUFLNFio7JSO2BOgvw-1; Thu, 04 May 2023 20:48:35 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A851785D536; Fri, 5 May 2023 00:48:34 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id E7558404B24D; Fri, 5 May 2023 00:48:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683247716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VqkCIzdJ0odmZAUF7wqjNnZetGlQIu+d7qF0paaVt5Q=; b=TWI/Esz7OH3qJWo2Y0HkXNyo7Az8wUgh0ehrEPPuWApKFuyX6gujV6nnDOsP1bNNmxLeAI vv76JfJnL/z2q70R5LvgpaKLmh/fZL9EAdO+ZIav+Kfw8Jzhhq+nwh4aq/kbde+lq55Ndk lnpkSElj9AtGidNkrVl5UXLw1EyVW9E= X-MC-Unique: ETeIKUFLNFio7JSO2BOgvw-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Eric Blake , Vladimir Sementsov-Ogievskiy , Stefan Hajnoczi , John Snow , Juan Quintela , qemu-block@nongnu.org, Leonardo Bras , Fam Zheng , Peter Xu , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 09/16] migration/rdma: It makes no sense to recive that flag without RDMA Date: Fri, 5 May 2023 02:48:05 +0200 Message-Id: <20230505004812.31583-10-quintela@redhat.com> In-Reply-To: <20230505004812.31583-1-quintela@redhat.com> References: <20230505004812.31583-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1683247845050100001 This could only happen if the source sent RAM_SAVE_FLAG_HOOK (i.e. rdma) and destination don't have CONFIG_RDMA. Signed-off-by: Juan Quintela Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20230504114443.23891-5-quintela@redhat.com> --- migration/qemu-file.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/migration/qemu-file.c b/migration/qemu-file.c index b7afc8d498..578b6309ba 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -345,14 +345,6 @@ void ram_control_load_hook(QEMUFile *f, uint64_t flags= , void *data) if (ret < 0) { qemu_file_set_error(f, ret); } - } else { - /* - * Hook is a hook specifically requested by the source sending a f= lag - * that expects there to be a hook on the destination. - */ - if (flags =3D=3D RAM_CONTROL_HOOK) { - qemu_file_set_error(f, -EINVAL); - } } } =20 --=20 2.40.0 From nobody Sat May 18 10:48:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683247923; cv=none; d=zohomail.com; s=zohoarc; b=NQgp4m+J1FxkRR+MH//WbMXv74zSqGEimGpJOWgPhDlFc0zsS7AKTYZS3xXIxiNIrpIShMbtu3vnpisnO9vZ8VSosUArwwmn95HHKkMIuE6+Dg7sn2L+WvxoBGGz+i79ogOre3I6zHOdW8CfadlyRUhwmhvc0vTT7lZQcX0ylLk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683247923; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=t9VbCH1BUc5dCY3vpQamrrAnEyyhHj4L4BSIXudcaB4=; b=U75rmuzeLYSRFfuY80qeuFxecz1DWym3I0JXU3lwRg2SN0fR7LBTpguz/wYjVRz+JOWviFnI/0Hm5sfhMbFxIIyVvtSzKuwH5ha9ND8HNgIlMN/6o2RK3Q0RY/2DYLZlBO7ToNeQ2UpuTP9BDUdT1KcVjOshPp2wepFhrfFVyhE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683247923531323.6891762575957; Thu, 4 May 2023 17:52:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pujcy-0004JG-A6; Thu, 04 May 2023 20:48:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcs-0004H6-FH for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcp-0001IE-QK for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:46 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-593-AxlFN8qGN46YKZXlPc3H8A-1; Thu, 04 May 2023 20:48:37 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ABF9F29AA3BD; Fri, 5 May 2023 00:48:36 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB650404B24D; Fri, 5 May 2023 00:48:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683247720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t9VbCH1BUc5dCY3vpQamrrAnEyyhHj4L4BSIXudcaB4=; b=cJ2JpUMy18S5fxn37TWe4R0sd5yloc9qODqERnh1Rf9tGON5HNFURbeozRpB0BMGmNwCR+ 5mzB7RzSQtFUssFfR2tdOJgm6LUFEnPqM1KvGMnnDglUz25tW5ui1EKRy0Udxdk6AuQP0x 8lbGCEt0N0oztJjNeb7HJaGjN5kQZpw= X-MC-Unique: AxlFN8qGN46YKZXlPc3H8A-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Eric Blake , Vladimir Sementsov-Ogievskiy , Stefan Hajnoczi , John Snow , Juan Quintela , qemu-block@nongnu.org, Leonardo Bras , Fam Zheng , Peter Xu , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 10/16] migration/rdma: Check for postcopy sooner Date: Fri, 5 May 2023 02:48:06 +0200 Message-Id: <20230505004812.31583-11-quintela@redhat.com> In-Reply-To: <20230505004812.31583-1-quintela@redhat.com> References: <20230505004812.31583-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1683247923936100001 It makes no sense first try to see if there is an rdma error and then do nothing on postcopy stage. Change it so we check we are in postcopy before doing anything. Signed-off-by: Juan Quintela Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20230504114443.23891-6-quintela@redhat.com> --- migration/rdma.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index 17c4b9206f..2cd8f1cc66 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -3234,19 +3234,19 @@ static size_t qemu_rdma_save_page(QEMUFile *f, RDMAContext *rdma; int ret; =20 - RCU_READ_LOCK_GUARD(); - rdma =3D qatomic_rcu_read(&rioc->rdmaout); - - if (!rdma) { - return -EIO; - } - - CHECK_ERROR_STATE(); - if (migration_in_postcopy()) { return RAM_SAVE_CONTROL_NOT_SUPP; } =20 + RCU_READ_LOCK_GUARD(); + rdma =3D qatomic_rcu_read(&rioc->rdmaout); + + if (!rdma) { + return -EIO; + } + + CHECK_ERROR_STATE(); + qemu_fflush(f); =20 /* @@ -3866,6 +3866,10 @@ static int qemu_rdma_registration_start(QEMUFile *f, QIOChannelRDMA *rioc =3D QIO_CHANNEL_RDMA(qemu_file_get_ioc(f)); RDMAContext *rdma; =20 + if (migration_in_postcopy()) { + return 0; + } + RCU_READ_LOCK_GUARD(); rdma =3D qatomic_rcu_read(&rioc->rdmaout); if (!rdma) { @@ -3874,10 +3878,6 @@ static int qemu_rdma_registration_start(QEMUFile *f, =20 CHECK_ERROR_STATE(); =20 - if (migration_in_postcopy()) { - return 0; - } - trace_qemu_rdma_registration_start(flags); qemu_put_be64(f, RAM_SAVE_FLAG_HOOK); qemu_fflush(f); @@ -3897,6 +3897,10 @@ static int qemu_rdma_registration_stop(QEMUFile *f, RDMAControlHeader head =3D { .len =3D 0, .repeat =3D 1 }; int ret =3D 0; =20 + if (migration_in_postcopy()) { + return 0; + } + RCU_READ_LOCK_GUARD(); rdma =3D qatomic_rcu_read(&rioc->rdmaout); if (!rdma) { @@ -3905,10 +3909,6 @@ static int qemu_rdma_registration_stop(QEMUFile *f, =20 CHECK_ERROR_STATE(); =20 - if (migration_in_postcopy()) { - return 0; - } - qemu_fflush(f); ret =3D qemu_rdma_drain_cq(f, rdma); =20 --=20 2.40.0 From nobody Sat May 18 10:48:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683247831; cv=none; d=zohomail.com; s=zohoarc; b=LvaOJmtIpqw4a3H7DP7tTKExZ55ERmtRqvCkW8AEHtDVjkaocQN6nMYn8rrp5SDAOy2sZhUgZ9d2+NHcxHUy5yc0vPGr/2H/KghA5E7HlS8g6vFFsd3xRxR8dcrE5leV5+eNeIFZpj8aHtNip16aiGXrxM7d7kyAC2A4BKL960g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683247831; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=G4FEacCIGM6kVKmqMn9bVOW9qdeGr7/FeQLVE7nW1xM=; b=ea2uePZ9c98cRepUXsljpzg5GDwgcuZJ9W0F015KWTzfObsZvUZGIAMjtW+oKJ9112K7gH5Lly2g89vujqsOgsgel42M4UCBdyWN6yshG6Ne4IRwQRHeR2RDU6tCJqCCfkLdPYF/L3MLndSQO3QfaBlqE4eMBpmV+eqknTrkjNA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683247831280995.9599414364069; Thu, 4 May 2023 17:50:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pujcz-0004KV-Cn; Thu, 04 May 2023 20:48:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcs-0004HN-Og for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcp-0001IS-RM for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:46 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-649-dQctjpPXPiyxvC7PNQdjpg-1; Thu, 04 May 2023 20:48:39 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B11FE109DCE5; Fri, 5 May 2023 00:48:38 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id F12F9404B24D; Fri, 5 May 2023 00:48:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683247722; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=G4FEacCIGM6kVKmqMn9bVOW9qdeGr7/FeQLVE7nW1xM=; b=BaBMwHGTOrUur69dsmKhotmrFy0NpY4OEVJArMEEmb0fXdxfVP+MmYzLT82zw7OkEUPspC DqieopJsaCabvtqJlrGzrwGizDQffhJ9QfyiCTbc+OVQ0MSyHKQjggjAiE8FhFa+D2D54p 3LRd1hYp7IS/VLuEjgWZJNWKCBNrgg4= X-MC-Unique: dQctjpPXPiyxvC7PNQdjpg-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Eric Blake , Vladimir Sementsov-Ogievskiy , Stefan Hajnoczi , John Snow , Juan Quintela , qemu-block@nongnu.org, Leonardo Bras , Fam Zheng , Peter Xu , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 11/16] migration: max_postcopy_bandwidth is a size parameter Date: Fri, 5 May 2023 02:48:07 +0200 Message-Id: <20230505004812.31583-12-quintela@redhat.com> In-Reply-To: <20230505004812.31583-1-quintela@redhat.com> References: <20230505004812.31583-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1683247831578100001 So make everything that uses it uint64_t no int64_t. Signed-off-by: Juan Quintela Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20230504113841.23130-2-quintela@redhat.com> --- migration/migration.c | 4 ++-- migration/options.c | 2 +- migration/options.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index feb5ab7493..232e387109 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2056,7 +2056,7 @@ static int postcopy_start(MigrationState *ms) QIOChannelBuffer *bioc; QEMUFile *fb; int64_t time_at_stop =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME); - int64_t bandwidth =3D migrate_max_postcopy_bandwidth(); + uint64_t bandwidth =3D migrate_max_postcopy_bandwidth(); bool restart_block =3D false; int cur_state =3D MIGRATION_STATUS_ACTIVE; =20 @@ -3176,7 +3176,7 @@ fail: void migrate_fd_connect(MigrationState *s, Error *error_in) { Error *local_err =3D NULL; - int64_t rate_limit; + uint64_t rate_limit; bool resume =3D s->state =3D=3D MIGRATION_STATUS_POSTCOPY_PAUSED; =20 /* diff --git a/migration/options.c b/migration/options.c index 7395787960..2e759cc306 100644 --- a/migration/options.c +++ b/migration/options.c @@ -717,7 +717,7 @@ uint64_t migrate_max_bandwidth(void) return s->parameters.max_bandwidth; } =20 -int64_t migrate_max_postcopy_bandwidth(void) +uint64_t migrate_max_postcopy_bandwidth(void) { MigrationState *s =3D migrate_get_current(); =20 diff --git a/migration/options.h b/migration/options.h index 09841d6a63..5cca3326d6 100644 --- a/migration/options.h +++ b/migration/options.h @@ -85,7 +85,7 @@ int migrate_decompress_threads(void); uint64_t migrate_downtime_limit(void); uint8_t migrate_max_cpu_throttle(void); uint64_t migrate_max_bandwidth(void); -int64_t migrate_max_postcopy_bandwidth(void); +uint64_t migrate_max_postcopy_bandwidth(void); int migrate_multifd_channels(void); MultiFDCompression migrate_multifd_compression(void); int migrate_multifd_zlib_level(void); --=20 2.40.0 From nobody Sat May 18 10:48:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683247924; cv=none; d=zohomail.com; s=zohoarc; b=fLWryxuskuyZMq9Ctn0z+t6UqWCcLIUyCsK7Iub0+RVEjpuq13PAhcidSi8gF1OHUhLeHXkDttzYcwuXH8k0jXO7a8gh/r2d5fIwK251+M3qA1Gvs1TQodIvUdvukeUGePgD2AQPPFELPI0bv7sKwerwLA9WbK4Oi/FaEtBsaL0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683247924; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=nPURkw5j/yJsflXTaxXIa9UkcEvDk6IdDUuPzAI8DcQ=; b=jqls2PnKvf88dHsRmBCOt4OjJHNiYfXAhnPe3oeQ1aryM+8a5PogZEqV+ChTIYLi6lN5mdk1K00j85kUdZsE205+EbzRoxnf+vgIIx8plWdj+7DDFqp+sQwm9WWfhFAUNuYXOZHw5QJ/+IiHwAAEMPhOCXsyDOmQTSRzyV7Z6m4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683247924760658.1374093359874; Thu, 4 May 2023 17:52:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pujcy-0004J1-2j; Thu, 04 May 2023 20:48:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcs-0004HM-Oh for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcp-0001Ic-QT for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:46 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-255-sRjpN0qIPq2ms4T4t8jW5w-1; Thu, 04 May 2023 20:48:41 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CE7E6A0F388; Fri, 5 May 2023 00:48:40 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id 171CC404B24D; Fri, 5 May 2023 00:48:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683247723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nPURkw5j/yJsflXTaxXIa9UkcEvDk6IdDUuPzAI8DcQ=; b=NVKIenSwmz47vT8r3SfY1S/mXoFM2rk1L3dmWmaVxvmjDZNKT/CNEMgWEAnjiHR7Xs9pXG OrVM2J/IBpJZOJFAS30P9627oCf63/OzvtV+Ka5/DSSPeJjTeTWBpMSvrE+/qx9G4LC/bu LodLLBNB+Y3+mXAzNlpnUWAnddsbBAw= X-MC-Unique: sRjpN0qIPq2ms4T4t8jW5w-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Eric Blake , Vladimir Sementsov-Ogievskiy , Stefan Hajnoczi , John Snow , Juan Quintela , qemu-block@nongnu.org, Leonardo Bras , Fam Zheng , Peter Xu , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 12/16] migration: qemu_file_total_transferred() function is monotonic Date: Fri, 5 May 2023 02:48:08 +0200 Message-Id: <20230505004812.31583-13-quintela@redhat.com> In-Reply-To: <20230505004812.31583-1-quintela@redhat.com> References: <20230505004812.31583-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1683247925684100009 So delta_bytes can only be greater or equal to zero. Never negative. Signed-off-by: Juan Quintela Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20230504113841.23130-3-quintela@redhat.com> --- migration/block.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/migration/block.c b/migration/block.c index 6d532ac7a2..3499f75e37 100644 --- a/migration/block.c +++ b/migration/block.c @@ -801,13 +801,7 @@ static int block_save_iterate(QEMUFile *f, void *opaqu= e) =20 qemu_put_be64(f, BLK_MIG_FLAG_EOS); delta_bytes =3D qemu_file_total_transferred(f) - last_bytes; - if (delta_bytes > 0) { - return 1; - } else if (delta_bytes < 0) { - return -1; - } else { - return 0; - } + return (delta_bytes > 0); } =20 /* Called with iothread lock taken. */ --=20 2.40.0 From nobody Sat May 18 10:48:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683247756; cv=none; d=zohomail.com; s=zohoarc; b=Az5GQ9Zp/WP7mbE+rFvW3rRKd8xenu9dzJCQM2uQzUkRu6kLcMFXKTI+bHLbugG45SkX6M/HkbM1f57MunJc6VMcrAmH8OXeynH/wQ9+3Cg+tiUdylRHwjIlgMCKvb1SU+sy535oAGSar7rLk503czY0Aa/Mkx4A4JUCS+Pwy9o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683247756; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GMHVWDrUVThsbU822PlnSGgs3d+7PgiPydjzn5UTjJ8=; b=Og7CC48Ht8Prf+48uGVx1ja2DWAgz1YGIDCirxQG5rMPxOhcIQ2W0U3y09Z3aKmwVYNP0T5ot+JKmaEUJoU4D2vc4G31wjLBaywGgbPxqYdMAYyVHPAYsKmqQZBGq2iGSvsTfmJh0ZTqfX5THbRk82SdyTds/jFjOmvA55emGkg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683247756681670.9593216433975; Thu, 4 May 2023 17:49:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pujd0-0004L5-7X; Thu, 04 May 2023 20:48:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcv-0004IU-0y for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcs-0001JU-Uq for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:48 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-658-HJaMHiPaOna2c6GsMOj49g-1; Thu, 04 May 2023 20:48:43 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D0D173804524; Fri, 5 May 2023 00:48:42 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1C722404B24D; Fri, 5 May 2023 00:48:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683247726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GMHVWDrUVThsbU822PlnSGgs3d+7PgiPydjzn5UTjJ8=; b=XZQGaffLorOu/LVH7QhFcMdH6/kMLkL4Dh8u7icttEpsVTSGSvHmFY+qkQTeKOeF4UBr78 XiQ7TZB1217BfWx/J+1FuyiZXetmeFS2caud2333rcSmI6aC0UXtLD6iTSsjccQl5cE2sq WnOmK5ICbq1fpNStDcyHRdylFAHY6Ig= X-MC-Unique: HJaMHiPaOna2c6GsMOj49g-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Eric Blake , Vladimir Sementsov-Ogievskiy , Stefan Hajnoczi , John Snow , Juan Quintela , qemu-block@nongnu.org, Leonardo Bras , Fam Zheng , Peter Xu , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 13/16] qemu-file: No need to check for shutdown in qemu_file_rate_limit Date: Fri, 5 May 2023 02:48:09 +0200 Message-Id: <20230505004812.31583-14-quintela@redhat.com> In-Reply-To: <20230505004812.31583-1-quintela@redhat.com> References: <20230505004812.31583-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1683247758298100003 After calling qemu_file_shutdown() we set the error as -EIO if there is no another previous error, so no need to check it here. Signed-off-by: Juan Quintela Reviewed-by: Peter Xu Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20230504113841.23130-6-quintela@redhat.com> --- migration/qemu-file.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/migration/qemu-file.c b/migration/qemu-file.c index 578b6309ba..a4ea808b15 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -732,9 +732,6 @@ int64_t qemu_file_total_transferred(QEMUFile *f) =20 int qemu_file_rate_limit(QEMUFile *f) { - if (f->shutdown) { - return 1; - } if (qemu_file_get_error(f)) { return 1; } --=20 2.40.0 From nobody Sat May 18 10:48:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683247816; cv=none; d=zohomail.com; s=zohoarc; b=jisDb5INtXlJXylNlzUXqQjshWtcLoH2ODB0LMuwASCkZWEEbboh6dCjYCHtkvov8apBKFfWlnPfISjzrK0Wg/jzvGJoDNt7dTvarAszgms3VpKO4BYuYHAIf0ffujC2CNPWkSqnbBW8KqQhKo4nTgEH8BvaF6YczGT62YyxdAE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683247816; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=X6w8sOJRe6wCelxSx0qtSHd7pwjwIwAdKWeFp1YCBlo=; b=SNTVN8d1vHxUnRb98OqT69IZ9k+nO9/OFjp4oN0SqIUVig+9Tv5MBr0DwnbcQVg6Y3x3dIGwsLJMDdMa1AFEfxM26MHu/RBJfm+qJlS+ClrS6uYY3Xway/UKF66K5/9+5FO/aNFtXASHEpNxS2MGC0nW/MGA/lKzcfbvAupKwKA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683247816710623.4872825216636; Thu, 4 May 2023 17:50:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pujd0-0004Lg-JE; Thu, 04 May 2023 20:48:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcw-0004Iz-Ip for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcv-0001KI-2i for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:50 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-117-LSzXgEC4MJ6u1Hy6rLSM4g-1; Thu, 04 May 2023 20:48:45 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D5140101A531; Fri, 5 May 2023 00:48:44 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1F5EC404B24D; Fri, 5 May 2023 00:48:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683247728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X6w8sOJRe6wCelxSx0qtSHd7pwjwIwAdKWeFp1YCBlo=; b=hrNybDvaYFoM45ef4QOVq+TP2a4lTl7nLVz4RAc/A1OWbV8+Wy1DJh062Q4C2rpL2YadQj 3lrSJqZx8h+u0HLy8SCDQdzBYx0sdb0XUX74qqc1/4YqnXeU0aLHxuDaYC2cwSovw2T+LW G8S6GWE03mCv1OAPeYhp+US1/86RHtk= X-MC-Unique: LSzXgEC4MJ6u1Hy6rLSM4g-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Eric Blake , Vladimir Sementsov-Ogievskiy , Stefan Hajnoczi , John Snow , Juan Quintela , qemu-block@nongnu.org, Leonardo Bras , Fam Zheng , Peter Xu , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 14/16] qemu-file: remove shutdown member Date: Fri, 5 May 2023 02:48:10 +0200 Message-Id: <20230505004812.31583-15-quintela@redhat.com> In-Reply-To: <20230505004812.31583-1-quintela@redhat.com> References: <20230505004812.31583-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1683247816949100001 The first thing that we do after setting the shutdown value is set the error as -EIO if there is not a previous error. So this value is redundant. Just remove it and use qemu_file_get_error() in the places that it was tested. Signed-off-by: Juan Quintela Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Xu Message-Id: <20230504113841.23130-7-quintela@redhat.com> --- migration/qemu-file.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/migration/qemu-file.c b/migration/qemu-file.c index a4ea808b15..11b510aa29 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -63,8 +63,6 @@ struct QEMUFile { =20 int last_error; Error *last_error_obj; - /* has the file has been shutdown */ - bool shutdown; }; =20 /* @@ -78,8 +76,6 @@ int qemu_file_shutdown(QEMUFile *f) { int ret =3D 0; =20 - f->shutdown =3D true; - /* * We must set qemufile error before the real shutdown(), otherwise * there can be a race window where we thought IO all went though @@ -294,7 +290,7 @@ void qemu_fflush(QEMUFile *f) return; } =20 - if (f->shutdown) { + if (qemu_file_get_error(f)) { return; } if (f->iovcnt > 0) { @@ -397,7 +393,7 @@ static ssize_t coroutine_mixed_fn qemu_fill_buffer(QEMU= File *f) f->buf_index =3D 0; f->buf_size =3D pending; =20 - if (f->shutdown) { + if (qemu_file_get_error(f)) { return 0; } =20 @@ -486,7 +482,7 @@ static int add_to_iovec(QEMUFile *f, const uint8_t *buf= , size_t size, } else { if (f->iovcnt >=3D MAX_IOV_SIZE) { /* Should only happen if a previous fflush failed */ - assert(f->shutdown || !qemu_file_is_writable(f)); + assert(qemu_file_get_error(f) || !qemu_file_is_writable(f)); return 1; } if (may_free) { --=20 2.40.0 From nobody Sat May 18 10:48:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683247777; cv=none; d=zohomail.com; s=zohoarc; b=GlANDC5uaP1PS1e/s6XKQLKZiUmDnK929UThKWbpNctEPfHZyN/6ouRjkTfpgo1Mepc6nFYleID/lbJhdd39oBlS4F+LKUBl4kN+PkyFQVWMHncofYOkaQtNSwki1dMNJXiFfgKJER00URcpMiqsJtE9M6NoXKRPXQWrgc1T+wQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683247777; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jFbyi6f+EalG6POKGAdgY+0P92ESpJvgeM/xst5KKos=; b=FxiKyNHbhesK0S6qajpwfZLdX1nYg9fAsMivzrwrhf3Brs5CVu23wuBa0gHb7ECEtSLShWGt9wW5aBy0u62YpRgMqRBeziyWgN03WrDask9aYoa/JRcKC3O/BT8iae0DWB7nGo4hCKFoti+hOe2ZOW/gr5E/0UyXFnYFW9OyFlQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 168324777793720.065340830647187; Thu, 4 May 2023 17:49:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pujd1-0004MJ-Md; Thu, 04 May 2023 20:48:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcz-0004Ku-Tq for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcx-0001Kw-93 for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:53 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-211-cc7fmGLuNzuhR4VX3wmi7Q-1; Thu, 04 May 2023 20:48:47 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 009DC1C068C1; Fri, 5 May 2023 00:48:47 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id 22249404B24D; Fri, 5 May 2023 00:48:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683247730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jFbyi6f+EalG6POKGAdgY+0P92ESpJvgeM/xst5KKos=; b=B87uEvcF5UO63viWySCOjNLQlEgeREg+2S6umP7kTGiI75ls4sa8oNusFwJro9HEWQl9Rz sKe6VbNw53ehNAolXZ4ZnOanE91o1s5GVi+C87440akEUZ7x7AQzW90DLZ/Ec4lpMasNAv c3A9Xr0IDATXacZm3KIYTToRo/Xy2Gk= X-MC-Unique: cc7fmGLuNzuhR4VX3wmi7Q-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Eric Blake , Vladimir Sementsov-Ogievskiy , Stefan Hajnoczi , John Snow , Juan Quintela , qemu-block@nongnu.org, Leonardo Bras , Fam Zheng , Peter Xu , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 15/16] qemu-file: Make total_transferred an uint64_t Date: Fri, 5 May 2023 02:48:11 +0200 Message-Id: <20230505004812.31583-16-quintela@redhat.com> In-Reply-To: <20230505004812.31583-1-quintela@redhat.com> References: <20230505004812.31583-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1683247779467100003 Change all the functions that use it. It was already passed as uint64_t. Signed-off-by: Juan Quintela Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20230504113841.23130-8-quintela@redhat.com> --- migration/block.c | 5 ++--- migration/qemu-file.c | 8 ++++---- migration/qemu-file.h | 4 ++-- migration/savevm.c | 6 ++---- migration/vmstate.c | 2 +- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/migration/block.c b/migration/block.c index 3499f75e37..a37678ce95 100644 --- a/migration/block.c +++ b/migration/block.c @@ -747,8 +747,7 @@ static int block_save_setup(QEMUFile *f, void *opaque) static int block_save_iterate(QEMUFile *f, void *opaque) { int ret; - int64_t last_bytes =3D qemu_file_total_transferred(f); - int64_t delta_bytes; + uint64_t last_bytes =3D qemu_file_total_transferred(f); =20 trace_migration_block_save("iterate", block_mig_state.submitted, block_mig_state.transferred); @@ -800,7 +799,7 @@ static int block_save_iterate(QEMUFile *f, void *opaque) } =20 qemu_put_be64(f, BLK_MIG_FLAG_EOS); - delta_bytes =3D qemu_file_total_transferred(f) - last_bytes; + uint64_t delta_bytes =3D qemu_file_total_transferred(f) - last_bytes; return (delta_bytes > 0); } =20 diff --git a/migration/qemu-file.c b/migration/qemu-file.c index 11b510aa29..ccbefc347e 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -51,7 +51,7 @@ struct QEMUFile { int64_t rate_limit_used; =20 /* The sum of bytes transferred on the wire */ - int64_t total_transferred; + uint64_t total_transferred; =20 int buf_index; int buf_size; /* 0 when writing */ @@ -708,9 +708,9 @@ int coroutine_mixed_fn qemu_get_byte(QEMUFile *f) return result; } =20 -int64_t qemu_file_total_transferred_fast(QEMUFile *f) +uint64_t qemu_file_total_transferred_fast(QEMUFile *f) { - int64_t ret =3D f->total_transferred; + uint64_t ret =3D f->total_transferred; int i; =20 for (i =3D 0; i < f->iovcnt; i++) { @@ -720,7 +720,7 @@ int64_t qemu_file_total_transferred_fast(QEMUFile *f) return ret; } =20 -int64_t qemu_file_total_transferred(QEMUFile *f) +uint64_t qemu_file_total_transferred(QEMUFile *f) { qemu_fflush(f); return f->total_transferred; diff --git a/migration/qemu-file.h b/migration/qemu-file.h index d16cd50448..4f26bf6961 100644 --- a/migration/qemu-file.h +++ b/migration/qemu-file.h @@ -83,7 +83,7 @@ int qemu_fclose(QEMUFile *f); * * Returns: the total bytes transferred */ -int64_t qemu_file_total_transferred(QEMUFile *f); +uint64_t qemu_file_total_transferred(QEMUFile *f); =20 /* * qemu_file_total_transferred_fast: @@ -95,7 +95,7 @@ int64_t qemu_file_total_transferred(QEMUFile *f); * * Returns: the total bytes transferred and queued */ -int64_t qemu_file_total_transferred_fast(QEMUFile *f); +uint64_t qemu_file_total_transferred_fast(QEMUFile *f); =20 /* * put_buffer without copying the buffer. diff --git a/migration/savevm.c b/migration/savevm.c index a9d0a88e62..032044b1d5 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -927,11 +927,9 @@ static int vmstate_load(QEMUFile *f, SaveStateEntry *s= e) static void vmstate_save_old_style(QEMUFile *f, SaveStateEntry *se, JSONWriter *vmdesc) { - int64_t old_offset, size; - - old_offset =3D qemu_file_total_transferred_fast(f); + uint64_t old_offset =3D qemu_file_total_transferred_fast(f); se->ops->save_state(f, se->opaque); - size =3D qemu_file_total_transferred_fast(f) - old_offset; + uint64_t size =3D qemu_file_total_transferred_fast(f) - old_offset; =20 if (vmdesc) { json_writer_int64(vmdesc, "size", size); diff --git a/migration/vmstate.c b/migration/vmstate.c index 83ca4c7d3e..351f56104e 100644 --- a/migration/vmstate.c +++ b/migration/vmstate.c @@ -349,7 +349,7 @@ int vmstate_save_state_v(QEMUFile *f, const VMStateDesc= ription *vmsd, void *first_elem =3D opaque + field->offset; int i, n_elems =3D vmstate_n_elems(opaque, field); int size =3D vmstate_size(opaque, field); - int64_t old_offset, written_bytes; + uint64_t old_offset, written_bytes; JSONWriter *vmdesc_loop =3D vmdesc; =20 trace_vmstate_save_state_loop(vmsd->name, field->name, n_elems= ); --=20 2.40.0 From nobody Sat May 18 10:48:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683247924; cv=none; d=zohomail.com; s=zohoarc; b=bfEWg4uqot+HBqAAIs6VyqopPIvZmcjBZp/4xOG3XD+Jr6h2ZX7IhNjSxgKM7Ne5i2ZfXTYIa7mnrIWl/q5dNwneWJ0PfXAg+NrJSyEZd9o1TieMlmStqbiD3gttAtnrXohKtDmVtd+qv7TzuuMaxURBdfVvNvWcs0GS51HwhxE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683247924; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=rrEtDO7dkFbj86NPv7r1AaJp3ELJVmhsZHuf7zA1gkA=; b=EdX6QFsGoIN4xcGYHB0/xb500cuQTfbSFoCz3N4MUInsEyckxSfSJi4AJC6F2XsDcCqZ1D4UgbtofSg3tR8fc3ENVpK1t4XoBzQHAN7d+hXqvCCaVj3xnSVQJv/r2K2wOMkdiCKLGvFQxwMhhW3r29HLbcLFP2cLyWEi27wF89g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683247924098581.3918789692807; Thu, 4 May 2023 17:52:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pujd2-0004ND-7W; Thu, 04 May 2023 20:48:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujd0-0004Lf-Fu for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pujcz-0001LT-64 for qemu-devel@nongnu.org; Thu, 04 May 2023 20:48:54 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-490-75OTIbe7PF6zSIwF92WvKg-1; Thu, 04 May 2023 20:48:49 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 041C0811E7E; Fri, 5 May 2023 00:48:49 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45C3F404B24D; Fri, 5 May 2023 00:48:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683247732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rrEtDO7dkFbj86NPv7r1AaJp3ELJVmhsZHuf7zA1gkA=; b=gSG0/Q8W9q5PAKWHTjEbxqEE/NpdkYfsRHPbT3XpIf5B3EmsX1GLrgalZFhOdSXPss3Tro yqAcbMgsSh3V6sDNxya+MxtIOd8ZPrwECk6u8K3Wt972jfKK0lmqrxW3QVsqUjvmaaiy2b 96Mxd+Cd/xSS3mjQhi8XwZO37XpqQvQ= X-MC-Unique: 75OTIbe7PF6zSIwF92WvKg-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Eric Blake , Vladimir Sementsov-Ogievskiy , Stefan Hajnoczi , John Snow , Juan Quintela , qemu-block@nongnu.org, Leonardo Bras , Fam Zheng , Peter Xu , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 16/16] qemu-file: Make ram_control_save_page() use accessors for rate_limit Date: Fri, 5 May 2023 02:48:12 +0200 Message-Id: <20230505004812.31583-17-quintela@redhat.com> In-Reply-To: <20230505004812.31583-1-quintela@redhat.com> References: <20230505004812.31583-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1683247926134100011 Signed-off-by: Juan Quintela Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Xu Message-Id: <20230504113841.23130-9-quintela@redhat.com> --- migration/qemu-file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/qemu-file.c b/migration/qemu-file.c index ccbefc347e..f4cfd05c67 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -352,7 +352,7 @@ size_t ram_control_save_page(QEMUFile *f, ram_addr_t bl= ock_offset, int ret =3D f->hooks->save_page(f, block_offset, offset, size, bytes_sent); if (ret !=3D RAM_SAVE_CONTROL_NOT_SUPP) { - f->rate_limit_used +=3D size; + qemu_file_acct_rate_limit(f, size); } =20 if (ret !=3D RAM_SAVE_CONTROL_DELAYED && --=20 2.40.0