From nobody Sun Nov 24 09:53:20 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=1724780844; cv=none; d=zohomail.com; s=zohoarc; b=bYn9aE+QRov7Z5bJ6sEAiY0IjJkzWkiFmUw/NUJUSZFK6mfi0/3JE/YWwu0yWwGRzR7DEAyJhDBIdXETloL4JE9IVAFw7QdH0/ZLJZvQS8j4vFflZuJg/q7EVgoH65gBqrH0+LP4sMXidssXEjn9M9HoclyD5/VQXhYvHJjzfZI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1724780844; h=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=3N/cbFy0MXlrNeVqrxMB3+ZmXakOnSm1XJUUwoNWCgA=; b=KVjCBhONFOCNP6XlYKci5MVPHt4iBh0TG200HyFszU8bKYU/9j/haFlDka4jm0YsEQzDTmyEurqEzsH6kR/ZWV+XT/gKP/A7FgrVqP2Pq1DWKt2G+trJeb1CFNKFx/69P/V9vzngLmeVmQGpCCW3Qxfl8x3mZkrte4M0NHkJscM= 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 1724780844247503.4401465681427; Tue, 27 Aug 2024 10:47:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sj0HF-0002MC-Sj; Tue, 27 Aug 2024 13:46:45 -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 1sj0HC-00027F-1g for qemu-devel@nongnu.org; Tue, 27 Aug 2024 13:46:42 -0400 Received: from smtp-out1.suse.de ([195.135.223.130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sj0H9-0000Wj-AE for qemu-devel@nongnu.org; Tue, 27 Aug 2024 13:46:41 -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-out1.suse.de (Postfix) with ESMTPS id 0922F21B1B; Tue, 27 Aug 2024 17:46:37 +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 9D4DB13A20; Tue, 27 Aug 2024 17:46:35 +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 6Cz1GPsQzma+UAAAD6G6ig (envelope-from ); Tue, 27 Aug 2024 17:46:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1724780797; h=from:from:reply-to: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=3N/cbFy0MXlrNeVqrxMB3+ZmXakOnSm1XJUUwoNWCgA=; b=pZaJHQ/piA3COdV0f4v/oPcizVwR/URwBWJTmQ4YijOaqUxR6hG/czM+gHsl5punlnagJv CvMQ6F+rI6aCfvrQwtbKxqEzGaq16z2fMr2jljJSLixzU3M760/2o01lnxnUstKKb/8XH3 DMjiHXdExBquVAaTYUx1cg7WUC3beSU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1724780797; h=from:from:reply-to: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=3N/cbFy0MXlrNeVqrxMB3+ZmXakOnSm1XJUUwoNWCgA=; b=7aX8yrG6LrRo1OmEYca4t57WnT5l0ZN77EKXTlURWu1DrmBPdVsAKKynY+8GfpbDcEjs4/ TdoDzXsi5TV+PfCg== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="pZaJHQ/p"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=7aX8yrG6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1724780797; h=from:from:reply-to: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=3N/cbFy0MXlrNeVqrxMB3+ZmXakOnSm1XJUUwoNWCgA=; b=pZaJHQ/piA3COdV0f4v/oPcizVwR/URwBWJTmQ4YijOaqUxR6hG/czM+gHsl5punlnagJv CvMQ6F+rI6aCfvrQwtbKxqEzGaq16z2fMr2jljJSLixzU3M760/2o01lnxnUstKKb/8XH3 DMjiHXdExBquVAaTYUx1cg7WUC3beSU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1724780797; h=from:from:reply-to: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=3N/cbFy0MXlrNeVqrxMB3+ZmXakOnSm1XJUUwoNWCgA=; b=7aX8yrG6LrRo1OmEYca4t57WnT5l0ZN77EKXTlURWu1DrmBPdVsAKKynY+8GfpbDcEjs4/ TdoDzXsi5TV+PfCg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , "Maciej S . Szmigiero" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v6 14/19] migration/multifd: Standardize on multifd ops names Date: Tue, 27 Aug 2024 14:46:01 -0300 Message-Id: <20240827174606.10352-15-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240827174606.10352-1-farosas@suse.de> References: <20240827174606.10352-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 0922F21B1B X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; 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)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCPT_COUNT_THREE(0.00)[4]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email, suse.de:dkim, suse.de:mid, imap1.dmz-prg2.suse.org:helo, imap1.dmz-prg2.suse.org:rdns] X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Action: no action X-Spam-Score: -3.01 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.130; envelope-from=farosas@suse.de; helo=smtp-out1.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, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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 @suse.de) X-ZM-MESSAGEID: 1724780846802116600 Content-Type: text/plain; charset="utf-8" Add the multifd_ prefix to all functions and remove the useless docstrings. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/multifd-qpl.c | 57 ---------------------------- migration/multifd-uadk.c | 55 --------------------------- migration/multifd-zlib.c | 81 ++++++---------------------------------- migration/multifd-zstd.c | 81 ++++++---------------------------------- migration/multifd.c | 78 ++++++-------------------------------- 5 files changed, 36 insertions(+), 316 deletions(-) diff --git a/migration/multifd-qpl.c b/migration/multifd-qpl.c index 21153f1987..75041a4c4d 100644 --- a/migration/multifd-qpl.c +++ b/migration/multifd-qpl.c @@ -220,16 +220,6 @@ static void multifd_qpl_deinit(QplData *qpl) } } =20 -/** - * multifd_qpl_send_setup: set up send side - * - * Set up the channel with QPL compression. - * - * Returns 0 on success or -1 on error - * - * @p: Params for the channel being used - * @errp: pointer to an error - */ static int multifd_qpl_send_setup(MultiFDSendParams *p, Error **errp) { QplData *qpl; @@ -251,14 +241,6 @@ static int multifd_qpl_send_setup(MultiFDSendParams *p= , Error **errp) return 0; } =20 -/** - * multifd_qpl_send_cleanup: clean up send side - * - * Close the channel and free memory. - * - * @p: Params for the channel being used - * @errp: pointer to an error - */ static void multifd_qpl_send_cleanup(MultiFDSendParams *p, Error **errp) { multifd_qpl_deinit(p->compress_data); @@ -487,17 +469,6 @@ static void multifd_qpl_compress_pages(MultiFDSendPara= ms *p) } } =20 -/** - * multifd_qpl_send_prepare: prepare data to be able to send - * - * Create a compressed buffer with all the pages that we are going to - * send. - * - * Returns 0 on success or -1 on error - * - * @p: Params for the channel being used - * @errp: pointer to an error - */ static int multifd_qpl_send_prepare(MultiFDSendParams *p, Error **errp) { QplData *qpl =3D p->compress_data; @@ -523,16 +494,6 @@ out: return 0; } =20 -/** - * multifd_qpl_recv_setup: set up receive side - * - * Create the compressed channel and buffer. - * - * Returns 0 on success or -1 on error - * - * @p: Params for the channel being used - * @errp: pointer to an error - */ static int multifd_qpl_recv_setup(MultiFDRecvParams *p, Error **errp) { QplData *qpl; @@ -547,13 +508,6 @@ static int multifd_qpl_recv_setup(MultiFDRecvParams *p= , Error **errp) return 0; } =20 -/** - * multifd_qpl_recv_cleanup: set up receive side - * - * Close the channel and free memory. - * - * @p: Params for the channel being used - */ static void multifd_qpl_recv_cleanup(MultiFDRecvParams *p) { multifd_qpl_deinit(p->compress_data); @@ -694,17 +648,6 @@ static int multifd_qpl_decompress_pages(MultiFDRecvPar= ams *p, Error **errp) } return 0; } -/** - * multifd_qpl_recv: read the data from the channel into actual pages - * - * Read the compressed buffer, and uncompress it into the actual - * pages. - * - * Returns 0 on success or -1 on error - * - * @p: Params for the channel being used - * @errp: pointer to an error - */ static int multifd_qpl_recv(MultiFDRecvParams *p, Error **errp) { QplData *qpl =3D p->compress_data; diff --git a/migration/multifd-uadk.c b/migration/multifd-uadk.c index 9d99807af5..db2549f59b 100644 --- a/migration/multifd-uadk.c +++ b/migration/multifd-uadk.c @@ -103,14 +103,6 @@ static void multifd_uadk_uninit_sess(struct wd_data *w= d) g_free(wd); } =20 -/** - * multifd_uadk_send_setup: setup send side - * - * Returns 0 for success or -1 for error - * - * @p: Params for the channel that we are using - * @errp: pointer to an error - */ static int multifd_uadk_send_setup(MultiFDSendParams *p, Error **errp) { struct wd_data *wd; @@ -134,14 +126,6 @@ static int multifd_uadk_send_setup(MultiFDSendParams *= p, Error **errp) return 0; } =20 -/** - * multifd_uadk_send_cleanup: cleanup send side - * - * Close the channel and return memory. - * - * @p: Params for the channel that we are using - * @errp: pointer to an error - */ static void multifd_uadk_send_cleanup(MultiFDSendParams *p, Error **errp) { struct wd_data *wd =3D p->compress_data; @@ -159,17 +143,6 @@ static inline void prepare_next_iov(MultiFDSendParams = *p, void *base, p->iovs_num++; } =20 -/** - * multifd_uadk_send_prepare: prepare data to be able to send - * - * Create a compressed buffer with all the pages that we are going to - * send. - * - * Returns 0 for success or -1 for error - * - * @p: Params for the channel that we are using - * @errp: pointer to an error - */ static int multifd_uadk_send_prepare(MultiFDSendParams *p, Error **errp) { struct wd_data *uadk_data =3D p->compress_data; @@ -229,16 +202,6 @@ out: return 0; } =20 -/** - * multifd_uadk_recv_setup: setup receive side - * - * Create the compressed channel and buffer. - * - * Returns 0 for success or -1 for error - * - * @p: Params for the channel that we are using - * @errp: pointer to an error - */ static int multifd_uadk_recv_setup(MultiFDRecvParams *p, Error **errp) { struct wd_data *wd; @@ -253,13 +216,6 @@ static int multifd_uadk_recv_setup(MultiFDRecvParams *= p, Error **errp) return 0; } =20 -/** - * multifd_uadk_recv_cleanup: cleanup receive side - * - * Close the channel and return memory. - * - * @p: Params for the channel that we are using - */ static void multifd_uadk_recv_cleanup(MultiFDRecvParams *p) { struct wd_data *wd =3D p->compress_data; @@ -268,17 +224,6 @@ static void multifd_uadk_recv_cleanup(MultiFDRecvParam= s *p) p->compress_data =3D NULL; } =20 -/** - * multifd_uadk_recv: read the data from the channel into actual pages - * - * Read the compressed buffer, and uncompress it into the actual - * pages. - * - * Returns 0 for success or -1 for error - * - * @p: Params for the channel that we are using - * @errp: pointer to an error - */ static int multifd_uadk_recv(MultiFDRecvParams *p, Error **errp) { struct wd_data *uadk_data =3D p->compress_data; diff --git a/migration/multifd-zlib.c b/migration/multifd-zlib.c index 66517c1067..6787538762 100644 --- a/migration/multifd-zlib.c +++ b/migration/multifd-zlib.c @@ -34,17 +34,7 @@ struct zlib_data { =20 /* Multifd zlib compression */ =20 -/** - * zlib_send_setup: setup send side - * - * Setup each channel with zlib compression. - * - * Returns 0 for success or -1 for error - * - * @p: Params for the channel that we are using - * @errp: pointer to an error - */ -static int zlib_send_setup(MultiFDSendParams *p, Error **errp) +static int multifd_zlib_send_setup(MultiFDSendParams *p, Error **errp) { struct zlib_data *z =3D g_new0(struct zlib_data, 1); z_stream *zs =3D &z->zs; @@ -86,15 +76,7 @@ err_free_z: return -1; } =20 -/** - * zlib_send_cleanup: cleanup send side - * - * Close the channel and return memory. - * - * @p: Params for the channel that we are using - * @errp: pointer to an error - */ -static void zlib_send_cleanup(MultiFDSendParams *p, Error **errp) +static void multifd_zlib_send_cleanup(MultiFDSendParams *p, Error **errp) { struct zlib_data *z =3D p->compress_data; =20 @@ -110,18 +92,7 @@ static void zlib_send_cleanup(MultiFDSendParams *p, Err= or **errp) p->iov =3D NULL; } =20 -/** - * zlib_send_prepare: prepare date to be able to send - * - * Create a compressed buffer with all the pages that we are going to - * send. - * - * Returns 0 for success or -1 for error - * - * @p: Params for the channel that we are using - * @errp: pointer to an error - */ -static int zlib_send_prepare(MultiFDSendParams *p, Error **errp) +static int multifd_zlib_send_prepare(MultiFDSendParams *p, Error **errp) { MultiFDPages_t *pages =3D &p->data->u.ram; struct zlib_data *z =3D p->compress_data; @@ -189,17 +160,7 @@ out: return 0; } =20 -/** - * zlib_recv_setup: setup receive side - * - * Create the compressed channel and buffer. - * - * Returns 0 for success or -1 for error - * - * @p: Params for the channel that we are using - * @errp: pointer to an error - */ -static int zlib_recv_setup(MultiFDRecvParams *p, Error **errp) +static int multifd_zlib_recv_setup(MultiFDRecvParams *p, Error **errp) { struct zlib_data *z =3D g_new0(struct zlib_data, 1); z_stream *zs =3D &z->zs; @@ -225,14 +186,7 @@ static int zlib_recv_setup(MultiFDRecvParams *p, Error= **errp) return 0; } =20 -/** - * zlib_recv_cleanup: setup receive side - * - * For no compression this function does nothing. - * - * @p: Params for the channel that we are using - */ -static void zlib_recv_cleanup(MultiFDRecvParams *p) +static void multifd_zlib_recv_cleanup(MultiFDRecvParams *p) { struct zlib_data *z =3D p->compress_data; =20 @@ -243,18 +197,7 @@ static void zlib_recv_cleanup(MultiFDRecvParams *p) p->compress_data =3D NULL; } =20 -/** - * zlib_recv: read the data from the channel into actual pages - * - * Read the compressed buffer, and uncompress it into the actual - * pages. - * - * Returns 0 for success or -1 for error - * - * @p: Params for the channel that we are using - * @errp: pointer to an error - */ -static int zlib_recv(MultiFDRecvParams *p, Error **errp) +static int multifd_zlib_recv(MultiFDRecvParams *p, Error **errp) { struct zlib_data *z =3D p->compress_data; z_stream *zs =3D &z->zs; @@ -335,12 +278,12 @@ static int zlib_recv(MultiFDRecvParams *p, Error **er= rp) } =20 static MultiFDMethods multifd_zlib_ops =3D { - .send_setup =3D zlib_send_setup, - .send_cleanup =3D zlib_send_cleanup, - .send_prepare =3D zlib_send_prepare, - .recv_setup =3D zlib_recv_setup, - .recv_cleanup =3D zlib_recv_cleanup, - .recv =3D zlib_recv + .send_setup =3D multifd_zlib_send_setup, + .send_cleanup =3D multifd_zlib_send_cleanup, + .send_prepare =3D multifd_zlib_send_prepare, + .recv_setup =3D multifd_zlib_recv_setup, + .recv_cleanup =3D multifd_zlib_recv_cleanup, + .recv =3D multifd_zlib_recv }; =20 static void multifd_zlib_register(void) diff --git a/migration/multifd-zstd.c b/migration/multifd-zstd.c index 04ac711cf4..1576b1e2ad 100644 --- a/migration/multifd-zstd.c +++ b/migration/multifd-zstd.c @@ -37,17 +37,7 @@ struct zstd_data { =20 /* Multifd zstd compression */ =20 -/** - * zstd_send_setup: setup send side - * - * Setup each channel with zstd compression. - * - * Returns 0 for success or -1 for error - * - * @p: Params for the channel that we are using - * @errp: pointer to an error - */ -static int zstd_send_setup(MultiFDSendParams *p, Error **errp) +static int multifd_zstd_send_setup(MultiFDSendParams *p, Error **errp) { struct zstd_data *z =3D g_new0(struct zstd_data, 1); int res; @@ -83,15 +73,7 @@ static int zstd_send_setup(MultiFDSendParams *p, Error *= *errp) return 0; } =20 -/** - * zstd_send_cleanup: cleanup send side - * - * Close the channel and return memory. - * - * @p: Params for the channel that we are using - * @errp: pointer to an error - */ -static void zstd_send_cleanup(MultiFDSendParams *p, Error **errp) +static void multifd_zstd_send_cleanup(MultiFDSendParams *p, Error **errp) { struct zstd_data *z =3D p->compress_data; =20 @@ -106,18 +88,7 @@ static void zstd_send_cleanup(MultiFDSendParams *p, Err= or **errp) p->iov =3D NULL; } =20 -/** - * zstd_send_prepare: prepare date to be able to send - * - * Create a compressed buffer with all the pages that we are going to - * send. - * - * Returns 0 for success or -1 for error - * - * @p: Params for the channel that we are using - * @errp: pointer to an error - */ -static int zstd_send_prepare(MultiFDSendParams *p, Error **errp) +static int multifd_zstd_send_prepare(MultiFDSendParams *p, Error **errp) { MultiFDPages_t *pages =3D &p->data->u.ram; struct zstd_data *z =3D p->compress_data; @@ -176,17 +147,7 @@ out: return 0; } =20 -/** - * zstd_recv_setup: setup receive side - * - * Create the compressed channel and buffer. - * - * Returns 0 for success or -1 for error - * - * @p: Params for the channel that we are using - * @errp: pointer to an error - */ -static int zstd_recv_setup(MultiFDRecvParams *p, Error **errp) +static int multifd_zstd_recv_setup(MultiFDRecvParams *p, Error **errp) { struct zstd_data *z =3D g_new0(struct zstd_data, 1); int ret; @@ -220,14 +181,7 @@ static int zstd_recv_setup(MultiFDRecvParams *p, Error= **errp) return 0; } =20 -/** - * zstd_recv_cleanup: setup receive side - * - * For no compression this function does nothing. - * - * @p: Params for the channel that we are using - */ -static void zstd_recv_cleanup(MultiFDRecvParams *p) +static void multifd_zstd_recv_cleanup(MultiFDRecvParams *p) { struct zstd_data *z =3D p->compress_data; =20 @@ -239,18 +193,7 @@ static void zstd_recv_cleanup(MultiFDRecvParams *p) p->compress_data =3D NULL; } =20 -/** - * zstd_recv: read the data from the channel into actual pages - * - * Read the compressed buffer, and uncompress it into the actual - * pages. - * - * Returns 0 for success or -1 for error - * - * @p: Params for the channel that we are using - * @errp: pointer to an error - */ -static int zstd_recv(MultiFDRecvParams *p, Error **errp) +static int multifd_zstd_recv(MultiFDRecvParams *p, Error **errp) { uint32_t in_size =3D p->next_packet_size; uint32_t out_size =3D 0; @@ -323,12 +266,12 @@ static int zstd_recv(MultiFDRecvParams *p, Error **er= rp) } =20 static MultiFDMethods multifd_zstd_ops =3D { - .send_setup =3D zstd_send_setup, - .send_cleanup =3D zstd_send_cleanup, - .send_prepare =3D zstd_send_prepare, - .recv_setup =3D zstd_recv_setup, - .recv_cleanup =3D zstd_recv_cleanup, - .recv =3D zstd_recv + .send_setup =3D multifd_zstd_send_setup, + .send_cleanup =3D multifd_zstd_send_cleanup, + .send_prepare =3D multifd_zstd_send_prepare, + .recv_setup =3D multifd_zstd_recv_setup, + .recv_cleanup =3D multifd_zstd_recv_cleanup, + .recv =3D multifd_zstd_recv }; =20 static void multifd_zstd_register(void) diff --git a/migration/multifd.c b/migration/multifd.c index ce08257706..9f40bb2f16 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -167,15 +167,7 @@ static void multifd_set_file_bitmap(MultiFDSendParams = *p) } } =20 -/* Multifd without compression */ - -/** - * nocomp_send_setup: setup send side - * - * @p: Params for the channel that we are using - * @errp: pointer to an error - */ -static int nocomp_send_setup(MultiFDSendParams *p, Error **errp) +static int multifd_nocomp_send_setup(MultiFDSendParams *p, Error **errp) { uint32_t page_count =3D multifd_ram_page_count(); =20 @@ -193,15 +185,7 @@ static int nocomp_send_setup(MultiFDSendParams *p, Err= or **errp) return 0; } =20 -/** - * nocomp_send_cleanup: cleanup send side - * - * For no compression this function does nothing. - * - * @p: Params for the channel that we are using - * @errp: pointer to an error - */ -static void nocomp_send_cleanup(MultiFDSendParams *p, Error **errp) +static void multifd_nocomp_send_cleanup(MultiFDSendParams *p, Error **errp) { g_free(p->iov); p->iov =3D NULL; @@ -222,18 +206,7 @@ static void multifd_send_prepare_iovs(MultiFDSendParam= s *p) p->next_packet_size =3D pages->normal_num * page_size; } =20 -/** - * nocomp_send_prepare: prepare date to be able to send - * - * For no compression we just have to calculate the size of the - * packet. - * - * Returns 0 for success or -1 for error - * - * @p: Params for the channel that we are using - * @errp: pointer to an error - */ -static int nocomp_send_prepare(MultiFDSendParams *p, Error **errp) +static int multifd_nocomp_send_prepare(MultiFDSendParams *p, Error **errp) { bool use_zero_copy_send =3D migrate_zero_copy_send(); int ret; @@ -272,46 +245,19 @@ static int nocomp_send_prepare(MultiFDSendParams *p, = Error **errp) return 0; } =20 -/** - * nocomp_recv_setup: setup receive side - * - * For no compression this function does nothing. - * - * Returns 0 for success or -1 for error - * - * @p: Params for the channel that we are using - * @errp: pointer to an error - */ -static int nocomp_recv_setup(MultiFDRecvParams *p, Error **errp) +static int multifd_nocomp_recv_setup(MultiFDRecvParams *p, Error **errp) { p->iov =3D g_new0(struct iovec, multifd_ram_page_count()); return 0; } =20 -/** - * nocomp_recv_cleanup: setup receive side - * - * For no compression this function does nothing. - * - * @p: Params for the channel that we are using - */ -static void nocomp_recv_cleanup(MultiFDRecvParams *p) +static void multifd_nocomp_recv_cleanup(MultiFDRecvParams *p) { g_free(p->iov); p->iov =3D NULL; } =20 -/** - * nocomp_recv: read the data from the channel - * - * For no compression we just need to read things into the correct place. - * - * Returns 0 for success or -1 for error - * - * @p: Params for the channel that we are using - * @errp: pointer to an error - */ -static int nocomp_recv(MultiFDRecvParams *p, Error **errp) +static int multifd_nocomp_recv(MultiFDRecvParams *p, Error **errp) { uint32_t flags; =20 @@ -342,12 +288,12 @@ static int nocomp_recv(MultiFDRecvParams *p, Error **= errp) } =20 static MultiFDMethods multifd_nocomp_ops =3D { - .send_setup =3D nocomp_send_setup, - .send_cleanup =3D nocomp_send_cleanup, - .send_prepare =3D nocomp_send_prepare, - .recv_setup =3D nocomp_recv_setup, - .recv_cleanup =3D nocomp_recv_cleanup, - .recv =3D nocomp_recv + .send_setup =3D multifd_nocomp_send_setup, + .send_cleanup =3D multifd_nocomp_send_cleanup, + .send_prepare =3D multifd_nocomp_send_prepare, + .recv_setup =3D multifd_nocomp_recv_setup, + .recv_cleanup =3D multifd_nocomp_recv_cleanup, + .recv =3D multifd_nocomp_recv }; =20 static MultiFDMethods *multifd_ops[MULTIFD_COMPRESSION__MAX] =3D { --=20 2.35.3