From nobody Sat Nov 15 20:49:55 2025 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1747174249; cv=none; d=zohomail.com; s=zohoarc; b=d1i6RMnrzeuFJ8Kj0C26ChcVK39e/t7vGO9P3A+vvdjXNmNPgkZpP9vTIAvTLtXlooGJ7ZPCulCm4bLd6RJsaYzUIp3BxzouTqLrNMyp79c7rb53hcwShX9gNdtm3KyLpB5fnRuqcvRILFto+kgmWsnVIPTptdyK6ph2XE4qhO4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747174249; 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=jt4JB+/eyLHSTi7aofMxYcpO1aDa+89PDt9ClOTPYVM=; b=Wu7WhKRuSJHfLut4N9eay7h0gACG+JRSePs23nJ2maz/6Un1DdYsPDRUBdAj7WrsBGuJtD8NhZ5OvGaDsOG2yTVxnI/IDnOdfsgKQu0dqdKN/9CMqPmoX22nRYettV1bkKF7OJou0D/9dND3hy49MUR3ZJwe0OihcMNuw5OOOe4= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 174717424906586.02553470578812; Tue, 13 May 2025 15:10:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uExoq-00061K-Gm; Tue, 13 May 2025 18:09:48 -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 1uExoc-0005yS-Rm for qemu-devel@nongnu.org; Tue, 13 May 2025 18:09:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uExoa-0006Fs-6T for qemu-devel@nongnu.org; Tue, 13 May 2025 18:09:34 -0400 Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-333-M0qrB1BEPPitQy9RcRvcgg-1; Tue, 13 May 2025 18:09:30 -0400 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-6f54fe13562so101863656d6.3 for ; Tue, 13 May 2025 15:09:30 -0700 (PDT) Received: from x1.com ([85.131.185.92]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6f6e3a0c5e3sm71708616d6.63.2025.05.13.15.09.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 May 2025 15:09:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747174171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jt4JB+/eyLHSTi7aofMxYcpO1aDa+89PDt9ClOTPYVM=; b=c5kszyvdAJBzqf0tAgURxIwvEIliIYNrllINf7+VfE0/JyeDuoJ4PS1tGPKBKTHLrrYal9 mqaegvKYCyhVZ2CLE8vaH2w42+kKiaRhAlRFmCt8Ls2h6RhenT1CpF6zfnNn8TG0IXNcqL ZJBUEficriEL/Foi5RxXez0prhzcRFU= X-MC-Unique: M0qrB1BEPPitQy9RcRvcgg-1 X-Mimecast-MFC-AGG-ID: M0qrB1BEPPitQy9RcRvcgg_1747174169 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747174169; x=1747778969; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jt4JB+/eyLHSTi7aofMxYcpO1aDa+89PDt9ClOTPYVM=; b=IQl+k6F5+ajXxfE1qp2efNk/D8ll44Er8Zl7Slb2xnGJaietOf9MygGvHgs6XLgBUJ GOylQtTzk+CXJ/yqaw2o2HXS9sYFGgPSr/5kW1O4S5btT3Ra1NrBWN5WPGeaFCkMdXDY FDNVYRMEDALWGZ02lEqTGAy8nZcN6p+y2hmcjC+cowqweQS4KyNqY0b1UR+zuBRt3mOQ rQ66khHKqkzVaWZSGNHaPmK1EdLs9XTzVem0Ned6u4Nd7YuaMlvX7Zvg1/kpZT+ioHdV mOAWm1m8+0AXusNeDKCbqkVBNZ1FVg5qah5wdBNdipywe8FVRPKDLyRKk4ufYF5EmGLH BD7w== X-Gm-Message-State: AOJu0YxLLy9d2nhZ5i3PugJ8sRxOXsvgrdz874Q5CfmDMfMUMSIxkkFK ba1vT6gr1gpmt9F9ethIpwYvokTDMLl9QsCM9/oSXGpHFhv0demvC+YlhAX1HazYPTO1LQWm3oz 9PQ/tKCMvi2LXPj3xFSbxJo+v1wWVVBIY4u4hSXOhi8wl31K0Vj+43E/tZCJBDgEpJ77XzX2vg7 OHvKnzO4hMcgAzZe9W9fVBe/2/oTxeQzBchg== X-Gm-Gg: ASbGncsPIfxshyj1AnOzD3+wPt8cqY8roaJw288TViQIAuhFFwS8NrzytNyIfqaPuhg D7e6U8DuhBPs8hMMreb85ZPgVnjHHUqxd2HYlWC3aZZggvlNsubG5N2pbZiZeX2quhjAl+2Z+kW GmkvS8fq10SkMyQKDvOyDLRRrPfJLtNamUNDB7Nu1RcrPFG8K8Mraz6xMI6SkVXCChL5NqNWkaz JZjzUBBO7clR5WyXOUA12vv9Ic32m1OteDuBIEwt09DCQKNB8E8xtUJkXW2ukw2PaEJHrOxXtmR X-Received: by 2002:a05:6214:48b:b0:6f5:3e38:612b with SMTP id 6a1803df08f44-6f896ec06f3mr15740496d6.41.1747174168913; Tue, 13 May 2025 15:09:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEcpuO0TnVb/usDEEYL9kHzBURNazRpwFiplAFSkPLEXB5RzK9oaRRYqVaAb7F3mL7dBZvxDg== X-Received: by 2002:a05:6214:48b:b0:6f5:3e38:612b with SMTP id 6a1803df08f44-6f896ec06f3mr15740116d6.41.1747174168532; Tue, 13 May 2025 15:09:28 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Prasad Pandit , Juraj Marcin , "Dr . David Alan Gilbert" , peterx@redhat.com Subject: [PATCH 1/3] migration: Allow caps to be set when preempt or multifd cap enabled Date: Tue, 13 May 2025 18:09:21 -0400 Message-ID: <20250513220923.518025-2-peterx@redhat.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250513220923.518025-1-peterx@redhat.com> References: <20250513220923.518025-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.549, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1747174250585019000 Content-Type: text/plain; charset="utf-8" With commit 82137e6c8c ("migration: enforce multifd and postcopy preempt to be set before incoming"), and if postcopy preempt / multifd is enabled, one cannot setup any capability because these checks would always fail. (qemu) migrate_set_capability xbzrle off Error: Postcopy preempt must be set before incoming starts To fix it, check existing cap and only raise an error if the specific cap changed. Fixes: 82137e6c8c ("migration: enforce multifd and postcopy preempt to be s= et before incoming") Signed-off-by: Peter Xu Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juraj Marcin --- migration/options.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migration/options.c b/migration/options.c index 3fcd577cd7..162c72cda4 100644 --- a/migration/options.c +++ b/migration/options.c @@ -568,7 +568,7 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps,= Error **errp) return false; } =20 - if (migrate_incoming_started()) { + if (!migrate_postcopy_preempt() && migrate_incoming_started()) { error_setg(errp, "Postcopy preempt must be set before incoming start= s"); return false; @@ -576,7 +576,7 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps,= Error **errp) } =20 if (new_caps[MIGRATION_CAPABILITY_MULTIFD]) { - if (migrate_incoming_started()) { + if (!migrate_multifd() && migrate_incoming_started()) { error_setg(errp, "Multifd must be set before incoming starts"); return false; } --=20 2.49.0 From nobody Sat Nov 15 20:49:55 2025 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1747174226; cv=none; d=zohomail.com; s=zohoarc; b=fTTQfki/r4wc1SEu3KlTgwIBfwstUAYh2eLVSiW4znJf3nvOjPIZnrlM/2OwxdGIGz1tUEg9DlIGyr9mNMWYRbeWbJEgxu5yHIIRc0VCKCcsIYGWfsAGrMBJMSx+bMaxr/UdWP2mZTuseQDZ9r7rVqzypOuQOoeP71HtqCNpSYo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747174226; 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=BZrWDD7DA8j5qiqOylSQQfuIsOy+c9WRkCmwViTrZB4=; b=BoAJYtFchO0eXiNqRnAkQ8L+D+bvsJaN6xxbGurYQY9qeOt+TjipGWc5uk2ZTjCSLuoLCZKWNhscEio4tgM1NAofEgC40Fhfwl0P8Rmpz0NjHTsEzyHx40q2rexFqwncAw2JwzGZ7dkErt7UgP/S+UpJCP3O1hSJKrP0SLOpZ8g= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1747174226695158.73471241957782; Tue, 13 May 2025 15:10:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uExon-00060M-Vp; Tue, 13 May 2025 18:09:46 -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 1uExod-0005yV-2F for qemu-devel@nongnu.org; Tue, 13 May 2025 18:09:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uExob-0006GE-JM for qemu-devel@nongnu.org; Tue, 13 May 2025 18:09:34 -0400 Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-610-HnMVonrSNR6C5pTUhevfLw-1; Tue, 13 May 2025 18:09:31 -0400 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-6f6ef385d1bso37478106d6.3 for ; Tue, 13 May 2025 15:09:31 -0700 (PDT) Received: from x1.com ([85.131.185.92]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6f6e3a0c5e3sm71708616d6.63.2025.05.13.15.09.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 May 2025 15:09:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747174172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BZrWDD7DA8j5qiqOylSQQfuIsOy+c9WRkCmwViTrZB4=; b=dB6Av1msoR3paOulDUhieGYXpYJdeAN7RHXsR2xBTUxRzlGtYx12BDKanZ8s9uZfXZxfFj nIHQEauq+O5MhHboqekOrg8eRO/cNLr9+rv86enm9XuLLTPEJoE3ll5S5xjWd+uKE+I03u CRluizMy45UjyvLRcVKH6qXB331xjTs= X-MC-Unique: HnMVonrSNR6C5pTUhevfLw-1 X-Mimecast-MFC-AGG-ID: HnMVonrSNR6C5pTUhevfLw_1747174171 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747174170; x=1747778970; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BZrWDD7DA8j5qiqOylSQQfuIsOy+c9WRkCmwViTrZB4=; b=qhF43EV5xVOBzkRdYBdPb+9GAL3GpdRtOBRHvJgLSUkqHkywx56UXnTKtaDgSavpd5 r/J/iDHL0JvnruJeKFoOOzSPfJxJqxGDy4o8NmVkTRgHckIEeoLBKJoCtL+JaRNp+5Da Fz6KiE+I995F53ZyJXsVQyXu+wt7pRS+NKmzwgyoo9YnZcnrIm9Xl9Mlb8y2/wZJEYqg 00BjVrEodpCHtAHSSd1uU7q0DZTW/1e3Cs9PF18ar2mJuAgkFScUlnT0ZaFpD6MVSrhh gDcIPH0qEEc2rlwV52QpHfwFJW0Ti0z9SxQj/Dz9hOYjmn4SYva0tu5ojLcuHV4+Tz8O Tfjw== X-Gm-Message-State: AOJu0Yx8c/cxiN+pthtIYznGqzqH/r1wuRtSR/Rlmi4WJkx97BuogNDc j+hHbsDIkLlnugSFPWCG7ZuLLR/CkphWiwfYHkIKxYluJjfDHfVdTGTuY1apPVHbThFPu9QEu4S vg5/v/U2rpAYyzO8lKsDhlcrMqqR78wVuMt6u21+kTyj5Q2XwuWwZNyOMjlfW4LHFOqSBaRyH9h jpftb/ZrKxNv07uzFMEPh8ARMjXSp9OAgthQ== X-Gm-Gg: ASbGncs+m+6xtrBfspZj5O8iPL+76h9GpPfDB4usMli4ipDvK/XkS0YRsQPt+DL9YQu oYn9RgZZqT5l0FZQcVIekaRgYGiBOrbeXf/oNAhy68kDZn/nsiS/id07uLefyH3SC94AZj62/q5 PDLMtEY+cXhnq2HLRwUByAHYGRkOzuwLKb87sZet67FQ/hL5Q1vjMPdPTtbIILFfoNmnH46Nkhd XW3SmBbiIvUub1SDdPoo2vBAcnuPydpssOy6q38cthYX+ZOa5IX+la9SOlmouh3NxhSL+Uvw1W4 X-Received: by 2002:a05:6214:4111:b0:6ea:d629:f47f with SMTP id 6a1803df08f44-6f896ec3367mr16453976d6.42.1747174170534; Tue, 13 May 2025 15:09:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHTwH5WJmONcRPFWO76ka4HrWbQQLL7JjAdptCtMSR1DbWXpb8nRmKO7YHZSPy7s7JlQgEEOQ== X-Received: by 2002:a05:6214:4111:b0:6ea:d629:f47f with SMTP id 6a1803df08f44-6f896ec3367mr16453566d6.42.1747174170060; Tue, 13 May 2025 15:09:30 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Prasad Pandit , Juraj Marcin , "Dr . David Alan Gilbert" , peterx@redhat.com Subject: [PATCH 2/3] migration/hmp: Dump global in "info migrate_parameters" instead Date: Tue, 13 May 2025 18:09:22 -0400 Message-ID: <20250513220923.518025-3-peterx@redhat.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250513220923.518025-1-peterx@redhat.com> References: <20250513220923.518025-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.549, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1747174228755019000 Content-Type: text/plain; charset="utf-8" "info migrate" is the command people would frequently use to query migration status. We may not want it to dump global configurations because dumping the same things over and over won't help. The globals are just more suitable for a parameter dump instead. Hence move it over. Signed-off-by: Peter Xu Reviewed-by: Juraj Marcin --- migration/migration-hmp-cmds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index 49c26daed3..0034dbe47f 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -58,8 +58,6 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict) =20 info =3D qmp_query_migrate(NULL); =20 - migration_global_dump(mon); - if (info->blocked_reasons) { strList *reasons =3D info->blocked_reasons; monitor_printf(mon, "Outgoing migration blocked:\n"); @@ -235,6 +233,8 @@ void hmp_info_migrate_parameters(Monitor *mon, const QD= ict *qdict) { MigrationParameters *params; =20 + migration_global_dump(mon); + params =3D qmp_query_migrate_parameters(NULL); =20 if (params) { --=20 2.49.0 From nobody Sat Nov 15 20:49:55 2025 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1747174243; cv=none; d=zohomail.com; s=zohoarc; b=nMhv+zeNT8ySC79kY/51dUu/N7GMQhjzIiEymBz90hizov/3qDN/SS18VSn7rZoxQaMBbwObXEknQmzjvGdQCl68lJ8UY/TUtXAa0NfeUT0p85s30RnyYr4PSHv6GUFtnZ9UStBLoQOR6dok8Usnvwjf5cI5Y/PgnfmCeWj8UGY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747174243; 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=x2OZvDlJsc5V7iAtEB+Ve0xlxaeX2GOqMGPYkHqennE=; b=EPvSA5cE7jUdJkr9uc2ZDsSUsI+p6/gXkARWTZm4xGHwunwzByJaICg25bL2fvSunyUR7XQLR6fm9/psIgH/9KVbnwhje+Z/tvid30518f+R9k3E32Tn65SQvanHtlRGZkU8AeDz/5qNx6hPbv3RPApuzyGRGrvcetQ6NgQE8ZE= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1747174243740882.6869707632744; Tue, 13 May 2025 15:10:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uExoo-00060Z-0o; Tue, 13 May 2025 18:09:46 -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 1uExof-0005zC-A0 for qemu-devel@nongnu.org; Tue, 13 May 2025 18:09:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uExod-0006Ge-8m for qemu-devel@nongnu.org; Tue, 13 May 2025 18:09:37 -0400 Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-217-MYKRWA0yOUiTdG1oKYXhWg-1; Tue, 13 May 2025 18:09:33 -0400 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-6f53d97079aso204645376d6.0 for ; Tue, 13 May 2025 15:09:33 -0700 (PDT) Received: from x1.com ([85.131.185.92]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6f6e3a0c5e3sm71708616d6.63.2025.05.13.15.09.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 May 2025 15:09:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747174174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=x2OZvDlJsc5V7iAtEB+Ve0xlxaeX2GOqMGPYkHqennE=; b=g4EkasYos27XjwJ4A7RmaZfhUCvUgvb8r7S3Gky/sOncL4aA1yety3ouJ1BKN/CuVvARfZ KjWb3op0a//bhxxtEyiVzrvyT7YJOpFY1+QSkcq7MHrkiL2R9mL02Sg2BHiKczH3nKu/Zm VUgPnOuN8IW/TEh+b545WUCkiaOrht4= X-MC-Unique: MYKRWA0yOUiTdG1oKYXhWg-1 X-Mimecast-MFC-AGG-ID: MYKRWA0yOUiTdG1oKYXhWg_1747174173 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747174172; x=1747778972; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x2OZvDlJsc5V7iAtEB+Ve0xlxaeX2GOqMGPYkHqennE=; b=vr+4vo3D0LHAU7vUlszC8gqpLJuuIChmKr0NHMF13JRlh6IXaIG9iyc/genE+9RiJl mA3Md3oCcaWrfK9bLOuCK4sw+yk0rkS1VqLoS6NMKO7X2mGPBJDIojJn7qsUCX13G+3K 9cq8CvTPnqkjhnRQlSlnKwbLi7JNzIqM+OxyaudYAiw/prn8Nxqy3BrzVl697NNFg2mx Ka4eYUJqn+yb0wg9g81mbHPZzGRQg5qb+MT1q9eW3Fb+QZqtxnp0UcwLPUoo7hMk42PF 5H8gQzc0AQxacbX1E2JcOXJ0KDzTbdR30QluPNhTYzQfGFNP8e5p1gpKpxxP8JddBcTf /cJQ== X-Gm-Message-State: AOJu0YxgGg94ZyGCn4MT+U6dlAgctinRpvoTzkKcOIHoMCuxrEPqbs66 Trctao56Zv+mkhOdbWuhq1dDNwLPbC0gYn56vZ4B0NEQUbPCb0LtaahSs5AGVHqyp3Eq+trC2SD i/y9yj8y8v0hk8l2HgZNnwPxZpGH7nBO9Yt1zhx+HyWJFfNGC2bSjuTZLmEKZPIFSZi2WRihuyg nZLFZ8YXpF/NxcvAAAkaCGXfHtOe75Vy99nw== X-Gm-Gg: ASbGncviByZjAUkjq9vBgn1ZmyZg/cLTblzp1lDT9ou2hvTAH0rUF2/xKeCY4vDQXpg UQrPLZFPdjDWiXhCdeRJvpnlzheXh2BlAvjEovRh7b1zN/2B9A1o1eWXyKmCdp7pDRyv7bSt8w4 HDtvccsBr58UtD16G93Htfei37x/zR75kGOROs+dW0AwuPMVn5/tIhjDZaO8u3qUoO6XJHzO05s DEMRWrK3xCxoqi7gJyrabWDLs8nPz5y3X2NoNd1R4drK36Y0Z/maUuW+aDBfDd8H0atJS88OR8D X-Received: by 2002:a05:6214:5007:b0:6f2:b0a7:3982 with SMTP id 6a1803df08f44-6f896ed979dmr18868456d6.37.1747174172074; Tue, 13 May 2025 15:09:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHvuJx1AeXjmklS8rbujyu5b5WTeHiI/WUYSo/N9Qee40U5NzmH6x+2o2WyDUWgpnxyygiHXg== X-Received: by 2002:a05:6214:5007:b0:6f2:b0a7:3982 with SMTP id 6a1803df08f44-6f896ed979dmr18868076d6.37.1747174171674; Tue, 13 May 2025 15:09:31 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Prasad Pandit , Juraj Marcin , "Dr . David Alan Gilbert" , peterx@redhat.com Subject: [PATCH 3/3] migration/hmp: Add "info migrate -a", reorg the dump Date: Tue, 13 May 2025 18:09:23 -0400 Message-ID: <20250513220923.518025-4-peterx@redhat.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250513220923.518025-1-peterx@redhat.com> References: <20250513220923.518025-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.549, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1747174244819019000 Content-Type: text/plain; charset="utf-8" I did quite some changes to the output of "info migrate". The general rule is: - Put important things at the top - Reuse a single line when things are very relevant, hence reducing lines needed to show the results - Remove almost useless ones (e.g. "normal_bytes", while we also have both "page size" and "normal" pages) - Regroup things, so that related fields will show together - etc. Before this change, it looks like (one example of a completed case): (qemu) info migrate globals: store-global-state: on only-migratable: off send-configuration: on send-section-footer: on send-switchover-start: on clear-bitmap-shift: 18 Migration status: completed total time: 122952 ms downtime: 76 ms setup: 15 ms transferred ram: 130825923 kbytes throughput: 8717.68 mbps remaining ram: 0 kbytes total ram: 16777992 kbytes duplicate: 997263 pages normal: 32622225 pages normal bytes: 130488900 kbytes dirty sync count: 10 page size: 4 kbytes multifd bytes: 117134260 kbytes pages-per-second: 169431 postcopy request count: 5835 precopy ram: 15 kbytes postcopy ram: 13691151 kbytes After this change, giving a few examples: NORMAL PRECOPY: (qemu) info migrate Status: active Time (ms): total=3D14292, setup=3D13, exp_down=3D12223 RAM info: Bandwidth (mbps): 9380.51 Sizes (KB): psize=3D4, total=3D16777992 transferred=3D15697718, remain=3D12383520, precopy=3D2, multifd=3D15697713, postcopy=3D0 Pages: normal=3D3913877, zero=3D599981, rate_per_sec=3D286769 Others: dirty_syncs=3D2, dirty_pages_rate=3D264552 XBZRLE: (qemu) info migrate Status: active Time (ms): total=3D43973, setup=3D16, exp_down=3D75826 RAM info: Bandwidth (mbps): 1496.08 Sizes (KB): psize=3D4, total=3D16777992 transferred=3D15156743, remain=3D12877944, precopy=3D15156768, multifd=3D0, postcopy=3D0 Pages: normal=3D3780458, zero=3D614029, rate_per_sec=3D45567 Others: dirty_syncs=3D2, dirty_pages_rate=3D128624 XBZRLE: size=3D67108864, transferred=3D0, pages=3D0, miss=3D188451 miss_rate=3D0.00, encode_rate=3D0.00, overflow=3D0 POSTCOPY: (qemu) info migrate Status: postcopy-active Time (ms): total=3D40504, setup=3D14, down=3D145 RAM info: Bandwidth (mbps): 6102.65 Sizes (KB): psize=3D4, total=3D16777992 transferred=3D37673019, remain=3D2136404, precopy=3D3, multifd=3D26108780, postcopy=3D11563855 Pages: normal=3D9394288, zero=3D600672, rate_per_sec=3D185875 Others: dirty_syncs=3D3, dirty_pages_rate=3D278378, postcopy_req=3D4078 COMPLETED: (qemu) info migrate Status: completed Time (ms): total=3D43708, setup=3D14, down=3D145 RAM info: Bandwidth (mbps): 7464.50 Sizes (KB): psize=3D4, total=3D16777992 transferred=3D39813725, remain=3D0, precopy=3D3, multifd=3D26108780, postcopy=3D13704436 Pages: normal=3D9928390, zero=3D600672, rate_per_sec=3D167283 Others: dirty_syncs=3D3, postcopy_req=3D5577 INCOMING (WHEN TCP LISTENING): (qemu) info migrate Status: setup Sockets: [ tcp:0.0.0.0:12345 ] Signed-off-by: Peter Xu Reviewed-by: Dr. David Alan Gilbert --- migration/migration-hmp-cmds.c | 158 +++++++++++++++++---------------- hmp-commands-info.hx | 6 +- 2 files changed, 85 insertions(+), 79 deletions(-) diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index 0034dbe47f..c1c10b22ae 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -54,6 +54,7 @@ static void migration_global_dump(Monitor *mon) =20 void hmp_info_migrate(Monitor *mon, const QDict *qdict) { + bool show_all =3D qdict_get_try_bool(qdict, "all", false); MigrationInfo *info; =20 info =3D qmp_query_migrate(NULL); @@ -68,7 +69,7 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict) } =20 if (info->has_status) { - monitor_printf(mon, "Migration status: %s", + monitor_printf(mon, "Status: %s", MigrationStatus_str(info->status)); if (info->status =3D=3D MIGRATION_STATUS_FAILED && info->error_des= c) { monitor_printf(mon, " (%s)\n", info->error_desc); @@ -76,90 +77,111 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict) monitor_printf(mon, "\n"); } =20 - monitor_printf(mon, "total time: %" PRIu64 " ms\n", - info->total_time); - if (info->has_expected_downtime) { - monitor_printf(mon, "expected downtime: %" PRIu64 " ms\n", - info->expected_downtime); - } - if (info->has_downtime) { - monitor_printf(mon, "downtime: %" PRIu64 " ms\n", - info->downtime); + if (info->total_time) { + monitor_printf(mon, "Time (ms): total=3D%" PRIu64, + info->total_time); + if (info->has_setup_time) { + monitor_printf(mon, ", setup=3D%" PRIu64, + info->setup_time); + } + if (info->has_expected_downtime) { + monitor_printf(mon, ", exp_down=3D%" PRIu64, + info->expected_downtime); + } + if (info->has_downtime) { + monitor_printf(mon, ", down=3D%" PRIu64, + info->downtime); + } + monitor_printf(mon, "\n"); } - if (info->has_setup_time) { - monitor_printf(mon, "setup: %" PRIu64 " ms\n", - info->setup_time); + } + + if (info->has_socket_address) { + SocketAddressList *addr; + + monitor_printf(mon, "Sockets: [\n"); + + for (addr =3D info->socket_address; addr; addr =3D addr->next) { + char *s =3D socket_uri(addr->value); + monitor_printf(mon, "\t%s\n", s); + g_free(s); } + monitor_printf(mon, "]\n"); } =20 if (info->ram) { - monitor_printf(mon, "transferred ram: %" PRIu64 " kbytes\n", - info->ram->transferred >> 10); - monitor_printf(mon, "throughput: %0.2f mbps\n", + monitor_printf(mon, "RAM info:\n"); + monitor_printf(mon, " Bandwidth (mbps): %0.2f\n", info->ram->mbps); - monitor_printf(mon, "remaining ram: %" PRIu64 " kbytes\n", - info->ram->remaining >> 10); - monitor_printf(mon, "total ram: %" PRIu64 " kbytes\n", + monitor_printf(mon, " Sizes (KB): psize=3D%" PRIu64 + ", total=3D%" PRIu64 "\n", + info->ram->page_size >> 10, info->ram->total >> 10); - monitor_printf(mon, "duplicate: %" PRIu64 " pages\n", - info->ram->duplicate); - monitor_printf(mon, "normal: %" PRIu64 " pages\n", - info->ram->normal); - monitor_printf(mon, "normal bytes: %" PRIu64 " kbytes\n", - info->ram->normal_bytes >> 10); - monitor_printf(mon, "dirty sync count: %" PRIu64 "\n", - info->ram->dirty_sync_count); - monitor_printf(mon, "page size: %" PRIu64 " kbytes\n", - info->ram->page_size >> 10); - monitor_printf(mon, "multifd bytes: %" PRIu64 " kbytes\n", - info->ram->multifd_bytes >> 10); - monitor_printf(mon, "pages-per-second: %" PRIu64 "\n", + monitor_printf(mon, " transferred=3D%" PRIu64 + ", remain=3D%" PRIu64 ",\n", + info->ram->transferred >> 10, + info->ram->remaining >> 10); + monitor_printf(mon, " precopy=3D%" PRIu64 + ", multifd=3D%" PRIu64 + ", postcopy=3D%" PRIu64, + info->ram->precopy_bytes >> 10, + info->ram->multifd_bytes >> 10, + info->ram->postcopy_bytes >> 10); + + if (info->vfio) { + monitor_printf(mon, ", vfio=3D%" PRIu64, + info->vfio->transferred >> 10); + } + monitor_printf(mon, "\n"); + + monitor_printf(mon, " Pages: normal=3D%" PRIu64 ", zero=3D%" PRIu= 64 + ", rate_per_sec=3D%" PRIu64 "\n", + info->ram->normal, + info->ram->duplicate, info->ram->pages_per_second); + monitor_printf(mon, " Others: dirty_syncs=3D%" PRIu64, + info->ram->dirty_sync_count); =20 if (info->ram->dirty_pages_rate) { - monitor_printf(mon, "dirty pages rate: %" PRIu64 " pages\n", + monitor_printf(mon, ", dirty_pages_rate=3D%" PRIu64, info->ram->dirty_pages_rate); } if (info->ram->postcopy_requests) { - monitor_printf(mon, "postcopy request count: %" PRIu64 "\n", + monitor_printf(mon, ", postcopy_req=3D%" PRIu64, info->ram->postcopy_requests); } - if (info->ram->precopy_bytes) { - monitor_printf(mon, "precopy ram: %" PRIu64 " kbytes\n", - info->ram->precopy_bytes >> 10); - } if (info->ram->downtime_bytes) { - monitor_printf(mon, "downtime ram: %" PRIu64 " kbytes\n", - info->ram->downtime_bytes >> 10); - } - if (info->ram->postcopy_bytes) { - monitor_printf(mon, "postcopy ram: %" PRIu64 " kbytes\n", - info->ram->postcopy_bytes >> 10); + monitor_printf(mon, ", downtime_ram=3D%" PRIu64, + info->ram->downtime_bytes); } if (info->ram->dirty_sync_missed_zero_copy) { - monitor_printf(mon, - "Zero-copy-send fallbacks happened: %" PRIu64 "= times\n", + monitor_printf(mon, ", zerocopy_fallbacks=3D%" PRIu64, info->ram->dirty_sync_missed_zero_copy); } + monitor_printf(mon, "\n"); } =20 if (info->xbzrle_cache) { - monitor_printf(mon, "cache size: %" PRIu64 " bytes\n", - info->xbzrle_cache->cache_size); - monitor_printf(mon, "xbzrle transferred: %" PRIu64 " kbytes\n", - info->xbzrle_cache->bytes >> 10); - monitor_printf(mon, "xbzrle pages: %" PRIu64 " pages\n", - info->xbzrle_cache->pages); - monitor_printf(mon, "xbzrle cache miss: %" PRIu64 " pages\n", - info->xbzrle_cache->cache_miss); - monitor_printf(mon, "xbzrle cache miss rate: %0.2f\n", - info->xbzrle_cache->cache_miss_rate); - monitor_printf(mon, "xbzrle encoding rate: %0.2f\n", - info->xbzrle_cache->encoding_rate); - monitor_printf(mon, "xbzrle overflow: %" PRIu64 "\n", + monitor_printf(mon, "XBZRLE: size=3D%" PRIu64 + ", transferred=3D%" PRIu64 + ", pages=3D%" PRIu64 + ", miss=3D%" PRIu64 "\n" + " miss_rate=3D%0.2f" + ", encode_rate=3D%0.2f" + ", overflow=3D%" PRIu64 "\n", + info->xbzrle_cache->cache_size, + info->xbzrle_cache->bytes, + info->xbzrle_cache->pages, + info->xbzrle_cache->cache_miss, + info->xbzrle_cache->cache_miss_rate, + info->xbzrle_cache->encoding_rate, info->xbzrle_cache->overflow); } =20 + if (!show_all) { + goto out; + } + if (info->has_cpu_throttle_percentage) { monitor_printf(mon, "cpu throttle percentage: %" PRIu64 "\n", info->cpu_throttle_percentage); @@ -191,24 +213,8 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict) g_free(str); visit_free(v); } - if (info->has_socket_address) { - SocketAddressList *addr; - - monitor_printf(mon, "socket address: [\n"); - - for (addr =3D info->socket_address; addr; addr =3D addr->next) { - char *s =3D socket_uri(addr->value); - monitor_printf(mon, "\t%s\n", s); - g_free(s); - } - monitor_printf(mon, "]\n"); - } - - if (info->vfio) { - monitor_printf(mon, "vfio device transferred: %" PRIu64 " kbytes\n= ", - info->vfio->transferred >> 10); - } =20 +out: qapi_free_MigrationInfo(info); } =20 diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index c59cd6637b..639a450ee5 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -475,9 +475,9 @@ ERST =20 { .name =3D "migrate", - .args_type =3D "", - .params =3D "", - .help =3D "show migration status", + .args_type =3D "all:-a", + .params =3D "[-a]", + .help =3D "show migration status (-a: all, dump all status)", .cmd =3D hmp_info_migrate, }, =20 --=20 2.49.0