From nobody Mon Nov 25 09:36:30 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=1715211372; cv=none; d=zohomail.com; s=zohoarc; b=g+7YX6ttCor4Ca8l5VDJFKELhurxCguhgh3k3xSXmuP8nuaVAO4hJ50zuvxFSugtSFsPOKZ8TlIZ4Bd62VgmAu188lFBHDFY9ApbXj+F7NgvU4DY5Hv73R088sMkuyIpODEMgB3dn3pdQcjjH9DroiKWMc2LVeJVSe9Fxt12FVk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715211372; 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=Yox7412cGTtUL2CQXPQpWip+SE1+94y2VLTqWSN6JyE=; b=eBo/z5JRR9Bk3iQpMv3UjDxXs43l5DWaMljZmFfJ14M2+msPBP0KtREohm/9B1UDbwIX+pTx62lWpNilP6MvhCibmBSzY462hOig3W/sI8ggMVjis2jWYAAVLL+jIU5fNIhWrntgpnBhusPTfNYLz5/3hainDYTvM4Oc7Bjf5fc= 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 1715211371992347.25254877420525; Wed, 8 May 2024 16:36:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4qpF-0002cs-CB; Wed, 08 May 2024 19:35: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 1s4qpD-0002c5-0N for qemu-devel@nongnu.org; Wed, 08 May 2024 19:35:51 -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 1s4qpB-0002GU-CU for qemu-devel@nongnu.org; Wed, 08 May 2024 19:35:50 -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 C62555D38B; Wed, 8 May 2024 23:35:46 +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 6741813A27; Wed, 8 May 2024 23:35:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id QOCDC1EMPGZ7FQAAD6G6ig (envelope-from ); Wed, 08 May 2024 23:35:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211346; 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=Yox7412cGTtUL2CQXPQpWip+SE1+94y2VLTqWSN6JyE=; b=GhWijWCoz+ufrq5nZCOJXYv8SczYD/uzMQVz0efy9we/GdYjFeZeiyk/C6OymVfa8OjXIk x16zQya2Z9GMd4YKWDZA0X6nYnSABw8sC3V2FcAHv9oZYe/rRH5bSRvRryVSRl1icJfF2R M6Qwe7U522h7ySY2wiDHaWnExr4BOfc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211346; 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=Yox7412cGTtUL2CQXPQpWip+SE1+94y2VLTqWSN6JyE=; b=zQYjyuwxsgYwvYtGDPqPZFQ1pwjR3bcXkmEQ64L0iJPzh6P98u+fU42SFqg/2fPyCpQqRZ vPYaakYbakmSt/Ag== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=GhWijWCo; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=zQYjyuwx DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211346; 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=Yox7412cGTtUL2CQXPQpWip+SE1+94y2VLTqWSN6JyE=; b=GhWijWCoz+ufrq5nZCOJXYv8SczYD/uzMQVz0efy9we/GdYjFeZeiyk/C6OymVfa8OjXIk x16zQya2Z9GMd4YKWDZA0X6nYnSABw8sC3V2FcAHv9oZYe/rRH5bSRvRryVSRl1icJfF2R M6Qwe7U522h7ySY2wiDHaWnExr4BOfc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211346; 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=Yox7412cGTtUL2CQXPQpWip+SE1+94y2VLTqWSN6JyE=; b=zQYjyuwxsgYwvYtGDPqPZFQ1pwjR3bcXkmEQ64L0iJPzh6P98u+fU42SFqg/2fPyCpQqRZ vPYaakYbakmSt/Ag== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Will Gyda Subject: [PULL v2 01/13] migration/ram.c: API Conversion qemu_mutex_lock(), and qemu_mutex_unlock() to WITH_QEMU_LOCK_GUARD macro Date: Wed, 8 May 2024 20:35:29 -0300 Message-Id: <20240508233541.2403-2-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240508233541.2403-1-farosas@suse.de> References: <20240508233541.2403-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; 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)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FUZZY_BLOCKED(0.00)[rspamd.com]; FREEMAIL_CC(0.00)[redhat.com,linaro.org,gmail.com]; RCVD_TLS_ALL(0.00)[]; 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]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; RCPT_COUNT_THREE(0.00)[4]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; FREEMAIL_ENVRCPT(0.00)[gmail.com] X-Rspamd-Action: no action X-Rspamd-Queue-Id: C62555D38B X-Rspamd-Server: rspamd1.dmz-prg2.suse.org 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.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 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: 1715211373651100001 Content-Type: text/plain; charset="utf-8" From: Will Gyda migration/ram.c: API Conversion qemu_mutex_lock(), and qemu_mutex_unlock() to WITH_QEMU_LOCK_GUARD macro Signed-off-by: Will Gyda Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/ram.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index a975c5af16..50df1e9cd2 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1066,14 +1066,14 @@ static void migration_bitmap_sync(RAMState *rs, boo= l last_stage) trace_migration_bitmap_sync_start(); memory_global_dirty_log_sync(last_stage); =20 - qemu_mutex_lock(&rs->bitmap_mutex); - WITH_RCU_READ_LOCK_GUARD() { - RAMBLOCK_FOREACH_NOT_IGNORED(block) { - ramblock_sync_dirty_bitmap(rs, block); + WITH_QEMU_LOCK_GUARD(&rs->bitmap_mutex) { + WITH_RCU_READ_LOCK_GUARD() { + RAMBLOCK_FOREACH_NOT_IGNORED(block) { + ramblock_sync_dirty_bitmap(rs, block); + } + stat64_set(&mig_stats.dirty_bytes_last_sync, ram_bytes_remaini= ng()); } - stat64_set(&mig_stats.dirty_bytes_last_sync, ram_bytes_remaining()= ); } - qemu_mutex_unlock(&rs->bitmap_mutex); =20 memory_global_after_dirty_log_sync(); trace_migration_bitmap_sync_end(rs->num_dirty_pages_period); --=20 2.35.3 From nobody Mon Nov 25 09:36:30 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=1715211368; cv=none; d=zohomail.com; s=zohoarc; b=GsJMH+ZJxLsvuOQ+4yOpDdqwaAb8aYAgui7fBXnnlt0ABkbgp9GLgInBCwuFt9JX+RNkPsSruYn/dFpCPbEsqf7nYSj18yqUF/xf3PcForiPzsKiySrr0JUFkJCDpKUK6Sx+DCLuzvxuoETo70RBoL1gyZfwJk0KDA8ILKDrJQk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715211368; 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=S+6ohOs8r7Uea7SyKPjqTFtiY9Ar+9l4fF6rc6w5alA=; b=PbBbeFC0V2p/+nba0VGpcp0hczrdb20wQX5WuAjN8Yaip863vcFPVTsClIu+FChSnt6YBmV+f9dHM2qB59UkLeRVN6l1iepy7fc6ByIMXBHoIshRml2dPfYbUbHGVGXz9cvuW7mw8s42S5XX4kqGwsv+FDr/lsohujFThe2VnoQ= 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 1715211368357649.1580742477062; Wed, 8 May 2024 16:36:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4qpH-0002db-Sr; Wed, 08 May 2024 19:35: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 1s4qpE-0002cW-B9 for qemu-devel@nongnu.org; Wed, 08 May 2024 19:35:52 -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 1s4qpC-0002IT-EJ for qemu-devel@nongnu.org; Wed, 08 May 2024 19:35:52 -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 98D0D22D9F; Wed, 8 May 2024 23:35:48 +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 3B07813A27; Wed, 8 May 2024 23:35:47 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id iCX3AFMMPGZ7FQAAD6G6ig (envelope-from ); Wed, 08 May 2024 23:35:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211348; 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=S+6ohOs8r7Uea7SyKPjqTFtiY9Ar+9l4fF6rc6w5alA=; b=uZK7klXroTm9w+Q3XVnb23JLfivlde178sS4HfDblYHS7FjaexEO2+3hYDAsmi4dSZl560 STb3LzCA6Wy6ej1L5HAUTMbqX0KMLRC6/i5pOdbcHMPqXEswWtY1gE8Elib9PXh4kMbm2N +ya7BVTze1nf8TQv4UycP4T/XA4hsNE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211348; 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=S+6ohOs8r7Uea7SyKPjqTFtiY9Ar+9l4fF6rc6w5alA=; b=tNEeotUerlv1VniUekcxh6VGp/FE1bLzqF8zSeht0Q38UqzneDzVmyOnGXasLSeSZe/ovF AouPg3EnQ+Thk7BQ== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=uZK7klXr; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=tNEeotUe DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211348; 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=S+6ohOs8r7Uea7SyKPjqTFtiY9Ar+9l4fF6rc6w5alA=; b=uZK7klXroTm9w+Q3XVnb23JLfivlde178sS4HfDblYHS7FjaexEO2+3hYDAsmi4dSZl560 STb3LzCA6Wy6ej1L5HAUTMbqX0KMLRC6/i5pOdbcHMPqXEswWtY1gE8Elib9PXh4kMbm2N +ya7BVTze1nf8TQv4UycP4T/XA4hsNE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211348; 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=S+6ohOs8r7Uea7SyKPjqTFtiY9Ar+9l4fF6rc6w5alA=; b=tNEeotUerlv1VniUekcxh6VGp/FE1bLzqF8zSeht0Q38UqzneDzVmyOnGXasLSeSZe/ovF AouPg3EnQ+Thk7BQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Vladimir Sementsov-Ogievskiy Subject: [PULL v2 02/13] migration: move trace-point from migrate_fd_error to migrate_set_error Date: Wed, 8 May 2024 20:35:30 -0300 Message-Id: <20240508233541.2403-3-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240508233541.2403-1-farosas@suse.de> References: <20240508233541.2403-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.01 X-Rspamd-Action: no action X-Rspamd-Queue-Id: 98D0D22D9F X-Rspamd-Server: rspamd2.dmz-prg2.suse.org 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)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[suse.de:+] 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: 1715211370204100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Cover more cases by trace-point. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/migration.c | 4 +++- migration/trace-events | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index b5af6b5105..2dc6a063e9 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1421,6 +1421,9 @@ static void migrate_fd_cleanup_bh(void *opaque) void migrate_set_error(MigrationState *s, const Error *error) { QEMU_LOCK_GUARD(&s->error_mutex); + + trace_migrate_error(error_get_pretty(error)); + if (!s->error) { s->error =3D error_copy(error); } @@ -1444,7 +1447,6 @@ static void migrate_error_free(MigrationState *s) =20 static void migrate_fd_error(MigrationState *s, const Error *error) { - trace_migrate_fd_error(error_get_pretty(error)); assert(s->to_dst_file =3D=3D NULL); migrate_set_state(&s->state, MIGRATION_STATUS_SETUP, MIGRATION_STATUS_FAILED); diff --git a/migration/trace-events b/migration/trace-events index f0e1cb80c7..d0c44c3853 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -152,7 +152,7 @@ multifd_set_outgoing_channel(void *ioc, const char *ioc= type, const char *hostnam # migration.c migrate_set_state(const char *new_state) "new state %s" migrate_fd_cleanup(void) "" -migrate_fd_error(const char *error_desc) "error=3D%s" +migrate_error(const char *error_desc) "error=3D%s" migrate_fd_cancel(void) "" migrate_handle_rp_req_pages(const char *rbname, size_t start, size_t len) = "in %s at 0x%zx len 0x%zx" migrate_pending_exact(uint64_t size, uint64_t pre, uint64_t post) "exact p= ending size %" PRIu64 " (pre =3D %" PRIu64 " post=3D%" PRIu64 ")" --=20 2.35.3 From nobody Mon Nov 25 09:36:30 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=1715211697; cv=none; d=zohomail.com; s=zohoarc; b=Ow9uSYf9LorPKcMO6UZZtZdLa6UgdQmyK58Httg+c72TCOmVtwvfS8exx7sxYjjOGS9rYt+9X7bNWjtYHEx1bPP0qBUWpgJ/IfIt5Ewo1SDevn+cOQoGr7RnZo1Gos7a4gf51MhG0yiGYkK86C6nciNNUo8zsi+zjIOVsWodg4Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715211697; 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=PG6Nx43BubMRRi84xqVwyEY8NqHhUhF21gkA0aoI2Ws=; b=Bh7TKSzt27akmx1Pi71+KOSjFWQRp/VKnCUmsvPDLrtNrFuP8chxLMWPuk4o+Mhc9QWkUJLEdPi2835o0+OEMsXiusEY7k6rZva4QLjVdSZp6fWDD7emCo0aE1v+OUBBlNhAa988Ds7hVBTQcu8lDVJnkx8dj4UcBORjEXQ3bP8= 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 1715211697200952.2762130310257; Wed, 8 May 2024 16:41:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4qpI-0002dp-LO; Wed, 08 May 2024 19:35: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 1s4qpF-0002cq-6C for qemu-devel@nongnu.org; Wed, 08 May 2024 19:35:53 -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 1s4qpD-0002Is-Mn for qemu-devel@nongnu.org; Wed, 08 May 2024 19:35:52 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [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 691EC5D38D; Wed, 8 May 2024 23:35:50 +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 0C4A313A27; Wed, 8 May 2024 23:35:48 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id 0Pw9MVQMPGZ7FQAAD6G6ig (envelope-from ); Wed, 08 May 2024 23:35:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211350; 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=PG6Nx43BubMRRi84xqVwyEY8NqHhUhF21gkA0aoI2Ws=; b=OVY4APoEgJ1to0zlSSDhF5QpxEfjhPrg0uwe/XnZLwr37QJboL1MnF4QqO8mX/eW519r+W kwIj6Jz/0NsUXuiEBIIdkteVAxfVdDyKuVMM2XVMY0J3EtKkHMmwmp1hAMoaabXq34xRKo pw48fWll5cLY1Y5yj+K/Klpee6p4JIk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211350; 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=PG6Nx43BubMRRi84xqVwyEY8NqHhUhF21gkA0aoI2Ws=; b=51AsjOeWVesdd0cnLp5EQZ7rWHsPsJlFJOGUORr8N5XuwmvV+br+IXqP3mJtvZBql6cBip oY6QBaxI0yaQrvDA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211350; 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=PG6Nx43BubMRRi84xqVwyEY8NqHhUhF21gkA0aoI2Ws=; b=OVY4APoEgJ1to0zlSSDhF5QpxEfjhPrg0uwe/XnZLwr37QJboL1MnF4QqO8mX/eW519r+W kwIj6Jz/0NsUXuiEBIIdkteVAxfVdDyKuVMM2XVMY0J3EtKkHMmwmp1hAMoaabXq34xRKo pw48fWll5cLY1Y5yj+K/Klpee6p4JIk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211350; 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=PG6Nx43BubMRRi84xqVwyEY8NqHhUhF21gkA0aoI2Ws=; b=51AsjOeWVesdd0cnLp5EQZ7rWHsPsJlFJOGUORr8N5XuwmvV+br+IXqP3mJtvZBql6cBip oY6QBaxI0yaQrvDA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Vladimir Sementsov-Ogievskiy Subject: [PULL v2 03/13] migration: process_incoming_migration_co(): complete cleanup on failure Date: Wed, 8 May 2024 20:35:31 -0300 Message-Id: <20240508233541.2403-4-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240508233541.2403-1-farosas@suse.de> References: <20240508233541.2403-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: -2.80 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 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: 1715211698951100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Make call to migration_incoming_state_destroy(), instead of doing only partial of it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/migration.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 2dc6a063e9..0d26db47f7 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -799,10 +799,7 @@ process_incoming_migration_co(void *opaque) fail: migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE, MIGRATION_STATUS_FAILED); - qemu_fclose(mis->from_src_file); - - multifd_recv_cleanup(); - compress_threads_load_cleanup(); + migration_incoming_state_destroy(); =20 exit(EXIT_FAILURE); } --=20 2.35.3 From nobody Mon Nov 25 09:36:30 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=1715211396; cv=none; d=zohomail.com; s=zohoarc; b=Q1tr9X2K0PWWoaxKcfSa3TtQxDd5QjQa136zz7e2y+GUlxugxCK5y1nPJ3A0D+lznZsO/1lTmMfm0Y6RKTnhLemBMTnbInsvGf/ZrfFFAoeZUCyJWcfcwFK4Qd0CkjfngyQZIvBgMGL0Wcjb1Si/TvF9ss69VMsPlNOYCxpauCg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715211396; 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=kwFxBUjKI76s0+hr0T52NqfIhUAReDRdgci88z6Buv4=; b=Ha4lZ9QXY1/WNqXlbWxpkmiopDt+R4RztXpl0UL9nRfnr2709zFSStBsGmJCBhj+OFeiLijCuTKVuVjgQdhgcx/IToATRqP8a8hgeVKELcxYycambQLGmMcb8VGTCtUOxWBmZbF15SsoO736myeMABXPi7F9BU6pu/8PGc4E+9g= 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 1715211396245469.86853503149393; Wed, 8 May 2024 16:36:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4qpJ-0002dq-Qa; Wed, 08 May 2024 19:35:57 -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 1s4qpH-0002dH-32 for qemu-devel@nongnu.org; Wed, 08 May 2024 19:35:55 -0400 Received: from smtp-out1.suse.de ([2a07:de40:b251:101:10:150:64:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s4qpF-0002Jo-F7 for qemu-devel@nongnu.org; Wed, 08 May 2024 19:35:54 -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 4767F376F9; Wed, 8 May 2024 23:35:52 +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 D368513A27; Wed, 8 May 2024 23:35:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id UOYlJlYMPGZ7FQAAD6G6ig (envelope-from ); Wed, 08 May 2024 23:35:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211352; 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=kwFxBUjKI76s0+hr0T52NqfIhUAReDRdgci88z6Buv4=; b=pR7EpV4qWMpSYGgSe0DBHB/+513FS1TK3f5pjfrHr4598GG21bK85QAu1TWoccupgCQQST c8z9MmGisE5UCqB63QhYldZalRtKEAzeAs0KbgTs+3UshvR6iHqMpM/73Zj5JJ985Efv+7 V5XYqNJ97yx7CuTCMFO2XezU8jBt6nk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211352; 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=kwFxBUjKI76s0+hr0T52NqfIhUAReDRdgci88z6Buv4=; b=SZniDdDbVLvFzTspUTNvgj2OV9KQMVoPp9naUj7m9xvQgy8Jhptyp2PsM5hwrrHtTpMuqO P5wfrKVZ0gfwSCCg== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=pR7EpV4q; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=SZniDdDb DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211352; 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=kwFxBUjKI76s0+hr0T52NqfIhUAReDRdgci88z6Buv4=; b=pR7EpV4qWMpSYGgSe0DBHB/+513FS1TK3f5pjfrHr4598GG21bK85QAu1TWoccupgCQQST c8z9MmGisE5UCqB63QhYldZalRtKEAzeAs0KbgTs+3UshvR6iHqMpM/73Zj5JJ985Efv+7 V5XYqNJ97yx7CuTCMFO2XezU8jBt6nk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211352; 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=kwFxBUjKI76s0+hr0T52NqfIhUAReDRdgci88z6Buv4=; b=SZniDdDbVLvFzTspUTNvgj2OV9KQMVoPp9naUj7m9xvQgy8Jhptyp2PsM5hwrrHtTpMuqO P5wfrKVZ0gfwSCCg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Vladimir Sementsov-Ogievskiy Subject: [PULL v2 04/13] migration: process_incoming_migration_co(): fix reporting s->error Date: Wed, 8 May 2024 20:35:32 -0300 Message-Id: <20240508233541.2403-5-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240508233541.2403-1-farosas@suse.de> References: <20240508233541.2403-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.01 X-Rspamd-Action: no action X-Rspamd-Queue-Id: 4767F376F9 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org 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)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[suse.de:+] 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=2a07:de40:b251:101:10:150:64:1; 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: 1715211397804100002 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy It's bad idea to leave critical section with error object freed, but s->error still set, this theoretically may lead to use-after-free crash. Let's avoid it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/migration.c | 1 + 1 file changed, 1 insertion(+) diff --git a/migration/migration.c b/migration/migration.c index 0d26db47f7..b307a4bc59 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -784,6 +784,7 @@ process_incoming_migration_co(void *opaque) if (migrate_has_error(s)) { WITH_QEMU_LOCK_GUARD(&s->error_mutex) { error_report_err(s->error); + s->error =3D NULL; } } error_report("load of migration failed: %s", strerror(-ret)); --=20 2.35.3 From nobody Mon Nov 25 09:36:30 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=1715211691; cv=none; d=zohomail.com; s=zohoarc; b=kWMW2dteQY1QQEe/Dt2sTLaW/9pSVUZRXgF5zL/ogLbUsEbjgDsUomsLJp6RUdQdqcLgxGA5Hwk+VIEWoQC2OZrp3WiFRquwuKj2CkSulE8owV+8AFmJTEuTBhxNv0HfIBY3rf5WEpGq6mJr3uvsAG1BnYN4Vr3JtonIi6gL4R8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715211691; 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=vcVI/R85fJDKlWIRs9/4yVECYIr6dkMFTWYL02L/qK4=; b=hXgojItD/sCmoC6IckPgtFKfPlU+yDbSwJBfbz6mkuIpNrZT6oKKDrtgQemVrrvnwTXjKL4qq7vmr8/88uzT95g6fmkxWVXAABJpYZl9n2YzTe2+bno7PWuV/lunvVe6ssGAzNeCWFrnS2scpDW+4NqLRC8aVQNP/zjGvaJ/Aks= 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 171521169115340.00010508245805; Wed, 8 May 2024 16:41:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4qpM-0002fZ-21; Wed, 08 May 2024 19:36:00 -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 1s4qpJ-0002e0-9b for qemu-devel@nongnu.org; Wed, 08 May 2024 19:35:57 -0400 Received: from smtp-out1.suse.de ([2a07:de40:b251:101:10:150:64:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s4qpH-0002KW-J1 for qemu-devel@nongnu.org; Wed, 08 May 2024 19:35:57 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [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 47E9137725; Wed, 8 May 2024 23:35:54 +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 A75C513A27; Wed, 8 May 2024 23:35:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id QD1TG1gMPGZ7FQAAD6G6ig (envelope-from ); Wed, 08 May 2024 23:35:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211354; 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=vcVI/R85fJDKlWIRs9/4yVECYIr6dkMFTWYL02L/qK4=; b=HteJT3P4mcdcGS/7wcXab1txLuawAVx0khJcAkPz+D56fUr+q1NtlVRNGm4LiQbdt+k6lE M9LBB+XnJkmsmdm3ivDCIvpAZtTkVTnE+75iqtT6KqprqZHIeFMJxT/XsxNSIHCukcZ5+9 aT2FjyLdQpLJJmuU3Vu1Bt8QlL9viJA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211354; 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=vcVI/R85fJDKlWIRs9/4yVECYIr6dkMFTWYL02L/qK4=; b=iTeV09PNoTKRr/BzTRTIJPWiIHRuu23mMNS+PDqNS9JwdQaIrEJGV4tkeNEXaiv3vrBewj 73HFG1nHlc2EoCAQ== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211354; 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=vcVI/R85fJDKlWIRs9/4yVECYIr6dkMFTWYL02L/qK4=; b=HteJT3P4mcdcGS/7wcXab1txLuawAVx0khJcAkPz+D56fUr+q1NtlVRNGm4LiQbdt+k6lE M9LBB+XnJkmsmdm3ivDCIvpAZtTkVTnE+75iqtT6KqprqZHIeFMJxT/XsxNSIHCukcZ5+9 aT2FjyLdQpLJJmuU3Vu1Bt8QlL9viJA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211354; 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=vcVI/R85fJDKlWIRs9/4yVECYIr6dkMFTWYL02L/qK4=; b=iTeV09PNoTKRr/BzTRTIJPWiIHRuu23mMNS+PDqNS9JwdQaIrEJGV4tkeNEXaiv3vrBewj 73HFG1nHlc2EoCAQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Vladimir Sementsov-Ogievskiy , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL v2 05/13] migration: process_incoming_migration_co(): rework error reporting Date: Wed, 8 May 2024 20:35:33 -0300 Message-Id: <20240508233541.2403-6-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240508233541.2403-1-farosas@suse.de> References: <20240508233541.2403-1-farosas@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-3.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCPT_COUNT_FIVE(0.00)[5]; FROM_HAS_DN(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email] X-Spam-Score: -3.30 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=2a07:de40:b251:101:10:150:64:1; 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: 1715211692936100011 From: Vladimir Sementsov-Ogievskiy Unify error reporting in the function. This simplifies the following commit, which will not-exit-on-error behavior variant to the function. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/migration.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index b307a4bc59..a9599838e6 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -735,14 +735,16 @@ static void process_incoming_migration_bh(void *opaqu= e) static void coroutine_fn process_incoming_migration_co(void *opaque) { + MigrationState *s =3D migrate_get_current(); MigrationIncomingState *mis =3D migration_incoming_get_current(); PostcopyState ps; int ret; + Error *local_err =3D NULL; =20 assert(mis->from_src_file); =20 if (compress_threads_load_setup(mis->from_src_file)) { - error_report("Failed to setup decompress threads"); + error_setg(&local_err, "Failed to setup decompress threads"); goto fail; } =20 @@ -779,19 +781,12 @@ process_incoming_migration_co(void *opaque) } =20 if (ret < 0) { - MigrationState *s =3D migrate_get_current(); - - if (migrate_has_error(s)) { - WITH_QEMU_LOCK_GUARD(&s->error_mutex) { - error_report_err(s->error); - s->error =3D NULL; - } - } - error_report("load of migration failed: %s", strerror(-ret)); + error_setg(&local_err, "load of migration failed: %s", strerror(-r= et)); goto fail; } =20 if (colo_incoming_co() < 0) { + error_setg(&local_err, "colo incoming failed"); goto fail; } =20 @@ -800,8 +795,16 @@ process_incoming_migration_co(void *opaque) fail: migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE, MIGRATION_STATUS_FAILED); + migrate_set_error(s, local_err); + error_free(local_err); + migration_incoming_state_destroy(); =20 + WITH_QEMU_LOCK_GUARD(&s->error_mutex) { + error_report_err(s->error); + s->error =3D NULL; + } + exit(EXIT_FAILURE); } =20 --=20 2.35.3 From nobody Mon Nov 25 09:36:30 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=1715211449; cv=none; d=zohomail.com; s=zohoarc; b=W611Mg3Du84/vpaiLAx/xvWb8gbCcpqrAhE0hmh5+U/tbKWF92ABPNmKK22QyatbqLXWEyjoqdGNb271olRZfPomoPgDNXkbRfkAltC9D4tP1yvUt3H8p5Q6atShoNg6Oh5fSTYwA5cM7PYQEOhn3V5klHrQ2jrJVh13Ovg/aFs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715211449; 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=T7TwvoAVe5RioVfpxD++Axd+EsFoR7/haRQrRhvgaKM=; b=dzmE8POrmdrkZpXLHMQtSjGuUPdMyfnn6Ts5F8G+VdNJ/EkNF88vTjAtZ9N8tlbLlEBBcifWL9/qS8fM8eiO+6p5lNBk3iFRuxO+9czWKapskU0HjshH2zPPeAG1lB8KeNeJSMNC/HDY0v8Hy4Jl/cqlUKaE6m/1Qfv2g3e6kAM= 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 1715211449211162.71388677478876; Wed, 8 May 2024 16:37:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4qpO-0002g5-Lu; Wed, 08 May 2024 19:36:02 -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 1s4qpL-0002fW-HT for qemu-devel@nongnu.org; Wed, 08 May 2024 19:36:00 -0400 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s4qpJ-0002Lj-HC for qemu-devel@nongnu.org; Wed, 08 May 2024 19:35:59 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [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 4F8385D38D; Wed, 8 May 2024 23:35:56 +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 B174F13A27; Wed, 8 May 2024 23:35:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id QIj2HVoMPGZ7FQAAD6G6ig (envelope-from ); Wed, 08 May 2024 23:35:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211356; 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=T7TwvoAVe5RioVfpxD++Axd+EsFoR7/haRQrRhvgaKM=; b=oyFYwT6PxlJJ6ks+YUGxgvZ6OR5MIldFzyzRRF4dJGMWWL6I6a+cO5HIVe8DSDXryasNcT uOtZjajZUPplsvKJ8v85dRdNZCVwGV30t4SaGrEnud1GH8SVf6DkntCoRO5TnAZ8JGCcxd kZ+vHwHr+6N/x9lNO8J/efWEVO9X5kk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211356; 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=T7TwvoAVe5RioVfpxD++Axd+EsFoR7/haRQrRhvgaKM=; b=+UHqGcS9NYu/81yoz0TchQOMe9L1IIoW0cYy6GVnJlgZSzDp/DiPcM4IALpn8yjGAglyrQ XohTvO4E0n6MVjCA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211356; 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=T7TwvoAVe5RioVfpxD++Axd+EsFoR7/haRQrRhvgaKM=; b=oyFYwT6PxlJJ6ks+YUGxgvZ6OR5MIldFzyzRRF4dJGMWWL6I6a+cO5HIVe8DSDXryasNcT uOtZjajZUPplsvKJ8v85dRdNZCVwGV30t4SaGrEnud1GH8SVf6DkntCoRO5TnAZ8JGCcxd kZ+vHwHr+6N/x9lNO8J/efWEVO9X5kk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211356; 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=T7TwvoAVe5RioVfpxD++Axd+EsFoR7/haRQrRhvgaKM=; b=+UHqGcS9NYu/81yoz0TchQOMe9L1IIoW0cYy6GVnJlgZSzDp/DiPcM4IALpn8yjGAglyrQ XohTvO4E0n6MVjCA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Vladimir Sementsov-Ogievskiy , Markus Armbruster Subject: [PULL v2 06/13] qapi: introduce exit-on-error parameter for migrate-incoming Date: Wed, 8 May 2024 20:35:34 -0300 Message-Id: <20240508233541.2403-7-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240508233541.2403-1-farosas@suse.de> References: <20240508233541.2403-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; RCVD_TLS_ALL(0.00)[] 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=2a07:de40:b251:101:10:150:64:2; 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 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: 1715211449899100003 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Now we do set MIGRATION_FAILED state, but don't give a chance to orchestrator to query migration state and get the error. Let's provide a possibility for QMP-based orchestrators to get an error like with outgoing migration. For hmp_migrate_incoming(), let's enable the new behavior: HMP is not and ABI, it's mostly intended to use by developer and it makes sense not to stop the process. For x-exit-preconfig, let's keep the old behavior: - it's called from init(), so here we want to keep current behavior by default - it does exit on error by itself as well So, if we want to change the behavior of x-exit-preconfig, it should be another patch. Signed-off-by: Vladimir Sementsov-Ogievskiy Acked-by: Markus Armbruster Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/migration-hmp-cmds.c | 2 +- migration/migration.c | 33 +++++++++++++++++++++++++++------ migration/migration.h | 3 +++ qapi/migration.json | 7 ++++++- system/vl.c | 3 ++- 5 files changed, 39 insertions(+), 9 deletions(-) diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index 7e96ae6ffd..23181bbee1 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -466,7 +466,7 @@ void hmp_migrate_incoming(Monitor *mon, const QDict *qd= ict) } QAPI_LIST_PREPEND(caps, g_steal_pointer(&channel)); =20 - qmp_migrate_incoming(NULL, true, caps, &err); + qmp_migrate_incoming(NULL, true, caps, true, false, &err); qapi_free_MigrationChannelList(caps); =20 end: diff --git a/migration/migration.c b/migration/migration.c index a9599838e6..289afa8d85 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -72,6 +72,8 @@ #define NOTIFIER_ELEM_INIT(array, elem) \ [elem] =3D NOTIFIER_WITH_RETURN_LIST_INITIALIZER((array)[elem]) =20 +#define INMIGRATE_DEFAULT_EXIT_ON_ERROR true + static NotifierWithReturnList migration_state_notifiers[] =3D { NOTIFIER_ELEM_INIT(migration_state_notifiers, MIG_MODE_NORMAL), NOTIFIER_ELEM_INIT(migration_state_notifiers, MIG_MODE_CPR_REBOOT), @@ -234,6 +236,8 @@ void migration_object_init(void) qemu_cond_init(¤t_incoming->page_request_cond); current_incoming->page_requested =3D g_tree_new(page_request_addr_cmp); =20 + current_incoming->exit_on_error =3D INMIGRATE_DEFAULT_EXIT_ON_ERROR; + migration_object_check(current_migration, &error_fatal); =20 blk_mig_init(); @@ -800,12 +804,14 @@ fail: =20 migration_incoming_state_destroy(); =20 - WITH_QEMU_LOCK_GUARD(&s->error_mutex) { - error_report_err(s->error); - s->error =3D NULL; - } + if (mis->exit_on_error) { + WITH_QEMU_LOCK_GUARD(&s->error_mutex) { + error_report_err(s->error); + s->error =3D NULL; + } =20 - exit(EXIT_FAILURE); + exit(EXIT_FAILURE); + } } =20 /** @@ -1314,6 +1320,15 @@ static void fill_destination_migration_info(Migratio= nInfo *info) break; } info->status =3D mis->state; + + if (!info->error_desc) { + MigrationState *s =3D migrate_get_current(); + QEMU_LOCK_GUARD(&s->error_mutex); + + if (s->error) { + info->error_desc =3D g_strdup(error_get_pretty(s->error)); + } + } } =20 MigrationInfo *qmp_query_migrate(Error **errp) @@ -1797,10 +1812,13 @@ void migrate_del_blocker(Error **reasonp) } =20 void qmp_migrate_incoming(const char *uri, bool has_channels, - MigrationChannelList *channels, Error **errp) + MigrationChannelList *channels, + bool has_exit_on_error, bool exit_on_error, + Error **errp) { Error *local_err =3D NULL; static bool once =3D true; + MigrationIncomingState *mis =3D migration_incoming_get_current(); =20 if (!once) { error_setg(errp, "The incoming migration has already been started"= ); @@ -1815,6 +1833,9 @@ void qmp_migrate_incoming(const char *uri, bool has_c= hannels, return; } =20 + mis->exit_on_error =3D + has_exit_on_error ? exit_on_error : INMIGRATE_DEFAULT_EXIT_ON_ERRO= R; + qemu_start_incoming_migration(uri, has_channels, channels, &local_err); =20 if (local_err) { diff --git a/migration/migration.h b/migration/migration.h index 6c612c0381..f3406c43c8 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -227,6 +227,9 @@ struct MigrationIncomingState { * is needed as this field is updated serially. */ unsigned int switchover_ack_pending_num; + + /* Do exit on incoming migration failure */ + bool exit_on_error; }; =20 MigrationIncomingState *migration_incoming_get_current(void); diff --git a/qapi/migration.json b/qapi/migration.json index 8c65b90328..9feed413b5 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1837,6 +1837,10 @@ # @channels: list of migration stream channels with each stream in the # list connected to a destination interface endpoint. # +# @exit-on-error: Exit on incoming migration failure. Default true. +# When set to false, the failure triggers a MIGRATION event, and +# error details could be retrieved with query-migrate. (since 9.1) +# # Since: 2.3 # # Notes: @@ -1889,7 +1893,8 @@ ## { 'command': 'migrate-incoming', 'data': {'*uri': 'str', - '*channels': [ 'MigrationChannel' ] } } + '*channels': [ 'MigrationChannel' ], + '*exit-on-error': 'bool' } } =20 ## # @xen-save-devices-state: diff --git a/system/vl.c b/system/vl.c index 7756eac81e..79cd498395 100644 --- a/system/vl.c +++ b/system/vl.c @@ -2723,7 +2723,8 @@ void qmp_x_exit_preconfig(Error **errp) if (incoming) { Error *local_err =3D NULL; if (strcmp(incoming, "defer") !=3D 0) { - qmp_migrate_incoming(incoming, false, NULL, &local_err); + qmp_migrate_incoming(incoming, false, NULL, true, true, + &local_err); if (local_err) { error_reportf_err(local_err, "-incoming %s: ", incoming); exit(1); --=20 2.35.3 From nobody Mon Nov 25 09:36:30 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=1715211716; cv=none; d=zohomail.com; s=zohoarc; b=daDFazn77p6tCuRLckGkm2PxARPlnIvHeMqB3MVfwF1WtMbi4Dp5glq0FXyizzp2rsjKQ1/rDxyXCg3JETDsrCe3+5/WSIYi2fSLgsCmVIEGjOKbMKPfq64TedqXblyBLJJGUQdvuYxKPbXiBvC4s1xRTSYEsHWrtBaZBCqfIy0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715211716; 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=lnhU60ekVuMyPHuQ6hN1D32Qj0fYBol5lki3fVtOe3Y=; b=NwWOj/JEsCxyeyIlo20GJ4YS26rMV94Rzs9u3fNUtaTG4CmFUmaZGHh1mKG2Iie+yrsrgrhyJpXqZ2j/rwSmcDZPqSfAP1hquIPVNpxttCWWApgh7uHG2a0D7p9fAE6BIgWIHxLKNXEO0TP5t9xeMMcuKI5VXjA+3bpdqjxhloQ= 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 171521171599838.198574765552394; Wed, 8 May 2024 16:41:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4qpg-0003Hf-Hd; Wed, 08 May 2024 19:36:20 -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 1s4qpb-0003Ak-Rd for qemu-devel@nongnu.org; Wed, 08 May 2024 19:36:15 -0400 Received: from smtp-out1.suse.de ([2a07:de40:b251:101:10:150:64:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s4qpL-0002O1-Bm for qemu-devel@nongnu.org; Wed, 08 May 2024 19:36:15 -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 239E1376F9; Wed, 8 May 2024 23:35: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 B9BB013A27; Wed, 8 May 2024 23:35:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id 8GXkH1wMPGZ7FQAAD6G6ig (envelope-from ); Wed, 08 May 2024 23:35:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211358; 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=lnhU60ekVuMyPHuQ6hN1D32Qj0fYBol5lki3fVtOe3Y=; b=KXxzqabKwXV6yA17SJIzDytukp0lm55dpNWGSa4UEyZcktfOZBGe0US5443soK3dVhiOq3 AbKAVajCLwbK9XeIQNF7iB1AHushq979UJNm47014BKYdpYIEjlD7D3ooOrC96icF2oWwc NEAYdl9CTbm18RICgVsKWn7jozgIAGA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211358; 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=lnhU60ekVuMyPHuQ6hN1D32Qj0fYBol5lki3fVtOe3Y=; b=Gt3+1RMsZcprum7UevBLIIQC4bogMbuZk1aJ9ph+zLdB+PP4N4P05idOZvrR8c7Go6O5oK fRs8XoLII5RQT7CQ== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=KXxzqabK; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=Gt3+1RMs DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211358; 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=lnhU60ekVuMyPHuQ6hN1D32Qj0fYBol5lki3fVtOe3Y=; b=KXxzqabKwXV6yA17SJIzDytukp0lm55dpNWGSa4UEyZcktfOZBGe0US5443soK3dVhiOq3 AbKAVajCLwbK9XeIQNF7iB1AHushq979UJNm47014BKYdpYIEjlD7D3ooOrC96icF2oWwc NEAYdl9CTbm18RICgVsKWn7jozgIAGA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211358; 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=lnhU60ekVuMyPHuQ6hN1D32Qj0fYBol5lki3fVtOe3Y=; b=Gt3+1RMsZcprum7UevBLIIQC4bogMbuZk1aJ9ph+zLdB+PP4N4P05idOZvrR8c7Go6O5oK fRs8XoLII5RQT7CQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Markus Armbruster Subject: [PULL v2 07/13] migration: Remove 'skipped' field from MigrationStats Date: Wed, 8 May 2024 20:35:35 -0300 Message-Id: <20240508233541.2403-8-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240508233541.2403-1-farosas@suse.de> References: <20240508233541.2403-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.01 X-Rspamd-Action: no action X-Rspamd-Queue-Id: 239E1376F9 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org 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)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[suse.de:+] 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=2a07:de40:b251:101:10:150:64:1; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: 1715211716881100001 Content-Type: text/plain; charset="utf-8" The 'skipped' field of the MigrationStats struct has been deprecated in 8.1. Time to remove it. Deprecation commit 7b24d32634 ("migration: skipped field is really obsolete."). Reviewed-by: Markus Armbruster Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- docs/about/deprecated.rst | 6 ------ docs/about/removed-features.rst | 6 ++++++ migration/migration-hmp-cmds.c | 2 -- migration/migration.c | 2 -- qapi/migration.json | 8 -------- 5 files changed, 6 insertions(+), 18 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 03f8b1b655..94d3e53513 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -477,12 +477,6 @@ option). Migration --------- =20 -``skipped`` MigrationStats field (since 8.1) -'''''''''''''''''''''''''''''''''''''''''''' - -``skipped`` field in Migration stats has been deprecated. It hasn't -been used for more than 10 years. - ``inc`` migrate command option (since 8.2) '''''''''''''''''''''''''''''''''''''''''' =20 diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.= rst index 53ca08aba9..c4cb2692d0 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -614,6 +614,12 @@ was superseded by ``sections``. Member ``section-size`` in the return value of ``query-sgx-capabilities`` was superseded by ``sections``. =20 +``query-migrate`` return value member ``skipped`` (removed in 9.1) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Member ``skipped`` of the ``MigrationStats`` struct hasn't been used +for more than 10 years. Removed with no replacement. + Human Monitor Protocol (HMP) commands ------------------------------------- =20 diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index 23181bbee1..b6b2035f64 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -105,8 +105,6 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict) info->ram->total >> 10); monitor_printf(mon, "duplicate: %" PRIu64 " pages\n", info->ram->duplicate); - monitor_printf(mon, "skipped: %" PRIu64 " pages\n", - info->ram->skipped); monitor_printf(mon, "normal: %" PRIu64 " pages\n", info->ram->normal); monitor_printf(mon, "normal bytes: %" PRIu64 " kbytes\n", diff --git a/migration/migration.c b/migration/migration.c index 289afa8d85..a4be929e40 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1156,8 +1156,6 @@ static void populate_ram_info(MigrationInfo *info, Mi= grationState *s) info->ram->transferred =3D migration_transferred_bytes(); info->ram->total =3D ram_bytes_total(); info->ram->duplicate =3D stat64_get(&mig_stats.zero_pages); - /* legacy value. It is not used anymore */ - info->ram->skipped =3D 0; info->ram->normal =3D stat64_get(&mig_stats.normal_pages); info->ram->normal_bytes =3D info->ram->normal * page_size; info->ram->mbps =3D s->mbps; diff --git a/qapi/migration.json b/qapi/migration.json index 9feed413b5..2dd70f1c0e 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -23,9 +23,6 @@ # # @duplicate: number of duplicate (zero) pages (since 1.2) # -# @skipped: number of skipped zero pages. Always zero, only provided -# for compatibility (since 1.5) -# # @normal: number of normal pages (since 1.2) # # @normal-bytes: number of normal bytes sent (since 1.2) @@ -63,16 +60,11 @@ # between 0 and @dirty-sync-count * @multifd-channels. (since # 7.1) # -# Features: -# -# @deprecated: Member @skipped is always zero since 1.5.3 -# # Since: 0.14 ## { 'struct': 'MigrationStats', 'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' , 'duplicate': 'int', - 'skipped': { 'type': 'int', 'features': [ 'deprecated' ] }, 'normal': 'int', 'normal-bytes': 'int', 'dirty-pages-rate': 'int', 'mbps': 'number', 'dirty-sync-count': 'int', --=20 2.35.3 From nobody Mon Nov 25 09:36:30 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=1715211528; cv=none; d=zohomail.com; s=zohoarc; b=hEJMdIhMUtiFSvMRivRJzCfQhln+alviCuLlZXPKsIEBBjLXCivFD2Igpzwgte/W8pTzI7cAAnHPK9Q/Con/Uq69KS7zYDASHsne2JYOeHq0I2DXd+J4fJ1qo4zn9HMBHXBFGaAlharhFibydo0wWkZPH1fAHvH2X0p5cfDaUSM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715211528; 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=NC828tU6joOKcaR8xfW2xQsLwu3JPWLUWZIZkxbv6bU=; b=EU8K/20XFb/rwzzp+a7vHH3hia6rxNZqT3YkhttTfS5TTKfoP18Rm06w6fXDkeLa68B7erDfAI2Js8COjSAV7CRSW+5U9iTbh4qRzSKA1BM7vuythiZL5MySlWxlmsSNvy7BW7bzcgtf9XfNwk3n1tjd143f11XWT83JpA12qnY= 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 1715211528241609.4223991365723; Wed, 8 May 2024 16:38:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4qpS-0002gi-Ag; Wed, 08 May 2024 19:36:06 -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 1s4qpQ-0002g9-2B for qemu-devel@nongnu.org; Wed, 08 May 2024 19:36: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 1s4qpN-0002PL-AD for qemu-devel@nongnu.org; Wed, 08 May 2024 19:36:03 -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 ED0F85D38D; Wed, 8 May 2024 23:35:59 +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 8DCDF13A27; Wed, 8 May 2024 23:35:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id 8C8vFV4MPGZ7FQAAD6G6ig (envelope-from ); Wed, 08 May 2024 23:35:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211360; 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=NC828tU6joOKcaR8xfW2xQsLwu3JPWLUWZIZkxbv6bU=; b=1gx0moKMAtSUbXrsUB7l4ybBuGQkg9ge3IomOA2Q0J4R2BxmgG3tUlGWR5UC29oFrj4G3N h0KrxFf2XKK3U6VNZqXQjZOoTAtYscE8Y4LvkG2/5HIcvh1zku1hreiSWcUsd7RHDMRF8h 14nPtLQBUhJEzWe4Sjzr00ZyZiB1krk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211360; 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=NC828tU6joOKcaR8xfW2xQsLwu3JPWLUWZIZkxbv6bU=; b=B3Lh7zikjMKgSryQe73PEjsWg34N8HwXlVVpyWoRtxzh7C9GKPZ/Ou5K15lF/qpJSebbkd 97IJmjPV0CFPacBQ== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=fC5HHXg1; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=7XI4X3At DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211359; 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=NC828tU6joOKcaR8xfW2xQsLwu3JPWLUWZIZkxbv6bU=; b=fC5HHXg1WXVbbKWw/MfPYJZe7LJ8sPwyJy+gOYypD1e/Zul/mHxf56JdJm5NLlr5C/2URp qi30YwtvkzAnhCBJb2CehJIxCioeFLi/J3ZBYxEwv367qvjfWIETCDV3dHXJzXN+h+CrKv q7x16e8498qfhUVXw4iajTNS12xm8GY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211359; 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=NC828tU6joOKcaR8xfW2xQsLwu3JPWLUWZIZkxbv6bU=; b=7XI4X3AtGFxKOhvEo8jnU9Qat/ndKQg5YgooEXNySInJJTpPVZpcvJiIwMM8i6+dguWNXy CHxn5ONaZpXqedDg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Markus Armbruster Subject: [PULL v2 08/13] migration: Remove 'inc' option from migrate command Date: Wed, 8 May 2024 20:35:36 -0300 Message-Id: <20240508233541.2403-9-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240508233541.2403-1-farosas@suse.de> References: <20240508233541.2403-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Action: no action X-Rspamd-Queue-Id: ED0F85D38D X-Rspamd-Server: rspamd1.dmz-prg2.suse.org 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.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 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) (identity @suse.de) X-ZM-MESSAGEID: 1715211530176100005 Content-Type: text/plain; charset="utf-8" The block incremental option for block migration has been deprecated in 8.2 in favor of using the block-mirror feature. Remove it now. Deprecation commit 40101f320d ("migration: migrate 'inc' command option is deprecated."). Reviewed-by: Markus Armbruster Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- docs/about/deprecated.rst | 9 ------ docs/about/removed-features.rst | 14 +++++++++ hmp-commands.hx | 13 +++----- migration/block.c | 1 - migration/migration-hmp-cmds.c | 18 ++--------- migration/migration.c | 24 +++++---------- migration/options.c | 30 +----------------- migration/options.h | 5 --- qapi/migration.json | 54 +++++++-------------------------- 9 files changed, 39 insertions(+), 129 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 94d3e53513..1dfbd5fad4 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -477,15 +477,6 @@ option). Migration --------- =20 -``inc`` migrate command option (since 8.2) -'''''''''''''''''''''''''''''''''''''''''' - -Use blockdev-mirror with NBD instead. - -As an intermediate step the ``inc`` functionality can be achieved by -setting the ``block-incremental`` migration parameter to ``true``. -But this parameter is also deprecated. - ``blk`` migrate command option (since 8.2) '''''''''''''''''''''''''''''''''''''''''' =20 diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.= rst index c4cb2692d0..7da4b3df14 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -620,6 +620,13 @@ was superseded by ``sections``. Member ``skipped`` of the ``MigrationStats`` struct hasn't been used for more than 10 years. Removed with no replacement. =20 +``migrate`` command option ``inc`` (removed in 9.1) +''''''''''''''''''''''''''''''''''''''''''''''''''' + +Use blockdev-mirror with NBD instead. See "QMP invocation for live +storage migration with ``blockdev-mirror`` + NBD" in +docs/interop/live-block-operations.rst for a detailed explanation. + Human Monitor Protocol (HMP) commands ------------------------------------- =20 @@ -680,6 +687,13 @@ This command didn't produce any output already. Remove= d with no replacement. The ``singlestep`` command has been replaced by the ``one-insn-per-tb`` command, which has the same behaviour but a less misleading name. =20 +``migrate`` command ``-i`` option (removed in 9.1) +'''''''''''''''''''''''''''''''''''''''''''''''''' + +Use blockdev-mirror with NBD instead. See "QMP invocation for live +storage migration with ``blockdev-mirror`` + NBD" in +docs/interop/live-block-operations.rst for a detailed explanation. + Host Architectures ------------------ =20 diff --git a/hmp-commands.hx b/hmp-commands.hx index 2e2a3bcf98..7978302949 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -909,26 +909,21 @@ ERST =20 { .name =3D "migrate", - .args_type =3D "detach:-d,blk:-b,inc:-i,resume:-r,uri:s", - .params =3D "[-d] [-b] [-i] [-r] uri", + .args_type =3D "detach:-d,blk:-b,resume:-r,uri:s", + .params =3D "[-d] [-b] [-r] uri", .help =3D "migrate to URI (using -d to not wait for completi= on)" "\n\t\t\t -b for migration without shared storage with" - " full copy of disk\n\t\t\t -i for migration without " - "shared storage with incremental copy of disk " - "(base image shared between src and destination)" - "\n\t\t\t -r to resume a paused migration", + " full copy of disk\n\t\t\t -r to resume a paused migration", .cmd =3D hmp_migrate, }, =20 =20 SRST -``migrate [-d] [-b] [-i]`` *uri* +``migrate [-d] [-b]`` *uri* Migrate to *uri* (using -d to not wait for completion). =20 ``-b`` for migration with full copy of disk - ``-i`` - for migration with incremental copy of disk (base image is shared) ERST =20 { diff --git a/migration/block.c b/migration/block.c index bae6e94891..87ec1a7e68 100644 --- a/migration/block.c +++ b/migration/block.c @@ -419,7 +419,6 @@ static int init_blk_migration(QEMUFile *f, Error **errp) bmds->bulk_completed =3D 0; bmds->total_sectors =3D sectors; bmds->completed_sectors =3D 0; - bmds->shared_base =3D migrate_block_incremental(); =20 assert(i < num_bs); bmds_bs[i].bmds =3D bmds; diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index b6b2035f64..8446c0721a 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -332,10 +332,6 @@ void hmp_info_migrate_parameters(Monitor *mon, const Q= Dict *qdict) monitor_printf(mon, "%s: %u ms\n", MigrationParameter_str(MIGRATION_PARAMETER_X_CHECKPOINT_DELAY), params->x_checkpoint_delay); - assert(params->has_block_incremental); - monitor_printf(mon, "%s: %s\n", - MigrationParameter_str(MIGRATION_PARAMETER_BLOCK_INCREMENTAL), - params->block_incremental ? "on" : "off"); monitor_printf(mon, "%s: %u\n", MigrationParameter_str(MIGRATION_PARAMETER_MULTIFD_CHANNELS), params->multifd_channels); @@ -616,10 +612,6 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDi= ct *qdict) p->has_x_checkpoint_delay =3D true; visit_type_uint32(v, param, &p->x_checkpoint_delay, &err); break; - case MIGRATION_PARAMETER_BLOCK_INCREMENTAL: - p->has_block_incremental =3D true; - visit_type_bool(v, param, &p->block_incremental, &err); - break; case MIGRATION_PARAMETER_MULTIFD_CHANNELS: p->has_multifd_channels =3D true; visit_type_uint8(v, param, &p->multifd_channels, &err); @@ -767,18 +759,12 @@ void hmp_migrate(Monitor *mon, const QDict *qdict) { bool detach =3D qdict_get_try_bool(qdict, "detach", false); bool blk =3D qdict_get_try_bool(qdict, "blk", false); - bool inc =3D qdict_get_try_bool(qdict, "inc", false); bool resume =3D qdict_get_try_bool(qdict, "resume", false); const char *uri =3D qdict_get_str(qdict, "uri"); Error *err =3D NULL; g_autoptr(MigrationChannelList) caps =3D NULL; g_autoptr(MigrationChannel) channel =3D NULL; =20 - if (inc) { - warn_report("option '-i' is deprecated;" - " use blockdev-mirror with NBD instead"); - } - if (blk) { warn_report("option '-b' is deprecated;" " use blockdev-mirror with NBD instead"); @@ -790,8 +776,8 @@ void hmp_migrate(Monitor *mon, const QDict *qdict) } QAPI_LIST_PREPEND(caps, g_steal_pointer(&channel)); =20 - qmp_migrate(NULL, true, caps, !!blk, blk, !!inc, inc, - false, false, true, resume, &err); + qmp_migrate(NULL, true, caps, !!blk, blk, false, false, + true, resume, &err); if (hmp_handle_error(mon, err)) { return; } diff --git a/migration/migration.c b/migration/migration.c index a4be929e40..11a13fa20c 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1935,14 +1935,9 @@ bool migration_is_blocked(Error **errp) } =20 /* Returns true if continue to migrate, or false if error detected */ -static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc, - bool resume, Error **errp) +static bool migrate_prepare(MigrationState *s, bool blk, bool resume, + Error **errp) { - if (blk_inc) { - warn_report("parameter 'inc' is deprecated;" - " use blockdev-mirror with NBD instead"); - } - if (blk) { warn_report("parameter 'blk' is deprecated;" " use blockdev-mirror with NBD instead"); @@ -2032,12 +2027,12 @@ static bool migrate_prepare(MigrationState *s, bool= blk, bool blk_inc, } } =20 - if (blk || blk_inc) { + if (blk) { if (migrate_colo()) { error_setg(errp, "No disk migration is required in COLO mode"); return false; } - if (migrate_block() || migrate_block_incremental()) { + if (migrate_block()) { error_setg(errp, "Command options are incompatible with " "current migration capabilities"); return false; @@ -2048,10 +2043,6 @@ static bool migrate_prepare(MigrationState *s, bool = blk, bool blk_inc, s->must_remove_block_options =3D true; } =20 - if (blk_inc) { - migrate_set_block_incremental(true); - } - if (migrate_init(s, errp)) { return false; } @@ -2061,8 +2052,8 @@ static bool migrate_prepare(MigrationState *s, bool b= lk, bool blk_inc, =20 void qmp_migrate(const char *uri, bool has_channels, MigrationChannelList *channels, bool has_blk, bool blk, - bool has_inc, bool inc, bool has_detach, bool detach, - bool has_resume, bool resume, Error **errp) + bool has_detach, bool detach, bool has_resume, bool resum= e, + Error **errp) { bool resume_requested; Error *local_err =3D NULL; @@ -2101,8 +2092,7 @@ void qmp_migrate(const char *uri, bool has_channels, } =20 resume_requested =3D has_resume && resume; - if (!migrate_prepare(s, has_blk && blk, has_inc && inc, - resume_requested, errp)) { + if (!migrate_prepare(s, has_blk && blk, resume_requested, errp)) { /* Error detected, put into errp */ return; } diff --git a/migration/options.c b/migration/options.c index 239f5ecfb4..5b16d99bd9 100644 --- a/migration/options.c +++ b/migration/options.c @@ -486,7 +486,7 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps,= Error **errp) =20 #ifndef CONFIG_LIVE_BLOCK_MIGRATION if (new_caps[MIGRATION_CAPABILITY_BLOCK]) { - error_setg(errp, "QEMU compiled without old-style (blk/-b, inc/-i)= " + error_setg(errp, "QEMU compiled without old-style (blk/-b) " "block migration"); error_append_hint(errp, "Use blockdev-mirror with NBD instead.\n"); return false; @@ -763,13 +763,6 @@ bool migrate_has_block_bitmap_mapping(void) return s->parameters.has_block_bitmap_mapping; } =20 -bool migrate_block_incremental(void) -{ - MigrationState *s =3D migrate_get_current(); - - return s->parameters.block_incremental; -} - uint32_t migrate_checkpoint_delay(void) { MigrationState *s =3D migrate_get_current(); @@ -948,15 +941,6 @@ ZeroPageDetection migrate_zero_page_detection(void) return s->parameters.zero_page_detection; } =20 -/* parameter setters */ - -void migrate_set_block_incremental(bool value) -{ - MigrationState *s =3D migrate_get_current(); - - s->parameters.block_incremental =3D value; -} - /* parameters helpers */ =20 void block_cleanup_parameters(void) @@ -966,7 +950,6 @@ void block_cleanup_parameters(void) if (s->must_remove_block_options) { /* setting to false can never fail */ migrate_cap_set(MIGRATION_CAPABILITY_BLOCK, false, &error_abort); - migrate_set_block_incremental(false); s->must_remove_block_options =3D false; } } @@ -1020,8 +1003,6 @@ MigrationParameters *qmp_query_migrate_parameters(Err= or **errp) params->downtime_limit =3D s->parameters.downtime_limit; params->has_x_checkpoint_delay =3D true; params->x_checkpoint_delay =3D s->parameters.x_checkpoint_delay; - params->has_block_incremental =3D true; - params->block_incremental =3D s->parameters.block_incremental; params->has_multifd_channels =3D true; params->multifd_channels =3D s->parameters.multifd_channels; params->has_multifd_compression =3D true; @@ -1081,7 +1062,6 @@ void migrate_params_init(MigrationParameters *params) params->has_max_bandwidth =3D true; params->has_downtime_limit =3D true; params->has_x_checkpoint_delay =3D true; - params->has_block_incremental =3D true; params->has_multifd_channels =3D true; params->has_multifd_compression =3D true; params->has_multifd_zlib_level =3D true; @@ -1359,9 +1339,6 @@ static void migrate_params_test_apply(MigrateSetParam= eters *params, dest->x_checkpoint_delay =3D params->x_checkpoint_delay; } =20 - if (params->has_block_incremental) { - dest->block_incremental =3D params->block_incremental; - } if (params->has_multifd_channels) { dest->multifd_channels =3D params->multifd_channels; } @@ -1502,11 +1479,6 @@ static void migrate_params_apply(MigrateSetParameter= s *params, Error **errp) colo_checkpoint_delay_set(); } =20 - if (params->has_block_incremental) { - warn_report("block migration is deprecated;" - " use blockdev-mirror with NBD instead"); - s->parameters.block_incremental =3D params->block_incremental; - } if (params->has_multifd_channels) { s->parameters.multifd_channels =3D params->multifd_channels; } diff --git a/migration/options.h b/migration/options.h index ab8199e207..fa5eb177df 100644 --- a/migration/options.h +++ b/migration/options.h @@ -67,7 +67,6 @@ bool migrate_cap_set(int cap, bool value, Error **errp); const BitmapMigrationNodeAliasList *migrate_block_bitmap_mapping(void); bool migrate_has_block_bitmap_mapping(void); =20 -bool migrate_block_incremental(void); uint32_t migrate_checkpoint_delay(void); int migrate_compress_level(void); int migrate_compress_threads(void); @@ -92,10 +91,6 @@ const char *migrate_tls_hostname(void); uint64_t migrate_xbzrle_cache_size(void); ZeroPageDetection migrate_zero_page_detection(void); =20 -/* parameters setters */ - -void migrate_set_block_incremental(bool value); - /* parameters helpers */ =20 bool migrate_params_check(MigrationParameters *params, Error **errp); diff --git a/qapi/migration.json b/qapi/migration.json index 2dd70f1c0e..b7d3ad015a 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -839,13 +839,6 @@ # @x-checkpoint-delay: The delay time (in ms) between two COLO # checkpoints in periodic mode. (Since 2.8) # -# @block-incremental: Affects how much storage is migrated when the -# block migration capability is enabled. When false, the entire -# storage backing chain is migrated into a flattened image at the -# destination; when true, only the active qcow2 layer is migrated -# and the destination must already have access to the same backing -# chain as was used on the source. (since 2.10) -# # @multifd-channels: Number of channels used to migrate data in # parallel. This is the same number that the number of sockets # used for migration. The default value is 2 (since 4.0) @@ -908,10 +901,9 @@ # # Features: # -# @deprecated: Member @block-incremental is deprecated. Use -# blockdev-mirror with NBD instead. Members @compress-level, -# @compress-threads, @decompress-threads and @compress-wait-thread -# are deprecated because @compression is deprecated. +# @deprecated: Members @compress-level, @compress-threads, +# @decompress-threads and @compress-wait-thread are deprecated +# because @compression is deprecated. # # @unstable: Members @x-checkpoint-delay and # @x-vcpu-dirty-limit-period are experimental. @@ -931,7 +923,6 @@ 'tls-creds', 'tls-hostname', 'tls-authz', 'max-bandwidth', 'avail-switchover-bandwidth', 'downtime-limit', { 'name': 'x-checkpoint-delay', 'features': [ 'unstable' ] }, - { 'name': 'block-incremental', 'features': [ 'deprecated' ] }, 'multifd-channels', 'xbzrle-cache-size', 'max-postcopy-bandwidth', 'max-cpu-throttle', 'multifd-compression', @@ -1047,13 +1038,6 @@ # @x-checkpoint-delay: The delay time (in ms) between two COLO # checkpoints in periodic mode. (Since 2.8) # -# @block-incremental: Affects how much storage is migrated when the -# block migration capability is enabled. When false, the entire -# storage backing chain is migrated into a flattened image at the -# destination; when true, only the active qcow2 layer is migrated -# and the destination must already have access to the same backing -# chain as was used on the source. (since 2.10) -# # @multifd-channels: Number of channels used to migrate data in # parallel. This is the same number that the number of sockets # used for migration. The default value is 2 (since 4.0) @@ -1116,10 +1100,9 @@ # # Features: # -# @deprecated: Member @block-incremental is deprecated. Use -# blockdev-mirror with NBD instead. Members @compress-level, -# @compress-threads, @decompress-threads and @compress-wait-thread -# are deprecated because @compression is deprecated. +# @deprecated: Members @compress-level, @compress-threads, +# @decompress-threads and @compress-wait-thread are deprecated +# because @compression is deprecated. # # @unstable: Members @x-checkpoint-delay and # @x-vcpu-dirty-limit-period are experimental. @@ -1154,8 +1137,6 @@ '*downtime-limit': 'uint64', '*x-checkpoint-delay': { 'type': 'uint32', 'features': [ 'unstable' ] }, - '*block-incremental': { 'type': 'bool', - 'features': [ 'deprecated' ] }, '*multifd-channels': 'uint8', '*xbzrle-cache-size': 'size', '*max-postcopy-bandwidth': 'size', @@ -1279,13 +1260,6 @@ # @x-checkpoint-delay: the delay time between two COLO checkpoints. # (Since 2.8) # -# @block-incremental: Affects how much storage is migrated when the -# block migration capability is enabled. When false, the entire -# storage backing chain is migrated into a flattened image at the -# destination; when true, only the active qcow2 layer is migrated -# and the destination must already have access to the same backing -# chain as was used on the source. (since 2.10) -# # @multifd-channels: Number of channels used to migrate data in # parallel. This is the same number that the number of sockets # used for migration. The default value is 2 (since 4.0) @@ -1348,10 +1322,9 @@ # # Features: # -# @deprecated: Member @block-incremental is deprecated. Use -# blockdev-mirror with NBD instead. Members @compress-level, -# @compress-threads, @decompress-threads and @compress-wait-thread -# are deprecated because @compression is deprecated. +# @deprecated: Members @compress-level, @compress-threads, +# @decompress-threads and @compress-wait-thread are deprecated +# because @compression is deprecated. # # @unstable: Members @x-checkpoint-delay and # @x-vcpu-dirty-limit-period are experimental. @@ -1383,8 +1356,6 @@ '*downtime-limit': 'uint64', '*x-checkpoint-delay': { 'type': 'uint32', 'features': [ 'unstable' ] }, - '*block-incremental': { 'type': 'bool', - 'features': [ 'deprecated' ] }, '*multifd-channels': 'uint8', '*xbzrle-cache-size': 'size', '*max-postcopy-bandwidth': 'size', @@ -1736,8 +1707,6 @@ # # @blk: do block migration (full disk copy) # -# @inc: incremental disk copy migration -# # @detach: this argument exists only for compatibility reasons and is # ignored by QEMU # @@ -1745,8 +1714,8 @@ # # Features: # -# @deprecated: Members @inc and @blk are deprecated. Use -# blockdev-mirror with NBD instead. +# @deprecated: Member @blk is deprecated. Use blockdev-mirror with +# NBD instead. # # Since: 0.14 # @@ -1814,7 +1783,6 @@ 'data': {'*uri': 'str', '*channels': [ 'MigrationChannel' ], '*blk': { 'type': 'bool', 'features': [ 'deprecated' ] }, - '*inc': { 'type': 'bool', 'features': [ 'deprecated' ] }, '*detach': 'bool', '*resume': 'bool' } } =20 ## --=20 2.35.3 From nobody Mon Nov 25 09:36:30 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=1715211396; cv=none; d=zohomail.com; s=zohoarc; b=KXeZRemm9Qezg76eJzMbPcx0lBiojYHgQGB9axyB4GoOLeHsJI2OqKRT8XNKeDF2iqL0KBcAyQqO2bMqmBFQXyVsMTDVXpD+DT5F9tr5r47vixmHixBt4wq+h8GptUQmYe+jMqvf7499PRjuKE9UL5NpAtj6NVPAUbMxKWUcd6k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715211396; 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=Kr6Y/kpfH0faSjWnCQORUmcl4qOvyvZpnA3H4a9M93Y=; b=dF76O8n3cbpDZjE2rpTLpggDg+KPzqoO16IF6tAhAUKe893Hzlq0BecGyndp/IfCYIT/sIj5iAY5GGPlK6n/ir0c5+eNzM6UW3S/UX7d9efZC2VcHmXAqav1sw93nyCTeg1mXEZlTUp5uw77Uo6GoC4grnhKOY/u/b3SzrrMwXQ= 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 171521139629124.142544734808098; Wed, 8 May 2024 16:36:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4qpV-0002oK-HZ; Wed, 08 May 2024 19:36: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 1s4qpT-0002gk-Fq for qemu-devel@nongnu.org; Wed, 08 May 2024 19:36:07 -0400 Received: from smtp-out1.suse.de ([2a07:de40:b251:101:10:150:64:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s4qpQ-0002QA-Ep for qemu-devel@nongnu.org; Wed, 08 May 2024 19:36:07 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [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 BCE9537725; Wed, 8 May 2024 23:36:01 +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 6304713A27; Wed, 8 May 2024 23:36:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id CFi9CmAMPGZ7FQAAD6G6ig (envelope-from ); Wed, 08 May 2024 23:36:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211361; 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=Kr6Y/kpfH0faSjWnCQORUmcl4qOvyvZpnA3H4a9M93Y=; b=ZxV6tQNw9PhhqwAaMpfFdw8p3plv2ZDUtzLLP+BFVCoN87z7qgYXaV22jTmcdq/56Ce44H ARJoZUL+fhCaq3dtT7CF99J2iTY+LvnUmUMH6C4PaCLdoZKzTnX1awzJQ5xH4GH9FCFnZ9 wpnqd3759kB/XqNOvnybZsXCCIsKsR4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211361; 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=Kr6Y/kpfH0faSjWnCQORUmcl4qOvyvZpnA3H4a9M93Y=; b=dR9HrYKQpMVdoi1rg1S1Fx3lJ+PXQz0yyMrlQyIS4KGsTEpaFsMCwpdMPQRgoBYP2PaWVy IqQx86BUXxYaeWAA== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211361; 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=Kr6Y/kpfH0faSjWnCQORUmcl4qOvyvZpnA3H4a9M93Y=; b=ZxV6tQNw9PhhqwAaMpfFdw8p3plv2ZDUtzLLP+BFVCoN87z7qgYXaV22jTmcdq/56Ce44H ARJoZUL+fhCaq3dtT7CF99J2iTY+LvnUmUMH6C4PaCLdoZKzTnX1awzJQ5xH4GH9FCFnZ9 wpnqd3759kB/XqNOvnybZsXCCIsKsR4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211361; 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=Kr6Y/kpfH0faSjWnCQORUmcl4qOvyvZpnA3H4a9M93Y=; b=dR9HrYKQpMVdoi1rg1S1Fx3lJ+PXQz0yyMrlQyIS4KGsTEpaFsMCwpdMPQRgoBYP2PaWVy IqQx86BUXxYaeWAA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Markus Armbruster Subject: [PULL v2 09/13] migration: Remove 'blk/-b' option from migrate commands Date: Wed, 8 May 2024 20:35:37 -0300 Message-Id: <20240508233541.2403-10-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240508233541.2403-1-farosas@suse.de> References: <20240508233541.2403-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: -2.80 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=2a07:de40:b251:101:10:150:64:1; 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: 1715211397850100005 Content-Type: text/plain; charset="utf-8" The block migration is considered obsolete and has been deprecated in 8.2. Remove the migrate command option that enables it. This only affects the QMP and HMP commands, the feature can still be accessed by setting the migration 'block' capability. The whole feature will be removed in a future patch. Deprecation commit 8846b5bfca ("migration: migrate 'blk' command option is deprecated."). Reviewed-by: Markus Armbruster Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- .gitlab-ci.d/buildtest.yml | 2 +- docs/about/deprecated.rst | 9 -- docs/about/removed-features.rst | 14 +++ hmp-commands.hx | 12 +-- migration/migration-hmp-cmds.c | 9 +- migration/migration.c | 31 +------ migration/migration.h | 4 - migration/options.c | 14 +-- migration/options.h | 2 - qapi/migration.json | 8 -- tests/qemu-iotests/183 | 147 ------------------------------- tests/qemu-iotests/183.out | 66 -------------- tests/qemu-iotests/common.filter | 7 -- 13 files changed, 25 insertions(+), 300 deletions(-) delete mode 100755 tests/qemu-iotests/183 delete mode 100644 tests/qemu-iotests/183.out diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index e9402a68a7..1bf76713d7 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -342,7 +342,7 @@ build-tcg-disabled: - cd tests/qemu-iotests/ - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033= 048 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163 - 170 171 183 184 192 194 208 221 226 227 236 253 277 image-flee= cing + 170 171 184 192 194 208 221 226 227 236 253 277 image-fleecing - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 1= 22 124 132 139 142 144 145 151 152 155 157 165 194 196 200 202 208 209 216 218 227 234 246 247 248 250 254 255 257 258 diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 1dfbd5fad4..08d8ef37a7 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -477,15 +477,6 @@ option). Migration --------- =20 -``blk`` migrate command option (since 8.2) -'''''''''''''''''''''''''''''''''''''''''' - -Use blockdev-mirror with NBD instead. - -As an intermediate step the ``blk`` functionality can be achieved by -setting the ``block`` migration capability to ``true``. But this -capability is also deprecated. - block migration (since 8.2) ''''''''''''''''''''''''''' =20 diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.= rst index 7da4b3df14..a491c66660 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -627,6 +627,13 @@ Use blockdev-mirror with NBD instead. See "QMP invocat= ion for live storage migration with ``blockdev-mirror`` + NBD" in docs/interop/live-block-operations.rst for a detailed explanation. =20 +``migrate`` command option ``blk`` (removed in 9.1) +''''''''''''''''''''''''''''''''''''''''''''''''''' + +Use blockdev-mirror with NBD instead. See "QMP invocation for live +storage migration with ``blockdev-mirror`` + NBD" in +docs/interop/live-block-operations.rst for a detailed explanation. + Human Monitor Protocol (HMP) commands ------------------------------------- =20 @@ -694,6 +701,13 @@ Use blockdev-mirror with NBD instead. See "QMP invocat= ion for live storage migration with ``blockdev-mirror`` + NBD" in docs/interop/live-block-operations.rst for a detailed explanation. =20 +``migrate`` command ``-b`` option (removed in 9.1) +'''''''''''''''''''''''''''''''''''''''''''''''''' + +Use blockdev-mirror with NBD instead. See "QMP invocation for live +storage migration with ``blockdev-mirror`` + NBD" in +docs/interop/live-block-operations.rst for a detailed explanation. + Host Architectures ------------------ =20 diff --git a/hmp-commands.hx b/hmp-commands.hx index 7978302949..ebca2cdced 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -909,21 +909,17 @@ ERST =20 { .name =3D "migrate", - .args_type =3D "detach:-d,blk:-b,resume:-r,uri:s", - .params =3D "[-d] [-b] [-r] uri", + .args_type =3D "detach:-d,resume:-r,uri:s", + .params =3D "[-d] [-r] uri", .help =3D "migrate to URI (using -d to not wait for completi= on)" - "\n\t\t\t -b for migration without shared storage with" - " full copy of disk\n\t\t\t -r to resume a paused migration", + "\n\t\t\t -r to resume a paused migration", .cmd =3D hmp_migrate, }, =20 =20 SRST -``migrate [-d] [-b]`` *uri* +``migrate [-d]`` *uri* Migrate to *uri* (using -d to not wait for completion). - - ``-b`` - for migration with full copy of disk ERST =20 { diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index 8446c0721a..734c1d29ce 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -758,26 +758,19 @@ static void hmp_migrate_status_cb(void *opaque) void hmp_migrate(Monitor *mon, const QDict *qdict) { bool detach =3D qdict_get_try_bool(qdict, "detach", false); - bool blk =3D qdict_get_try_bool(qdict, "blk", false); bool resume =3D qdict_get_try_bool(qdict, "resume", false); const char *uri =3D qdict_get_str(qdict, "uri"); Error *err =3D NULL; g_autoptr(MigrationChannelList) caps =3D NULL; g_autoptr(MigrationChannel) channel =3D NULL; =20 - if (blk) { - warn_report("option '-b' is deprecated;" - " use blockdev-mirror with NBD instead"); - } - if (!migrate_uri_parse(uri, &channel, &err)) { hmp_handle_error(mon, err); return; } QAPI_LIST_PREPEND(caps, g_steal_pointer(&channel)); =20 - qmp_migrate(NULL, true, caps, !!blk, blk, false, false, - true, resume, &err); + qmp_migrate(NULL, true, caps, false, false, true, resume, &err); if (hmp_handle_error(mon, err)) { return; } diff --git a/migration/migration.c b/migration/migration.c index 11a13fa20c..91327b98c5 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1935,14 +1935,8 @@ bool migration_is_blocked(Error **errp) } =20 /* Returns true if continue to migrate, or false if error detected */ -static bool migrate_prepare(MigrationState *s, bool blk, bool resume, - Error **errp) +static bool migrate_prepare(MigrationState *s, bool resume, Error **errp) { - if (blk) { - warn_report("parameter 'blk' is deprecated;" - " use blockdev-mirror with NBD instead"); - } - if (resume) { if (s->state !=3D MIGRATION_STATUS_POSTCOPY_PAUSED) { error_setg(errp, "Cannot resume if there is no " @@ -2027,22 +2021,6 @@ static bool migrate_prepare(MigrationState *s, bool = blk, bool resume, } } =20 - if (blk) { - if (migrate_colo()) { - error_setg(errp, "No disk migration is required in COLO mode"); - return false; - } - if (migrate_block()) { - error_setg(errp, "Command options are incompatible with " - "current migration capabilities"); - return false; - } - if (!migrate_cap_set(MIGRATION_CAPABILITY_BLOCK, true, errp)) { - return false; - } - s->must_remove_block_options =3D true; - } - if (migrate_init(s, errp)) { return false; } @@ -2051,9 +2029,8 @@ static bool migrate_prepare(MigrationState *s, bool b= lk, bool resume, } =20 void qmp_migrate(const char *uri, bool has_channels, - MigrationChannelList *channels, bool has_blk, bool blk, - bool has_detach, bool detach, bool has_resume, bool resum= e, - Error **errp) + MigrationChannelList *channels, bool has_detach, bool det= ach, + bool has_resume, bool resume, Error **errp) { bool resume_requested; Error *local_err =3D NULL; @@ -2092,7 +2069,7 @@ void qmp_migrate(const char *uri, bool has_channels, } =20 resume_requested =3D has_resume && resume; - if (!migrate_prepare(s, has_blk && blk, resume_requested, errp)) { + if (!migrate_prepare(s, resume_requested, errp)) { /* Error detected, put into errp */ return; } diff --git a/migration/migration.h b/migration/migration.h index f3406c43c8..a02c2ec782 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -379,10 +379,6 @@ struct MigrationState { /* mutex to protect errp */ QemuMutex error_mutex; =20 - /* Do we have to clean up -b/-i from old migrate parameters */ - /* This feature is deprecated and will be removed */ - bool must_remove_block_options; - /* * Global switch on whether we need to store the global state * during migration. diff --git a/migration/options.c b/migration/options.c index 5b16d99bd9..856b2fa33c 100644 --- a/migration/options.c +++ b/migration/options.c @@ -486,8 +486,7 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps,= Error **errp) =20 #ifndef CONFIG_LIVE_BLOCK_MIGRATION if (new_caps[MIGRATION_CAPABILITY_BLOCK]) { - error_setg(errp, "QEMU compiled without old-style (blk/-b) " - "block migration"); + error_setg(errp, "QEMU compiled without old-style block migration"= ); error_append_hint(errp, "Use blockdev-mirror with NBD instead.\n"); return false; } @@ -943,17 +942,6 @@ ZeroPageDetection migrate_zero_page_detection(void) =20 /* parameters helpers */ =20 -void block_cleanup_parameters(void) -{ - MigrationState *s =3D migrate_get_current(); - - if (s->must_remove_block_options) { - /* setting to false can never fail */ - migrate_cap_set(MIGRATION_CAPABILITY_BLOCK, false, &error_abort); - s->must_remove_block_options =3D false; - } -} - AnnounceParameters *migrate_announce_params(void) { static AnnounceParameters ap; diff --git a/migration/options.h b/migration/options.h index fa5eb177df..e9cb60444f 100644 --- a/migration/options.h +++ b/migration/options.h @@ -95,6 +95,4 @@ ZeroPageDetection migrate_zero_page_detection(void); =20 bool migrate_params_check(MigrationParameters *params, Error **errp); void migrate_params_init(MigrationParameters *params); -void block_cleanup_parameters(void); - #endif diff --git a/qapi/migration.json b/qapi/migration.json index b7d3ad015a..381b52f680 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1705,18 +1705,11 @@ # @channels: list of migration stream channels with each stream in the # list connected to a destination interface endpoint. # -# @blk: do block migration (full disk copy) -# # @detach: this argument exists only for compatibility reasons and is # ignored by QEMU # # @resume: resume one paused migration, default "off". (since 3.0) # -# Features: -# -# @deprecated: Member @blk is deprecated. Use blockdev-mirror with -# NBD instead. -# # Since: 0.14 # # Notes: @@ -1782,7 +1775,6 @@ { 'command': 'migrate', 'data': {'*uri': 'str', '*channels': [ 'MigrationChannel' ], - '*blk': { 'type': 'bool', 'features': [ 'deprecated' ] }, '*detach': 'bool', '*resume': 'bool' } } =20 ## diff --git a/tests/qemu-iotests/183 b/tests/qemu-iotests/183 deleted file mode 100755 index b85770458e..0000000000 --- a/tests/qemu-iotests/183 +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/env bash -# group: rw migration quick -# -# Test old-style block migration (migrate -b) -# -# Copyright (C) 2017 Red Hat, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - -# creator -owner=3Dkwolf@redhat.com - -seq=3D`basename $0` -echo "QA output created by $seq" - -status=3D1 # failure is the default! - -MIG_SOCKET=3D"${SOCK_DIR}/migrate" - -_cleanup() -{ - rm -f "${MIG_SOCKET}" - _rm_test_img "${TEST_IMG}.dest" - _cleanup_test_img - _cleanup_qemu -} -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common.rc -. ./common.filter -. ./common.qemu - -_supported_os Linux FreeBSD NetBSD -_supported_fmt qcow2 raw qed quorum -_supported_proto file fuse - -size=3D64M -_make_test_img $size -TEST_IMG=3D"${TEST_IMG}.dest" _make_test_img $size - -echo -echo =3D=3D=3D Starting VMs =3D=3D=3D -echo - -qemu_comm_method=3D"qmp" - -_launch_qemu \ - -drive file=3D"${TEST_IMG}",cache=3D$CACHEMODE,aio=3D$AIOMODE,driver= =3D$IMGFMT,id=3Ddisk -src=3D$QEMU_HANDLE -_send_qemu_cmd $src "{ 'execute': 'qmp_capabilities' }" 'return' - -_launch_qemu \ - -drive file=3D"${TEST_IMG}.dest",cache=3D$CACHEMODE,aio=3D$AIOMODE,dri= ver=3D$IMGFMT,id=3Ddisk \ - -incoming "unix:${MIG_SOCKET}" -dest=3D$QEMU_HANDLE -_send_qemu_cmd $dest "{ 'execute': 'qmp_capabilities' }" 'return' - -echo -echo =3D=3D=3D Write something on the source =3D=3D=3D -echo - -_send_qemu_cmd $src \ - "{ 'execute': 'human-monitor-command', - 'arguments': { 'command-line': - 'qemu-io disk \"write -P 0x55 0 64k\"' } }" \ - 'return' -_send_qemu_cmd $src \ - "{ 'execute': 'human-monitor-command', - 'arguments': { 'command-line': - 'qemu-io disk \"read -P 0x55 0 64k\"' } }" \ - 'return' - -echo -echo =3D=3D=3D Do block migration to destination =3D=3D=3D -echo - -reply=3D"$(_send_qemu_cmd $src \ - "{ 'execute': 'migrate', - 'arguments': { 'uri': 'unix:${MIG_SOCKET}', 'blk': true } }" \ - 'return\|error' | _filter_migration_block_deprecated)" -echo "$reply" -if echo "$reply" | grep "compiled without old-style" > /dev/null; then - _notrun "migrate -b support not compiled in" -fi - -timeout_comm=3D$QEMU_COMM_TIMEOUT -if [ "${VALGRIND_QEMU}" =3D=3D "y" ]; then - QEMU_COMM_TIMEOUT=3D4 -else - QEMU_COMM_TIMEOUT=3D0.1 -fi -qemu_cmd_repeat=3D50 silent=3Dyes \ - _send_qemu_cmd $src "{ 'execute': 'query-migrate' }" '"status": "compl= eted"' -QEMU_COMM_TIMEOUT=3D$timeout_comm -_send_qemu_cmd $src "{ 'execute': 'query-status' }" "return" - -echo -echo =3D=3D=3D Do some I/O on the destination =3D=3D=3D -echo - -# It is important that we use the BlockBackend of the guest device here in= stead -# of the node name, which would create a new BlockBackend and not test whe= ther -# the guest has the necessary permissions to access the image now -silent=3Dyes _send_qemu_cmd $dest "" "100 %" -_send_qemu_cmd $dest "{ 'execute': 'query-status' }" "return" -_send_qemu_cmd $dest \ - "{ 'execute': 'human-monitor-command', - 'arguments': { 'command-line': - 'qemu-io disk \"read -P 0x55 0 64k\"' } }" \ - 'return' -_send_qemu_cmd $dest \ - "{ 'execute': 'human-monitor-command', - 'arguments': { 'command-line': - 'qemu-io disk \"write -P 0x66 1M 64k\"' } }" \ - 'return' - -echo -echo =3D=3D=3D Shut down and check image =3D=3D=3D -echo - -_send_qemu_cmd $src '{"execute":"quit"}' 'return' -_send_qemu_cmd $dest '{"execute":"quit"}' 'return' -wait=3D1 _cleanup_qemu - -_check_test_img -TEST_IMG=3D"${TEST_IMG}.dest" _check_test_img - -$QEMU_IO -c 'write -P 0x66 1M 64k' "$TEST_IMG" | _filter_qemu_io -$QEMU_IMG compare "$TEST_IMG.dest" "$TEST_IMG" - -# success, all done -echo "*** done" -rm -f $seq.full -status=3D0 diff --git a/tests/qemu-iotests/183.out b/tests/qemu-iotests/183.out deleted file mode 100644 index 8aef74a25d..0000000000 --- a/tests/qemu-iotests/183.out +++ /dev/null @@ -1,66 +0,0 @@ -QA output created by 183 -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 -Formatting 'TEST_DIR/t.IMGFMT.dest', fmt=3DIMGFMT size=3D67108864 - -=3D=3D=3D Starting VMs =3D=3D=3D - -{ 'execute': 'qmp_capabilities' } -{"return": {}} -{ 'execute': 'qmp_capabilities' } -{"return": {}} - -=3D=3D=3D Write something on the source =3D=3D=3D - -{ 'execute': 'human-monitor-command', - 'arguments': { 'command-line': - 'qemu-io disk "write -P 0x55 0 64k"' } } -wrote 65536/65536 bytes at offset 0 -64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -{"return": ""} -{ 'execute': 'human-monitor-command', - 'arguments': { 'command-line': - 'qemu-io disk "read -P 0x55 0 64k"' } } -read 65536/65536 bytes at offset 0 -64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -{"return": ""} - -=3D=3D=3D Do block migration to destination =3D=3D=3D - -{ 'execute': 'migrate', - 'arguments': { 'uri': 'unix:SOCK_DIR/migrate', 'blk': true } } -{"return": {}} -{ 'execute': 'query-status' } -{"return": {"status": "postmigrate", "running": false}} - -=3D=3D=3D Do some I/O on the destination =3D=3D=3D - -{ 'execute': 'query-status' } -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "RESUME"} -{"return": {"status": "running", "running": true}} -{ 'execute': 'human-monitor-command', - 'arguments': { 'command-line': - 'qemu-io disk "read -P 0x55 0 64k"' } } -read 65536/65536 bytes at offset 0 -64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -{"return": ""} -{ 'execute': 'human-monitor-command', - 'arguments': { 'command-line': - 'qemu-io disk "write -P 0x66 1M 64k"' } } -wrote 65536/65536 bytes at offset 1048576 -64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -{"return": ""} - -=3D=3D=3D Shut down and check image =3D=3D=3D - -{"execute":"quit"} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} -{"return": {}} -{"execute":"quit"} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} -{"return": {}} -No errors were found on the image. -No errors were found on the image. -wrote 65536/65536 bytes at offset 1048576 -64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Images are identical. -*** done diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.f= ilter index 2846c83808..fc3c64bcb8 100644 --- a/tests/qemu-iotests/common.filter +++ b/tests/qemu-iotests/common.filter @@ -359,12 +359,5 @@ _filter_qcow2_compression_type_bit() -e 's/\(incompatible_features.*\), 3\(,.*\)/\1\2/' } =20 -# filter warnings caused for block migration deprecation -_filter_migration_block_deprecated() -{ - gsed -e '/warning: parameter .blk. is deprecated; use blockdev-mirror = with NBD instead/d' \ - -e '/warning: block migration is deprecated; use blockdev-mirror = with NBD instead/d' -} - # make sure this script returns success true --=20 2.35.3 From nobody Mon Nov 25 09:36:30 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=1715211781; cv=none; d=zohomail.com; s=zohoarc; b=AcK1p28V/1h50sYPWRyoD/780zl5bxNxce/+1PfO1x/giR7pikbADIKcT11OWcTo0NCI7bzhUWwsdUPg9JFrqp8xisTzXVC6CBqjdi6P9YdNTBmq5lfYhB1Fb8SzislyVpFB7Prx0alTUimU4uh9JZMjkavCXmVOKi5aVOlfMQs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715211781; 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=A3ZCQ8my7fq5aD27T5VAM5q0662sU7Lo9VgjV7/RKvc=; b=cHxY3miSV3adQEk32n9F2tLVaxkFzfzcvc/9mlB3bTZs5fjXAa9m3NvnAgFRYY5rqNBqTzvGSdDtFa+4G5teAd2y0+kYORljkOC+cTo+Xsn/W+eR5zLcoCrxfyP7rVGQ9vWt0cZs1yuxH6Vxc7/EL2xVR9/MnOCg0p/AFpWu8Q0= 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 1715211781759677.2526361329377; Wed, 8 May 2024 16:43:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4qpd-0003ED-Ag; Wed, 08 May 2024 19:36:17 -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 1s4qpY-0002zF-JE for qemu-devel@nongnu.org; Wed, 08 May 2024 19:36:12 -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 1s4qpS-0002SU-AB for qemu-devel@nongnu.org; Wed, 08 May 2024 19:36:12 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [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 C6C1C5D38F; Wed, 8 May 2024 23:36:03 +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 352C413A27; Wed, 8 May 2024 23:36:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id IBMKO2EMPGZ7FQAAD6G6ig (envelope-from ); Wed, 08 May 2024 23:36:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211365; 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=A3ZCQ8my7fq5aD27T5VAM5q0662sU7Lo9VgjV7/RKvc=; b=z2JQLe4pzS7tglh8/flqAiFYflj5tCF3zVzLO481TVPs+tr3T06ECVTU+WfPxvotBJ/QNC 1B+qdX/HWUy/8HiXmPAJYmLnM6ysq2BTcGMP8GXZaHZy7RLqBZ9no37ZxDG1qaKNUP2a6J 9Qqq/xYo48KDvIWYZEMpQZALzHvMZDM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211365; 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=A3ZCQ8my7fq5aD27T5VAM5q0662sU7Lo9VgjV7/RKvc=; b=0OfGiED+pcrHzIMwNZtq8hLMF6nFcuNacGXaWC6+N960mg9O8KR159YoPovBdfUN49I1AO Rs+p1xCZojqXkXDg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211363; 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=A3ZCQ8my7fq5aD27T5VAM5q0662sU7Lo9VgjV7/RKvc=; b=K3qhjPjbGbyHOQpoFimIWVNJB3CJjkdg50fUHhKo4i7AEtoUam342EvMggmr6XjVa2eKlB 45KICEutmbhJzhTZDbIlvOcru8Qgg+Ip7UBwWFtOHsl4B0ogEUqizZpOPeztQxMa4HF7FX SdDoLTHGjObdVDD4hRizlI2yjJqTfUE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211363; 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=A3ZCQ8my7fq5aD27T5VAM5q0662sU7Lo9VgjV7/RKvc=; b=SOCKGLAIv3Ssr4wgZgXEeTKB9n2fxZ4qYEtRdUezMrMZ6PizYVf7FTBBIetoprZ+vNP1di BVyOAj9kKPl+BqAw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Markus Armbruster Subject: [PULL v2 10/13] migration: Remove block migration Date: Wed, 8 May 2024 20:35:38 -0300 Message-Id: <20240508233541.2403-11-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240508233541.2403-1-farosas@suse.de> References: <20240508233541.2403-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,meson.build:url]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: -2.80 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 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) (identity @suse.de) X-ZM-MESSAGEID: 1715211783119100009 Content-Type: text/plain; charset="utf-8" The block migration has been considered obsolete since QEMU 8.2 in favor of the more flexible storage migration provided by the blockdev-mirror driver. Two releases have passed so now it's time to remove it. Deprecation commit 66db46ca83 ("migration: Deprecate block migration"). Reviewed-by: Markus Armbruster Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- MAINTAINERS | 1 - docs/about/deprecated.rst | 10 - docs/about/removed-features.rst | 14 + docs/devel/migration/main.rst | 2 +- include/migration/misc.h | 6 - meson.build | 2 - meson_options.txt | 2 - migration/block.c | 1018 ------------------------------- migration/block.h | 52 -- migration/colo.c | 1 - migration/meson.build | 3 - migration/migration-hmp-cmds.c | 25 - migration/migration.c | 15 - migration/options.c | 25 - migration/options.h | 1 - migration/ram.c | 15 - migration/savevm.c | 5 - qapi/migration.json | 61 +- scripts/meson-buildoptions.sh | 4 - 19 files changed, 26 insertions(+), 1236 deletions(-) delete mode 100644 migration/block.c delete mode 100644 migration/block.h diff --git a/MAINTAINERS b/MAINTAINERS index 84391777db..e4990ea42e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2866,7 +2866,6 @@ F: util/aio-*.h F: util/defer-call.c F: util/fdmon-*.c F: block/io.c -F: migration/block* F: include/block/aio.h F: include/block/aio-wait.h F: include/qemu/defer-call.h diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 08d8ef37a7..3d324930f3 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -477,16 +477,6 @@ option). Migration --------- =20 -block migration (since 8.2) -''''''''''''''''''''''''''' - -Block migration is too inflexible. It needs to migrate all block -devices or none. - -Please see "QMP invocation for live storage migration with -``blockdev-mirror`` + NBD" in docs/interop/live-block-operations.rst -for a detailed explanation. - old compression method (since 8.2) '''''''''''''''''''''''''''''''''' =20 diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.= rst index a491c66660..9e7d8ee4ff 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -634,6 +634,13 @@ Use blockdev-mirror with NBD instead. See "QMP invocat= ion for live storage migration with ``blockdev-mirror`` + NBD" in docs/interop/live-block-operations.rst for a detailed explanation. =20 +``migrate-set-capabilities`` ``block`` option (removed in 9.1) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Block migration has been removed. For a replacement, see "QMP +invocation for live storage migration with ``blockdev-mirror`` + NBD" +in docs/interop/live-block-operations.rst. + Human Monitor Protocol (HMP) commands ------------------------------------- =20 @@ -708,6 +715,13 @@ Use blockdev-mirror with NBD instead. See "QMP invocat= ion for live storage migration with ``blockdev-mirror`` + NBD" in docs/interop/live-block-operations.rst for a detailed explanation. =20 +``migrate_set_capability`` ``block`` option (removed in 9.1) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Block migration has been removed. For a replacement, see "QMP +invocation for live storage migration with ``blockdev-mirror`` + NBD" +in docs/interop/live-block-operations.rst. + Host Architectures ------------------ =20 diff --git a/docs/devel/migration/main.rst b/docs/devel/migration/main.rst index 54385a23e5..495cdcb112 100644 --- a/docs/devel/migration/main.rst +++ b/docs/devel/migration/main.rst @@ -454,7 +454,7 @@ Examples of such API functions are: Iterative device migration -------------------------- =20 -Some devices, such as RAM, Block storage or certain platform devices, +Some devices, such as RAM or certain platform devices, have large amounts of data that would mean that the CPUs would be paused for too long if they were sent in one section. For these devices an *iterative* approach is taken. diff --git a/include/migration/misc.h b/include/migration/misc.h index c9e200f4eb..bf7339cc1e 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -45,12 +45,6 @@ bool migrate_ram_is_ignored(RAMBlock *block); =20 /* migration/block.c */ =20 -#ifdef CONFIG_LIVE_BLOCK_MIGRATION -void blk_mig_init(void); -#else -static inline void blk_mig_init(void) {} -#endif - AnnounceParameters *migrate_announce_params(void); /* migration/savevm.c */ =20 diff --git a/meson.build b/meson.build index 43da492372..83ae4347c7 100644 --- a/meson.build +++ b/meson.build @@ -2351,7 +2351,6 @@ config_host_data.set('CONFIG_DEBUG_MUTEX', get_option= ('debug_mutex')) config_host_data.set('CONFIG_DEBUG_STACK_USAGE', get_option('debug_stack_u= sage')) config_host_data.set('CONFIG_DEBUG_TCG', get_option('debug_tcg')) config_host_data.set('CONFIG_DEBUG_REMAP', get_option('debug_remap')) -config_host_data.set('CONFIG_LIVE_BLOCK_MIGRATION', get_option('live_block= _migration').allowed()) config_host_data.set('CONFIG_QOM_CAST_DEBUG', get_option('qom_cast_debug')) config_host_data.set('CONFIG_REPLICATION', get_option('replication').allow= ed()) =20 @@ -4302,7 +4301,6 @@ if have_block summary_info +=3D {'Use block whitelist in tools': get_option('block_drv= _whitelist_in_tools')} summary_info +=3D {'VirtFS (9P) support': have_virtfs} summary_info +=3D {'VirtFS (9P) Proxy Helper support (deprecated)': have= _virtfs_proxy_helper} - summary_info +=3D {'Live block migration': config_host_data.get('CONFIG_= LIVE_BLOCK_MIGRATION')} summary_info +=3D {'replication support': config_host_data.get('CONFIG_R= EPLICATION')} summary_info +=3D {'bochs support': get_option('bochs').allowed()} summary_info +=3D {'cloop support': get_option('cloop').allowed()} diff --git a/meson_options.txt b/meson_options.txt index adc77bae0c..4c1583eb40 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -314,8 +314,6 @@ option('fdt', type: 'combo', value: 'auto', =20 option('selinux', type: 'feature', value: 'auto', description: 'SELinux support in qemu-nbd') -option('live_block_migration', type: 'feature', value: 'auto', - description: 'block migration in the main migration stream') option('replication', type: 'feature', value: 'auto', description: 'replication support') option('colo_proxy', type: 'feature', value: 'auto', diff --git a/migration/block.c b/migration/block.c deleted file mode 100644 index 87ec1a7e68..0000000000 --- a/migration/block.c +++ /dev/null @@ -1,1018 +0,0 @@ -/* - * QEMU live block migration - * - * Copyright IBM, Corp. 2009 - * - * Authors: - * Liran Schour - * - * This work is licensed under the terms of the GNU GPL, version 2. See - * the COPYING file in the top-level directory. - * - * Contributions after 2012-01-13 are licensed under the terms of the - * GNU GPL, version 2 or (at your option) any later version. - */ - -#include "qemu/osdep.h" -#include "qapi/error.h" -#include "qemu/error-report.h" -#include "qemu/main-loop.h" -#include "qemu/cutils.h" -#include "qemu/queue.h" -#include "block.h" -#include "block/dirty-bitmap.h" -#include "migration/misc.h" -#include "migration.h" -#include "migration-stats.h" -#include "migration/register.h" -#include "qemu-file.h" -#include "migration/vmstate.h" -#include "sysemu/block-backend.h" -#include "trace.h" -#include "options.h" - -#define BLK_MIG_BLOCK_SIZE (1ULL << 20) -#define BDRV_SECTORS_PER_DIRTY_CHUNK (BLK_MIG_BLOCK_SIZE >> BDRV_SECTOR_BI= TS) - -#define BLK_MIG_FLAG_DEVICE_BLOCK 0x01 -#define BLK_MIG_FLAG_EOS 0x02 -#define BLK_MIG_FLAG_PROGRESS 0x04 -#define BLK_MIG_FLAG_ZERO_BLOCK 0x08 - -#define MAX_IS_ALLOCATED_SEARCH (65536 * BDRV_SECTOR_SIZE) - -#define MAX_IO_BUFFERS 512 -#define MAX_PARALLEL_IO 16 - -typedef struct BlkMigDevState { - /* Written during setup phase. Can be read without a lock. */ - BlockBackend *blk; - char *blk_name; - int shared_base; - int64_t total_sectors; - QSIMPLEQ_ENTRY(BlkMigDevState) entry; - Error *blocker; - - /* Only used by migration thread. Does not need a lock. */ - int bulk_completed; - int64_t cur_sector; - int64_t cur_dirty; - - /* Data in the aio_bitmap is protected by block migration lock. - * Allocation and free happen during setup and cleanup respectively. - */ - unsigned long *aio_bitmap; - - /* Protected by block migration lock. */ - int64_t completed_sectors; - - /* During migration this is protected by bdrv_dirty_bitmap_lock(). - * Allocation and free happen during setup and cleanup respectively. - */ - BdrvDirtyBitmap *dirty_bitmap; -} BlkMigDevState; - -typedef struct BlkMigBlock { - /* Only used by migration thread. */ - uint8_t *buf; - BlkMigDevState *bmds; - int64_t sector; - int nr_sectors; - QEMUIOVector qiov; - BlockAIOCB *aiocb; - - /* Protected by block migration lock. */ - int ret; - QSIMPLEQ_ENTRY(BlkMigBlock) entry; -} BlkMigBlock; - -typedef struct BlkMigState { - QSIMPLEQ_HEAD(, BlkMigDevState) bmds_list; - int64_t total_sector_sum; - bool zero_blocks; - - /* Protected by lock. */ - QSIMPLEQ_HEAD(, BlkMigBlock) blk_list; - int submitted; - int read_done; - - /* Only used by migration thread. Does not need a lock. */ - int transferred; - int prev_progress; - int bulk_completed; - - /* Lock must be taken _inside_ the BQL. */ - QemuMutex lock; -} BlkMigState; - -static BlkMigState block_mig_state; - -static void blk_mig_lock(void) -{ - qemu_mutex_lock(&block_mig_state.lock); -} - -static void blk_mig_unlock(void) -{ - qemu_mutex_unlock(&block_mig_state.lock); -} - -/* Must run outside of the BQL during the bulk phase, - * or the VM will stall. - */ - -static void blk_send(QEMUFile *f, BlkMigBlock * blk) -{ - int len; - uint64_t flags =3D BLK_MIG_FLAG_DEVICE_BLOCK; - - if (block_mig_state.zero_blocks && - buffer_is_zero(blk->buf, BLK_MIG_BLOCK_SIZE)) { - flags |=3D BLK_MIG_FLAG_ZERO_BLOCK; - } - - /* sector number and flags */ - qemu_put_be64(f, (blk->sector << BDRV_SECTOR_BITS) - | flags); - - /* device name */ - len =3D strlen(blk->bmds->blk_name); - qemu_put_byte(f, len); - qemu_put_buffer(f, (uint8_t *) blk->bmds->blk_name, len); - - /* if a block is zero we need to flush here since the network - * bandwidth is now a lot higher than the storage device bandwidth. - * thus if we queue zero blocks we slow down the migration */ - if (flags & BLK_MIG_FLAG_ZERO_BLOCK) { - qemu_fflush(f); - return; - } - - qemu_put_buffer(f, blk->buf, BLK_MIG_BLOCK_SIZE); -} - -int blk_mig_active(void) -{ - return !QSIMPLEQ_EMPTY(&block_mig_state.bmds_list); -} - -int blk_mig_bulk_active(void) -{ - return blk_mig_active() && !block_mig_state.bulk_completed; -} - -uint64_t blk_mig_bytes_transferred(void) -{ - BlkMigDevState *bmds; - uint64_t sum =3D 0; - - blk_mig_lock(); - QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) { - sum +=3D bmds->completed_sectors; - } - blk_mig_unlock(); - return sum << BDRV_SECTOR_BITS; -} - -uint64_t blk_mig_bytes_remaining(void) -{ - return blk_mig_bytes_total() - blk_mig_bytes_transferred(); -} - -uint64_t blk_mig_bytes_total(void) -{ - BlkMigDevState *bmds; - uint64_t sum =3D 0; - - QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) { - sum +=3D bmds->total_sectors; - } - return sum << BDRV_SECTOR_BITS; -} - - -/* Called with migration lock held. */ - -static int bmds_aio_inflight(BlkMigDevState *bmds, int64_t sector) -{ - int64_t chunk =3D sector / (int64_t)BDRV_SECTORS_PER_DIRTY_CHUNK; - - if (sector < bmds->total_sectors) { - return !!(bmds->aio_bitmap[chunk / (sizeof(unsigned long) * 8)] & - (1UL << (chunk % (sizeof(unsigned long) * 8)))); - } else { - return 0; - } -} - -/* Called with migration lock held. */ - -static void bmds_set_aio_inflight(BlkMigDevState *bmds, int64_t sector_num, - int nb_sectors, int set) -{ - int64_t start, end; - unsigned long val, idx, bit; - - start =3D sector_num / BDRV_SECTORS_PER_DIRTY_CHUNK; - end =3D (sector_num + nb_sectors - 1) / BDRV_SECTORS_PER_DIRTY_CHUNK; - - for (; start <=3D end; start++) { - idx =3D start / (sizeof(unsigned long) * 8); - bit =3D start % (sizeof(unsigned long) * 8); - val =3D bmds->aio_bitmap[idx]; - if (set) { - val |=3D 1UL << bit; - } else { - val &=3D ~(1UL << bit); - } - bmds->aio_bitmap[idx] =3D val; - } -} - -static void alloc_aio_bitmap(BlkMigDevState *bmds) -{ - int64_t bitmap_size; - - bitmap_size =3D bmds->total_sectors + BDRV_SECTORS_PER_DIRTY_CHUNK * 8= - 1; - bitmap_size /=3D BDRV_SECTORS_PER_DIRTY_CHUNK * 8; - - bmds->aio_bitmap =3D g_malloc0(bitmap_size); -} - -/* Never hold migration lock when yielding to the main loop! */ - -static void blk_mig_read_cb(void *opaque, int ret) -{ - BlkMigBlock *blk =3D opaque; - - blk_mig_lock(); - blk->ret =3D ret; - - QSIMPLEQ_INSERT_TAIL(&block_mig_state.blk_list, blk, entry); - bmds_set_aio_inflight(blk->bmds, blk->sector, blk->nr_sectors, 0); - - block_mig_state.submitted--; - block_mig_state.read_done++; - assert(block_mig_state.submitted >=3D 0); - blk_mig_unlock(); -} - -/* Called with no lock taken. */ - -static int mig_save_device_bulk(QEMUFile *f, BlkMigDevState *bmds) -{ - int64_t total_sectors =3D bmds->total_sectors; - int64_t cur_sector =3D bmds->cur_sector; - BlockBackend *bb =3D bmds->blk; - BlkMigBlock *blk; - int nr_sectors; - int64_t count; - - if (bmds->shared_base) { - bql_lock(); - /* Skip unallocated sectors; intentionally treats failure or - * partial sector as an allocated sector */ - while (cur_sector < total_sectors && - !bdrv_is_allocated(blk_bs(bb), cur_sector * BDRV_SECTOR_SIZ= E, - MAX_IS_ALLOCATED_SEARCH, &count)) { - if (count < BDRV_SECTOR_SIZE) { - break; - } - cur_sector +=3D count >> BDRV_SECTOR_BITS; - } - bql_unlock(); - } - - if (cur_sector >=3D total_sectors) { - bmds->cur_sector =3D bmds->completed_sectors =3D total_sectors; - return 1; - } - - bmds->completed_sectors =3D cur_sector; - - cur_sector &=3D ~((int64_t)BDRV_SECTORS_PER_DIRTY_CHUNK - 1); - - /* we are going to transfer a full block even if it is not allocated */ - nr_sectors =3D BDRV_SECTORS_PER_DIRTY_CHUNK; - - if (total_sectors - cur_sector < BDRV_SECTORS_PER_DIRTY_CHUNK) { - nr_sectors =3D total_sectors - cur_sector; - } - - blk =3D g_new(BlkMigBlock, 1); - blk->buf =3D g_malloc(BLK_MIG_BLOCK_SIZE); - blk->bmds =3D bmds; - blk->sector =3D cur_sector; - blk->nr_sectors =3D nr_sectors; - - qemu_iovec_init_buf(&blk->qiov, blk->buf, nr_sectors * BDRV_SECTOR_SIZ= E); - - blk_mig_lock(); - block_mig_state.submitted++; - blk_mig_unlock(); - - /* - * The migration thread does not have an AioContext. Lock the BQL so t= hat - * I/O runs in the main loop AioContext (see - * qemu_get_current_aio_context()). - */ - bql_lock(); - bdrv_reset_dirty_bitmap(bmds->dirty_bitmap, cur_sector * BDRV_SECTOR_S= IZE, - nr_sectors * BDRV_SECTOR_SIZE); - blk->aiocb =3D blk_aio_preadv(bb, cur_sector * BDRV_SECTOR_SIZE, &blk-= >qiov, - 0, blk_mig_read_cb, blk); - bql_unlock(); - - bmds->cur_sector =3D cur_sector + nr_sectors; - return (bmds->cur_sector >=3D total_sectors); -} - -/* Called with the BQL taken. */ - -static int set_dirty_tracking(void) -{ - BlkMigDevState *bmds; - int ret; - - QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) { - bmds->dirty_bitmap =3D bdrv_create_dirty_bitmap(blk_bs(bmds->blk), - BLK_MIG_BLOCK_SIZE, - NULL, NULL); - if (!bmds->dirty_bitmap) { - ret =3D -errno; - goto fail; - } - } - return 0; - -fail: - QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) { - if (bmds->dirty_bitmap) { - bdrv_release_dirty_bitmap(bmds->dirty_bitmap); - } - } - return ret; -} - -/* Called with the BQL taken. */ - -static void unset_dirty_tracking(void) -{ - BlkMigDevState *bmds; - - QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) { - if (bmds->dirty_bitmap) { - bdrv_release_dirty_bitmap(bmds->dirty_bitmap); - } - } -} - -static int init_blk_migration(QEMUFile *f, Error **errp) -{ - BlockDriverState *bs; - BlkMigDevState *bmds; - int64_t sectors; - BdrvNextIterator it; - int i, num_bs =3D 0; - struct { - BlkMigDevState *bmds; - BlockDriverState *bs; - } *bmds_bs; - int ret; - - GRAPH_RDLOCK_GUARD_MAINLOOP(); - - block_mig_state.submitted =3D 0; - block_mig_state.read_done =3D 0; - block_mig_state.transferred =3D 0; - block_mig_state.total_sector_sum =3D 0; - block_mig_state.prev_progress =3D -1; - block_mig_state.bulk_completed =3D 0; - block_mig_state.zero_blocks =3D migrate_zero_blocks(); - - for (bs =3D bdrv_first(&it); bs; bs =3D bdrv_next(&it)) { - num_bs++; - } - bmds_bs =3D g_malloc0(num_bs * sizeof(*bmds_bs)); - - for (i =3D 0, bs =3D bdrv_first(&it); bs; bs =3D bdrv_next(&it), i++) { - if (bdrv_is_read_only(bs)) { - continue; - } - - sectors =3D bdrv_nb_sectors(bs); - if (sectors =3D=3D 0) { - continue; - } - if (sectors < 0) { - error_setg(errp, "Error getting length of block device %s", - bdrv_get_device_name(bs)); - ret =3D sectors; - bdrv_next_cleanup(&it); - goto out; - } - - bmds =3D g_new0(BlkMigDevState, 1); - bmds->blk =3D blk_new(qemu_get_aio_context(), - BLK_PERM_CONSISTENT_READ, BLK_PERM_ALL); - bmds->blk_name =3D g_strdup(bdrv_get_device_name(bs)); - bmds->bulk_completed =3D 0; - bmds->total_sectors =3D sectors; - bmds->completed_sectors =3D 0; - - assert(i < num_bs); - bmds_bs[i].bmds =3D bmds; - bmds_bs[i].bs =3D bs; - - block_mig_state.total_sector_sum +=3D sectors; - - if (bmds->shared_base) { - trace_migration_block_init_shared(bdrv_get_device_name(bs)); - } else { - trace_migration_block_init_full(bdrv_get_device_name(bs)); - } - - QSIMPLEQ_INSERT_TAIL(&block_mig_state.bmds_list, bmds, entry); - } - - /* Can only insert new BDSes now because doing so while iterating block - * devices may end up in a deadlock (iterating the new BDSes, too). */ - for (i =3D 0; i < num_bs; i++) { - bmds =3D bmds_bs[i].bmds; - bs =3D bmds_bs[i].bs; - - if (bmds) { - ret =3D blk_insert_bs(bmds->blk, bs, errp); - if (ret < 0) { - goto out; - } - - alloc_aio_bitmap(bmds); - error_setg(&bmds->blocker, "block device is in use by migratio= n"); - bdrv_op_block_all(bs, bmds->blocker); - } - } - - ret =3D 0; -out: - g_free(bmds_bs); - return ret; -} - -/* Called with no lock taken. */ - -static int blk_mig_save_bulked_block(QEMUFile *f) -{ - int64_t completed_sector_sum =3D 0; - BlkMigDevState *bmds; - int progress; - int ret =3D 0; - - QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) { - if (bmds->bulk_completed =3D=3D 0) { - if (mig_save_device_bulk(f, bmds) =3D=3D 1) { - /* completed bulk section for this device */ - bmds->bulk_completed =3D 1; - } - completed_sector_sum +=3D bmds->completed_sectors; - ret =3D 1; - break; - } else { - completed_sector_sum +=3D bmds->completed_sectors; - } - } - - if (block_mig_state.total_sector_sum !=3D 0) { - progress =3D completed_sector_sum * 100 / - block_mig_state.total_sector_sum; - } else { - progress =3D 100; - } - if (progress !=3D block_mig_state.prev_progress) { - block_mig_state.prev_progress =3D progress; - qemu_put_be64(f, (progress << BDRV_SECTOR_BITS) - | BLK_MIG_FLAG_PROGRESS); - trace_migration_block_progression(progress); - } - - return ret; -} - -static void blk_mig_reset_dirty_cursor(void) -{ - BlkMigDevState *bmds; - - QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) { - bmds->cur_dirty =3D 0; - } -} - -/* Called with the BQL taken. */ - -static int mig_save_device_dirty(QEMUFile *f, BlkMigDevState *bmds, - int is_async) -{ - BlkMigBlock *blk; - int64_t total_sectors =3D bmds->total_sectors; - int64_t sector; - int nr_sectors; - int ret =3D -EIO; - - for (sector =3D bmds->cur_dirty; sector < bmds->total_sectors;) { - blk_mig_lock(); - if (bmds_aio_inflight(bmds, sector)) { - blk_mig_unlock(); - blk_drain(bmds->blk); - } else { - blk_mig_unlock(); - } - bdrv_dirty_bitmap_lock(bmds->dirty_bitmap); - if (bdrv_dirty_bitmap_get_locked(bmds->dirty_bitmap, - sector * BDRV_SECTOR_SIZE)) { - if (total_sectors - sector < BDRV_SECTORS_PER_DIRTY_CHUNK) { - nr_sectors =3D total_sectors - sector; - } else { - nr_sectors =3D BDRV_SECTORS_PER_DIRTY_CHUNK; - } - bdrv_reset_dirty_bitmap_locked(bmds->dirty_bitmap, - sector * BDRV_SECTOR_SIZE, - nr_sectors * BDRV_SECTOR_SIZE); - bdrv_dirty_bitmap_unlock(bmds->dirty_bitmap); - - blk =3D g_new(BlkMigBlock, 1); - blk->buf =3D g_malloc(BLK_MIG_BLOCK_SIZE); - blk->bmds =3D bmds; - blk->sector =3D sector; - blk->nr_sectors =3D nr_sectors; - - if (is_async) { - qemu_iovec_init_buf(&blk->qiov, blk->buf, - nr_sectors * BDRV_SECTOR_SIZE); - - blk->aiocb =3D blk_aio_preadv(bmds->blk, - sector * BDRV_SECTOR_SIZE, - &blk->qiov, 0, blk_mig_read_cb, - blk); - - blk_mig_lock(); - block_mig_state.submitted++; - bmds_set_aio_inflight(bmds, sector, nr_sectors, 1); - blk_mig_unlock(); - } else { - ret =3D blk_pread(bmds->blk, sector * BDRV_SECTOR_SIZE, - nr_sectors * BDRV_SECTOR_SIZE, blk->buf, 0= ); - if (ret < 0) { - goto error; - } - blk_send(f, blk); - - g_free(blk->buf); - g_free(blk); - } - - sector +=3D nr_sectors; - bmds->cur_dirty =3D sector; - break; - } - - bdrv_dirty_bitmap_unlock(bmds->dirty_bitmap); - sector +=3D BDRV_SECTORS_PER_DIRTY_CHUNK; - bmds->cur_dirty =3D sector; - } - - return (bmds->cur_dirty >=3D bmds->total_sectors); - -error: - trace_migration_block_save_device_dirty(sector); - g_free(blk->buf); - g_free(blk); - return ret; -} - -/* Called with the BQL taken. - * - * return value: - * 0: too much data for max_downtime - * 1: few enough data for max_downtime -*/ -static int blk_mig_save_dirty_block(QEMUFile *f, int is_async) -{ - BlkMigDevState *bmds; - int ret =3D 1; - - QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) { - ret =3D mig_save_device_dirty(f, bmds, is_async); - if (ret <=3D 0) { - break; - } - } - - return ret; -} - -/* Called with no locks taken. */ - -static int flush_blks(QEMUFile *f) -{ - BlkMigBlock *blk; - int ret =3D 0; - - trace_migration_block_flush_blks("Enter", block_mig_state.submitted, - block_mig_state.read_done, - block_mig_state.transferred); - - blk_mig_lock(); - while ((blk =3D QSIMPLEQ_FIRST(&block_mig_state.blk_list)) !=3D NULL) { - if (migration_rate_exceeded(f)) { - break; - } - if (blk->ret < 0) { - ret =3D blk->ret; - break; - } - - QSIMPLEQ_REMOVE_HEAD(&block_mig_state.blk_list, entry); - blk_mig_unlock(); - blk_send(f, blk); - blk_mig_lock(); - - g_free(blk->buf); - g_free(blk); - - block_mig_state.read_done--; - block_mig_state.transferred++; - assert(block_mig_state.read_done >=3D 0); - } - blk_mig_unlock(); - - trace_migration_block_flush_blks("Exit", block_mig_state.submitted, - block_mig_state.read_done, - block_mig_state.transferred); - return ret; -} - -/* Called with the BQL taken. */ - -static int64_t get_remaining_dirty(void) -{ - BlkMigDevState *bmds; - int64_t dirty =3D 0; - - QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) { - bdrv_dirty_bitmap_lock(bmds->dirty_bitmap); - dirty +=3D bdrv_get_dirty_count(bmds->dirty_bitmap); - bdrv_dirty_bitmap_unlock(bmds->dirty_bitmap); - } - - return dirty; -} - - - -/* Called with the BQL taken. */ -static void block_migration_cleanup_bmds(void) -{ - BlkMigDevState *bmds; - BlockDriverState *bs; - - unset_dirty_tracking(); - - while ((bmds =3D QSIMPLEQ_FIRST(&block_mig_state.bmds_list)) !=3D NULL= ) { - QSIMPLEQ_REMOVE_HEAD(&block_mig_state.bmds_list, entry); - - bs =3D blk_bs(bmds->blk); - if (bs) { - bdrv_op_unblock_all(bs, bmds->blocker); - } - error_free(bmds->blocker); - blk_unref(bmds->blk); - g_free(bmds->blk_name); - g_free(bmds->aio_bitmap); - g_free(bmds); - } -} - -/* Called with the BQL taken. */ -static void block_migration_cleanup(void *opaque) -{ - BlkMigBlock *blk; - - bdrv_drain_all(); - - block_migration_cleanup_bmds(); - - blk_mig_lock(); - while ((blk =3D QSIMPLEQ_FIRST(&block_mig_state.blk_list)) !=3D NULL) { - QSIMPLEQ_REMOVE_HEAD(&block_mig_state.blk_list, entry); - g_free(blk->buf); - g_free(blk); - } - blk_mig_unlock(); -} - -static int block_save_setup(QEMUFile *f, void *opaque, Error **errp) -{ - int ret; - - trace_migration_block_save("setup", block_mig_state.submitted, - block_mig_state.transferred); - - warn_report("block migration is deprecated;" - " use blockdev-mirror with NBD instead"); - - ret =3D init_blk_migration(f, errp); - if (ret < 0) { - return ret; - } - - /* start track dirty blocks */ - ret =3D set_dirty_tracking(); - if (ret) { - error_setg_errno(errp, -ret, "Failed to start block dirty tracking= "); - return ret; - } - - ret =3D flush_blks(f); - if (ret) { - error_setg_errno(errp, -ret, "Flushing block failed"); - return ret; - } - blk_mig_reset_dirty_cursor(); - qemu_put_be64(f, BLK_MIG_FLAG_EOS); - - return ret; -} - -static int block_save_iterate(QEMUFile *f, void *opaque) -{ - int ret; - uint64_t last_bytes =3D qemu_file_transferred(f); - - trace_migration_block_save("iterate", block_mig_state.submitted, - block_mig_state.transferred); - - ret =3D flush_blks(f); - if (ret) { - return ret; - } - - blk_mig_reset_dirty_cursor(); - - /* control the rate of transfer */ - blk_mig_lock(); - while (block_mig_state.read_done * BLK_MIG_BLOCK_SIZE < - migration_rate_get() && - block_mig_state.submitted < MAX_PARALLEL_IO && - (block_mig_state.submitted + block_mig_state.read_done) < - MAX_IO_BUFFERS) { - blk_mig_unlock(); - if (block_mig_state.bulk_completed =3D=3D 0) { - /* first finish the bulk phase */ - if (blk_mig_save_bulked_block(f) =3D=3D 0) { - /* finished saving bulk on all devices */ - block_mig_state.bulk_completed =3D 1; - } - ret =3D 0; - } else { - /* Always called with the BQL taken for - * simplicity, block_save_complete also calls it. - */ - bql_lock(); - ret =3D blk_mig_save_dirty_block(f, 1); - bql_unlock(); - } - if (ret < 0) { - return ret; - } - blk_mig_lock(); - if (ret !=3D 0) { - /* no more dirty blocks */ - break; - } - } - blk_mig_unlock(); - - ret =3D flush_blks(f); - if (ret) { - return ret; - } - - qemu_put_be64(f, BLK_MIG_FLAG_EOS); - uint64_t delta_bytes =3D qemu_file_transferred(f) - last_bytes; - return (delta_bytes > 0); -} - -/* Called with the BQL taken. */ - -static int block_save_complete(QEMUFile *f, void *opaque) -{ - int ret; - - trace_migration_block_save("complete", block_mig_state.submitted, - block_mig_state.transferred); - - ret =3D flush_blks(f); - if (ret) { - return ret; - } - - blk_mig_reset_dirty_cursor(); - - /* we know for sure that save bulk is completed and - all async read completed */ - blk_mig_lock(); - assert(block_mig_state.submitted =3D=3D 0); - blk_mig_unlock(); - - do { - ret =3D blk_mig_save_dirty_block(f, 0); - if (ret < 0) { - return ret; - } - } while (ret =3D=3D 0); - - /* report completion */ - qemu_put_be64(f, (100 << BDRV_SECTOR_BITS) | BLK_MIG_FLAG_PROGRESS); - - trace_migration_block_save_complete(); - - qemu_put_be64(f, BLK_MIG_FLAG_EOS); - - /* Make sure that our BlockBackends are gone, so that the block driver - * nodes can be inactivated. */ - block_migration_cleanup_bmds(); - - return 0; -} - -static void block_state_pending(void *opaque, uint64_t *must_precopy, - uint64_t *can_postcopy) -{ - /* Estimate pending number of bytes to send */ - uint64_t pending; - - bql_lock(); - pending =3D get_remaining_dirty(); - bql_unlock(); - - blk_mig_lock(); - pending +=3D block_mig_state.submitted * BLK_MIG_BLOCK_SIZE + - block_mig_state.read_done * BLK_MIG_BLOCK_SIZE; - blk_mig_unlock(); - - /* Report at least one block pending during bulk phase */ - if (!pending && !block_mig_state.bulk_completed) { - pending =3D BLK_MIG_BLOCK_SIZE; - } - - trace_migration_block_state_pending(pending); - /* We don't do postcopy */ - *must_precopy +=3D pending; -} - -static int block_load(QEMUFile *f, void *opaque, int version_id) -{ - static int banner_printed; - int len, flags; - char device_name[256]; - int64_t addr; - BlockBackend *blk, *blk_prev =3D NULL; - Error *local_err =3D NULL; - uint8_t *buf; - int64_t total_sectors =3D 0; - int nr_sectors; - int ret; - BlockDriverInfo bdi; - int cluster_size =3D BLK_MIG_BLOCK_SIZE; - - do { - addr =3D qemu_get_be64(f); - - flags =3D addr & (BDRV_SECTOR_SIZE - 1); - addr >>=3D BDRV_SECTOR_BITS; - - if (flags & BLK_MIG_FLAG_DEVICE_BLOCK) { - /* get device name */ - len =3D qemu_get_byte(f); - qemu_get_buffer(f, (uint8_t *)device_name, len); - device_name[len] =3D '\0'; - - blk =3D blk_by_name(device_name); - if (!blk) { - fprintf(stderr, "Error unknown block device %s\n", - device_name); - return -EINVAL; - } - - if (blk !=3D blk_prev) { - blk_prev =3D blk; - total_sectors =3D blk_nb_sectors(blk); - if (total_sectors <=3D 0) { - error_report("Error getting length of block device %s", - device_name); - return -EINVAL; - } - - blk_activate(blk, &local_err); - if (local_err) { - error_report_err(local_err); - return -EINVAL; - } - - ret =3D bdrv_get_info(blk_bs(blk), &bdi); - if (ret =3D=3D 0 && bdi.cluster_size > 0 && - bdi.cluster_size <=3D BLK_MIG_BLOCK_SIZE && - BLK_MIG_BLOCK_SIZE % bdi.cluster_size =3D=3D 0) { - cluster_size =3D bdi.cluster_size; - } else { - cluster_size =3D BLK_MIG_BLOCK_SIZE; - } - } - - if (total_sectors - addr < BDRV_SECTORS_PER_DIRTY_CHUNK) { - nr_sectors =3D total_sectors - addr; - } else { - nr_sectors =3D BDRV_SECTORS_PER_DIRTY_CHUNK; - } - - if (flags & BLK_MIG_FLAG_ZERO_BLOCK) { - ret =3D blk_pwrite_zeroes(blk, addr * BDRV_SECTOR_SIZE, - nr_sectors * BDRV_SECTOR_SIZE, - BDRV_REQ_MAY_UNMAP); - } else { - int i; - int64_t cur_addr; - uint8_t *cur_buf; - - buf =3D g_malloc(BLK_MIG_BLOCK_SIZE); - qemu_get_buffer(f, buf, BLK_MIG_BLOCK_SIZE); - for (i =3D 0; i < BLK_MIG_BLOCK_SIZE / cluster_size; i++) { - cur_addr =3D addr * BDRV_SECTOR_SIZE + i * cluster_siz= e; - cur_buf =3D buf + i * cluster_size; - - if ((!block_mig_state.zero_blocks || - cluster_size < BLK_MIG_BLOCK_SIZE) && - buffer_is_zero(cur_buf, cluster_size)) { - ret =3D blk_pwrite_zeroes(blk, cur_addr, - cluster_size, - BDRV_REQ_MAY_UNMAP); - } else { - ret =3D blk_pwrite(blk, cur_addr, cluster_size, cu= r_buf, - 0); - } - if (ret < 0) { - break; - } - } - g_free(buf); - } - - if (ret < 0) { - return ret; - } - } else if (flags & BLK_MIG_FLAG_PROGRESS) { - if (!banner_printed) { - printf("Receiving block device images\n"); - banner_printed =3D 1; - } - printf("Completed %d %%%c", (int)addr, - (addr =3D=3D 100) ? '\n' : '\r'); - fflush(stdout); - } else if (!(flags & BLK_MIG_FLAG_EOS)) { - fprintf(stderr, "Unknown block migration flags: 0x%x\n", flags= ); - return -EINVAL; - } - ret =3D qemu_file_get_error(f); - if (ret !=3D 0) { - return ret; - } - } while (!(flags & BLK_MIG_FLAG_EOS)); - - return 0; -} - -static bool block_is_active(void *opaque) -{ - return migrate_block(); -} - -static SaveVMHandlers savevm_block_handlers =3D { - .save_setup =3D block_save_setup, - .save_live_iterate =3D block_save_iterate, - .save_live_complete_precopy =3D block_save_complete, - .state_pending_exact =3D block_state_pending, - .state_pending_estimate =3D block_state_pending, - .load_state =3D block_load, - .save_cleanup =3D block_migration_cleanup, - .is_active =3D block_is_active, -}; - -void blk_mig_init(void) -{ - QSIMPLEQ_INIT(&block_mig_state.bmds_list); - QSIMPLEQ_INIT(&block_mig_state.blk_list); - qemu_mutex_init(&block_mig_state.lock); - - register_savevm_live("block", 0, 1, &savevm_block_handlers, - &block_mig_state); -} diff --git a/migration/block.h b/migration/block.h deleted file mode 100644 index 3178609dbd..0000000000 --- a/migration/block.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * QEMU live block migration - * - * Copyright IBM, Corp. 2009 - * - * Authors: - * Liran Schour - * - * This work is licensed under the terms of the GNU GPL, version 2. See - * the COPYING file in the top-level directory. - * - */ - -#ifndef MIGRATION_BLOCK_H -#define MIGRATION_BLOCK_H - -#ifdef CONFIG_LIVE_BLOCK_MIGRATION -int blk_mig_active(void); -int blk_mig_bulk_active(void); -uint64_t blk_mig_bytes_transferred(void); -uint64_t blk_mig_bytes_remaining(void); -uint64_t blk_mig_bytes_total(void); - -#else -static inline int blk_mig_active(void) -{ - return false; -} - -static inline int blk_mig_bulk_active(void) -{ - return false; -} - -static inline uint64_t blk_mig_bytes_transferred(void) -{ - return 0; -} - -static inline uint64_t blk_mig_bytes_remaining(void) -{ - return 0; -} - -static inline uint64_t blk_mig_bytes_total(void) -{ - return 0; -} -#endif /* CONFIG_LIVE_BLOCK_MIGRATION */ - -void migrate_set_block_enabled(bool value, Error **errp); -#endif /* MIGRATION_BLOCK_H */ diff --git a/migration/colo.c b/migration/colo.c index 5600a43d78..e2b450c132 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -18,7 +18,6 @@ #include "qemu-file.h" #include "savevm.h" #include "migration/colo.h" -#include "block.h" #include "io/channel-buffer.h" #include "trace.h" #include "qemu/error-report.h" diff --git a/migration/meson.build b/migration/meson.build index f76b1ba328..d7e118f584 100644 --- a/migration/meson.build +++ b/migration/meson.build @@ -39,9 +39,6 @@ else endif =20 system_ss.add(when: rdma, if_true: files('rdma.c')) -if get_option('live_block_migration').allowed() - system_ss.add(files('block.c')) -endif system_ss.add(when: zstd, if_true: files('multifd-zstd.c')) =20 specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index 734c1d29ce..a497ef95d7 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -145,15 +145,6 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict) } } =20 - if (info->disk) { - monitor_printf(mon, "transferred disk: %" PRIu64 " kbytes\n", - info->disk->transferred >> 10); - monitor_printf(mon, "remaining disk: %" PRIu64 " kbytes\n", - info->disk->remaining >> 10); - monitor_printf(mon, "total disk: %" PRIu64 " kbytes\n", - info->disk->total >> 10); - } - if (info->xbzrle_cache) { monitor_printf(mon, "cache size: %" PRIu64 " bytes\n", info->xbzrle_cache->cache_size); @@ -726,24 +717,8 @@ static void hmp_migrate_status_cb(void *opaque) info =3D qmp_query_migrate(NULL); if (!info->has_status || info->status =3D=3D MIGRATION_STATUS_ACTIVE || info->status =3D=3D MIGRATION_STATUS_SETUP) { - if (info->disk) { - int progress; - - if (info->disk->remaining) { - progress =3D info->disk->transferred * 100 / info->disk->t= otal; - } else { - progress =3D 100; - } - - monitor_printf(status->mon, "Completed %d %%\r", progress); - monitor_flush(status->mon); - } - timer_mod(status->timer, qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + = 1000); } else { - if (migrate_block()) { - monitor_printf(status->mon, "\n"); - } if (info->error_desc) { error_report("%s", info->error_desc); } diff --git a/migration/migration.c b/migration/migration.c index 91327b98c5..6f209601d3 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -46,7 +46,6 @@ #include "qapi/qmp/qerror.h" #include "qapi/qmp/qnull.h" #include "qemu/rcu.h" -#include "block.h" #include "postcopy-ram.h" #include "qemu/thread.h" #include "trace.h" @@ -240,7 +239,6 @@ void migration_object_init(void) =20 migration_object_check(current_migration, &error_fatal); =20 - blk_mig_init(); ram_mig_init(); dirty_bitmap_mig_init(); } @@ -1206,16 +1204,6 @@ static void populate_ram_info(MigrationInfo *info, M= igrationState *s) } } =20 -static void populate_disk_info(MigrationInfo *info) -{ - if (blk_mig_active()) { - info->disk =3D g_malloc0(sizeof(*info->disk)); - info->disk->transferred =3D blk_mig_bytes_transferred(); - info->disk->remaining =3D blk_mig_bytes_remaining(); - info->disk->total =3D blk_mig_bytes_total(); - } -} - static void fill_source_migration_info(MigrationInfo *info) { MigrationState *s =3D migrate_get_current(); @@ -1258,7 +1246,6 @@ static void fill_source_migration_info(MigrationInfo = *info) /* TODO add some postcopy stats */ populate_time_info(info, s); populate_ram_info(info, s); - populate_disk_info(info); migration_populate_vfio_info(info); break; case MIGRATION_STATUS_COLO: @@ -1423,7 +1410,6 @@ static void migrate_fd_cleanup(MigrationState *s) type =3D migration_has_failed(s) ? MIG_EVENT_PRECOPY_FAILED : MIG_EVENT_PRECOPY_DONE; migration_call_notifiers(s, type, NULL); - block_cleanup_parameters(); yank_unregister_instance(MIGRATION_YANK_INSTANCE); } =20 @@ -2102,7 +2088,6 @@ void qmp_migrate(const char *uri, bool has_channels, "a valid migration protocol"); migrate_set_state(&s->state, MIGRATION_STATUS_SETUP, MIGRATION_STATUS_FAILED); - block_cleanup_parameters(); } =20 if (local_err) { diff --git a/migration/options.c b/migration/options.c index 856b2fa33c..cc2599ae4a 100644 --- a/migration/options.c +++ b/migration/options.c @@ -195,7 +195,6 @@ Property migration_properties[] =3D { MIGRATION_CAPABILITY_POSTCOPY_PREEMPT), DEFINE_PROP_MIG_CAP("x-colo", MIGRATION_CAPABILITY_X_COLO), DEFINE_PROP_MIG_CAP("x-release-ram", MIGRATION_CAPABILITY_RELEASE_RAM), - DEFINE_PROP_MIG_CAP("x-block", MIGRATION_CAPABILITY_BLOCK), DEFINE_PROP_MIG_CAP("x-return-path", MIGRATION_CAPABILITY_RETURN_PATH), DEFINE_PROP_MIG_CAP("x-multifd", MIGRATION_CAPABILITY_MULTIFD), DEFINE_PROP_MIG_CAP("x-background-snapshot", @@ -225,13 +224,6 @@ bool migrate_background_snapshot(void) return s->capabilities[MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT]; } =20 -bool migrate_block(void) -{ - MigrationState *s =3D migrate_get_current(); - - return s->capabilities[MIGRATION_CAPABILITY_BLOCK]; -} - bool migrate_colo(void) { MigrationState *s =3D migrate_get_current(); @@ -484,18 +476,6 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps= , Error **errp) ERRP_GUARD(); MigrationIncomingState *mis =3D migration_incoming_get_current(); =20 -#ifndef CONFIG_LIVE_BLOCK_MIGRATION - if (new_caps[MIGRATION_CAPABILITY_BLOCK]) { - error_setg(errp, "QEMU compiled without old-style block migration"= ); - error_append_hint(errp, "Use blockdev-mirror with NBD instead.\n"); - return false; - } -#endif - if (new_caps[MIGRATION_CAPABILITY_BLOCK]) { - warn_report("block migration is deprecated;" - " use blockdev-mirror with NBD instead"); - } - if (new_caps[MIGRATION_CAPABILITY_COMPRESS]) { warn_report("old compression method is deprecated;" " use multifd compression methods instead"); @@ -706,11 +686,6 @@ MigrationCapabilityStatusList *qmp_query_migrate_capab= ilities(Error **errp) int i; =20 for (i =3D 0; i < MIGRATION_CAPABILITY__MAX; i++) { -#ifndef CONFIG_LIVE_BLOCK_MIGRATION - if (i =3D=3D MIGRATION_CAPABILITY_BLOCK) { - continue; - } -#endif caps =3D g_malloc0(sizeof(*caps)); caps->capability =3D i; caps->state =3D s->capabilities[i]; diff --git a/migration/options.h b/migration/options.h index e9cb60444f..3c56d70d07 100644 --- a/migration/options.h +++ b/migration/options.h @@ -25,7 +25,6 @@ extern Property migration_properties[]; /* capabilities */ =20 bool migrate_auto_converge(void); -bool migrate_block(void); bool migrate_colo(void); bool migrate_compress(void); bool migrate_dirty_bitmaps(void); diff --git a/migration/ram.c b/migration/ram.c index 50df1e9cd2..a5320aa889 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -53,7 +53,6 @@ #include "exec/target_page.h" #include "qemu/rcu_queue.h" #include "migration/colo.h" -#include "block.h" #include "sysemu/cpu-throttle.h" #include "savevm.h" #include "qemu/iov.h" @@ -1025,13 +1024,6 @@ static void migration_trigger_throttle(RAMState *rs) uint64_t bytes_dirty_period =3D rs->num_dirty_pages_period * TARGET_PA= GE_SIZE; uint64_t bytes_dirty_threshold =3D bytes_xfer_period * threshold / 100; =20 - /* During block migration the auto-converge logic incorrectly detects - * that ram migration makes no progress. Avoid this by disabling the - * throttling logic during the bulk phase of block migration. */ - if (blk_mig_bulk_active()) { - return; - } - /* * The following detection logic can be refined later. For now: * Check to see if the ratio between dirtied bytes and the approx. @@ -3230,13 +3222,6 @@ static int ram_save_iterate(QEMUFile *f, void *opaqu= e) int64_t t0; int done =3D 0; =20 - if (blk_mig_bulk_active()) { - /* Avoid transferring ram during bulk phase of block migration as - * the bulk phase will usually take a long time and transferring - * ram updates during that time is pointless. */ - goto out; - } - /* * We'll take this lock a little bit long, but it's okay for two reaso= ns. * Firstly, the only possible other thread to take it is who calls diff --git a/migration/savevm.c b/migration/savevm.c index 4509482ec4..6c789bd54b 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1711,11 +1711,6 @@ static int qemu_savevm_state(QEMUFile *f, Error **er= rp) return -EINVAL; } =20 - if (migrate_block()) { - error_setg(errp, "Block migration and snapshots are incompatible"); - return -EINVAL; - } - ret =3D migrate_init(ms, errp); if (ret) { return ret; diff --git a/qapi/migration.json b/qapi/migration.json index 381b52f680..f721039c6e 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -193,9 +193,6 @@ # @ram: @MigrationStats containing detailed migration status, only # returned if status is 'active' or 'completed'(since 1.2) # -# @disk: @MigrationStats containing detailed disk migration status, -# only returned if status is 'active' and it is a block migration -# # @xbzrle-cache: @XBZRLECacheStats containing detailed XBZRLE # migration statistics, only returned if XBZRLE feature is on and # status is 'active' or 'completed' (since 1.2) @@ -262,17 +259,15 @@ # # Features: # -# @deprecated: Member @disk is deprecated because block migration is. -# Member @compression is deprecated because it is unreliable and -# untested. It is recommended to use multifd migration, which -# offers an alternative compression implementation that is -# reliable and tested. +# @deprecated: Member @compression is deprecated because it is +# unreliable and untested. It is recommended to use multifd +# migration, which offers an alternative compression +# implementation that is reliable and tested. # # Since: 0.14 ## { 'struct': 'MigrationInfo', 'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats', - '*disk': { 'type': 'MigrationStats', 'features': [ 'deprecated'= ] }, '*vfio': 'VfioStats', '*xbzrle-cache': 'XBZRLECacheStats', '*total-time': 'int', @@ -294,8 +289,7 @@ # # Returns information about current migration process. If migration # is active there will be another json-object with RAM migration -# status and if block migration is active another one with block -# migration status. +# status. # # Returns: @MigrationInfo # @@ -333,7 +327,7 @@ # -> { "execute": "query-migrate" } # <- { "return": { "status": "failed" } } # -# 4. Migration is being performed and is not a block migration: +# 4. Migration is being performed: # # -> { "execute": "query-migrate" } # <- { @@ -354,33 +348,7 @@ # } # } # -# 5. Migration is being performed and is a block migration: -# -# -> { "execute": "query-migrate" } -# <- { -# "return":{ -# "status":"active", -# "total-time":12345, -# "setup-time":12345, -# "expected-downtime":12345, -# "ram":{ -# "total":1057024, -# "remaining":1053304, -# "transferred":3720, -# "duplicate":123, -# "normal":123, -# "normal-bytes":123456, -# "dirty-sync-count":15 -# }, -# "disk":{ -# "total":20971520, -# "remaining":20880384, -# "transferred":91136 -# } -# } -# } -# -# 6. Migration is being performed and XBZRLE is active: +# 5. Migration is being performed and XBZRLE is active: # # -> { "execute": "query-migrate" } # <- { @@ -460,11 +428,6 @@ # @release-ram: if enabled, qemu will free the migrated ram pages on # the source during postcopy-ram migration. (since 2.9) # -# @block: If enabled, QEMU will also migrate the contents of all block -# devices. Default is disabled. A possible alternative uses -# mirror jobs to a builtin NBD server on the destination, which -# offers more flexibility. (Since 2.10) -# # @return-path: If enabled, migration will use the return path even # for precopy. (since 2.10) # @@ -528,11 +491,10 @@ # # Features: # -# @deprecated: Member @block is deprecated. Use blockdev-mirror with -# NBD instead. Member @compress is deprecated because it is -# unreliable and untested. It is recommended to use multifd -# migration, which offers an alternative compression -# implementation that is reliable and tested. +# @deprecated: Member @compress is deprecated because it is unreliable +# and untested. It is recommended to use multifd migration, which +# offers an alternative compression implementation that is +# reliable and tested. # # @unstable: Members @x-colo and @x-ignore-shared are experimental. # @@ -544,7 +506,6 @@ 'events', 'postcopy-ram', { 'name': 'x-colo', 'features': [ 'unstable' ] }, 'release-ram', - { 'name': 'block', 'features': [ 'deprecated' ] }, 'return-path', 'pause-before-switchover', 'multifd', 'dirty-bitmaps', 'postcopy-blocktime', 'late-block-activate', { 'name': 'x-ignore-shared', 'features': [ 'unstable' ] }, diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index 0a29d35fdb..6ce5a8b72a 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -143,8 +143,6 @@ meson_options_help() { printf "%s\n" ' libvduse build VDUSE Library' printf "%s\n" ' linux-aio Linux AIO support' printf "%s\n" ' linux-io-uring Linux io_uring support' - printf "%s\n" ' live-block-migration' - printf "%s\n" ' block migration in the main migration s= tream' printf "%s\n" ' lzfse lzfse support for DMG images' printf "%s\n" ' lzo lzo compression support' printf "%s\n" ' malloc-trim enable libc malloc_trim() for memory op= timization' @@ -382,8 +380,6 @@ _meson_option_parse() { --disable-linux-aio) printf "%s" -Dlinux_aio=3Ddisabled ;; --enable-linux-io-uring) printf "%s" -Dlinux_io_uring=3Denabled ;; --disable-linux-io-uring) printf "%s" -Dlinux_io_uring=3Ddisabled ;; - --enable-live-block-migration) printf "%s" -Dlive_block_migration=3Den= abled ;; - --disable-live-block-migration) printf "%s" -Dlive_block_migration=3Dd= isabled ;; --localedir=3D*) quote_sh "-Dlocaledir=3D$2" ;; --localstatedir=3D*) quote_sh "-Dlocalstatedir=3D$2" ;; --enable-lzfse) printf "%s" -Dlzfse=3Denabled ;; --=20 2.35.3 From nobody Mon Nov 25 09:36:30 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=1715211781; cv=none; d=zohomail.com; s=zohoarc; b=AfRPZ7DSJ1muiEZMD5QIotoV/feRRVJ9ZARLAHkYwW/yAM03l6BlW7xNFpLObqUDgnijW+tzohC72y4OndBhtfalT9EsghXW54aa9xzM9KNVOOlSaJpXE1ZwQwcNmci/IKstjaBw7WbLKFy5NzmNws0CmJGLBKiU9rLaBOZNnbA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715211781; 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=VT0xT2oM9J/cd/0rTniuvephMfiwH/lom8rJKO7zN9U=; b=cB5hzJM1EH5e05Q7G5KgmWFQOs/wrlZVdNPVhYil7HzJ2oW40+RK2L+kLlnpYTG6eqhltwhEeHj7ww1bI1R1uhzKzPAqchv1zRRCmz7VBucOMs9/hZrLNGcIVw9qaVcIK/e4bjPonV8I0G5V2GbvBOtGA+V0ay15uemWGbMicYM= 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 1715211781712390.2257901125388; Wed, 8 May 2024 16:43:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4qpe-0003Fc-G8; Wed, 08 May 2024 19:36:18 -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 1s4qpa-00034o-Bt for qemu-devel@nongnu.org; Wed, 08 May 2024 19:36:14 -0400 Received: from smtp-out1.suse.de ([2a07:de40:b251:101:10:150:64:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s4qpU-0002Sk-1W for qemu-devel@nongnu.org; Wed, 08 May 2024 19:36:14 -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 9A3503772A; Wed, 8 May 2024 23:36:05 +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 3C71113A3D; Wed, 8 May 2024 23:36:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id 6EtrAWQMPGZ7FQAAD6G6ig (envelope-from ); Wed, 08 May 2024 23:36:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211365; 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=VT0xT2oM9J/cd/0rTniuvephMfiwH/lom8rJKO7zN9U=; b=HFedulDZK6jyKxJCsv3BTo4Gt0RgfxTI+k3lASFJ8Wert6YPrIf106eKUgDHbvWQMt7sIC mHJcOoU5aXq+8merTVSZ4T/12j+C860YSwvBL/D6OWoVScsS/MQNRPeMmtHnRSRIc/v4tM bsydP2m7TFEI0vAmbb/60IfgCZTkydg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211365; 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=VT0xT2oM9J/cd/0rTniuvephMfiwH/lom8rJKO7zN9U=; b=oTCYF3LaZQtzRskvFHsyQTX5qWgQHD6sstPfytlxtsfRFHCWO2NrrnsMfTuZGsMvfhHZju WLvRaIJlwZv8mhDA== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=HFedulDZ; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=oTCYF3La DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211365; 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=VT0xT2oM9J/cd/0rTniuvephMfiwH/lom8rJKO7zN9U=; b=HFedulDZK6jyKxJCsv3BTo4Gt0RgfxTI+k3lASFJ8Wert6YPrIf106eKUgDHbvWQMt7sIC mHJcOoU5aXq+8merTVSZ4T/12j+C860YSwvBL/D6OWoVScsS/MQNRPeMmtHnRSRIc/v4tM bsydP2m7TFEI0vAmbb/60IfgCZTkydg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211365; 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=VT0xT2oM9J/cd/0rTniuvephMfiwH/lom8rJKO7zN9U=; b=oTCYF3LaZQtzRskvFHsyQTX5qWgQHD6sstPfytlxtsfRFHCWO2NrrnsMfTuZGsMvfhHZju WLvRaIJlwZv8mhDA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , Markus Armbruster Subject: [PULL v2 11/13] migration: Remove non-multifd compression Date: Wed, 8 May 2024 20:35:39 -0300 Message-Id: <20240508233541.2403-12-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240508233541.2403-1-farosas@suse.de> References: <20240508233541.2403-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.01 X-Rspamd-Action: no action X-Rspamd-Queue-Id: 9A3503772A X-Rspamd-Server: rspamd2.dmz-prg2.suse.org 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)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; 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]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_TLS_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email] 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=2a07:de40:b251:101:10:150:64:1; 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: 1715211783173100011 Content-Type: text/plain; charset="utf-8" The 'compress' migration capability enables the old compression code which has shown issues over the years and is thought to be less stable and tested than the more recent multifd-based compression. The old compression code has been deprecated in 8.2 and now is time to remove it. Deprecation commit 864128df46 ("migration: Deprecate old compression method"). Acked-by: Markus Armbruster Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- docs/about/deprecated.rst | 11 - docs/about/removed-features.rst | 55 ++++ hw/core/machine.c | 1 - migration/meson.build | 1 - migration/migration-hmp-cmds.c | 47 --- migration/migration.c | 13 - migration/migration.h | 7 - migration/options.c | 164 ---------- migration/options.h | 5 - migration/qemu-file.c | 78 ----- migration/qemu-file.h | 4 - migration/ram-compress.c | 564 -------------------------------- migration/ram-compress.h | 77 ----- migration/ram.c | 154 +-------- qapi/migration.json | 112 ------- tests/qtest/migration-test.c | 139 -------- 16 files changed, 64 insertions(+), 1368 deletions(-) delete mode 100644 migration/ram-compress.c delete mode 100644 migration/ram-compress.h diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 3d324930f3..64b8f838be 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -473,14 +473,3 @@ both, older and future versions of QEMU. The ``blacklist`` config file option has been renamed to ``block-rpcs`` (to be in sync with the renaming of the corresponding command line option). - -Migration ---------- - -old compression method (since 8.2) -'''''''''''''''''''''''''''''''''' - -Compression method fails too much. Too many races. We are going to -remove it if nobody fixes it. For starters, migration-test -compression tests are disabled because they fail randomly. If you need -compression, use multifd compression methods. diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.= rst index 9e7d8ee4ff..fba0cfb0b0 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -505,6 +505,11 @@ configurations (e.g. -smp 8,sockets=3D0) is removed si= nce 9.0, users have to ensure that all the topology members described with -smp are greater than zero. =20 +``-global migration.decompress-error-check`` (removed in 9.1) +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Removed along with the ``compression`` migration capability. + User-mode emulator command line arguments ----------------------------------------- =20 @@ -641,6 +646,31 @@ Block migration has been removed. For a replacement, s= ee "QMP invocation for live storage migration with ``blockdev-mirror`` + NBD" in docs/interop/live-block-operations.rst. =20 +``migrate-set-parameter`` ``compress-level`` option (removed in 9.1) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Use ``multifd-zlib-level`` or ``multifd-zstd-level`` instead. + +``migrate-set-parameter`` ``compress-threads`` option (removed in 9.1) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Use ``multifd-channels`` instead. + +``migrate-set-parameter`` ``compress-wait-thread`` option (removed in 9.1) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Removed with no replacement. + +``migrate-set-parameter`` ``decompress-threads`` option (removed in 9.1) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Use ``multifd-channels`` instead. + +``migrate-set-capability`` ``compress`` option (removed in 9.1) +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Use ``multifd-compression`` instead. + Human Monitor Protocol (HMP) commands ------------------------------------- =20 @@ -722,6 +752,31 @@ Block migration has been removed. For a replacement, s= ee "QMP invocation for live storage migration with ``blockdev-mirror`` + NBD" in docs/interop/live-block-operations.rst. =20 +``migrate_set_parameter`` ``compress-level`` option (removed in 9.1) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Use ``multifd-zlib-level`` or ``multifd-zstd-level`` instead. + +``migrate_set_parameter`` ``compress-threads`` option (removed in 9.1) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Use ``multifd-channels`` instead. + +``migrate_set_parameter`` ``compress-wait-thread`` option (removed in 9.1) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Removed with no replacement. + +``migrate_set_parameter`` ``decompress-threads`` option (removed in 9.1) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Use ``multifd-channels`` instead. + +``migrate_set_capability`` ``compress`` option (removed in 9.1) +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Use ``multifd-compression`` instead. + Host Architectures ------------------ =20 diff --git a/hw/core/machine.c b/hw/core/machine.c index 4ff60911e7..c7ceb11501 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -192,7 +192,6 @@ GlobalProperty hw_compat_3_0[] =3D {}; const size_t hw_compat_3_0_len =3D G_N_ELEMENTS(hw_compat_3_0); =20 GlobalProperty hw_compat_2_12[] =3D { - { "migration", "decompress-error-check", "off" }, { "hda-audio", "use-timer", "false" }, { "cirrus-vga", "global-vmstate", "true" }, { "VGA", "global-vmstate", "true" }, diff --git a/migration/meson.build b/migration/meson.build index d7e118f584..8815f80837 100644 --- a/migration/meson.build +++ b/migration/meson.build @@ -23,7 +23,6 @@ system_ss.add(files( 'multifd.c', 'multifd-zlib.c', 'multifd-zero-page.c', - 'ram-compress.c', 'options.c', 'postcopy-ram.c', 'savevm.c', diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index a497ef95d7..9f0e8029e0 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -46,8 +46,6 @@ static void migration_global_dump(Monitor *mon) ms->send_configuration ? "on" : "off"); monitor_printf(mon, "send-section-footer: %s\n", ms->send_section_footer ? "on" : "off"); - monitor_printf(mon, "decompress-error-check: %s\n", - ms->decompress_error_check ? "on" : "off"); monitor_printf(mon, "clear-bitmap-shift: %u\n", ms->clear_bitmap_shift); } @@ -162,19 +160,6 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict) info->xbzrle_cache->overflow); } =20 - if (info->compression) { - monitor_printf(mon, "compression pages: %" PRIu64 " pages\n", - info->compression->pages); - monitor_printf(mon, "compression busy: %" PRIu64 "\n", - info->compression->busy); - monitor_printf(mon, "compression busy rate: %0.2f\n", - info->compression->busy_rate); - monitor_printf(mon, "compressed size: %" PRIu64 " kbytes\n", - info->compression->compressed_size >> 10); - monitor_printf(mon, "compression rate: %0.2f\n", - info->compression->compression_rate); - } - if (info->has_cpu_throttle_percentage) { monitor_printf(mon, "cpu throttle percentage: %" PRIu64 "\n", info->cpu_throttle_percentage); @@ -263,22 +248,6 @@ void hmp_info_migrate_parameters(Monitor *mon, const Q= Dict *qdict) monitor_printf(mon, "%s: %" PRIu64 " ms\n", MigrationParameter_str(MIGRATION_PARAMETER_ANNOUNCE_STEP), params->announce_step); - assert(params->has_compress_level); - monitor_printf(mon, "%s: %u\n", - MigrationParameter_str(MIGRATION_PARAMETER_COMPRESS_LEVEL), - params->compress_level); - assert(params->has_compress_threads); - monitor_printf(mon, "%s: %u\n", - MigrationParameter_str(MIGRATION_PARAMETER_COMPRESS_THREADS), - params->compress_threads); - assert(params->has_compress_wait_thread); - monitor_printf(mon, "%s: %s\n", - MigrationParameter_str(MIGRATION_PARAMETER_COMPRESS_WAIT_THREA= D), - params->compress_wait_thread ? "on" : "off"); - assert(params->has_decompress_threads); - monitor_printf(mon, "%s: %u\n", - MigrationParameter_str(MIGRATION_PARAMETER_DECOMPRESS_THREADS), - params->decompress_threads); assert(params->has_throttle_trigger_threshold); monitor_printf(mon, "%s: %u\n", MigrationParameter_str(MIGRATION_PARAMETER_THROTTLE_TRIGGER_TH= RESHOLD), @@ -520,22 +489,6 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDi= ct *qdict) } =20 switch (val) { - case MIGRATION_PARAMETER_COMPRESS_LEVEL: - p->has_compress_level =3D true; - visit_type_uint8(v, param, &p->compress_level, &err); - break; - case MIGRATION_PARAMETER_COMPRESS_THREADS: - p->has_compress_threads =3D true; - visit_type_uint8(v, param, &p->compress_threads, &err); - break; - case MIGRATION_PARAMETER_COMPRESS_WAIT_THREAD: - p->has_compress_wait_thread =3D true; - visit_type_bool(v, param, &p->compress_wait_thread, &err); - break; - case MIGRATION_PARAMETER_DECOMPRESS_THREADS: - p->has_decompress_threads =3D true; - visit_type_uint8(v, param, &p->decompress_threads, &err); - break; case MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD: p->has_throttle_trigger_threshold =3D true; visit_type_uint8(v, param, &p->throttle_trigger_threshold, &err); diff --git a/migration/migration.c b/migration/migration.c index 6f209601d3..e88b24f1e6 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -27,7 +27,6 @@ #include "sysemu/cpu-throttle.h" #include "rdma.h" #include "ram.h" -#include "ram-compress.h" #include "migration/global_state.h" #include "migration/misc.h" #include "migration.h" @@ -356,7 +355,6 @@ void migration_incoming_state_destroy(void) struct MigrationIncomingState *mis =3D migration_incoming_get_current(= ); =20 multifd_recv_cleanup(); - compress_threads_load_cleanup(); =20 if (mis->to_src_file) { /* Tell source that we are done */ @@ -649,10 +647,6 @@ static void qemu_start_incoming_migration(const char *= uri, bool has_channels, } #ifdef CONFIG_RDMA } else if (addr->transport =3D=3D MIGRATION_ADDRESS_TYPE_RDMA) { - if (migrate_compress()) { - error_setg(errp, "RDMA and compression can't be used together"= ); - return; - } if (migrate_xbzrle()) { error_setg(errp, "RDMA and XBZRLE can't be used together"); return; @@ -745,11 +739,6 @@ process_incoming_migration_co(void *opaque) =20 assert(mis->from_src_file); =20 - if (compress_threads_load_setup(mis->from_src_file)) { - error_setg(&local_err, "Failed to setup decompress threads"); - goto fail; - } - mis->largest_page_size =3D qemu_ram_pagesize_largest(); postcopy_state_set(POSTCOPY_INCOMING_NONE); migrate_set_state(&mis->state, MIGRATION_STATUS_SETUP, @@ -1181,8 +1170,6 @@ static void populate_ram_info(MigrationInfo *info, Mi= grationState *s) info->xbzrle_cache->overflow =3D xbzrle_counters.overflow; } =20 - populate_compress(info); - if (cpu_throttle_active()) { info->has_cpu_throttle_percentage =3D true; info->cpu_throttle_percentage =3D cpu_throttle_get_percentage(); diff --git a/migration/migration.h b/migration/migration.h index a02c2ec782..6af01362d4 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -392,13 +392,6 @@ struct MigrationState { =20 /* Needed by postcopy-pause state */ QemuSemaphore postcopy_pause_sem; - /* - * Whether we abort the migration if decompression errors are - * detected at the destination. It is left at false for qemu - * older than 3.0, since only newer qemu sends streams that - * do not trigger spurious decompression errors. - */ - bool decompress_error_check; /* * This variable only affects behavior when postcopy preempt mode is * enabled. diff --git a/migration/options.c b/migration/options.c index cc2599ae4a..5ab5b6d85d 100644 --- a/migration/options.c +++ b/migration/options.c @@ -40,13 +40,6 @@ * for sending the last part */ #define DEFAULT_MIGRATE_SET_DOWNTIME 300 =20 -/* Default compression thread count */ -#define DEFAULT_MIGRATE_COMPRESS_THREAD_COUNT 8 -/* Default decompression thread count, usually decompression is at - * least 4 times as fast as compression.*/ -#define DEFAULT_MIGRATE_DECOMPRESS_THREAD_COUNT 2 -/*0: means nocompress, 1: best speed, ... 9: best compress ratio */ -#define DEFAULT_MIGRATE_COMPRESS_LEVEL 1 /* Define default autoconverge cpu throttle migration parameters */ #define DEFAULT_MIGRATE_THROTTLE_TRIGGER_THRESHOLD 50 #define DEFAULT_MIGRATE_CPU_THROTTLE_INITIAL 20 @@ -92,8 +85,6 @@ Property migration_properties[] =3D { send_configuration, true), DEFINE_PROP_BOOL("send-section-footer", MigrationState, send_section_footer, true), - DEFINE_PROP_BOOL("decompress-error-check", MigrationState, - decompress_error_check, true), DEFINE_PROP_BOOL("multifd-flush-after-each-section", MigrationState, multifd_flush_after_each_section, false), DEFINE_PROP_UINT8("x-clear-bitmap-shift", MigrationState, @@ -102,17 +93,6 @@ Property migration_properties[] =3D { preempt_pre_7_2, false), =20 /* Migration parameters */ - DEFINE_PROP_UINT8("x-compress-level", MigrationState, - parameters.compress_level, - DEFAULT_MIGRATE_COMPRESS_LEVEL), - DEFINE_PROP_UINT8("x-compress-threads", MigrationState, - parameters.compress_threads, - DEFAULT_MIGRATE_COMPRESS_THREAD_COUNT), - DEFINE_PROP_BOOL("x-compress-wait-thread", MigrationState, - parameters.compress_wait_thread, true), - DEFINE_PROP_UINT8("x-decompress-threads", MigrationState, - parameters.decompress_threads, - DEFAULT_MIGRATE_DECOMPRESS_THREAD_COUNT), DEFINE_PROP_UINT8("x-throttle-trigger-threshold", MigrationState, parameters.throttle_trigger_threshold, DEFAULT_MIGRATE_THROTTLE_TRIGGER_THRESHOLD), @@ -188,7 +168,6 @@ Property migration_properties[] =3D { DEFINE_PROP_MIG_CAP("x-rdma-pin-all", MIGRATION_CAPABILITY_RDMA_PIN_AL= L), DEFINE_PROP_MIG_CAP("x-auto-converge", MIGRATION_CAPABILITY_AUTO_CONVE= RGE), DEFINE_PROP_MIG_CAP("x-zero-blocks", MIGRATION_CAPABILITY_ZERO_BLOCKS), - DEFINE_PROP_MIG_CAP("x-compress", MIGRATION_CAPABILITY_COMPRESS), DEFINE_PROP_MIG_CAP("x-events", MIGRATION_CAPABILITY_EVENTS), DEFINE_PROP_MIG_CAP("x-postcopy-ram", MIGRATION_CAPABILITY_POSTCOPY_RA= M), DEFINE_PROP_MIG_CAP("x-postcopy-preempt", @@ -231,13 +210,6 @@ bool migrate_colo(void) return s->capabilities[MIGRATION_CAPABILITY_X_COLO]; } =20 -bool migrate_compress(void) -{ - MigrationState *s =3D migrate_get_current(); - - return s->capabilities[MIGRATION_CAPABILITY_COMPRESS]; -} - bool migrate_dirty_bitmaps(void) { MigrationState *s =3D migrate_get_current(); @@ -451,7 +423,6 @@ INITIALIZE_MIGRATE_CAPS_SET(check_caps_background_snaps= hot, MIGRATION_CAPABILITY_AUTO_CONVERGE, MIGRATION_CAPABILITY_RELEASE_RAM, MIGRATION_CAPABILITY_RDMA_PIN_ALL, - MIGRATION_CAPABILITY_COMPRESS, MIGRATION_CAPABILITY_XBZRLE, MIGRATION_CAPABILITY_X_COLO, MIGRATION_CAPABILITY_VALIDATE_UUID, @@ -476,11 +447,6 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps= , Error **errp) ERRP_GUARD(); MigrationIncomingState *mis =3D migration_incoming_get_current(); =20 - if (new_caps[MIGRATION_CAPABILITY_COMPRESS]) { - warn_report("old compression method is deprecated;" - " use multifd compression methods instead"); - } - #ifndef CONFIG_REPLICATION if (new_caps[MIGRATION_CAPABILITY_X_COLO]) { error_setg(errp, "QEMU compiled without replication module" @@ -549,7 +515,6 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps,= Error **errp) #ifdef CONFIG_LINUX if (new_caps[MIGRATION_CAPABILITY_ZERO_COPY_SEND] && (!new_caps[MIGRATION_CAPABILITY_MULTIFD] || - new_caps[MIGRATION_CAPABILITY_COMPRESS] || new_caps[MIGRATION_CAPABILITY_XBZRLE] || migrate_multifd_compression() || migrate_tls())) { @@ -571,17 +536,6 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps= , Error **errp) return false; } =20 - /* - * Preempt mode requires urgent pages to be sent in separate - * channel, OTOH compression logic will disorder all pages into - * different compression channels, which is not compatible with the - * preempt assumptions on channel assignments. - */ - if (new_caps[MIGRATION_CAPABILITY_COMPRESS]) { - error_setg(errp, "Postcopy preempt not compatible with compres= s"); - return false; - } - if (migrate_incoming_started()) { error_setg(errp, "Postcopy preempt must be set before incoming start= s"); @@ -590,10 +544,6 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps= , Error **errp) } =20 if (new_caps[MIGRATION_CAPABILITY_MULTIFD]) { - if (new_caps[MIGRATION_CAPABILITY_COMPRESS]) { - error_setg(errp, "Multifd is not compatible with compress"); - return false; - } if (migrate_incoming_started()) { error_setg(errp, "Multifd must be set before incoming starts"); return false; @@ -628,13 +578,6 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps= , Error **errp) } } =20 - if (new_caps[MIGRATION_CAPABILITY_COMPRESS]) { - if (new_caps[MIGRATION_CAPABILITY_XBZRLE]) { - error_setg(errp, "Compression is not compatible with xbzrle"); - return false; - } - } - if (new_caps[MIGRATION_CAPABILITY_MAPPED_RAM]) { if (new_caps[MIGRATION_CAPABILITY_XBZRLE]) { error_setg(errp, @@ -642,12 +585,6 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps= , Error **errp) return false; } =20 - if (new_caps[MIGRATION_CAPABILITY_COMPRESS]) { - error_setg(errp, - "Mapped-ram migration is incompatible with compress= ion"); - return false; - } - if (new_caps[MIGRATION_CAPABILITY_POSTCOPY_RAM]) { error_setg(errp, "Mapped-ram migration is incompatible with postcopy= "); @@ -744,27 +681,6 @@ uint32_t migrate_checkpoint_delay(void) return s->parameters.x_checkpoint_delay; } =20 -int migrate_compress_level(void) -{ - MigrationState *s =3D migrate_get_current(); - - return s->parameters.compress_level; -} - -int migrate_compress_threads(void) -{ - MigrationState *s =3D migrate_get_current(); - - return s->parameters.compress_threads; -} - -int migrate_compress_wait_thread(void) -{ - MigrationState *s =3D migrate_get_current(); - - return s->parameters.compress_wait_thread; -} - uint8_t migrate_cpu_throttle_increment(void) { MigrationState *s =3D migrate_get_current(); @@ -786,13 +702,6 @@ bool migrate_cpu_throttle_tailslow(void) return s->parameters.cpu_throttle_tailslow; } =20 -int migrate_decompress_threads(void) -{ - MigrationState *s =3D migrate_get_current(); - - return s->parameters.decompress_threads; -} - uint64_t migrate_downtime_limit(void) { MigrationState *s =3D migrate_get_current(); @@ -938,14 +847,6 @@ MigrationParameters *qmp_query_migrate_parameters(Erro= r **errp) =20 /* TODO use QAPI_CLONE() instead of duplicating it inline */ params =3D g_malloc0(sizeof(*params)); - params->has_compress_level =3D true; - params->compress_level =3D s->parameters.compress_level; - params->has_compress_threads =3D true; - params->compress_threads =3D s->parameters.compress_threads; - params->has_compress_wait_thread =3D true; - params->compress_wait_thread =3D s->parameters.compress_wait_thread; - params->has_decompress_threads =3D true; - params->decompress_threads =3D s->parameters.decompress_threads; params->has_throttle_trigger_threshold =3D true; params->throttle_trigger_threshold =3D s->parameters.throttle_trigger_= threshold; params->has_cpu_throttle_initial =3D true; @@ -1014,10 +915,6 @@ void migrate_params_init(MigrationParameters *params) params->tls_creds =3D g_strdup(""); =20 /* Set has_* up only for parameter checks */ - params->has_compress_level =3D true; - params->has_compress_threads =3D true; - params->has_compress_wait_thread =3D true; - params->has_decompress_threads =3D true; params->has_throttle_trigger_threshold =3D true; params->has_cpu_throttle_initial =3D true; params->has_cpu_throttle_increment =3D true; @@ -1050,27 +947,6 @@ bool migrate_params_check(MigrationParameters *params= , Error **errp) { ERRP_GUARD(); =20 - if (params->has_compress_level && - (params->compress_level > 9)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "compress_level", - "a value between 0 and 9"); - return false; - } - - if (params->has_compress_threads && (params->compress_threads < 1)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "compress_threads", - "a value between 1 and 255"); - return false; - } - - if (params->has_decompress_threads && (params->decompress_threads < 1)= ) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "decompress_threads", - "a value between 1 and 255"); - return false; - } - if (params->has_throttle_trigger_threshold && (params->throttle_trigger_threshold < 1 || params->throttle_trigger_threshold > 100)) { @@ -1244,22 +1120,6 @@ static void migrate_params_test_apply(MigrateSetPara= meters *params, =20 /* TODO use QAPI_CLONE() instead of duplicating it inline */ =20 - if (params->has_compress_level) { - dest->compress_level =3D params->compress_level; - } - - if (params->has_compress_threads) { - dest->compress_threads =3D params->compress_threads; - } - - if (params->has_compress_wait_thread) { - dest->compress_wait_thread =3D params->compress_wait_thread; - } - - if (params->has_decompress_threads) { - dest->decompress_threads =3D params->decompress_threads; - } - if (params->has_throttle_trigger_threshold) { dest->throttle_trigger_threshold =3D params->throttle_trigger_thre= shold; } @@ -1364,30 +1224,6 @@ static void migrate_params_apply(MigrateSetParameter= s *params, Error **errp) =20 /* TODO use QAPI_CLONE() instead of duplicating it inline */ =20 - if (params->has_compress_level) { - warn_report("old compression is deprecated;" - " use multifd compression methods instead"); - s->parameters.compress_level =3D params->compress_level; - } - - if (params->has_compress_threads) { - warn_report("old compression is deprecated;" - " use multifd compression methods instead"); - s->parameters.compress_threads =3D params->compress_threads; - } - - if (params->has_compress_wait_thread) { - warn_report("old compression is deprecated;" - " use multifd compression methods instead"); - s->parameters.compress_wait_thread =3D params->compress_wait_threa= d; - } - - if (params->has_decompress_threads) { - warn_report("old compression is deprecated;" - " use multifd compression methods instead"); - s->parameters.decompress_threads =3D params->decompress_threads; - } - if (params->has_throttle_trigger_threshold) { s->parameters.throttle_trigger_threshold =3D params->throttle_trig= ger_threshold; } diff --git a/migration/options.h b/migration/options.h index 3c56d70d07..4b21cc2669 100644 --- a/migration/options.h +++ b/migration/options.h @@ -26,7 +26,6 @@ extern Property migration_properties[]; =20 bool migrate_auto_converge(void); bool migrate_colo(void); -bool migrate_compress(void); bool migrate_dirty_bitmaps(void); bool migrate_events(void); bool migrate_mapped_ram(void); @@ -67,13 +66,9 @@ const BitmapMigrationNodeAliasList *migrate_block_bitmap= _mapping(void); bool migrate_has_block_bitmap_mapping(void); =20 uint32_t migrate_checkpoint_delay(void); -int migrate_compress_level(void); -int migrate_compress_threads(void); -int migrate_compress_wait_thread(void); uint8_t migrate_cpu_throttle_increment(void); uint8_t migrate_cpu_throttle_initial(void); bool migrate_cpu_throttle_tailslow(void); -int migrate_decompress_threads(void); uint64_t migrate_downtime_limit(void); uint8_t migrate_max_cpu_throttle(void); uint64_t migrate_max_bandwidth(void); diff --git a/migration/qemu-file.c b/migration/qemu-file.c index a10882d47f..9ccbbb0099 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -778,84 +778,6 @@ uint64_t qemu_get_be64(QEMUFile *f) return v; } =20 -/* return the size after compression, or negative value on error */ -static int qemu_compress_data(z_stream *stream, uint8_t *dest, size_t dest= _len, - const uint8_t *source, size_t source_len) -{ - int err; - - err =3D deflateReset(stream); - if (err !=3D Z_OK) { - return -1; - } - - stream->avail_in =3D source_len; - stream->next_in =3D (uint8_t *)source; - stream->avail_out =3D dest_len; - stream->next_out =3D dest; - - err =3D deflate(stream, Z_FINISH); - if (err !=3D Z_STREAM_END) { - return -1; - } - - return stream->next_out - dest; -} - -/* Compress size bytes of data start at p and store the compressed - * data to the buffer of f. - * - * Since the file is dummy file with empty_ops, return -1 if f has no spac= e to - * save the compressed data. - */ -ssize_t qemu_put_compression_data(QEMUFile *f, z_stream *stream, - const uint8_t *p, size_t size) -{ - ssize_t blen =3D IO_BUF_SIZE - f->buf_index - sizeof(int32_t); - - if (blen < compressBound(size)) { - return -1; - } - - blen =3D qemu_compress_data(stream, f->buf + f->buf_index + sizeof(int= 32_t), - blen, p, size); - if (blen < 0) { - return -1; - } - - qemu_put_be32(f, blen); - add_buf_to_iovec(f, blen); - return blen + sizeof(int32_t); -} - -/* Put the data in the buffer of f_src to the buffer of f_des, and - * then reset the buf_index of f_src to 0. - */ - -int qemu_put_qemu_file(QEMUFile *f_des, QEMUFile *f_src) -{ - int len =3D 0; - - if (f_src->buf_index > 0) { - len =3D f_src->buf_index; - qemu_put_buffer(f_des, f_src->buf, f_src->buf_index); - f_src->buf_index =3D 0; - f_src->iovcnt =3D 0; - } - return len; -} - -/* - * Check if the writable buffer is empty - */ - -bool qemu_file_buffer_empty(QEMUFile *file) -{ - assert(qemu_file_is_writable(file)); - - return !file->iovcnt; -} - /* * Get a string whose length is determined by a single preceding byte * A preallocated 256 byte buffer must be passed in. diff --git a/migration/qemu-file.h b/migration/qemu-file.h index 32fd4a34fd..11c2120edd 100644 --- a/migration/qemu-file.h +++ b/migration/qemu-file.h @@ -54,10 +54,6 @@ void qemu_put_buffer_async(QEMUFile *f, const uint8_t *b= uf, size_t size, =20 size_t coroutine_mixed_fn qemu_peek_buffer(QEMUFile *f, uint8_t **buf, siz= e_t size, size_t offset); size_t coroutine_mixed_fn qemu_get_buffer_in_place(QEMUFile *f, uint8_t **= buf, size_t size); -ssize_t qemu_put_compression_data(QEMUFile *f, z_stream *stream, - const uint8_t *p, size_t size); -int qemu_put_qemu_file(QEMUFile *f_des, QEMUFile *f_src); -bool qemu_file_buffer_empty(QEMUFile *file); =20 /* * Note that you can only peek continuous bytes from where the current poi= nter diff --git a/migration/ram-compress.c b/migration/ram-compress.c deleted file mode 100644 index fa4388f6a6..0000000000 --- a/migration/ram-compress.c +++ /dev/null @@ -1,564 +0,0 @@ -/* - * QEMU System Emulator - * - * Copyright (c) 2003-2008 Fabrice Bellard - * Copyright (c) 2011-2015 Red Hat Inc - * - * Authors: - * Juan Quintela - * - * Permission is hereby granted, free of charge, to any person obtaining a= copy - * of this software and associated documentation files (the "Software"), t= o deal - * in the Software without restriction, including without limitation the r= ights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included= in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN - * THE SOFTWARE. - */ - -#include "qemu/osdep.h" -#include "qemu/cutils.h" - -#include "ram-compress.h" - -#include "qemu/error-report.h" -#include "qemu/stats64.h" -#include "migration.h" -#include "options.h" -#include "io/channel-null.h" -#include "exec/target_page.h" -#include "exec/ramblock.h" -#include "ram.h" -#include "migration-stats.h" - -static struct { - int64_t pages; - int64_t busy; - double busy_rate; - int64_t compressed_size; - double compression_rate; - /* compression statistics since the beginning of the period */ - /* amount of count that no free thread to compress data */ - uint64_t compress_thread_busy_prev; - /* amount bytes after compression */ - uint64_t compressed_size_prev; - /* amount of compressed pages */ - uint64_t compress_pages_prev; -} compression_counters; - -static CompressParam *comp_param; -static QemuThread *compress_threads; -/* comp_done_cond is used to wake up the migration thread when - * one of the compression threads has finished the compression. - * comp_done_lock is used to co-work with comp_done_cond. - */ -static QemuMutex comp_done_lock; -static QemuCond comp_done_cond; - -struct DecompressParam { - bool done; - bool quit; - QemuMutex mutex; - QemuCond cond; - void *des; - uint8_t *compbuf; - int len; - z_stream stream; -}; -typedef struct DecompressParam DecompressParam; - -static QEMUFile *decomp_file; -static DecompressParam *decomp_param; -static QemuThread *decompress_threads; -static QemuMutex decomp_done_lock; -static QemuCond decomp_done_cond; - -static CompressResult do_compress_ram_page(QEMUFile *f, z_stream *stream, - RAMBlock *block, ram_addr_t off= set, - uint8_t *source_buf); - -static void *do_data_compress(void *opaque) -{ - CompressParam *param =3D opaque; - RAMBlock *block; - ram_addr_t offset; - CompressResult result; - - qemu_mutex_lock(¶m->mutex); - while (!param->quit) { - if (param->trigger) { - block =3D param->block; - offset =3D param->offset; - param->trigger =3D false; - qemu_mutex_unlock(¶m->mutex); - - result =3D do_compress_ram_page(param->file, ¶m->stream, - block, offset, param->originbuf); - - qemu_mutex_lock(&comp_done_lock); - param->done =3D true; - param->result =3D result; - qemu_cond_signal(&comp_done_cond); - qemu_mutex_unlock(&comp_done_lock); - - qemu_mutex_lock(¶m->mutex); - } else { - qemu_cond_wait(¶m->cond, ¶m->mutex); - } - } - qemu_mutex_unlock(¶m->mutex); - - return NULL; -} - -void compress_threads_save_cleanup(void) -{ - int i, thread_count; - - if (!migrate_compress() || !comp_param) { - return; - } - - thread_count =3D migrate_compress_threads(); - for (i =3D 0; i < thread_count; i++) { - /* - * we use it as a indicator which shows if the thread is - * properly init'd or not - */ - if (!comp_param[i].file) { - break; - } - - qemu_mutex_lock(&comp_param[i].mutex); - comp_param[i].quit =3D true; - qemu_cond_signal(&comp_param[i].cond); - qemu_mutex_unlock(&comp_param[i].mutex); - - qemu_thread_join(compress_threads + i); - qemu_mutex_destroy(&comp_param[i].mutex); - qemu_cond_destroy(&comp_param[i].cond); - deflateEnd(&comp_param[i].stream); - g_free(comp_param[i].originbuf); - qemu_fclose(comp_param[i].file); - comp_param[i].file =3D NULL; - } - qemu_mutex_destroy(&comp_done_lock); - qemu_cond_destroy(&comp_done_cond); - g_free(compress_threads); - g_free(comp_param); - compress_threads =3D NULL; - comp_param =3D NULL; -} - -int compress_threads_save_setup(void) -{ - int i, thread_count; - - if (!migrate_compress()) { - return 0; - } - thread_count =3D migrate_compress_threads(); - compress_threads =3D g_new0(QemuThread, thread_count); - comp_param =3D g_new0(CompressParam, thread_count); - qemu_cond_init(&comp_done_cond); - qemu_mutex_init(&comp_done_lock); - for (i =3D 0; i < thread_count; i++) { - comp_param[i].originbuf =3D g_try_malloc(qemu_target_page_size()); - if (!comp_param[i].originbuf) { - goto exit; - } - - if (deflateInit(&comp_param[i].stream, - migrate_compress_level()) !=3D Z_OK) { - g_free(comp_param[i].originbuf); - goto exit; - } - - /* comp_param[i].file is just used as a dummy buffer to save data, - * set its ops to empty. - */ - comp_param[i].file =3D qemu_file_new_output( - QIO_CHANNEL(qio_channel_null_new())); - comp_param[i].done =3D true; - comp_param[i].quit =3D false; - qemu_mutex_init(&comp_param[i].mutex); - qemu_cond_init(&comp_param[i].cond); - qemu_thread_create(compress_threads + i, "compress", - do_data_compress, comp_param + i, - QEMU_THREAD_JOINABLE); - } - return 0; - -exit: - compress_threads_save_cleanup(); - return -1; -} - -static CompressResult do_compress_ram_page(QEMUFile *f, z_stream *stream, - RAMBlock *block, ram_addr_t off= set, - uint8_t *source_buf) -{ - uint8_t *p =3D block->host + offset; - size_t page_size =3D qemu_target_page_size(); - int ret; - - assert(qemu_file_buffer_empty(f)); - - if (buffer_is_zero(p, page_size)) { - return RES_ZEROPAGE; - } - - /* - * copy it to a internal buffer to avoid it being modified by VM - * so that we can catch up the error during compression and - * decompression - */ - memcpy(source_buf, p, page_size); - ret =3D qemu_put_compression_data(f, stream, source_buf, page_size); - if (ret < 0) { - qemu_file_set_error(migrate_get_current()->to_dst_file, ret); - error_report("compressed data failed!"); - qemu_fflush(f); - return RES_NONE; - } - return RES_COMPRESS; -} - -static inline void compress_reset_result(CompressParam *param) -{ - param->result =3D RES_NONE; - param->block =3D NULL; - param->offset =3D 0; -} - -void compress_flush_data(void) -{ - int thread_count =3D migrate_compress_threads(); - - if (!migrate_compress()) { - return; - } - - qemu_mutex_lock(&comp_done_lock); - for (int i =3D 0; i < thread_count; i++) { - while (!comp_param[i].done) { - qemu_cond_wait(&comp_done_cond, &comp_done_lock); - } - } - qemu_mutex_unlock(&comp_done_lock); - - for (int i =3D 0; i < thread_count; i++) { - qemu_mutex_lock(&comp_param[i].mutex); - if (!comp_param[i].quit) { - CompressParam *param =3D &comp_param[i]; - compress_send_queued_data(param); - assert(qemu_file_buffer_empty(param->file)); - compress_reset_result(param); - } - qemu_mutex_unlock(&comp_param[i].mutex); - } -} - -static inline void set_compress_params(CompressParam *param, RAMBlock *blo= ck, - ram_addr_t offset) -{ - param->block =3D block; - param->offset =3D offset; - param->trigger =3D true; -} - -/* - * Return true when it compress a page - */ -bool compress_page_with_multi_thread(RAMBlock *block, ram_addr_t offset, - int (send_queued_data(CompressParam *= ))) -{ - int thread_count; - bool wait =3D migrate_compress_wait_thread(); - - thread_count =3D migrate_compress_threads(); - qemu_mutex_lock(&comp_done_lock); - - while (true) { - for (int i =3D 0; i < thread_count; i++) { - if (comp_param[i].done) { - CompressParam *param =3D &comp_param[i]; - qemu_mutex_lock(¶m->mutex); - param->done =3D false; - send_queued_data(param); - assert(qemu_file_buffer_empty(param->file)); - compress_reset_result(param); - set_compress_params(param, block, offset); - - qemu_cond_signal(¶m->cond); - qemu_mutex_unlock(¶m->mutex); - qemu_mutex_unlock(&comp_done_lock); - return true; - } - } - if (!wait) { - qemu_mutex_unlock(&comp_done_lock); - compression_counters.busy++; - return false; - } - /* - * wait for a free thread if the user specifies - * 'compress-wait-thread', otherwise we will post the page out - * in the main thread as normal page. - */ - qemu_cond_wait(&comp_done_cond, &comp_done_lock); - } -} - -/* return the size after decompression, or negative value on error */ -static int -qemu_uncompress_data(z_stream *stream, uint8_t *dest, size_t dest_len, - const uint8_t *source, size_t source_len) -{ - int err; - - err =3D inflateReset(stream); - if (err !=3D Z_OK) { - return -1; - } - - stream->avail_in =3D source_len; - stream->next_in =3D (uint8_t *)source; - stream->avail_out =3D dest_len; - stream->next_out =3D dest; - - err =3D inflate(stream, Z_NO_FLUSH); - if (err !=3D Z_STREAM_END) { - return -1; - } - - return stream->total_out; -} - -static void *do_data_decompress(void *opaque) -{ - DecompressParam *param =3D opaque; - unsigned long pagesize; - uint8_t *des; - int len, ret; - - qemu_mutex_lock(¶m->mutex); - while (!param->quit) { - if (param->des) { - des =3D param->des; - len =3D param->len; - param->des =3D 0; - qemu_mutex_unlock(¶m->mutex); - - pagesize =3D qemu_target_page_size(); - - ret =3D qemu_uncompress_data(¶m->stream, des, pagesize, - param->compbuf, len); - if (ret < 0 && migrate_get_current()->decompress_error_check) { - error_report("decompress data failed"); - qemu_file_set_error(decomp_file, ret); - } - - qemu_mutex_lock(&decomp_done_lock); - param->done =3D true; - qemu_cond_signal(&decomp_done_cond); - qemu_mutex_unlock(&decomp_done_lock); - - qemu_mutex_lock(¶m->mutex); - } else { - qemu_cond_wait(¶m->cond, ¶m->mutex); - } - } - qemu_mutex_unlock(¶m->mutex); - - return NULL; -} - -int wait_for_decompress_done(void) -{ - if (!migrate_compress()) { - return 0; - } - - int thread_count =3D migrate_decompress_threads(); - qemu_mutex_lock(&decomp_done_lock); - for (int i =3D 0; i < thread_count; i++) { - while (!decomp_param[i].done) { - qemu_cond_wait(&decomp_done_cond, &decomp_done_lock); - } - } - qemu_mutex_unlock(&decomp_done_lock); - return qemu_file_get_error(decomp_file); -} - -void compress_threads_load_cleanup(void) -{ - int i, thread_count; - - if (!migrate_compress()) { - return; - } - thread_count =3D migrate_decompress_threads(); - for (i =3D 0; i < thread_count; i++) { - /* - * we use it as a indicator which shows if the thread is - * properly init'd or not - */ - if (!decomp_param[i].compbuf) { - break; - } - - qemu_mutex_lock(&decomp_param[i].mutex); - decomp_param[i].quit =3D true; - qemu_cond_signal(&decomp_param[i].cond); - qemu_mutex_unlock(&decomp_param[i].mutex); - } - for (i =3D 0; i < thread_count; i++) { - if (!decomp_param[i].compbuf) { - break; - } - - qemu_thread_join(decompress_threads + i); - qemu_mutex_destroy(&decomp_param[i].mutex); - qemu_cond_destroy(&decomp_param[i].cond); - inflateEnd(&decomp_param[i].stream); - g_free(decomp_param[i].compbuf); - decomp_param[i].compbuf =3D NULL; - } - g_free(decompress_threads); - g_free(decomp_param); - decompress_threads =3D NULL; - decomp_param =3D NULL; - decomp_file =3D NULL; -} - -int compress_threads_load_setup(QEMUFile *f) -{ - int i, thread_count; - - if (!migrate_compress()) { - return 0; - } - - /* - * set compression_counters memory to zero for a new migration - */ - memset(&compression_counters, 0, sizeof(compression_counters)); - - thread_count =3D migrate_decompress_threads(); - decompress_threads =3D g_new0(QemuThread, thread_count); - decomp_param =3D g_new0(DecompressParam, thread_count); - qemu_mutex_init(&decomp_done_lock); - qemu_cond_init(&decomp_done_cond); - decomp_file =3D f; - for (i =3D 0; i < thread_count; i++) { - if (inflateInit(&decomp_param[i].stream) !=3D Z_OK) { - goto exit; - } - - size_t compbuf_size =3D compressBound(qemu_target_page_size()); - decomp_param[i].compbuf =3D g_malloc0(compbuf_size); - qemu_mutex_init(&decomp_param[i].mutex); - qemu_cond_init(&decomp_param[i].cond); - decomp_param[i].done =3D true; - decomp_param[i].quit =3D false; - qemu_thread_create(decompress_threads + i, "decompress", - do_data_decompress, decomp_param + i, - QEMU_THREAD_JOINABLE); - } - return 0; -exit: - compress_threads_load_cleanup(); - return -1; -} - -void decompress_data_with_multi_threads(QEMUFile *f, void *host, int len) -{ - int thread_count =3D migrate_decompress_threads(); - QEMU_LOCK_GUARD(&decomp_done_lock); - while (true) { - for (int i =3D 0; i < thread_count; i++) { - if (decomp_param[i].done) { - decomp_param[i].done =3D false; - qemu_mutex_lock(&decomp_param[i].mutex); - qemu_get_buffer(f, decomp_param[i].compbuf, len); - decomp_param[i].des =3D host; - decomp_param[i].len =3D len; - qemu_cond_signal(&decomp_param[i].cond); - qemu_mutex_unlock(&decomp_param[i].mutex); - return; - } - } - qemu_cond_wait(&decomp_done_cond, &decomp_done_lock); - } -} - -void populate_compress(MigrationInfo *info) -{ - if (!migrate_compress()) { - return; - } - info->compression =3D g_malloc0(sizeof(*info->compression)); - info->compression->pages =3D compression_counters.pages; - info->compression->busy =3D compression_counters.busy; - info->compression->busy_rate =3D compression_counters.busy_rate; - info->compression->compressed_size =3D compression_counters.compressed= _size; - info->compression->compression_rate =3D compression_counters.compressi= on_rate; -} - -uint64_t compress_ram_pages(void) -{ - return compression_counters.pages; -} - -void update_compress_thread_counts(const CompressParam *param, int bytes_x= mit) -{ - ram_transferred_add(bytes_xmit); - - if (param->result =3D=3D RES_ZEROPAGE) { - stat64_add(&mig_stats.zero_pages, 1); - return; - } - - /* 8 means a header with RAM_SAVE_FLAG_CONTINUE. */ - compression_counters.compressed_size +=3D bytes_xmit - 8; - compression_counters.pages++; -} - -void compress_update_rates(uint64_t page_count) -{ - if (!migrate_compress()) { - return; - } - compression_counters.busy_rate =3D (double)(compression_counters.busy - - compression_counters.compress_thread_busy_prev) / page_count; - compression_counters.compress_thread_busy_prev =3D - compression_counters.busy; - - double compressed_size =3D compression_counters.compressed_size - - compression_counters.compressed_size_prev; - if (compressed_size) { - double uncompressed_size =3D (compression_counters.pages - - compression_counters.compress_pages_pr= ev) * - qemu_target_page_size(); - - /* Compression-Ratio =3D Uncompressed-size / Compressed-size */ - compression_counters.compression_rate =3D - uncompressed_size / compressed_size; - - compression_counters.compress_pages_prev =3D - compression_counters.pages; - compression_counters.compressed_size_prev =3D - compression_counters.compressed_size; - } -} diff --git a/migration/ram-compress.h b/migration/ram-compress.h deleted file mode 100644 index 0d89a2f55e..0000000000 --- a/migration/ram-compress.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * QEMU System Emulator - * - * Copyright (c) 2003-2008 Fabrice Bellard - * Copyright (c) 2011-2015 Red Hat Inc - * - * Authors: - * Juan Quintela - * - * Permission is hereby granted, free of charge, to any person obtaining a= copy - * of this software and associated documentation files (the "Software"), t= o deal - * in the Software without restriction, including without limitation the r= ights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included= in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN - * THE SOFTWARE. - */ - -#ifndef QEMU_MIGRATION_COMPRESS_H -#define QEMU_MIGRATION_COMPRESS_H - -#include "qemu-file.h" -#include "qapi/qapi-types-migration.h" - -enum CompressResult { - RES_NONE =3D 0, - RES_ZEROPAGE =3D 1, - RES_COMPRESS =3D 2 -}; -typedef enum CompressResult CompressResult; - -struct CompressParam { - bool done; - bool quit; - bool trigger; - CompressResult result; - QEMUFile *file; - QemuMutex mutex; - QemuCond cond; - RAMBlock *block; - ram_addr_t offset; - - /* internally used fields */ - z_stream stream; - uint8_t *originbuf; -}; -typedef struct CompressParam CompressParam; - -void compress_threads_save_cleanup(void); -int compress_threads_save_setup(void); - -bool compress_page_with_multi_thread(RAMBlock *block, ram_addr_t offset, - int (send_queued_data(CompressParam = *))); - -int wait_for_decompress_done(void); -void compress_threads_load_cleanup(void); -int compress_threads_load_setup(QEMUFile *f); -void decompress_data_with_multi_threads(QEMUFile *f, void *host, int len); - -void populate_compress(MigrationInfo *info); -uint64_t compress_ram_pages(void); -void update_compress_thread_counts(const CompressParam *param, int bytes_x= mit); -void compress_update_rates(uint64_t page_count); -int compress_send_queued_data(CompressParam *param); -void compress_flush_data(void); - -#endif diff --git a/migration/ram.c b/migration/ram.c index a5320aa889..ceea586b06 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -33,7 +33,6 @@ #include "qemu/madvise.h" #include "qemu/main-loop.h" #include "xbzrle.h" -#include "ram-compress.h" #include "ram.h" #include "migration.h" #include "migration-stats.h" @@ -77,9 +76,10 @@ * worked for pages that were filled with the same char. We switched * it to only search for the zero value. And to avoid confusion with * RAM_SAVE_FLAG_COMPRESS_PAGE just rename it. - */ -/* - * RAM_SAVE_FLAG_FULL was obsoleted in 2009, it can be reused now + * + * RAM_SAVE_FLAG_FULL was obsoleted in 2009. + * + * RAM_SAVE_FLAG_COMPRESS_PAGE (0x100) was removed in QEMU 9.1. */ #define RAM_SAVE_FLAG_FULL 0x01 #define RAM_SAVE_FLAG_ZERO 0x02 @@ -89,7 +89,6 @@ #define RAM_SAVE_FLAG_CONTINUE 0x20 #define RAM_SAVE_FLAG_XBZRLE 0x40 /* 0x80 is reserved in rdma.h for RAM_SAVE_FLAG_HOOK */ -#define RAM_SAVE_FLAG_COMPRESS_PAGE 0x100 #define RAM_SAVE_FLAG_MULTIFD_FLUSH 0x200 /* We can't use any flag that is bigger than 0x200 */ =20 @@ -690,8 +689,7 @@ static int save_xbzrle_page(RAMState *rs, PageSearchSta= tus *pss, qemu_put_buffer(file, XBZRLE.encoded_buf, encoded_len); bytes_xbzrle +=3D encoded_len + 1 + 2; /* - * Like compressed_size (please see update_compress_thread_counts), - * the xbzrle encoded bytes don't count the 8 byte header with + * The xbzrle encoded bytes don't count the 8 byte header with * RAM_SAVE_FLAG_CONTINUE. */ xbzrle_counters.bytes +=3D bytes_xbzrle - 8; @@ -949,7 +947,7 @@ uint64_t ram_get_total_transferred_pages(void) { return stat64_get(&mig_stats.normal_pages) + stat64_get(&mig_stats.zero_pages) + - compress_ram_pages() + xbzrle_counters.pages; + xbzrle_counters.pages; } =20 static void migration_update_rates(RAMState *rs, int64_t end_time) @@ -982,7 +980,6 @@ static void migration_update_rates(RAMState *rs, int64_= t end_time) rs->xbzrle_pages_prev =3D xbzrle_counters.pages; rs->xbzrle_bytes_prev =3D xbzrle_counters.bytes; } - compress_update_rates(page_count); } =20 /* @@ -1288,41 +1285,6 @@ static int ram_save_multifd_page(RAMBlock *block, ra= m_addr_t offset) return 1; } =20 -int compress_send_queued_data(CompressParam *param) -{ - PageSearchStatus *pss =3D &ram_state->pss[RAM_CHANNEL_PRECOPY]; - MigrationState *ms =3D migrate_get_current(); - QEMUFile *file =3D ms->to_dst_file; - int len =3D 0; - - RAMBlock *block =3D param->block; - ram_addr_t offset =3D param->offset; - - if (param->result =3D=3D RES_NONE) { - return 0; - } - - assert(block =3D=3D pss->last_sent_block); - - if (param->result =3D=3D RES_ZEROPAGE) { - assert(qemu_file_buffer_empty(param->file)); - len +=3D save_page_header(pss, file, block, offset | RAM_SAVE_FLAG= _ZERO); - qemu_put_byte(file, 0); - len +=3D 1; - ram_release_page(block->idstr, offset); - } else if (param->result =3D=3D RES_COMPRESS) { - assert(!qemu_file_buffer_empty(param->file)); - len +=3D save_page_header(pss, file, block, - offset | RAM_SAVE_FLAG_COMPRESS_PAGE); - len +=3D qemu_put_qemu_file(file, param->file); - } else { - abort(); - } - - update_compress_thread_counts(param, len); - - return len; -} =20 #define PAGE_ALL_CLEAN 0 #define PAGE_TRY_AGAIN 1 @@ -1374,16 +1336,6 @@ static int find_dirty_block(RAMState *rs, PageSearch= Status *pss) qemu_fflush(f); } } - /* - * If memory migration starts over, we will meet a dirtied page - * which may still exists in compression threads's ring, so we - * should flush the compressed data to make sure the new page - * is not overwritten by the old one in the destination. - * - * Also If xbzrle is on, stop using the data compression at th= is - * point. In theory, xbzrle can do better than compression. - */ - compress_flush_data(); =20 /* Hit the end of the list */ pss->block =3D QLIST_FIRST_RCU(&ram_list.blocks); @@ -2034,37 +1986,6 @@ int ram_save_queue_pages(const char *rbname, ram_add= r_t start, ram_addr_t len, return 0; } =20 -/* - * try to compress the page before posting it out, return true if the page - * has been properly handled by compression, otherwise needs other - * paths to handle it - */ -static bool save_compress_page(RAMState *rs, PageSearchStatus *pss, - ram_addr_t offset) -{ - if (!migrate_compress()) { - return false; - } - - /* - * When starting the process of a new block, the first page of - * the block should be sent out before other pages in the same - * block, and all the pages in last block should have been sent - * out, keeping this order is important, because the 'cont' flag - * is used to avoid resending the block name. - * - * We post the fist page as normal page as compression will take - * much CPU resource. - */ - if (pss->block !=3D pss->last_sent_block) { - compress_flush_data(); - return false; - } - - return compress_page_with_multi_thread(pss->block, offset, - compress_send_queued_data); -} - /** * ram_save_target_page_legacy: save one target page * @@ -2082,10 +2003,6 @@ static int ram_save_target_page_legacy(RAMState *rs,= PageSearchStatus *pss) return res; } =20 - if (save_compress_page(rs, pss, offset)) { - return 1; - } - if (save_zero_page(rs, pss, offset)) { return 1; } @@ -2470,7 +2387,6 @@ static void ram_save_cleanup(void *opaque) ram_bitmaps_destroy(); =20 xbzrle_cleanup(); - compress_threads_save_cleanup(); ram_state_cleanup(rsp); g_free(migration_ops); migration_ops =3D NULL; @@ -3089,15 +3005,9 @@ static int ram_save_setup(QEMUFile *f, void *opaque,= Error **errp) RAMBlock *block; int ret, max_hg_page_size; =20 - if (compress_threads_save_setup()) { - error_setg(errp, "%s: failed to start compress threads", __func__); - return -1; - } - /* migration has already setup the bitmap, reuse it. */ if (!migration_in_colo_state()) { if (ram_init_all(rsp, errp) !=3D 0) { - compress_threads_save_cleanup(); return -1; } } @@ -3268,14 +3178,6 @@ static int ram_save_iterate(QEMUFile *f, void *opaqu= e) =20 rs->target_page_count +=3D pages; =20 - /* - * During postcopy, it is necessary to make sure one whole= host - * page is sent in one chunk. - */ - if (migrate_postcopy_ram()) { - compress_flush_data(); - } - /* * we want to check in the 1st loop, just in case it was t= he 1st * time and we had to sync the dirty bitmap. @@ -3374,8 +3276,6 @@ static int ram_save_complete(QEMUFile *f, void *opaqu= e) } qemu_mutex_unlock(&rs->bitmap_mutex); =20 - compress_flush_data(); - ret =3D rdma_registration_stop(f, RAM_CONTROL_FINISH); if (ret < 0) { qemu_file_set_error(f, ret); @@ -3789,7 +3689,6 @@ int ram_load_postcopy(QEMUFile *f, int channel) void *place_source =3D NULL; RAMBlock *block =3D NULL; uint8_t ch; - int len; =20 addr =3D qemu_get_be64(f); =20 @@ -3806,8 +3705,7 @@ int ram_load_postcopy(QEMUFile *f, int channel) addr &=3D TARGET_PAGE_MASK; =20 trace_ram_load_postcopy_loop(channel, (uint64_t)addr, flags); - if (flags & (RAM_SAVE_FLAG_ZERO | RAM_SAVE_FLAG_PAGE | - RAM_SAVE_FLAG_COMPRESS_PAGE)) { + if (flags & (RAM_SAVE_FLAG_ZERO | RAM_SAVE_FLAG_PAGE)) { block =3D ram_block_from_stream(mis, f, flags, channel); if (!block) { ret =3D -EINVAL; @@ -3902,16 +3800,6 @@ int ram_load_postcopy(QEMUFile *f, int channel) TARGET_PAGE_SIZE); } break; - case RAM_SAVE_FLAG_COMPRESS_PAGE: - tmp_page->all_zero =3D false; - len =3D qemu_get_be32(f); - if (len < 0 || len > compressBound(TARGET_PAGE_SIZE)) { - error_report("Invalid compressed data length: %d", len); - ret =3D -EINVAL; - break; - } - decompress_data_with_multi_threads(f, page_buffer, len); - break; case RAM_SAVE_FLAG_MULTIFD_FLUSH: multifd_recv_sync_main(); break; @@ -3929,11 +3817,6 @@ int ram_load_postcopy(QEMUFile *f, int channel) break; } =20 - /* Got the whole host page, wait for decompress before placing. */ - if (place_needed) { - ret |=3D wait_for_decompress_done(); - } - /* Detect for any possible file errors */ if (!ret && qemu_file_get_error(f)) { ret =3D qemu_file_get_error(f); @@ -4238,11 +4121,7 @@ static int parse_ramblocks(QEMUFile *f, ram_addr_t t= otal_ram_bytes) static int ram_load_precopy(QEMUFile *f) { MigrationIncomingState *mis =3D migration_incoming_get_current(); - int flags =3D 0, ret =3D 0, invalid_flags =3D 0, len =3D 0, i =3D 0; - - if (!migrate_compress()) { - invalid_flags |=3D RAM_SAVE_FLAG_COMPRESS_PAGE; - } + int flags =3D 0, ret =3D 0, invalid_flags =3D 0, i =3D 0; =20 if (migrate_mapped_ram()) { invalid_flags |=3D (RAM_SAVE_FLAG_HOOK | RAM_SAVE_FLAG_MULTIFD_FLU= SH | @@ -4279,16 +4158,12 @@ static int ram_load_precopy(QEMUFile *f) if (flags & invalid_flags) { error_report("Unexpected RAM flags: %d", flags & invalid_flags= ); =20 - if (flags & invalid_flags & RAM_SAVE_FLAG_COMPRESS_PAGE) { - error_report("Received an unexpected compressed page"); - } - ret =3D -EINVAL; break; } =20 if (flags & (RAM_SAVE_FLAG_ZERO | RAM_SAVE_FLAG_PAGE | - RAM_SAVE_FLAG_COMPRESS_PAGE | RAM_SAVE_FLAG_XBZRLE)) { + RAM_SAVE_FLAG_XBZRLE)) { RAMBlock *block =3D ram_block_from_stream(mis, f, flags, RAM_CHANNEL_PRECOPY); =20 @@ -4357,16 +4232,6 @@ static int ram_load_precopy(QEMUFile *f) qemu_get_buffer(f, host, TARGET_PAGE_SIZE); break; =20 - case RAM_SAVE_FLAG_COMPRESS_PAGE: - len =3D qemu_get_be32(f); - if (len < 0 || len > compressBound(TARGET_PAGE_SIZE)) { - error_report("Invalid compressed data length: %d", len); - ret =3D -EINVAL; - break; - } - decompress_data_with_multi_threads(f, host, len); - break; - case RAM_SAVE_FLAG_XBZRLE: if (load_xbzrle(f, addr, host) < 0) { error_report("Failed to decompress XBZRLE page at " @@ -4408,7 +4273,6 @@ static int ram_load_precopy(QEMUFile *f) } } =20 - ret |=3D wait_for_decompress_done(); return ret; } =20 diff --git a/qapi/migration.json b/qapi/migration.json index f721039c6e..a351fd3714 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -229,10 +229,6 @@ # This is only present when the postcopy-blocktime migration # capability is enabled. (Since 3.0) # -# @compression: migration compression statistics, only returned if -# compression feature is on and status is 'active' or 'completed' -# (Since 3.1) -# # @socket-address: Only used for tcp, to know what the real port is # (Since 4.0) # @@ -257,13 +253,6 @@ # average memory load of the virtual CPU indirectly. Note that # zero means guest doesn't dirty memory. (Since 8.1) # -# Features: -# -# @deprecated: Member @compression is deprecated because it is -# unreliable and untested. It is recommended to use multifd -# migration, which offers an alternative compression -# implementation that is reliable and tested. -# # Since: 0.14 ## { 'struct': 'MigrationInfo', @@ -279,7 +268,6 @@ '*blocked-reasons': ['str'], '*postcopy-blocktime': 'uint32', '*postcopy-vcpu-blocktime': ['uint32'], - '*compression': { 'type': 'CompressionStats', 'features': [ 'de= precated' ] }, '*socket-address': ['SocketAddress'], '*dirty-limit-throttle-time-per-round': 'uint64', '*dirty-limit-ring-full-time': 'uint64'} } @@ -401,14 +389,6 @@ # capability on the source VM. The feature is disabled by default. # (since 1.6) # -# @compress: Use multiple compression threads to accelerate live -# migration. This feature can help to reduce the migration -# traffic, by sending compressed pages. Please note that if -# compress and xbzrle are both on, compress only takes effect in -# the ram bulk stage, after that, it will be disabled and only -# xbzrle takes effect, this can help to minimize migration -# traffic. The feature is disabled by default. (since 2.4) -# # @events: generate events for each migration state change (since 2.4) # # @auto-converge: If enabled, QEMU will automatically throttle down @@ -491,18 +471,12 @@ # # Features: # -# @deprecated: Member @compress is deprecated because it is unreliable -# and untested. It is recommended to use multifd migration, which -# offers an alternative compression implementation that is -# reliable and tested. -# # @unstable: Members @x-colo and @x-ignore-shared are experimental. # # Since: 1.2 ## { 'enum': 'MigrationCapability', 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks', - { 'name': 'compress', 'features': [ 'deprecated' ] }, 'events', 'postcopy-ram', { 'name': 'x-colo', 'features': [ 'unstable' ] }, 'release-ram', @@ -562,7 +536,6 @@ # {"state": false, "capability": "rdma-pin-all"}, # {"state": false, "capability": "auto-converge"}, # {"state": false, "capability": "zero-blocks"}, -# {"state": false, "capability": "compress"}, # {"state": true, "capability": "events"}, # {"state": false, "capability": "postcopy-ram"}, # {"state": false, "capability": "x-colo"} @@ -710,27 +683,6 @@ # @announce-step: Increase in delay (in milliseconds) between # subsequent packets in the announcement (Since 4.0) # -# @compress-level: Set the compression level to be used in live -# migration, the compression level is an integer between 0 and 9, -# where 0 means no compression, 1 means the best compression -# speed, and 9 means best compression ratio which will consume -# more CPU. -# -# @compress-threads: Set compression thread count to be used in live -# migration, the compression thread count is an integer between 1 -# and 255. -# -# @compress-wait-thread: Controls behavior when all compression -# threads are currently busy. If true (default), wait for a free -# compression thread to become available; otherwise, send the page -# uncompressed. (Since 3.1) -# -# @decompress-threads: Set decompression thread count to be used in -# live migration, the decompression thread count is an integer -# between 1 and 255. Usually, decompression is at least 4 times as -# fast as compression, so set the decompress-threads to the number -# about 1/4 of compress-threads is adequate. -# # @throttle-trigger-threshold: The ratio of bytes_dirty_period and # bytes_xfer_period to trigger throttling. It is expressed as # percentage. The default value is 50. (Since 5.0) @@ -862,10 +814,6 @@ # # Features: # -# @deprecated: Members @compress-level, @compress-threads, -# @decompress-threads and @compress-wait-thread are deprecated -# because @compression is deprecated. -# # @unstable: Members @x-checkpoint-delay and # @x-vcpu-dirty-limit-period are experimental. # @@ -874,10 +822,6 @@ { 'enum': 'MigrationParameter', 'data': ['announce-initial', 'announce-max', 'announce-rounds', 'announce-step', - { 'name': 'compress-level', 'features': [ 'deprecated' ] }, - { 'name': 'compress-threads', 'features': [ 'deprecated' ] }, - { 'name': 'decompress-threads', 'features': [ 'deprecated' ] }, - { 'name': 'compress-wait-thread', 'features': [ 'deprecated' ] = }, 'throttle-trigger-threshold', 'cpu-throttle-initial', 'cpu-throttle-increment', 'cpu-throttle-tailslow', @@ -909,27 +853,6 @@ # @announce-step: Increase in delay (in milliseconds) between # subsequent packets in the announcement (Since 4.0) # -# @compress-level: Set the compression level to be used in live -# migration, the compression level is an integer between 0 and 9, -# where 0 means no compression, 1 means the best compression -# speed, and 9 means best compression ratio which will consume -# more CPU. -# -# @compress-threads: Set compression thread count to be used in live -# migration, the compression thread count is an integer between 1 -# and 255. -# -# @compress-wait-thread: Controls behavior when all compression -# threads are currently busy. If true (default), wait for a free -# compression thread to become available; otherwise, send the page -# uncompressed. (Since 3.1) -# -# @decompress-threads: Set decompression thread count to be used in -# live migration, the decompression thread count is an integer -# between 1 and 255. Usually, decompression is at least 4 times as -# fast as compression, so set the decompress-threads to the number -# about 1/4 of compress-threads is adequate. -# # @throttle-trigger-threshold: The ratio of bytes_dirty_period and # bytes_xfer_period to trigger throttling. It is expressed as # percentage. The default value is 50. (Since 5.0) @@ -1061,10 +984,6 @@ # # Features: # -# @deprecated: Members @compress-level, @compress-threads, -# @decompress-threads and @compress-wait-thread are deprecated -# because @compression is deprecated. -# # @unstable: Members @x-checkpoint-delay and # @x-vcpu-dirty-limit-period are experimental. # @@ -1078,14 +997,6 @@ '*announce-max': 'size', '*announce-rounds': 'size', '*announce-step': 'size', - '*compress-level': { 'type': 'uint8', - 'features': [ 'deprecated' ] }, - '*compress-threads': { 'type': 'uint8', - 'features': [ 'deprecated' ] }, - '*compress-wait-thread': { 'type': 'bool', - 'features': [ 'deprecated' ] }, - '*decompress-threads': { 'type': 'uint8', - 'features': [ 'deprecated' ] }, '*throttle-trigger-threshold': 'uint8', '*cpu-throttle-initial': 'uint8', '*cpu-throttle-increment': 'uint8', @@ -1145,17 +1056,6 @@ # @announce-step: Increase in delay (in milliseconds) between # subsequent packets in the announcement (Since 4.0) # -# @compress-level: compression level -# -# @compress-threads: compression thread count -# -# @compress-wait-thread: Controls behavior when all compression -# threads are currently busy. If true (default), wait for a free -# compression thread to become available; otherwise, send the page -# uncompressed. (Since 3.1) -# -# @decompress-threads: decompression thread count -# # @throttle-trigger-threshold: The ratio of bytes_dirty_period and # bytes_xfer_period to trigger throttling. It is expressed as # percentage. The default value is 50. (Since 5.0) @@ -1283,10 +1183,6 @@ # # Features: # -# @deprecated: Members @compress-level, @compress-threads, -# @decompress-threads and @compress-wait-thread are deprecated -# because @compression is deprecated. -# # @unstable: Members @x-checkpoint-delay and # @x-vcpu-dirty-limit-period are experimental. # @@ -1297,14 +1193,6 @@ '*announce-max': 'size', '*announce-rounds': 'size', '*announce-step': 'size', - '*compress-level': { 'type': 'uint8', - 'features': [ 'deprecated' ] }, - '*compress-threads': { 'type': 'uint8', - 'features': [ 'deprecated' ] }, - '*compress-wait-thread': { 'type': 'bool', - 'features': [ 'deprecated' ] }, - '*decompress-threads': { 'type': 'uint8', - 'features': [ 'deprecated' ] }, '*throttle-trigger-threshold': 'uint8', '*cpu-throttle-initial': 'uint8', '*cpu-throttle-increment': 'uint8', diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 5d6d8cd634..7a1345f80f 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -427,38 +427,6 @@ static void migrate_set_parameter_str(QTestState *who,= const char *parameter, migrate_check_parameter_str(who, parameter, value); } =20 -static long long migrate_get_parameter_bool(QTestState *who, - const char *parameter) -{ - QDict *rsp; - int result; - - rsp =3D qtest_qmp_assert_success_ref( - who, "{ 'execute': 'query-migrate-parameters' }"); - result =3D qdict_get_bool(rsp, parameter); - qobject_unref(rsp); - return !!result; -} - -static void migrate_check_parameter_bool(QTestState *who, const char *para= meter, - int value) -{ - int result; - - result =3D migrate_get_parameter_bool(who, parameter); - g_assert_cmpint(result, =3D=3D, value); -} - -static void migrate_set_parameter_bool(QTestState *who, const char *parame= ter, - int value) -{ - qtest_qmp_assert_success(who, - "{ 'execute': 'migrate-set-parameters'," - "'arguments': { %s: %i } }", - parameter, value); - migrate_check_parameter_bool(who, parameter, value); -} - static void migrate_ensure_non_converge(QTestState *who) { /* Can't converge with 1ms downtime + 3 mbs bandwidth limit */ @@ -1240,36 +1208,6 @@ test_migrate_tls_x509_finish(QTestState *from, #endif /* CONFIG_TASN1 */ #endif /* CONFIG_GNUTLS */ =20 -static void * -test_migrate_compress_start(QTestState *from, - QTestState *to) -{ - migrate_set_parameter_int(from, "compress-level", 1); - migrate_set_parameter_int(from, "compress-threads", 4); - migrate_set_parameter_bool(from, "compress-wait-thread", true); - migrate_set_parameter_int(to, "decompress-threads", 4); - - migrate_set_capability(from, "compress", true); - migrate_set_capability(to, "compress", true); - - return NULL; -} - -static void * -test_migrate_compress_nowait_start(QTestState *from, - QTestState *to) -{ - migrate_set_parameter_int(from, "compress-level", 9); - migrate_set_parameter_int(from, "compress-threads", 1); - migrate_set_parameter_bool(from, "compress-wait-thread", false); - migrate_set_parameter_int(to, "decompress-threads", 1); - - migrate_set_capability(from, "compress", true); - migrate_set_capability(to, "compress", true); - - return NULL; -} - static int migrate_postcopy_prepare(QTestState **from_ptr, QTestState **to_ptr, MigrateCommon *args) @@ -1370,15 +1308,6 @@ static void test_postcopy_suspend(void) test_postcopy_common(&args); } =20 -static void test_postcopy_compress(void) -{ - MigrateCommon args =3D { - .start_hook =3D test_migrate_compress_start - }; - - test_postcopy_common(&args); -} - static void test_postcopy_preempt(void) { MigrateCommon args =3D { @@ -1561,15 +1490,6 @@ static void test_postcopy_recovery(void) test_postcopy_recovery_common(&args); } =20 -static void test_postcopy_recovery_compress(void) -{ - MigrateCommon args =3D { - .start_hook =3D test_migrate_compress_start - }; - - test_postcopy_recovery_common(&args); -} - #ifndef _WIN32 static void test_postcopy_recovery_double_fail(void) { @@ -2027,48 +1947,6 @@ static void test_precopy_unix_xbzrle(void) test_precopy_common(&args); } =20 -static void test_precopy_unix_compress(void) -{ - g_autofree char *uri =3D g_strdup_printf("unix:%s/migsocket", tmpfs); - MigrateCommon args =3D { - .connect_uri =3D uri, - .listen_uri =3D uri, - .start_hook =3D test_migrate_compress_start, - /* - * Test that no invalid thread state is left over from - * the previous iteration. - */ - .iterations =3D 2, - /* - * We make sure the compressor can always work well even if guest - * memory is changing. See commit 34ab9e9743 where we used to fix - * a bug when only trigger-able with guest memory changing. - */ - .live =3D true, - }; - - test_precopy_common(&args); -} - -static void test_precopy_unix_compress_nowait(void) -{ - g_autofree char *uri =3D g_strdup_printf("unix:%s/migsocket", tmpfs); - MigrateCommon args =3D { - .connect_uri =3D uri, - .listen_uri =3D uri, - .start_hook =3D test_migrate_compress_nowait_start, - /* - * Test that no invalid thread state is left over from - * the previous iteration. - */ - .iterations =3D 2, - /* Same reason for the wait version of precopy compress test */ - .live =3D true, - }; - - test_precopy_common(&args); -} - static void test_precopy_file(void) { g_autofree char *uri =3D g_strdup_printf("file:%s/%s", tmpfs, @@ -3597,12 +3475,6 @@ int main(int argc, char **argv) test_postcopy_preempt); migration_test_add("/migration/postcopy/preempt/recovery/plain", test_postcopy_preempt_recovery); - if (getenv("QEMU_TEST_FLAKY_TESTS")) { - migration_test_add("/migration/postcopy/compress/plain", - test_postcopy_compress); - migration_test_add("/migration/postcopy/recovery/compress/plai= n", - test_postcopy_recovery_compress); - } #ifndef _WIN32 migration_test_add("/migration/postcopy/recovery/double-failures", test_postcopy_recovery_double_fail); @@ -3623,17 +3495,6 @@ int main(int argc, char **argv) test_precopy_unix_plain); migration_test_add("/migration/precopy/unix/xbzrle", test_precopy_unix_xbzrle); - /* - * Compression fails from time to time. - * Put test here but don't enable it until everything is fixed. - */ - if (getenv("QEMU_TEST_FLAKY_TESTS")) { - migration_test_add("/migration/precopy/unix/compress/wait", - test_precopy_unix_compress); - migration_test_add("/migration/precopy/unix/compress/nowait", - test_precopy_unix_compress_nowait); - } - migration_test_add("/migration/precopy/file", test_precopy_file); migration_test_add("/migration/precopy/file/offset", --=20 2.35.3 From nobody Mon Nov 25 09:36:30 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=1715211606; cv=none; d=zohomail.com; s=zohoarc; b=Rn+4/e7OF3rZQbWXX3jRLXSWI/IACWrEws1N9EYj6R6jJsD3WD6tSwXYKFH0IYJ5CIk3wMmOXQefSS9PlnLOAbTfOWIdRTjosWfbPmyHNFEipPHY7WkI5c8JTU+XmRb5Ywaukl4Z8ploKKRd5JyYuoXvwjboTwx2oC6gXxOWqLo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715211606; 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=bu8KuEGO9tZwmVBqA8ncjfkgnv45Vf4NF85Yzr2wLdo=; b=hVfohT6xfmIb7oC4nH+4lNG2sjgHvxN2Q6jydRBssu3oDncFc2lYkevKhXjVeryxA8gZSYGPLd3eshvLZLmPbSa+922UF64W1MYBtkviV4WqcQw8DiO/20gIzhaxulYlV9pZy+DQAouVWSlsXA0T0uFL8zb5qHd0e5VpllamUdI= 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 171521160646819.984124307283537; Wed, 8 May 2024 16:40:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4qpc-0003B0-3v; Wed, 08 May 2024 19:36:16 -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 1s4qpX-0002tm-Eq for qemu-devel@nongnu.org; Wed, 08 May 2024 19:36:11 -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 1s4qpU-0002TL-Ge for qemu-devel@nongnu.org; Wed, 08 May 2024 19:36:11 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [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 35AD15D392; Wed, 8 May 2024 23:36:07 +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 1048113A27; Wed, 8 May 2024 23:36:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id MAU0MmUMPGZ7FQAAD6G6ig (envelope-from ); Wed, 08 May 2024 23:36:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211367; 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=bu8KuEGO9tZwmVBqA8ncjfkgnv45Vf4NF85Yzr2wLdo=; b=sE0J0NvgWCWTzdH2FZFYWeq4X7JbMla58eS8l2+xQXTclrQBpNWPkdiwB4DXFfD1u7izJE BeZTffT40VBcHqYA3QLDrbrOifjBNzzYO6Zp97MhuDEs1b6r3XlfWj0DVm3V+GVqo74KIt PfJoKCzPrZiQ8CztSypfOWTUQHxBLC0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211367; 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=bu8KuEGO9tZwmVBqA8ncjfkgnv45Vf4NF85Yzr2wLdo=; b=oWg6dsCzy6tSKHia1FN9B3nHCGTZ97iYmDXPc8zDks4BnwdYiCzajgstMCaZk4snCcSA7M 8Yn1LZLB3hrRbbDA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211367; 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=bu8KuEGO9tZwmVBqA8ncjfkgnv45Vf4NF85Yzr2wLdo=; b=sE0J0NvgWCWTzdH2FZFYWeq4X7JbMla58eS8l2+xQXTclrQBpNWPkdiwB4DXFfD1u7izJE BeZTffT40VBcHqYA3QLDrbrOifjBNzzYO6Zp97MhuDEs1b6r3XlfWj0DVm3V+GVqo74KIt PfJoKCzPrZiQ8CztSypfOWTUQHxBLC0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211367; 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=bu8KuEGO9tZwmVBqA8ncjfkgnv45Vf4NF85Yzr2wLdo=; b=oWg6dsCzy6tSKHia1FN9B3nHCGTZ97iYmDXPc8zDks4BnwdYiCzajgstMCaZk4snCcSA7M 8Yn1LZLB3hrRbbDA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson Subject: [PULL v2 12/13] migration: Deprecate fd: for file migration Date: Wed, 8 May 2024 20:35:40 -0300 Message-Id: <20240508233541.2403-13-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240508233541.2403-1-farosas@suse.de> References: <20240508233541.2403-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: -2.80 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 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: 1715211608404100003 Content-Type: text/plain; charset="utf-8" The fd: URI can currently trigger two different types of migration, a TCP migration using sockets and a file migration using a plain file. This is in conflict with the recently introduced (8.2) QMP migrate API that takes structured data as JSON-like format. We cannot keep the same backend for both types of migration because with the new API the code is more tightly coupled to the type of transport. This means a TCP migration must use the 'socket' transport and a file migration must use the 'file' transport. If we keep allowing fd: when using a file, this creates an issue when the user converts the old-style (fd:) to the new style ("transport": "socket") invocation because the file descriptor in question has previously been allowed to be either a plain file or a socket. To avoid creating too much confusion, we can simply deprecate the fd: + file usage, which is thought to be rarely used currently and instead establish a 1:1 correspondence between fd: URI and socket transport, and file: URI and file transport. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- docs/about/deprecated.rst | 14 ++++++++++++++ migration/fd.c | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 64b8f838be..f5f111495b 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -473,3 +473,17 @@ both, older and future versions of QEMU. The ``blacklist`` config file option has been renamed to ``block-rpcs`` (to be in sync with the renaming of the corresponding command line option). + +Migration +--------- + +``fd:`` URI when used for file migration (since 9.1) +'''''''''''''''''''''''''''''''''''''''''''''''''''' + +The ``fd:`` URI can currently provide a file descriptor that +references either a socket or a plain file. These are two different +types of migration. In order to reduce ambiguity, the ``fd:`` URI +usage of providing a file descriptor to a plain file has been +deprecated in favor of explicitly using the ``file:`` URI with the +file descriptor being passed as an ``fdset``. Refer to the ``add-fd`` +command documentation for details on the ``fdset`` usage. diff --git a/migration/fd.c b/migration/fd.c index 449adaa2de..aab5189eac 100644 --- a/migration/fd.c +++ b/migration/fd.c @@ -20,6 +20,8 @@ #include "file.h" #include "migration.h" #include "monitor/monitor.h" +#include "qemu/error-report.h" +#include "qemu/sockets.h" #include "io/channel-util.h" #include "trace.h" =20 @@ -32,6 +34,11 @@ void fd_start_outgoing_migration(MigrationState *s, cons= t char *fdname, Error ** return; } =20 + if (!fd_is_socket(fd)) { + warn_report("fd: migration to a file is deprecated." + " Use file: instead."); + } + trace_migration_fd_outgoing(fd); ioc =3D qio_channel_new_fd(fd, errp); if (!ioc) { @@ -61,6 +68,11 @@ void fd_start_incoming_migration(const char *fdname, Err= or **errp) return; } =20 + if (!fd_is_socket(fd)) { + warn_report("fd: migration to a file is deprecated." + " Use file: instead."); + } + trace_migration_fd_incoming(fd); =20 ioc =3D qio_channel_new_fd(fd, errp); --=20 2.35.3 From nobody Mon Nov 25 09:36:30 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=1715211461; cv=none; d=zohomail.com; s=zohoarc; b=W72Rc+AxxXk1qwtbuo8brqIjrKI5O/G70SjOVlk2ScMQ2h2HNeSrNvlKHS6EwK0CRL2zvegpjvaZm6Vrx3O3gbG29mWtRdt6RSWp0Rn4CAwH88WJsnvSa4gyICflQSE/7TSLTqFfKU/DWReZEDGtGdVlPxpBPu4K0/sUBFPzPUQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715211461; 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=NMgdBzy6B6BZ+ndeqFAhyOm8zroXBnrmqFiaqChf4Hw=; b=aVANwfx/VM4WQCRH7fgulng9dVh78tyOB2Wo0oClyM1KiqoTEzDRGd0bQhwBf+CzbYGqyKBuaSXmMltrRkj1jil7jVXURO5Pf/2ZVvK0EsAZoha7Hhf0Prnf+KgRQ2B5J9rXXNjEhEDBfSJ/WMFIx5Pv/s8FOo1txzRXYqpBm+E= 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 171521146152250.38292921230345; Wed, 8 May 2024 16:37:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4qpb-00039g-Mj; Wed, 08 May 2024 19:36:15 -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 1s4qpZ-00033b-U3 for qemu-devel@nongnu.org; Wed, 08 May 2024 19:36:13 -0400 Received: from smtp-out1.suse.de ([2a07:de40:b251:101:10:150:64:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s4qpW-0002UF-Nz for qemu-devel@nongnu.org; Wed, 08 May 2024 19:36:13 -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 4940837725; Wed, 8 May 2024 23:36:09 +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 A00BF13A27; Wed, 8 May 2024 23:36:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id eJGHGWcMPGZ7FQAAD6G6ig (envelope-from ); Wed, 08 May 2024 23:36:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211369; 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=NMgdBzy6B6BZ+ndeqFAhyOm8zroXBnrmqFiaqChf4Hw=; b=AEVAspSlIx6Rf0TpVEmFyuvo9OyUT1tJ6zTPsI6u5b2pHmjzDrfgKbKZT+Gweo3msllM73 v0GHuGurg74UJkyDjHfOdVLB6OcuQTk8d98FcHfmxSTAeb6kwUBXLkHhf/R28c9mrRvGl2 1ytTNXB//Y6gPY28qeL/gKW3BJ/RsNs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211369; 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=NMgdBzy6B6BZ+ndeqFAhyOm8zroXBnrmqFiaqChf4Hw=; b=qU7AIzB9egfDWik8PjZZUKS+z/+H71hWqDzkEVbCnOctI9+eCk49aB5UT5OQ5zj1HusQqM +vSQPbMC76CIDnAA== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=AEVAspSl; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=qU7AIzB9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715211369; 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=NMgdBzy6B6BZ+ndeqFAhyOm8zroXBnrmqFiaqChf4Hw=; b=AEVAspSlIx6Rf0TpVEmFyuvo9OyUT1tJ6zTPsI6u5b2pHmjzDrfgKbKZT+Gweo3msllM73 v0GHuGurg74UJkyDjHfOdVLB6OcuQTk8d98FcHfmxSTAeb6kwUBXLkHhf/R28c9mrRvGl2 1ytTNXB//Y6gPY28qeL/gKW3BJ/RsNs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715211369; 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=NMgdBzy6B6BZ+ndeqFAhyOm8zroXBnrmqFiaqChf4Hw=; b=qU7AIzB9egfDWik8PjZZUKS+z/+H71hWqDzkEVbCnOctI9+eCk49aB5UT5OQ5zj1HusQqM +vSQPbMC76CIDnAA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson , "Dr . David Alan Gilbert" , Markus Armbruster Subject: [PULL v2 13/13] hmp/migration: Fix "migrate" command's documentation Date: Wed, 8 May 2024 20:35:41 -0300 Message-Id: <20240508233541.2403-14-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240508233541.2403-1-farosas@suse.de> References: <20240508233541.2403-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Action: no action X-Rspamd-Queue-Id: 4940837725 X-Rspamd-Server: rspamd1.dmz-prg2.suse.org 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=2a07:de40:b251:101:10:150:64:1; 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: 1715211461876100002 Content-Type: text/plain; charset="utf-8" From: Peter Xu Peter missed the Sphinx HMP document for the "resume/-r" flag in commit 7a4da28b26 ("qmp: hmp: add migrate "resume" option"). Add it. When at it, slightly cleanup the lines around: - Move "detach/-d" to a separate section rather than appending it at the end of the command description. Add a hint for how to query the migration results in detached mode. - Add "postcopy" keyword to "resume/-r" help messages, as it only applies to postcopy. Cc: Dr. David Alan Gilbert Cc: Fabiano Rosas Fixes: 7a4da28b26 ("qmp: hmp: add migrate "resume" option") Reported-by: Markus Armbruster Reviewed-by: Markus Armbruster Signed-off-by: Peter Xu Signed-off-by: Fabiano Rosas --- hmp-commands.hx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index ebca2cdced..06746f0afc 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -912,14 +912,20 @@ ERST .args_type =3D "detach:-d,resume:-r,uri:s", .params =3D "[-d] [-r] uri", .help =3D "migrate to URI (using -d to not wait for completi= on)" - "\n\t\t\t -r to resume a paused migration", + "\n\t\t\t -r to resume a paused postcopy migration", .cmd =3D hmp_migrate, }, =20 =20 SRST -``migrate [-d]`` *uri* - Migrate to *uri* (using -d to not wait for completion). +``migrate [-d] [-r]`` *uri* + Migrate the VM to *uri*. + + ``-d`` + Start the migration process, but do not wait for its completion. To + query an ongoing migration process, use "info migrate". + ``-r`` + Resume a paused postcopy migration. ERST =20 { --=20 2.35.3