From nobody Sun Nov 24 08:27:48 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1724702125; cv=none; d=zohomail.com; s=zohoarc; b=EYmMloch+tNnagH1m9L34+NzZ26WNyTgKck2dQLRQJPMdE2c2aczGYtzJudZC3nh0WRp72k79VKH+mRV/m8cyAZHsSsnbpZpfl2PxGSRYS4JB7yoiO+72ddr0aXj9EQFsepcStdtEdjjCVERxRxW1aYL1bQLt1ug+y7S7A3B5a4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1724702125; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=H2Ko9dfIYywBCHTciEx7It8uBibggU527KNYZlqsze4=; b=OibRxC5ujYDffx3w6yqMf6nLOqWPTqsOOC719fyVrGxML2b8XsLgH2NeK8ncQ32eMDi3JqOVTUSCuQZWaueI3sKRPl3sHO9AxD9kWv5sRXXppDfDFNLAJnkGZjyNiAUBnVkpsrQ9fdvlAMGK1n4e2t+LZsrvmbtHjQkvdVkwrhA= 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 172470212514188.70451084377328; Mon, 26 Aug 2024 12:55:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sifmz-0000BE-8h; Mon, 26 Aug 2024 15:54:09 -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 1sifmu-0008Kv-RB for qemu-devel@nongnu.org; Mon, 26 Aug 2024 15:54:04 -0400 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sifmr-0002FZ-Q6 for qemu-devel@nongnu.org; Mon, 26 Aug 2024 15:54:04 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id C31B41F8B2; Mon, 26 Aug 2024 19:53:58 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 61BA41398D; Mon, 26 Aug 2024 19:53:57 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id AE40ClXdzGY5PQAAD6G6ig (envelope-from ); Mon, 26 Aug 2024 19:53:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1724702038; h=from:from:reply-to: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=H2Ko9dfIYywBCHTciEx7It8uBibggU527KNYZlqsze4=; b=Jn2DNBJtTfRTSaMxCXVhZOytkgbrOjG5Ho+yuHCQ/78mYWOQGRaTWJbXTsklgEIXrHhygh o7J7591TyhgtUTB4NYa9WPf1F2OYPwpiMJH9HSCxb0Y9vsdnjp8FrRqwQmZRkXkzXk2QFa fyilyoH2KV1n8Dvu8wWbbQXmoYU7TI0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1724702038; h=from:from:reply-to: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=H2Ko9dfIYywBCHTciEx7It8uBibggU527KNYZlqsze4=; b=3BoaKMNs7LTz4qa+javSo3kGdDO1GgggDgiax6mZ+g/jMHQfM6N4aA43eaek3qwn5OaZyw CA6lGMn167JseiCw== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=Jn2DNBJt; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=3BoaKMNs DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1724702038; h=from:from:reply-to: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=H2Ko9dfIYywBCHTciEx7It8uBibggU527KNYZlqsze4=; b=Jn2DNBJtTfRTSaMxCXVhZOytkgbrOjG5Ho+yuHCQ/78mYWOQGRaTWJbXTsklgEIXrHhygh o7J7591TyhgtUTB4NYa9WPf1F2OYPwpiMJH9HSCxb0Y9vsdnjp8FrRqwQmZRkXkzXk2QFa fyilyoH2KV1n8Dvu8wWbbQXmoYU7TI0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1724702038; h=from:from:reply-to: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=H2Ko9dfIYywBCHTciEx7It8uBibggU527KNYZlqsze4=; b=3BoaKMNs7LTz4qa+javSo3kGdDO1GgggDgiax6mZ+g/jMHQfM6N4aA43eaek3qwn5OaZyw CA6lGMn167JseiCw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , "Maciej S . Szmigiero" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v5 17/18] migration/multifd: Make MultiFDMethods const Date: Mon, 26 Aug 2024 16:53:21 -0300 Message-Id: <20240826195322.16532-18-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240826195322.16532-1-farosas@suse.de> References: <20240826195322.16532-1-farosas@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: C31B41F8B2 X-Spam-Score: -3.51 X-Rspamd-Action: no action X-Spamd-Result: default: False [-3.51 / 50.00]; BAYES_HAM(-3.00)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; MIME_TRACE(0.00)[0:+]; R_RATELIMIT(0.00)[to_ip_from(RLh86bwecppbq6yc1rdt9t5mys)]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org 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=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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 @suse.de) X-ZM-MESSAGEID: 1724702126009116600 The methods are defined at module_init time and don't ever change. Make them const. Suggested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Fabiano Rosas --- migration/multifd-nocomp.c | 2 +- migration/multifd-qpl.c | 2 +- migration/multifd-uadk.c | 2 +- migration/multifd-zlib.c | 2 +- migration/multifd-zstd.c | 2 +- migration/multifd.c | 8 ++++---- migration/multifd.h | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/migration/multifd-nocomp.c b/migration/multifd-nocomp.c index 53ea9f9c83..f294d1b0b2 100644 --- a/migration/multifd-nocomp.c +++ b/migration/multifd-nocomp.c @@ -377,7 +377,7 @@ bool multifd_send_prepare_common(MultiFDSendParams *p) return true; } =20 -static MultiFDMethods multifd_nocomp_ops =3D { +static const MultiFDMethods multifd_nocomp_ops =3D { .send_setup =3D multifd_nocomp_send_setup, .send_cleanup =3D multifd_nocomp_send_cleanup, .send_prepare =3D multifd_nocomp_send_prepare, diff --git a/migration/multifd-qpl.c b/migration/multifd-qpl.c index 75041a4c4d..b0f1e2ba46 100644 --- a/migration/multifd-qpl.c +++ b/migration/multifd-qpl.c @@ -694,7 +694,7 @@ static int multifd_qpl_recv(MultiFDRecvParams *p, Error= **errp) return multifd_qpl_decompress_pages_slow_path(p, errp); } =20 -static MultiFDMethods multifd_qpl_ops =3D { +static const MultiFDMethods multifd_qpl_ops =3D { .send_setup =3D multifd_qpl_send_setup, .send_cleanup =3D multifd_qpl_send_cleanup, .send_prepare =3D multifd_qpl_send_prepare, diff --git a/migration/multifd-uadk.c b/migration/multifd-uadk.c index db2549f59b..89f6a72f0e 100644 --- a/migration/multifd-uadk.c +++ b/migration/multifd-uadk.c @@ -305,7 +305,7 @@ static int multifd_uadk_recv(MultiFDRecvParams *p, Erro= r **errp) return 0; } =20 -static MultiFDMethods multifd_uadk_ops =3D { +static const MultiFDMethods multifd_uadk_ops =3D { .send_setup =3D multifd_uadk_send_setup, .send_cleanup =3D multifd_uadk_send_cleanup, .send_prepare =3D multifd_uadk_send_prepare, diff --git a/migration/multifd-zlib.c b/migration/multifd-zlib.c index 6787538762..8cf8a26bb4 100644 --- a/migration/multifd-zlib.c +++ b/migration/multifd-zlib.c @@ -277,7 +277,7 @@ static int multifd_zlib_recv(MultiFDRecvParams *p, Erro= r **errp) return 0; } =20 -static MultiFDMethods multifd_zlib_ops =3D { +static const MultiFDMethods multifd_zlib_ops =3D { .send_setup =3D multifd_zlib_send_setup, .send_cleanup =3D multifd_zlib_send_cleanup, .send_prepare =3D multifd_zlib_send_prepare, diff --git a/migration/multifd-zstd.c b/migration/multifd-zstd.c index 1576b1e2ad..53da33e048 100644 --- a/migration/multifd-zstd.c +++ b/migration/multifd-zstd.c @@ -265,7 +265,7 @@ static int multifd_zstd_recv(MultiFDRecvParams *p, Erro= r **errp) return 0; } =20 -static MultiFDMethods multifd_zstd_ops =3D { +static const MultiFDMethods multifd_zstd_ops =3D { .send_setup =3D multifd_zstd_send_setup, .send_cleanup =3D multifd_zstd_send_cleanup, .send_prepare =3D multifd_zstd_send_prepare, diff --git a/migration/multifd.c b/migration/multifd.c index 0c07a2040b..b89715fdc2 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -76,7 +76,7 @@ struct { */ int exiting; /* multifd ops */ - MultiFDMethods *ops; + const MultiFDMethods *ops; } *multifd_send_state; =20 struct { @@ -93,7 +93,7 @@ struct { uint64_t packet_num; int exiting; /* multifd ops */ - MultiFDMethods *ops; + const MultiFDMethods *ops; } *multifd_recv_state; =20 MultiFDSendData *multifd_send_data_alloc(void) @@ -128,9 +128,9 @@ void multifd_send_channel_created(void) qemu_sem_post(&multifd_send_state->channels_created); } =20 -static MultiFDMethods *multifd_ops[MULTIFD_COMPRESSION__MAX] =3D {}; +static const MultiFDMethods *multifd_ops[MULTIFD_COMPRESSION__MAX] =3D {}; =20 -void multifd_register_ops(int method, MultiFDMethods *ops) +void multifd_register_ops(int method, const MultiFDMethods *ops) { assert(0 <=3D method && method < MULTIFD_COMPRESSION__MAX); assert(!multifd_ops[method]); diff --git a/migration/multifd.h b/migration/multifd.h index a3e35196d1..13e7a88c01 100644 --- a/migration/multifd.h +++ b/migration/multifd.h @@ -243,7 +243,7 @@ typedef struct { int (*recv)(MultiFDRecvParams *p, Error **errp); } MultiFDMethods; =20 -void multifd_register_ops(int method, MultiFDMethods *ops); +void multifd_register_ops(int method, const MultiFDMethods *ops); void multifd_send_fill_packet(MultiFDSendParams *p); bool multifd_send_prepare_common(MultiFDSendParams *p); void multifd_send_zero_page_detect(MultiFDSendParams *p); --=20 2.35.3