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=1747760897; cv=none; d=zohomail.com; s=zohoarc; b=gHl8QKvorZ1wGSkz8+BCCARSyIIaOR5REYg+1TGI3z7jsvuxhUc3j+yzorri8M2XvA+Fx0Xmhc9hhOWwFKt1fy4Rsl5zSs3MZxzMERQDzOwf52pgcRYbK1VITd+WF8fWcuTvvZHewkp9qMrPszHwIlOxaegJS8Wipt/59OixV74= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747760897; 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=oFv5D4hEy9mdg+wBMNu8OfO2ONidK/rNd3D0qeEm5jo=; b=Wfm1yKQuwHEkmCKYsOK7pNrrkJIjndUyb4JrVWOnnQ4Lo8Gk4DNrASf8YQahXDvRaaOZGnde5qE65VzGUnykfLpIGIViOFWQJnjokbahOH3iVLvnzAt0p9UtNn0xPsRnyV5dKfV7De/LDEfODcP2xWfAh2l6UYXHSsiB1JxutQ0= 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 1747760897135403.9535817767527; Tue, 20 May 2025 10:08:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uHQRf-0008Qi-DX; Tue, 20 May 2025 13:08:03 -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 1uHQRd-0008OI-MR for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:01 -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 1uHQRb-000153-ME for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:01 -0400 Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-686-B4lkGYMDMpi-hj2GyrwCNw-1; Tue, 20 May 2025 13:07:57 -0400 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-7caee990715so1612596685a.3 for ; Tue, 20 May 2025 10:07:57 -0700 (PDT) Received: from x1.com ([85.131.185.92]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7cd467be47bsm763846585a.16.2025.05.20.10.07.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 May 2025 10:07:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747760878; 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=oFv5D4hEy9mdg+wBMNu8OfO2ONidK/rNd3D0qeEm5jo=; b=YTBayRrAXFD8Z8p2L/t6AvDLaBOH5naTqxoastx6h7iQUgTVBcwYOBqdgd8O4hpCvOEUwE 8HExdwp7veJXNmf+ecuvBMCaDbFPDx3MTVYdxU8g7DYr9A8oTqnEBjdBP6C4wBMzpaRKyC peQBzArp4rdYg/f36Z/Ob4aWpDfyl2M= X-MC-Unique: B4lkGYMDMpi-hj2GyrwCNw-1 X-Mimecast-MFC-AGG-ID: B4lkGYMDMpi-hj2GyrwCNw_1747760877 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747760876; x=1748365676; 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=oFv5D4hEy9mdg+wBMNu8OfO2ONidK/rNd3D0qeEm5jo=; b=Ngkq4s7AaDYZ4bvdHFlPU+iGCODfKzdJkIgl7gQLrtrpTxXZugjKkp1YCdKRKxOz34 sYNAIUJFOSUHh0Vqk/TgUFf0iJ8TYlgdtSJzoPo2+qGkYVgQrmmoATB7d20S5lBQ7T65 peQDbSawOpxDqs5WIe4aMj81urWs9ImPV8BsHHBmuoE/HK240Lto+WwtWFLFs5JnKvzj g+OPI1ROJ//23sE7OZVUKVoxvOZExc9fChSL9xx+Pw59jdOPNCMGmZZYxVNxLu4gtctc KcKkDzqsk/QTG61T9+OGCgNAQ31kjBTpPzsXTpArGoBvV5F3UWWSxzqbXXWd6+pBdznr U8YA== X-Gm-Message-State: AOJu0YwEvQLmta2esOUeyZosRC+GoZdgMW4iYFKZJWZUeKwGRK3ID9Y4 TKVPrLgGSy7qT/HvOdDO4GyddFStASZE1qPZE3Q8jBRQMs1Mw8SwRN57z6TkrSvpEYWXLiAvgVm JfDFbB0BFpt3L32++9EfMtedsHI+/KTh0CQ9iGWhLlagESEuJpxP+bsCTb5q8SBc8QN2WxtJKkl +oSJAxHYfCDSv5MnWiR/aXiKYrgymbSLIUNhdCFQ== X-Gm-Gg: ASbGnct8BuRA+gF3OETHmGyMsyhYR5TvpjFjpDlvTfNcE9QHCp2UlAEQ9TxN5Uwm83q ajIz8QmMIctLN6VbmgjXxBaDmqXAuwSgfEpmAhuvoRurhORxTfsrE/6z7hda6qy//5NO8sVTRP9 h8+v1fWMWZnkmeloM0k8VTGHEFeR6HrcG8Fgyop24MQBdUSZxTUzHoV6KKnt7AZaL/Ar4TgI//V gZKvEFx2ni4fYZMOBW7Ge8Ej/vYyFMp2FEbXBB1SjIBhOZWd/E+NpupD2BvK+S2bBMpi2zuaP+6 X-Received: by 2002:a05:620a:2847:b0:7ca:f04b:3fa2 with SMTP id af79cd13be357-7cd4679cf74mr2588746985a.38.1747760875796; Tue, 20 May 2025 10:07:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHYQBdINaITNXB48B+U532tsejXcavQFUNo6veM7e/fx9HjYiddrbQOCrybaJ4QWMaEPgmYLg== X-Received: by 2002:a05:620a:2847:b0:7ca:f04b:3fa2 with SMTP id af79cd13be357-7cd4679cf74mr2588742985a.38.1747760875446; Tue, 20 May 2025 10:07:55 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Stefan Hajnoczi , peterx@redhat.com, Paolo Bonzini , Thomas Huth Subject: [PULL 01/12] scripts/vmstate-static-checker.py: Add new hpet entry for num_timers Date: Tue, 20 May 2025 13:07:40 -0400 Message-ID: <20250520170751.786787-2-peterx@redhat.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250520170751.786787-1-peterx@redhat.com> References: <20250520170751.786787-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: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.487, 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1747760898745116600 Content-Type: text/plain; charset="utf-8" The old "num_timers" got a rename. See commit 1433e38cc8 ("hpet: do not overwrite properties on post_load") for more details. Teach the script to accept the new name. Cc: Paolo Bonzini Cc: Thomas Huth Reviewed-by: Thomas Huth Link: https://lore.kernel.org/r/20250501151235.636709-1-peterx@redhat.com Signed-off-by: Peter Xu --- scripts/vmstate-static-checker.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/vmstate-static-checker.py b/scripts/vmstate-static-che= cker.py index 25aca839a0..2335e25f94 100755 --- a/scripts/vmstate-static-checker.py +++ b/scripts/vmstate-static-checker.py @@ -91,6 +91,7 @@ def check_fields_match(name, s_field, d_field): 'mem_win_size', 'mig_mem_win_size', 'io_win_addr', 'mig_io_win_addr', 'io_win_size', 'mig_io_win_size'], + 'hpet': ['num_timers', 'num_timers_save'], } =20 if not name in changed_names: --=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=1747760977; cv=none; d=zohomail.com; s=zohoarc; b=K8CkFFF0A6XpMv6zepMqHUfyQ/uhguLGK+s40V5dHGddRCJ92RS+GeAuMHEwH9ZRHH7gIGzMKlhABHUIh11v8944gLE7R2DQEcAEXvJWRFYV4MFKcmbEZ7bw2wZ/N6qeiMfBrhLptKFGEogz3RTTWEyBrDNpImmzWv8AXzphFic= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747760977; 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=rq0T0MzaIFV/IMvPshoRJq+5dempSPF70k6hbdmc2b8=; b=dRHAvskrbs0z9cj4ddwj9cNx6e4IfZRSySNcocRR5JsK7egBHgtAoRVoqfbUUIyhEGHacw/swCHNY4hjJ9oo8y/3otDEnPN2zJkcQmeyOnJ6KhWKhlSa2pPLaVHBb2W1oixVaIgtYgBZJTvohvjwM/+4toFcJBn21NlRuB2MQ2g= 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 1747760977686980.0994488707083; Tue, 20 May 2025 10:09:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uHQRq-00006O-Du; Tue, 20 May 2025 13:08:14 -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 1uHQRg-0008Rf-3p for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:05 -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 1uHQRe-00015a-9o for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:03 -0400 Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-638-vMoPtvSTNsW76_rBieD57Q-1; Tue, 20 May 2025 13:08:00 -0400 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-7c5cd0f8961so1222278085a.1 for ; Tue, 20 May 2025 10:07:59 -0700 (PDT) Received: from x1.com ([85.131.185.92]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7cd467be47bsm763846585a.16.2025.05.20.10.07.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 May 2025 10:07:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747760881; 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=rq0T0MzaIFV/IMvPshoRJq+5dempSPF70k6hbdmc2b8=; b=V5a9mY62RASYbMVjPWmNIjZJ5dFkp0bvtGvFBYhtf8HWOqlKsrkEDWhn7rObAdZldv7JWw q4w2ycprvTWU0wPrlqKewteWjbHVJGDLhpK80QGnctH+7M7xQKmCCo/vah49X3+aT3JD6h 5+s/v1ghnADi+AC6xxQohUS9IiKwvYk= X-MC-Unique: vMoPtvSTNsW76_rBieD57Q-1 X-Mimecast-MFC-AGG-ID: vMoPtvSTNsW76_rBieD57Q_1747760879 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747760878; x=1748365678; 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=rq0T0MzaIFV/IMvPshoRJq+5dempSPF70k6hbdmc2b8=; b=D8IHj9VrzyExzDsPmPqmf0qBYR2Oc5UbX3xB1S70dA+me5ZoMqaK9GaFwlmPTRo9Ic l0nZ0VXIpGX0gB78nPB+ERIVisSqFF/FojimzVLQUQFSoG9PdG5nKmq3McM8RX8K+2+F dnJsoZ37h6HlcAVw8eWky5gW/ClPsTUDRpiTa1thItUBlGxidjiJx81EmMzv3nprVvYh HCBgFmFXP3CHasrajSHRCWow583u+bP7my/lxGEpv0S6mNKaaHOZmoXX8fqcma1tetaw 2lMUmv1CwCI0YAxsuSWZmhZrszrIMgKivEdJ9F8YsezkDks3Gr0AvjWDXkk+oBCwX5D5 4zMw== X-Gm-Message-State: AOJu0Yy4nNQs80vTRR0SewKLLXP5PiTv2oyjY+MlGRzE7Qb0f1zvZuZQ sRKeB9vE5L5EYUVJB25M46FWzBADlIRbmAC8nZrl4riidN4JRCRDncdxtOOHCNWxf3+Dafc9x28 rlYulFPn0oT0B8dMRET5LAt9HiC0gA9YUny9KwW4/Um4Q7n7aWxqXktTsqOwnSCTCYIYFhOgZU3 0hm2SXYk/rgGNP6O6/gwF+tPSHvDdPIdRsvkv4RA== X-Gm-Gg: ASbGnctT01Kp4tipDfuxIBzswoY1BhnhtAC3lqR7ypJeU+Fi1MdNmshUJ0OyAyauYRg hZgeXmNZFmajRYdPwSKS9eKjw8hIOOgJaXyU4cpHo8s+CfejmRr1vKQmB7g0lKaJRaFJb8hUb/x oPcbTiul70meD7PLN+iSj76fib7bjpJT/meNyzPyB90w42o2LxwSF8J3T4bvX9Zb79OdANuuaks ooBe/5+TbbovNOsH4QqaTxwKmbHg20diFtAVYdGIGcD6U0/dOEgVwygKKCPKSYmrhztvS33li2q X-Received: by 2002:a05:620a:d8d:b0:7ca:c9cb:ac1 with SMTP id af79cd13be357-7cd4671895bmr3050488285a.4.1747760878098; Tue, 20 May 2025 10:07:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF8YVVQBo/XHo3OTYsL7tLkltlROFlAi7O3RiahparSKlJO6T2zAjyw/SWzcNVvBBdhyF2wFw== X-Received: by 2002:a05:620a:d8d:b0:7ca:c9cb:ac1 with SMTP id af79cd13be357-7cd4671895bmr3050482385a.4.1747760877501; Tue, 20 May 2025 10:07:57 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Stefan Hajnoczi , peterx@redhat.com, Li Zhijian Subject: [PULL 02/12] qtest/migration/rdma: Enforce RLIMIT_MEMLOCK >= 128MB requirement Date: Tue, 20 May 2025 13:07:41 -0400 Message-ID: <20250520170751.786787-3-peterx@redhat.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250520170751.786787-1-peterx@redhat.com> References: <20250520170751.786787-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: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.487, 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1747760979970116600 Content-Type: text/plain; charset="utf-8" From: Li Zhijian Ensure successful migration over RDMA by verifying that RLIMIT_MEMLOCK is set to at least 128MB. This allocation is necessary due to the requirement to pin significant portions of guest memory, typically exceeding 100MB in this test, while the remainder is transmitted as compressed zero pages. Otherwise, it will fail with: stderr: qemu-system-x86_64: cannot get rkey qemu-system-x86_64: error while loading state section id 2(ram) qemu-system-x86_64: load of migration failed: Operation not permitted qemu-system-x86_64: rdma migration: recv polling control error! qemu-system-x86_64: RDMA is in an error state waiting migration to abort! qemu-system-x86_64: failed to save SaveStateEntry with id(name): 2(ram): -1 qemu-system-x86_64: Channel error: Operation not permitted Reported-by: Peter Xu Signed-off-by: Li Zhijian Link: https://lore.kernel.org/r/20250509014211.1272640-1-lizhijian@fujitsu.= com Signed-off-by: Peter Xu --- tests/qtest/migration/precopy-tests.c | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/qtest/migration/precopy-tests.c b/tests/qtest/migration/= precopy-tests.c index 87b0a7e8ef..5be1cd5742 100644 --- a/tests/qtest/migration/precopy-tests.c +++ b/tests/qtest/migration/precopy-tests.c @@ -101,6 +101,35 @@ static void test_precopy_unix_dirty_ring(void) =20 #ifdef CONFIG_RDMA =20 +#include + +/* + * During migration over RDMA, it will try to pin portions of guest memory, + * typically exceeding 100MB in this test, while the remainder will be + * transmitted as compressed zero pages. + * + * REQUIRED_MEMLOCK_SZ indicates the minimal mlock size in the current con= text. + */ +#define REQUIRED_MEMLOCK_SZ (128 << 20) /* 128MB */ + +/* check 'ulimit -l' */ +static bool mlock_check(void) +{ + uid_t uid; + struct rlimit rlim; + + uid =3D getuid(); + if (uid =3D=3D 0) { + return true; + } + + if (getrlimit(RLIMIT_MEMLOCK, &rlim) !=3D 0) { + return false; + } + + return rlim.rlim_cur >=3D REQUIRED_MEMLOCK_SZ; +} + #define RDMA_MIGRATION_HELPER "scripts/rdma-migration-helper.sh" static int new_rdma_link(char *buffer) { @@ -136,6 +165,11 @@ static void test_precopy_rdma_plain(void) { char buffer[128] =3D {}; =20 + if (!mlock_check()) { + g_test_skip("'ulimit -l' is too small, require >=3D128M"); + return; + } + if (new_rdma_link(buffer)) { g_test_skip("No rdma link available\n" "# To enable the test:\n" --=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=1747761005; cv=none; d=zohomail.com; s=zohoarc; b=JuGaXYfStWlW5cgL11OwoUdKRyKX8ih0KycMsi1zhbvHvrlzUPkTL8twqX2/fqKFdGqvCyf8b8/ZWr8OEXKRuSe2+R2YO0Mt5RHxjeRHf2xI/WN90d/oeWbfq/9Xzk0B/ZEzMDr5Jh5ZfjCZYCRRELqotDQZ7WoL/mqhEQM1f9s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747761005; 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=qY1AUIA6ijEBYZA6sdiasVuRJE305+tULljHJYN/mSM=; b=NFoat/g9Rnc7JOWojKfXukK3JfzXPnNX4RjyKrW34AroeNJTIQ/FtSjvR9guqwmeAc6N/Rs85SRpHilLXcxIZLLzTffcZUdWDQVAAhtQ/WqVd9A5+3k+RPCFGW3lzCnVfQTHoXCh7YzjzqsM1XCIVae16XF03cVZml+MRu1bn7g= 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 1747761005383968.8001480962753; Tue, 20 May 2025 10:10:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uHQRr-00007u-0q; Tue, 20 May 2025 13:08: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 1uHQRi-0008Rw-9D for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:07 -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 1uHQRg-000165-9F for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:06 -0400 Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-13-A1DGnXsxOyyznupgk-R9wA-1; Tue, 20 May 2025 13:08:00 -0400 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-7c5b9333642so679833885a.3 for ; Tue, 20 May 2025 10:08:00 -0700 (PDT) Received: from x1.com ([85.131.185.92]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7cd467be47bsm763846585a.16.2025.05.20.10.07.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 May 2025 10:07:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747760883; 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=qY1AUIA6ijEBYZA6sdiasVuRJE305+tULljHJYN/mSM=; b=UbLfwEpVtXXc9fI3h0BxjRhPKrDHyfabbWcsPoMSK208RUkj3VDsvCN7ryQhwhRwoxmlXm BzPdcfSDmOOKt2Rn40KL3RpS96unGNz38BeSDSgYzAO4wIIOMYXwQ1ES0RjOAD0qjcTC/u u6IeSlwCHUvugnMW2UDTZI15DIChZfA= X-MC-Unique: A1DGnXsxOyyznupgk-R9wA-1 X-Mimecast-MFC-AGG-ID: A1DGnXsxOyyznupgk-R9wA_1747760880 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747760879; x=1748365679; 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=qY1AUIA6ijEBYZA6sdiasVuRJE305+tULljHJYN/mSM=; b=DNgJ8sygAQnWqwU1XTOblaEj3eW9RHtDISRTuqn6AuGu2RkIMFgRmzBlUwTqv2eek7 yk8oajeV3B/R79i+3SNmdAxFy0x67EoUe94DGHgIoQVVCOEBYWQYRu4LMG/oiKP1IY6l MEPbZGggEwSE6TdtpJrTTkKwkgQPtFeGYwyIKLBQcTOyxp75e3UQRMYR2Bo2J5eMslnQ zW1L48dYv6Wns584sAlpw3t/hZgDTLWUjdfKoaEAIn52c9s9BtRAWiEQUnBsTOjFtuSC 8tHPw0mbtdQEt8NmFejxILW4VmLSd6zahi8XYs5Srrof157C5oaNZH1TDTy321Q4lpgh B4Ug== X-Gm-Message-State: AOJu0Yz47MnbjaEIRFuX8d8ocyDUdjlvIbWsls/0P+glEnJmBvrwFlkf VsBL2pXaWtso6d/yVZHeZXXQn4wRz+E9d7d1ud69NJQXzriOEImNIohdHxeAfTr3IJA5PhkCVvm zrCjcQA12fak1lo8+Chqw/ujKFvD0M39Dk7MJMJ9HWPd26W6/t5PeGC+YD0gKA71H7rWTTLUSfZ SJnxgL3g29JSLDXdUL5BfaphHPd8CbRHLAakzHbg== X-Gm-Gg: ASbGncsmHCHd41PtNU7spz4t2Ms4qY28bIuK1QKWY2nDS2JNZtjK8HOrap4DH3XPPuK WTTzEqFgFVa7cbN0oWkjxP9DBj5m/Ye0yVALhBUNQ+1nTvAzJjLR09YpEyikRCuPMQRB+aDkaSJ iFGrv4FNxkdWXSsG4HnQI3mP8qn6DCPSFWHzGbM5VI3o0g58M0C7Qiyrkx1HErWGyOfF7l2f+Pa Glf3TSDPPmDDYpEkDQyclxPwOySUXVI/VL1ahmTPsssGjkWdiQmja6FDKTs0PU6nnK1NY/dKvKj X-Received: by 2002:a05:620a:370a:b0:7c5:5e5b:2fdb with SMTP id af79cd13be357-7cd4677d69cmr2912243185a.41.1747760879303; Tue, 20 May 2025 10:07:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGAOBQaU2XywMsAhySyQMLL1//jg8KqIle/kmQfUg/MKeKythcQ7TrQy2L7nfiQUJsjotsAsw== X-Received: by 2002:a05:620a:370a:b0:7c5:5e5b:2fdb with SMTP id af79cd13be357-7cd4677d69cmr2912235685a.41.1747760878670; Tue, 20 May 2025 10:07:58 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Stefan Hajnoczi , peterx@redhat.com, Li Zhijian , Jack Wang , "Michael R. Galaxy" , Yu Zhang Subject: [PULL 03/12] qtest/migration/rdma: Add test for rdma migration with ipv6 Date: Tue, 20 May 2025 13:07:42 -0400 Message-ID: <20250520170751.786787-4-peterx@redhat.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250520170751.786787-1-peterx@redhat.com> References: <20250520170751.786787-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: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.487, 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1747761006483116600 Content-Type: text/plain; charset="utf-8" From: Li Zhijian Recently, we removed ipv6 restriction[0] from RDMA migration, add a test for it. [0] https://lore.kernel.org/qemu-devel/20250326095224.9918-1-jinpu.wang@ion= os.com/ Cc: Jack Wang Cc: Michael R. Galaxy Cc: Peter Xu Cc: Yu Zhang Reviewed-by: Jack Wang Signed-off-by: Li Zhijian Link: https://lore.kernel.org/r/20250513012207.2867069-1-lizhijian@fujitsu.= com [peterx: Fix over long lines] Signed-off-by: Peter Xu --- tests/qtest/migration/precopy-tests.c | 21 ++++++++-- scripts/rdma-migration-helper.sh | 57 ++++++++++++++++++++++----- 2 files changed, 65 insertions(+), 13 deletions(-) diff --git a/tests/qtest/migration/precopy-tests.c b/tests/qtest/migration/= precopy-tests.c index 5be1cd5742..a62d3c5378 100644 --- a/tests/qtest/migration/precopy-tests.c +++ b/tests/qtest/migration/precopy-tests.c @@ -131,12 +131,13 @@ static bool mlock_check(void) } =20 #define RDMA_MIGRATION_HELPER "scripts/rdma-migration-helper.sh" -static int new_rdma_link(char *buffer) +static int new_rdma_link(char *buffer, bool ipv6) { char cmd[256]; bool verbose =3D g_getenv("QTEST_LOG"); =20 - snprintf(cmd, sizeof(cmd), "%s detect %s", RDMA_MIGRATION_HELPER, + snprintf(cmd, sizeof(cmd), "IP_FAMILY=3D%s %s detect %s", + ipv6 ? "ipv6" : "ipv4", RDMA_MIGRATION_HELPER, verbose ? "" : "2>/dev/null"); =20 FILE *pipe =3D popen(cmd, "r"); @@ -161,7 +162,7 @@ static int new_rdma_link(char *buffer) return -1; } =20 -static void test_precopy_rdma_plain(void) +static void __test_precopy_rdma_plain(bool ipv6) { char buffer[128] =3D {}; =20 @@ -170,7 +171,7 @@ static void test_precopy_rdma_plain(void) return; } =20 - if (new_rdma_link(buffer)) { + if (new_rdma_link(buffer, ipv6)) { g_test_skip("No rdma link available\n" "# To enable the test:\n" "# Run \'" RDMA_MIGRATION_HELPER " setup\' with root t= o " @@ -193,6 +194,16 @@ static void test_precopy_rdma_plain(void) =20 test_precopy_common(&args); } + +static void test_precopy_rdma_plain(void) +{ + __test_precopy_rdma_plain(false); +} + +static void test_precopy_rdma_plain_ipv6(void) +{ + __test_precopy_rdma_plain(true); +} #endif =20 static void test_precopy_tcp_plain(void) @@ -1226,6 +1237,8 @@ static void migration_test_add_precopy_smoke(Migratio= nTestEnv *env) #ifdef CONFIG_RDMA migration_test_add("/migration/precopy/rdma/plain", test_precopy_rdma_plain); + migration_test_add("/migration/precopy/rdma/plain/ipv6", + test_precopy_rdma_plain_ipv6); #endif } =20 diff --git a/scripts/rdma-migration-helper.sh b/scripts/rdma-migration-help= er.sh index a39f2fb0e5..d784d1566a 100755 --- a/scripts/rdma-migration-helper.sh +++ b/scripts/rdma-migration-helper.sh @@ -8,23 +8,44 @@ get_ipv4_addr() head -1 | tr -d '\n' } =20 +get_ipv6_addr() { + ipv6=3D$(ip -6 -o addr show dev "$1" | + sed -n 's/.*[[:blank:]]inet6[[:blank:]]*\([^[:blank:]/]*\).*/\1/p'= | + head -1 | tr -d '\n') + + [ $? -eq 0 ] || return + + if [[ "$ipv6" =3D~ ^fe80: ]]; then + echo -n "[$ipv6%$1]" + else + echo -n "[$ipv6]" + fi +} + # existing rdma interfaces rdma_interfaces() { - rdma link show | sed -nE 's/^link .* netdev ([^ ]+).*$/\1 /p' + rdma link show | sed -nE 's/^link .* netdev ([^ ]+).*$/\1 /p' | + grep -Ev '^(lo|tun|tap)' } =20 # existing valid ipv4 interfaces ipv4_interfaces() { - ip -o addr show | awk '/inet / {print $2}' | grep -v -w lo + ip -o addr show | awk '/inet / {print $2}' | grep -Ev '^(lo|tun|tap)' +} + +ipv6_interfaces() +{ + ip -o addr show | awk '/inet6 / {print $2}' | grep -Ev '^(lo|tun|tap)' } =20 rdma_rxe_detect() { + family=3D$1 for r in $(rdma_interfaces) do - ipv4_interfaces | grep -qw $r && get_ipv4_addr $r && return + "$family"_interfaces | grep -qw $r && get_"$family"_addr $r && ret= urn done =20 return 1 @@ -32,16 +53,23 @@ rdma_rxe_detect() =20 rdma_rxe_setup() { - for i in $(ipv4_interfaces) + family=3D$1 + for i in $("$family"_interfaces) do - rdma_interfaces | grep -qw $i && continue + if rdma_interfaces | grep -qw $i; then + echo "$family: Reuse the existing rdma/rxe ${i}_rxe" \ + "for $i with $(get_"$family"_addr $i)" + return + fi + rdma link add "${i}_rxe" type rxe netdev "$i" && { - echo "Setup new rdma/rxe ${i}_rxe for $i with $(get_ipv4_addr = $i)" + echo "$family: Setup new rdma/rxe ${i}_rxe" \ + "for $i with $(get_"$family"_addr $i)" return } done =20 - echo "Failed to setup any new rdma/rxe link" >&2 + echo "$family: Failed to setup any new rdma/rxe link" >&2 return 1 } =20 @@ -50,6 +78,12 @@ rdma_rxe_clean() modprobe -r rdma_rxe } =20 +IP_FAMILY=3D${IP_FAMILY:-ipv4} +if [ "$IP_FAMILY" !=3D "ipv6" ] && [ "$IP_FAMILY" !=3D "ipv4" ]; then + echo "Unknown ip family '$IP_FAMILY', only ipv4 or ipv6 is supported."= >&2 + exit 1 +fi + operation=3D${1:-detect} =20 command -v rdma >/dev/null || { @@ -62,9 +96,14 @@ if [ "$operation" =3D=3D "setup" ] || [ "$operation" =3D= =3D "clean" ]; then echo "Root privilege is required to setup/clean a rdma/rxe link" >= &2 exit 1 } - rdma_rxe_"$operation" + if [ "$operation" =3D=3D "setup" ]; then + rdma_rxe_setup ipv4 + rdma_rxe_setup ipv6 + else + rdma_rxe_clean + fi elif [ "$operation" =3D=3D "detect" ]; then - rdma_rxe_detect + rdma_rxe_detect "$IP_FAMILY" else echo "Usage: $0 [setup | detect | clean]" fi --=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=1747760983; cv=none; d=zohomail.com; s=zohoarc; b=eggm6dtCkW/aQQSaOhQPQheWlN7uKfZCRHaFnZV18zWMeC9MgOeBcuMx54Bs2MlHy+miDxCdxDop5ScGyKu4eNGCClzmoyf/Rn6Vz7uIaU5aHzYtoiIGsJ8c1DVYoaUCF0jimkz1tSZiEVU5YnVmwi1C1SDBtZ3Yk3dIfI26m/E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747760983; 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=cK2Qrag8lsMimqo4w6ggG/jQzApxY9jejaQoEEkbUak=; b=iL8wBfLI+7lE0z5zuHW0KF1THHdVluLnYJ5Us3Xw+yZKtK6172eaLFFUZ+hAeGnqiaT64KutnPNA5gLHf+GwpqOwHW8c33cy1w6K3Df0dHmJtu8tOWE2sWbOV6kwmgd/z7ju9Bu8lrsa63tSg9zfU8ZqnpjaIdMUhzj1J34pAQg= 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 1747760982872162.54426828852638; Tue, 20 May 2025 10:09:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uHQRr-000093-DZ; Tue, 20 May 2025 13:08: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 1uHQRi-0008S2-EF for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:07 -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 1uHQRg-00016D-HY for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:06 -0400 Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-277-hq69AJzvOH2kWTlm1eGuAw-1; Tue, 20 May 2025 13:08:02 -0400 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-7c579d37eeeso916967385a.0 for ; Tue, 20 May 2025 10:08:02 -0700 (PDT) Received: from x1.com ([85.131.185.92]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7cd467be47bsm763846585a.16.2025.05.20.10.07.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 May 2025 10:07:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747760883; 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=cK2Qrag8lsMimqo4w6ggG/jQzApxY9jejaQoEEkbUak=; b=ehQ/Vybav/7YKrmVqcLpGoDojYWkoDsLidIBI4Ie3bXTkJmzmZ8aMMp9eBG84c9Vr85cmo 6Ef6b0x7J0o1zEZYuzNPY/coW5JFnOz1e4902gZD1YQR2oLsc4abLHUldqRvm1a/02EX7D C6iYM70Q9h3U8NZxySObKoQNo3l6jfI= X-MC-Unique: hq69AJzvOH2kWTlm1eGuAw-1 X-Mimecast-MFC-AGG-ID: hq69AJzvOH2kWTlm1eGuAw_1747760882 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747760881; x=1748365681; 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=cK2Qrag8lsMimqo4w6ggG/jQzApxY9jejaQoEEkbUak=; b=Pa2R1/oIXNSL+Qn3pdutHTIPLgYmFNfKs75CSFy5/Uf2DYPfRsBSTMVV0jCiWN62Gg Pdiw9mm7JImTpcVIslhVP2Oq65SwvV3a1rGJRq9MawqpHGxUAKemTh8xlDpQHEU7BdJN YWZsxtvuP5Vk0M/e8bMIwAgIOkP1xPjVSDDtotRfSEDHWFC77K6YJ6pBv2SVCs/Twej1 cFao3WZ7heY9s4wD/Kp3rOhXiVA4WiOk1UwfkIagXiDwpAQncs+wniNlJg28q6fVD3Rd Mb5p0K+b8FFBfxVba4YEg/bqbbQSN7YKwJdPN1dgI8eb1cN0QRhmgJXa8sSX4smlzk7Z lQ2Q== X-Gm-Message-State: AOJu0YzguC90OOJMNh809gGNG76Yy1zqGko2HgzBI+eGJhtQBY4PNECK crGZS6OqdN9+OnDAC13yzIQ5viDsYiJMPazdsu5AIpYs+kc8rnlQCdxEXiPuv5x1IuJSzMupj4q 2ImZ7k7yR6D9YgBGMKdPqZ7gpoD+1aFy3Ms2zjT4lAJBXNFQN7Dxs2wf2V0qMQ1gZtCcqo8i6zs 7JJRc+fv4HmebHH3uiEqJpMxl66YdS5OG5P3CaLA== X-Gm-Gg: ASbGncuqOCNHCkM+iZPUcXTQVY+GEdFBVxtV5sDn+dhHLgpnWGDklTzMbfK0wurahWx 0ZzuB/lCj1N+yfsm83LPqwZDM5VnMFOy/KGDeLe4xKPaif/KoQZEFddn2T7108LRznKKBEgtPcg 9AvZIZx9kI8X/LhrjW6Kd1FetgfBdzPNZ+8Phxg/q+0wUw0x2AYCH5QfTGtzH+jFdDT7xgBBED2 DCSu6nzjK9lGz4k+CY+6Xe1hH7Y70holkEnMDLt+ipilKJqfgPJRhQxVxFFb8dz8B8tK8o4p5mz X-Received: by 2002:a05:620a:1793:b0:7c9:256d:f6b6 with SMTP id af79cd13be357-7cd47f0f301mr2305922185a.2.1747760881176; Tue, 20 May 2025 10:08:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEkKLwIkorKdzOcSpiP4fteKVOeDjGU5s9tyL22DM/26CHeQLU8oy8w/gxo2dhYyVPWRdSPoQ== X-Received: by 2002:a05:620a:1793:b0:7c9:256d:f6b6 with SMTP id af79cd13be357-7cd47f0f301mr2305918085a.2.1747760880768; Tue, 20 May 2025 10:08:00 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Stefan Hajnoczi , peterx@redhat.com Subject: [PULL 04/12] ci: Re-enable python subtests in qtest migration suite Date: Tue, 20 May 2025 13:07:43 -0400 Message-ID: <20250520170751.786787-5-peterx@redhat.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250520170751.786787-1-peterx@redhat.com> References: <20250520170751.786787-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: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.487, 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1747760983924116600 Content-Type: text/plain; charset="utf-8" From: Fabiano Rosas The migration compatibility tests have been running with the PYTHON variable unset to avoid running a broken test. The faulty test has since been removed, so we can enable the python tests once again. Aside from the broken test, only one other test uses python and I have been running it locally ever since, so this commit should not expose any new bug. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas Link: https://lore.kernel.org/r/20250513133353.23022-2-farosas@suse.de Signed-off-by: Peter Xu --- .gitlab-ci.d/buildtest.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index 248aaed137..fbad34138c 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -227,14 +227,6 @@ build-previous-qemu: # testing an old QEMU against new features/tests that it is not # compatible with. - cd build-previous - # Don't allow python-based tests to run. The - # vmstate-checker-script test has a race that causes it to fail - # sometimes. It cannot be fixed it because this job runs the test - # from the old QEMU version. The test will be removed on master, - # but this job will only see the change in the next release. - # - # TODO: remove this line after 9.2 release - - unset PYTHON # old to new - QTEST_QEMU_BINARY_SRC=3D./qemu-system-${TARGET} QTEST_QEMU_BINARY=3D../build/qemu-system-${TARGET} ./tests/qtest= /migration-test --=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=1747760907; cv=none; d=zohomail.com; s=zohoarc; b=eUHG55+LFCHCctDLIutU2oAzxsudp0mEesbSMfl2WSzytfxEXkszjotmks2jWNfluPVs2/IuGtx9o6Sio1H2BC51/whur862S0W9NDOIk3YNFdNIJnhZmq7qBz/Z2A0aRpZMBaY8qrpSACLBRelEhT+Clq1ZqWO5ZDEjwCiOj+o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747760907; 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=Mg57tDr1hLSW4EBlF63M1IEQEijGGkMw39lQFkGM4v8=; b=S+CviPRZYrXxeOm/wnwbRZU9A8K+KO4VC+HKCgduKwJk73ZAJLiQWu0C728zFe+uDRr9x+HZMrACWduW4FuIjWIVRMKdXEa7yDbKvQGI8/7DDyMboLFa3wrGZStCfGsCq9B0vuTdW3NZNh2ser7p4/r7vjZWwa6ZenrGAHfSWng= 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 1747760907842274.6550811517368; Tue, 20 May 2025 10:08:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uHQRt-0000D6-P5; Tue, 20 May 2025 13:08: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 1uHQRj-0008St-Tb for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:12 -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 1uHQRh-00016i-S2 for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:07 -0400 Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-458-4bkymGRUNOyustuN5Wk0jg-1; Tue, 20 May 2025 13:08:03 -0400 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-7c5f876bfe0so1067329385a.3 for ; Tue, 20 May 2025 10:08:03 -0700 (PDT) Received: from x1.com ([85.131.185.92]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7cd467be47bsm763846585a.16.2025.05.20.10.08.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 May 2025 10:08:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747760885; 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=Mg57tDr1hLSW4EBlF63M1IEQEijGGkMw39lQFkGM4v8=; b=iMZiNr27Xnn4Bg23jkiedz/5aFA1vyTc/IpGcdz7BHHapFMc/w5AlTR6jCjMb8mSzSCDmE Nb2ohYUfchK9OkEfD5oUSu6gBlkYPi4Wd7mT7SH2expBeJXrdB9KAI+ZXdS3v8d+znTWJI xBk3O4Tm/RiGQlj2QKNEf8TtUTt3EWs= X-MC-Unique: 4bkymGRUNOyustuN5Wk0jg-1 X-Mimecast-MFC-AGG-ID: 4bkymGRUNOyustuN5Wk0jg_1747760883 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747760883; x=1748365683; 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=Mg57tDr1hLSW4EBlF63M1IEQEijGGkMw39lQFkGM4v8=; b=YGG06IUfKPHj2Octz3rMCbGXEjjV6m3ZJUVJWoBj57zLmuvR+YSZbVWGu/rmdF6Xr1 ElcCpQIqkgcb6MutYk5iKPV94vqSQvCjoql/r9ptYBP5VDs0EYNeZVVnhGCUx2Ln1or3 0iKf0+sg85EgcT10CUhYGvpPGMd28GdQ9hWzNfRR74wkURatG/gg+1y6GT8JmB9nhVZD TXYWV9wvf3vUOcVdbODLhX8EdkQnluaUyNdcgeeGI2C6x9+X60v4FAG/YEFIRmEJqsr0 lqKigKedLCDXdUQNczDz0glhLOjyUiETDqd5B4100tsiVKUxLpmqzNw1zVu8lcLXqzf5 eCjQ== X-Gm-Message-State: AOJu0YzCv6SDQ/9+gvmRTR9tdBwe3wnemkTHRB4m0Hz/sXlpTwSAlzMS qUKk0SQ+dTGcyQ84UFgbkskDk/9AoNs5jwvY/NLSSmGLbw8URJgGLLvz6lE5tdEp+7bQoCq8D5C Z+RpZoB++s+vNc8x5C/s9w68TRbBy2tshdiEr2Ihj+ByJCUNXuSuEpVlq1agUvRj6sUclYC4ZcU 0QDXVNNRWNlTeT9Pf31jhV72lLXLTfsvQxlaWFYQ== X-Gm-Gg: ASbGncsJ7gu7N+4h2/iOal9sXYdAPmhmrCRYgstdTYW1mIfCKw2GjL7MAXFUJoSJGdp 0jfeXylHrQbQU4wBdDB0RMT11YsKzO4nrUKepzbVvr+M9kgyspTtIJQbDMUchqA6UW9H//3ou1s KrHJzppDhI8nfp/L1e5NA+tlQk7oUxbSDLHve/J4Q6lfz8B6vnLFK7XFnoucwKrZ4eNyPpwCVK4 f2hTCjDv+YStfPm1f/HYnRcpi48hg/CDj35bK07DwBr/QTgyZbbchpjzcUrq/u91nTD5bmTsKLg X-Received: by 2002:a05:620a:430b:b0:7c9:55b2:c3a with SMTP id af79cd13be357-7cd4670815amr2286949085a.11.1747760882816; Tue, 20 May 2025 10:08:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHSX+ZuU2hGc6nYq7kRIuJRV91HuIIRauMHdPEm3A/L3UNohg7zDV5wTFzCibGN197HyNtaLQ== X-Received: by 2002:a05:620a:430b:b0:7c9:55b2:c3a with SMTP id af79cd13be357-7cd4670815amr2286943985a.11.1747760882273; Tue, 20 May 2025 10:08:02 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Stefan Hajnoczi , peterx@redhat.com Subject: [PULL 05/12] ci: Fix build-previous-qemu when the version tag is absent Date: Tue, 20 May 2025 13:07:44 -0400 Message-ID: <20250520170751.786787-6-peterx@redhat.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250520170751.786787-1-peterx@redhat.com> References: <20250520170751.786787-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: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.487, 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1747760911275116600 Content-Type: text/plain; charset="utf-8" From: Fabiano Rosas Stefan reports that during QEMU release, pushing a series with the VERSION bump commit, but not pushing the new git tag in the same command will cause a failure of the build-previous-qemu job at the git fetch step. Since the job is intended to produce a build of the previous QEMU version for consumption by the migration-compat-* jobs, there's no reason to produce a build of the release commit because the migration job would end up testing the release against itself. Skip the job when VERSION contains the newly release version number. I'm opting for 'exit 0' for both the build and the test jobs because allow_failure would mask any real error in the jobs. It also avoids having an orange ! on every release pipeline. Reported-by: Stefan Hajnoczi Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas Link: https://lore.kernel.org/r/20250513133353.23022-3-farosas@suse.de Signed-off-by: Peter Xu --- .gitlab-ci.d/buildtest.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index fbad34138c..b4e39fd7c1 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -203,6 +203,11 @@ build-previous-qemu: GIT_FETCH_EXTRA_FLAGS: --prune --quiet before_script: - source scripts/ci/gitlab-ci-section + # Skip if this series contains the release bump commit. During the + # release process there might be a window of commits when the + # version tag is not yet present in the remote and git fetch would + # fail. + - if grep -q "\.0$" VERSION; then exit 0; fi - export QEMU_PREV_VERSION=3D"$(sed 's/\([0-9.]*\)\.[0-9]*/v\1.0/' VER= SION)" - git remote add upstream https://gitlab.com/qemu-project/qemu - git fetch upstream refs/tags/$QEMU_PREV_VERSION:refs/tags/$QEMU_PREV= _VERSION @@ -223,6 +228,9 @@ build-previous-qemu: IMAGE: opensuse-leap MAKE_CHECK_ARGS: check-build script: + # Skip for round release numbers, this job is only relevant for + # testing a development tree. + - if grep -q "\.0$" VERSION; then exit 0; fi # Use the migration-tests from the older QEMU tree. This avoids # testing an old QEMU against new features/tests that it is not # compatible with. --=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=1747760920; cv=none; d=zohomail.com; s=zohoarc; b=jyC/N7M7v/7y3ObUeO/yVCnMJmXahSNESA1BjTd6ZfAW/pSPh367ES97oj+Egp3n+H7kZ2lAH048bvNye1hOngHIcrPAMxwya6H0cC4QVOkzX6ewWhxMx6VHDLmxZYJcS8loWEJQkpX6A9V12O59TBoqqA5nJmxT85jBYec+7o0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747760920; 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=9r2K5IRydGAKK2ZqGpput8QmW6uoc48LgjM6fFzTJZY=; b=TCAhctwyo5w6bL4W85dsKyi7t433y8z7dQqq3MbadogiJq0xUmKFbDCNrmR5hvyA3t0EbMYzCB7w22f1NgYtiORxijijZmZSV+E/gJn6Y2tDO6X+SMPy6tuDohChKcvXcbNmiWZtP6OaI1euUxcGZ/w51qqCDg4hNHW8AK5jf6I= 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 1747760920579462.333247109721; Tue, 20 May 2025 10:08:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uHQRu-0000FI-Rf; Tue, 20 May 2025 13:08: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 1uHQRl-0008V0-ED for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:12 -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 1uHQRj-00017g-Pv for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:09 -0400 Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-81-kKkKisOYMzC9HlvFLfP1Sw-1; Tue, 20 May 2025 13:08:05 -0400 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-7c760637fe5so1056809385a.0 for ; Tue, 20 May 2025 10:08:05 -0700 (PDT) Received: from x1.com ([85.131.185.92]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7cd467be47bsm763846585a.16.2025.05.20.10.08.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 May 2025 10:08:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747760886; 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=9r2K5IRydGAKK2ZqGpput8QmW6uoc48LgjM6fFzTJZY=; b=aJrusxoV2aUUBysLxOtH8Z0ffeI5lSm1mbT7JqXSIdgQ4pxYSafpyK6EYUPZsNAB4zOE5N JFbGZdyPh1lnn3Bwftcr9a3WOq5HOGrJqkaugcrYbhyzJVxDgZ7qfLIOOySRrc2lWyfSLR k3A+pOGURrmqd21Sadw5MXZKBczdLLk= X-MC-Unique: kKkKisOYMzC9HlvFLfP1Sw-1 X-Mimecast-MFC-AGG-ID: kKkKisOYMzC9HlvFLfP1Sw_1747760885 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747760884; x=1748365684; 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=9r2K5IRydGAKK2ZqGpput8QmW6uoc48LgjM6fFzTJZY=; b=VxuTxIUacxNQx+/0zKp3gFbU7tYnHi2nZW6qkfqGCGK4rVLl9sTOcvrS+jakSFiolI xo6TEDrjz9LqCLEo/1468tCv0TMSpZcoUr/Y6YvU5mxfy99h9MxdDknOUycEulpXfIHw xw+rtNGvxAhU1psBy3Jn6UsFW9l5U8/npB3/l3OVTHQVM7HyqrLstrX50YMZPzjlTOl2 73B9aKXpRg6n++Pp7YHuPtWmeQkWuYF0NE2DYv931j8tzmurap58O9hzBZOFqbncGfN1 QLspyCj3mFKd0QYKhtRMhZNw3Zx0QMo6yByFNP/Nc3CQeY1p36AOr58TTbOeNbtV0OKo a9FA== X-Gm-Message-State: AOJu0Yy88SLl9brKEZ0WjKWN+zUN7xmkjPyOCptMON1RQBcDoBFFBP42 M3RMrnOfzDpUAGu6qVZ9P1ybzz9axH+wkKIYdS8rjwcdXJnaXBRE8JSsF8h+OEYlX24e5IAflcO C3cpTZsV5XVeeifxn8cOqqHtY6G4E/oXME3W4h8dwXmg7FNOnPHQk5zTTMxM0Q0OUDRm4tPGovb y0k0aA0eI+MadYv/iiD4AIYA5AwISFjoqr0QBOyA== X-Gm-Gg: ASbGncu2rNmAdXZyUKaObLsP8l0bzzHAmPUaOMlcKyWd91j0Na+YBS+ER6kjL7yTvmr yDgYcbopPr5hBq/Ovk7hz52jJn8qsoXU87Ujx2v1ZeHKWKKZBbTWZvNpyUuxnRRtyH/G2uicCc9 7IjN/wSsDsBq6qVYIIyIBupXlNXQUEWbbwxfSh8x8NC8qG6SHQPfqEXS2YdplTCaGpKGu3vvEHK dE1pyuItHowaEeR8ZdDyqm+tqSr0vFvIN0C/aNjAfe2qj1ltfV7quhb6rvVG9a2Z8vwaEkRrA87 X-Received: by 2002:a05:620a:2948:b0:7c7:747f:89d0 with SMTP id af79cd13be357-7cd46721bc7mr2410086685a.18.1747760884213; Tue, 20 May 2025 10:08:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IECkjycnqg3O/94xSsEw97NNHZPc+JWixdlIYcpLvqI9zHoIeTO/6/SDpOZx0lSmzfU4dYEUg== X-Received: by 2002:a05:620a:2948:b0:7c7:747f:89d0 with SMTP id af79cd13be357-7cd46721bc7mr2410080585a.18.1747760883570; Tue, 20 May 2025 10:08:03 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Stefan Hajnoczi , peterx@redhat.com Subject: [PULL 06/12] ci: Reduce the size of artifacts for build-previous-qemu Date: Tue, 20 May 2025 13:07:45 -0400 Message-ID: <20250520170751.786787-7-peterx@redhat.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250520170751.786787-1-peterx@redhat.com> References: <20250520170751.786787-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: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.487, 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1747760921325116600 Content-Type: text/plain; charset="utf-8" From: Fabiano Rosas The build-previous-qemu job is intented to produce a build of the previous QEMU release for consumption by the migration-compat-* jobs. Keep only the pieces of the build that are necessary. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas Link: https://lore.kernel.org/r/20250513133353.23022-4-farosas@suse.de Signed-off-by: Peter Xu --- .gitlab-ci.d/buildtest.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index b4e39fd7c1..ca1a9c6f70 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -188,12 +188,11 @@ build-previous-qemu: when: on_success expire_in: 2 days paths: - - build-previous - exclude: - - build-previous/**/*.p - - build-previous/**/*.a.p - - build-previous/**/*.c.o - - build-previous/**/*.c.o.d + - build-previous/qemu-bundle + - build-previous/qemu-system-aarch64 + - build-previous/qemu-system-x86_64 + - build-previous/tests/qtest/migration-test + - build-previous/scripts needs: job: amd64-opensuse-leap-container variables: --=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=1747760991; cv=none; d=zohomail.com; s=zohoarc; b=NHr9FX3bXJHBIqOV3FD9PUErgAmvh5bZo294wr/9t1AXrcn5KPeev/DJ8rmNap+EYuQziO4SntuTl8/PpUofwGyYM+1cHqZchUBlTlSrQ25cYdLsqQpd1Cp/HsTGfMEAd1TyiYBLGPGZl9i93aoiIvgMgyPYRwNcO8XQ4dLc/T8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747760991; 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=QHv2iNqYhFqYDicLPQgm1PbA3RDnzLiIMmKr4H3KBKo=; b=BQ9A16om2CA2MQMM0mNkscZAZmo6167ZVCbf+biQFdnOHcndikr0ddC2eyI8+GFgX965vtf6Z8qQ+4/P/9hPTgfHUiuDQdKzB3SSq8NPQqXZeH88V4EV2T8oQrDOVZ43yAXoSMrk8zJv5BGyBzk85knzwuopcuINP5ThgtQnt64= 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 1747760991366873.9932617057494; Tue, 20 May 2025 10:09:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uHQRs-00009s-5r; Tue, 20 May 2025 13:08: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 1uHQRn-0008V4-6k for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:12 -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 1uHQRl-00018H-AB for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:10 -0400 Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-376-DnwKobpGNNeq1O7MCufvZQ-1; Tue, 20 May 2025 13:08:07 -0400 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-7c5b9333642so679847785a.3 for ; Tue, 20 May 2025 10:08:06 -0700 (PDT) Received: from x1.com ([85.131.185.92]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7cd467be47bsm763846585a.16.2025.05.20.10.08.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 May 2025 10:08:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747760888; 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=QHv2iNqYhFqYDicLPQgm1PbA3RDnzLiIMmKr4H3KBKo=; b=hnogXX8DqxiNu1VO6KLyTp8ruyyjCFo8WbOeeqq9ybBg9SiVyOopWTCdKRT1U2Z9b9c2nv Fmv5H87VtnfQVxHqYoOuIUH9D53X/lVzdbDH0hB8rhaLe6FyaVmJrdiAquI7RetPV2r/6x BM3XJUzXUWUQx14NRZ4dHZBAYsq7fww= X-MC-Unique: DnwKobpGNNeq1O7MCufvZQ-1 X-Mimecast-MFC-AGG-ID: DnwKobpGNNeq1O7MCufvZQ_1747760886 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747760886; x=1748365686; 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=QHv2iNqYhFqYDicLPQgm1PbA3RDnzLiIMmKr4H3KBKo=; b=ErUvaiwT75JRdc+ohmPXj/VrLRTte15nfMWifHw11Q1gl616UAJYoNUeyj8VqAzGif gadsNfQv37hCZPGu4BvK6B0TKab9dsgTDcx4B6W2KHz+FEbX28tNseXLH2wAm2vI0ZY3 IJN9XzmtCl2Bv5MNDNL/Yhc6PmH0ndk5tPuhroPK2ZzzEkjjTRO4AMGRlqORjlgW+ZZn QFj0Zw4c8lcFpmVp+ryuV6+2QXYs/1hrPcIMwHA6XS+f/SRVbZ9JP8wTz9sWsHJ+ZFsJ PBVVa2p7hTjNmDx3+nQCxfDJYbvxmi9JaKKQbyoBDeXL1rk+Gl8QRpwkVCIOgr9JpTTo up8w== X-Gm-Message-State: AOJu0Ywubt2Snwq285Vn3JRDZF4l/lNL+GV/fgJ0JHOttnzosqBfyHbF zcyVguoq1HmKstX7OvVNZgQTI0k+5/0fyLse2HHHPEzEbuknqIwhoAQwUhMuBjgjp8UHJ5Nds8k lrYFpDYrgL4thfhwenjQiy9sKWGGq9+Qv+XRAyx2AaXvS1Hxya5mFeIN80Jl9LP6k/PRiAA2S49 d0hq3KM5UESJX9/Dwb5h9IKvDcgO02QGHsMNGpug== X-Gm-Gg: ASbGncsDwOjVAYyhAHyk0E/s0TIUd9/uXiXuwRY+3p8eMoLvox6oIdZuF34rFloIjSC hDUL8wrd7jN3aNK3DObr0NqBwsUJN6t1vPVbCVmW3q6S3wc32iOwBe0A+sZ+KzhmdriTcS5J2MV Ev2l4+VxLFR39lSV/K7IsCg8/QDQOLdiwwYSO6A2fAdtGlkhMhamPdvVH2Krr8kQqG3uv9580wu Zst3DtilMgF36QQixzu5rBvQW3T5ObrowSlc91FgATUQ2mPsfFllGNDa0IoSOYhNSx3JMcLTdHv X-Received: by 2002:a05:620a:44d0:b0:7ca:ea9a:828c with SMTP id af79cd13be357-7cd467ac210mr3193005985a.48.1747760885489; Tue, 20 May 2025 10:08:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBlxk36UFSySyte3/zNACB19fveue/7EgR84iRSn/HU5Kh9J4V1pvsnmO/I6KPRjIwhhYzwg== X-Received: by 2002:a05:620a:44d0:b0:7ca:ea9a:828c with SMTP id af79cd13be357-7cd467ac210mr3192998085a.48.1747760884810; Tue, 20 May 2025 10:08:04 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Stefan Hajnoczi , peterx@redhat.com, Prasad Pandit Subject: [PULL 07/12] migration: write zero pages when postcopy enabled Date: Tue, 20 May 2025 13:07:46 -0400 Message-ID: <20250520170751.786787-8-peterx@redhat.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250520170751.786787-1-peterx@redhat.com> References: <20250520170751.786787-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: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.487, 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1747760992293116600 Content-Type: text/plain; charset="utf-8" From: Prasad Pandit During multifd migration, zero pages are written if they are migrated more than once. This may result in a migration thread hang issue when multifd and postcopy are enabled together. When postcopy is enabled, always write zero pages as and when they are migrated. Signed-off-by: Prasad Pandit Reviewed-by: Fabiano Rosas Link: https://lore.kernel.org/r/20250512125124.147064-2-ppandit@redhat.com Signed-off-by: Peter Xu --- migration/multifd-zero-page.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/migration/multifd-zero-page.c b/migration/multifd-zero-page.c index dbc1184921..4cde868159 100644 --- a/migration/multifd-zero-page.c +++ b/migration/multifd-zero-page.c @@ -85,9 +85,27 @@ void multifd_recv_zero_page_process(MultiFDRecvParams *p) { for (int i =3D 0; i < p->zero_num; i++) { void *page =3D p->host + p->zero[i]; - if (ramblock_recv_bitmap_test_byte_offset(p->block, p->zero[i])) { + bool received =3D + ramblock_recv_bitmap_test_byte_offset(p->block, p->zero[i]= ); + + /* + * During multifd migration zero page is written to the memory + * only if it is migrated more than once. + * + * It becomes a problem when both multifd & postcopy options are + * enabled. If the zero page which was skipped during multifd phas= e, + * is accessed during the postcopy phase of the migration, a page + * fault occurs. But this page fault is not served because the + * 'receivedmap' says the zero page is already received. Thus the + * thread accessing that page may hang. + * + * When postcopy is enabled, always write the zero page as and when + * it is migrated. + */ + if (migrate_postcopy_ram() || received) { memset(page, 0, multifd_ram_page_size()); - } else { + } + if (!received) { ramblock_recv_bitmap_set_offset(p->block, p->zero[i]); } } --=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=1747760991; cv=none; d=zohomail.com; s=zohoarc; b=ZcoYMZsAjOEj2tSUF86f1O+kHVintzrViZ8bJOM1sVMVwuL+ZWlIYzR+10yHsiNWKoGtOv2Fu8P5pwondZeG2vXMgGWuWDdImZ98eBZe2BCh6oB7eI//iM9SHapf0nSds7HptNCu1m4BSOV61R9OofjSALt8fCWp6DFPT1Bh05o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747760991; 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=ArTcPfynfAjB7vrW9cw5ePgpA4S+h7XZwLMfRpl8hTg=; b=ZvovAUGrWg+VV8DZmWrc9newtScbA7l+jy4CuzySCUzbvz5vbk3LrU1OIstoHWvRbQQxBeUyJKftiUl1xBQ2iB01jaUsHyOSRcx9Xp9rxLUZutc+1A8S6mJywb/SXJbA/67y2PciMrVtoojRFKSNS3CFquT3IIOHmi09VVe3KTw= 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 1747760991497724.6491006462129; Tue, 20 May 2025 10:09:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uHQRs-0000A2-6W; Tue, 20 May 2025 13:08: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 1uHQRp-000056-KF for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:13 -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 1uHQRn-00019F-V0 for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:13 -0400 Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-623-w6UeSLp_NZWr9ykf54oXjw-1; Tue, 20 May 2025 13:08:08 -0400 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-7c5f3b8b1a1so964843185a.3 for ; Tue, 20 May 2025 10:08:08 -0700 (PDT) Received: from x1.com ([85.131.185.92]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7cd467be47bsm763846585a.16.2025.05.20.10.08.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 May 2025 10:08:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747760890; 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=ArTcPfynfAjB7vrW9cw5ePgpA4S+h7XZwLMfRpl8hTg=; b=FCADfa9k8v68WM5uiO69LFB1TQbUEgOzTP2EvsNvPokltQHD42UDyyuLO6Cea/xamg6fR7 kBYhyV3tiFGsDosFr8RGvYfG386Uz7VhwcAYmrfJCdGuNvPBxl7ehRYq4LBuZB73dU0kuR +tnNpGYvnBupJ9aQUFLiajMLJeFKi/o= X-MC-Unique: w6UeSLp_NZWr9ykf54oXjw-1 X-Mimecast-MFC-AGG-ID: w6UeSLp_NZWr9ykf54oXjw_1747760888 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747760887; x=1748365687; 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=ArTcPfynfAjB7vrW9cw5ePgpA4S+h7XZwLMfRpl8hTg=; b=tfCPUmxt/AMM1rA9ptpgHrYS3qrODNXee99ayp8law/+sX7cETQCexCu5lcw2Xmtkh z2a87+6x1e3G4LAis+0x8dQtc1UhbxfCHwk2t8hTS46spB0v1Qm4HLx+1fvlW3qV4qYc 39iKXjl9orhT0iTAWqp8WZvGYN9rVteuyz4vkGxg8VXxSBUCXg9pOy7tk1lI+Q/PfYRJ vyqOBdx2pWkCPhbP8NnqAtbfymA1Ci0XTLJgza8br8q4Cuf4QioZLd8yBkJTDZ0J8ujx wAXWuac9I9c3AXC2rvMjhnp6h0Z06IpX3OmVNOezBE0fIDX23y/CvWl9FVGTIgwNJOV/ PXPQ== X-Gm-Message-State: AOJu0YxBP2zcFvJfjOiPTPy8NCG4d3y+SRvA7ZRk+6twLDX4HvUnfnFE UIW1moz8AF7MtCtr5M8INjptEuHqMoxIt88Z6WgGU8lqYxJYVOqXvLBDG5ZebiwkVQbctsd8pyQ GhOr6OUl85Kot0l7ogvsbhHkuZvV0JY+p1ARhJmVKGUWTBUUBT0SFsNZt1AdUHEfvlO1NEWHhzU 5Tcf48F/+4W9a/r345+t5IcN0zgLdy+hnahYgw4Q== X-Gm-Gg: ASbGnctXEgwTTSzBkmKDiBrgVrhVQpHc58ZwngZpi3vIVN5Be+f08EFZ49qWIMwfymA 1Z9x9ki+VLbtvoCj8YksHyeA7ln6lD0Kmi+wALDYsetEGE4tArA1LX2RErn7ekcd8izsVyyn51a pHJv7OGhqGVWcbuq+HrWvPjK/bPOoh+HgvVWrH09aCmuzzBbkXVPn/FwaQNisrxv4CyTGWXzxHp PqXMqALGupZQqVq9daZ9rAtiXWJMs+ZqEPmpok/IFPHgxTv0sf/oofx38tfUdGg7Uv2Fzb9h01T X-Received: by 2002:a05:620a:29d1:b0:7cc:ffaf:60a5 with SMTP id af79cd13be357-7cd46718b5bmr2289434185a.3.1747760887224; Tue, 20 May 2025 10:08:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJHx9IKg71n1PTl3Wpw2I+skrld75ToKulHk++mMPOAqopLxllM0SWD9Z3KIz7ph4ynLuK9A== X-Received: by 2002:a05:620a:29d1:b0:7cc:ffaf:60a5 with SMTP id af79cd13be357-7cd46718b5bmr2289427985a.3.1747760886587; Tue, 20 May 2025 10:08:06 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Stefan Hajnoczi , peterx@redhat.com, Prasad Pandit Subject: [PULL 08/12] migration: enable multifd and postcopy together Date: Tue, 20 May 2025 13:07:47 -0400 Message-ID: <20250520170751.786787-9-peterx@redhat.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250520170751.786787-1-peterx@redhat.com> References: <20250520170751.786787-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: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.487, 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1747760992317116600 Content-Type: text/plain; charset="utf-8" From: Prasad Pandit Enable Multifd and Postcopy migration together. The migration_ioc_process_incoming() routine checks magic value sent on each channel and helps to properly setup multifd and postcopy channels. The Precopy and Multifd threads work during the initial guest RAM transfer. When migration moves to the Postcopy phase, the multifd threads cease to send data on multifd channels and Postcopy threads on the destination request/pull data from the source side. Reviewed-by: Fabiano Rosas Signed-off-by: Prasad Pandit Link: https://lore.kernel.org/r/20250512125124.147064-3-ppandit@redhat.com Signed-off-by: Peter Xu --- migration/multifd-nocomp.c | 3 ++- migration/multifd.c | 7 +++++++ migration/options.c | 5 ----- migration/ram.c | 5 ++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/migration/multifd-nocomp.c b/migration/multifd-nocomp.c index 88fe0f99f2..b48eae3d86 100644 --- a/migration/multifd-nocomp.c +++ b/migration/multifd-nocomp.c @@ -17,6 +17,7 @@ #include "migration-stats.h" #include "multifd.h" #include "options.h" +#include "migration.h" #include "qapi/error.h" #include "qemu/cutils.h" #include "qemu/error-report.h" @@ -398,7 +399,7 @@ int multifd_ram_flush_and_sync(QEMUFile *f) MultiFDSyncReq req; int ret; =20 - if (!migrate_multifd()) { + if (!migrate_multifd() || migration_in_postcopy()) { return 0; } =20 diff --git a/migration/multifd.c b/migration/multifd.c index ec108af624..f18b166bcf 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -1379,6 +1379,13 @@ static void *multifd_recv_thread(void *opaque) } =20 if (has_data) { + /* + * multifd thread should not be active and receive data + * when migration is in the Postcopy phase. Two threads + * writing the same memory area could easily corrupt + * the guest state. + */ + assert(!migration_in_postcopy()); if (is_device_state) { assert(use_packets); ret =3D multifd_device_state_recv(p, &local_err); diff --git a/migration/options.c b/migration/options.c index b6ae95358d..3fcd577cd7 100644 --- a/migration/options.c +++ b/migration/options.c @@ -509,11 +509,6 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps= , Error **errp) error_setg(errp, "Postcopy is not compatible with ignore-share= d"); return false; } - - if (new_caps[MIGRATION_CAPABILITY_MULTIFD]) { - error_setg(errp, "Postcopy is not yet compatible with multifd"= ); - return false; - } } =20 if (new_caps[MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT]) { diff --git a/migration/ram.c b/migration/ram.c index e12913b43e..d26dbd37c4 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1993,9 +1993,8 @@ static int ram_save_target_page(RAMState *rs, PageSea= rchStatus *pss) } } =20 - if (migrate_multifd()) { - RAMBlock *block =3D pss->block; - return ram_save_multifd_page(block, offset); + if (migrate_multifd() && !migration_in_postcopy()) { + return ram_save_multifd_page(pss->block, offset); } =20 return ram_save_page(rs, pss); --=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=1747760973; cv=none; d=zohomail.com; s=zohoarc; b=GnPzOQGSL6vBlSbDuAwsfD1h4O8th2IEMIqfZT1bnKnYD1X/VQA/wwG8oE6sYb8Y3oD6xj8uB74WqaD43cYQhEUTUj5jrPVOyp/2EDG6cvfEPX5n8CMyKzcZ+e+lM2CKAJ3EuTEn3zw+7lLKw35VdqnFUL1eTyQ94AsIF935kSU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747760973; 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=01YMP5taIjwAvddt2i07PXPU0sX/XjmcmoeCbymdLxA=; b=Li6XQUJFdTJA2Vu6Q+bcH2+D0TEFysE5UH8VQaUZGNEzKk83ijFVYw/J5uUODEDYsc/HT9v+IDjzu36+QJq3clbvEYY5FpQzqSwcO7/wTl1kPzODYp/B0Nr1UqIdWZOVueeFoYsbuRLgW9CuZWYslCJgzsXz6IyiMg/ssjDigmo= 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 1747760973053227.88189970531164; Tue, 20 May 2025 10:09:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uHQS2-0000IU-43; Tue, 20 May 2025 13:08:26 -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 1uHQS0-0000IK-PP for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:24 -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 1uHQRy-0001ER-NW for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:24 -0400 Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-249-fNl9qgLJMeS_bwx0Neu4Cw-1; Tue, 20 May 2025 13:08:21 -0400 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-6f8e114ef64so32230416d6.1 for ; Tue, 20 May 2025 10:08:20 -0700 (PDT) Received: from x1.com ([85.131.185.92]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7cd467be47bsm763846585a.16.2025.05.20.10.08.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 May 2025 10:08:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747760902; 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=01YMP5taIjwAvddt2i07PXPU0sX/XjmcmoeCbymdLxA=; b=DuKwTQqHnjfktOh9emuzhJmMAmu4dNwNuf/vyWpECKsEgJ9gKPBQA6YNYwLTkG4xi/9Ir4 KqMkXUp+LU1atCJ59E8dbpSADZz2gZOPGLNQkwqywiHfQAjU/wHccT22D2bJOO8JA0l7vZ ft2bcFdURykwqhDXji9/e2QmAyo9+bs= X-MC-Unique: fNl9qgLJMeS_bwx0Neu4Cw-1 X-Mimecast-MFC-AGG-ID: fNl9qgLJMeS_bwx0Neu4Cw_1747760900 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747760900; x=1748365700; 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=01YMP5taIjwAvddt2i07PXPU0sX/XjmcmoeCbymdLxA=; b=vb/oNxUqoejTVoATJg5x5F5U+or6lGSILsYu3ES3nIjxDO6rD6POmbtt9toFgZ44Xi Os7kQDG25iowRAy0uC5Wgax/GoJYIokcHsEUNLWAyF29rwbKumj+Je/kjAPRB/kvRVT8 MAiv7dksMn34x+Lf/G6ZVQq4nwfdrWip3tmfEXpJYe/f1qRhHjlOqga/fDR1k2YwicaG YlPUrBnQ7b82aHsF5NTIrU5XhpXdaltgXuglyhu2qphSN9RnZR9YwzF+apyM3mbwB/0A bFlE1IR/tB3CS7TB6YovH2jJaRJkV0Q6JoXg6bdAV4jgYIWBSSvegZCDLwpKp+oo3MgE GdIg== X-Gm-Message-State: AOJu0YwQHBdR6E85563bJzfxcZTxTFebP9leVWNI4FC42dCgCqMWVJlq swRg2wKa3JcFTbc+05QbKWVeqffnr7LTZMYMmKnivklyLqf3mAKX6OKwDi6EAoU3ppuEGKlPkfS 82CMx1Zx4CNYRWqdXBYvlA3Iu9b5kKGrxq1O0z1cKA3j7iiCeUelwYKWQhxgy/wLUqJ6C81m8rp tVU/2pcCZNix1p1Wwk4bfJ5HjIkLRTDLGFuzjq3A== X-Gm-Gg: ASbGncvPMV0o90AKW3fCsXSbsruciWix3TP7LLEjB9rw5CisOVshDx0iPBx0Frf4cEP D5YLRhx6eIFEYQfmaeK8ixr4xoI991X5lj3zaiDEpIO2Nhq0ka1on7KnCYnZLsWpgVsu6O44zj+ 9/HjKfrFxZref7ePwPZYA78fzVipeV1BcRfuahbgUAvN07q3S9bjIdVwQHMSakOQJGmYxXBHdA8 UnGvhV9FRIPgQE6gLCEOABCE2HKfzZnZfoxAuv2lkHNJXUkq1Fb4SbnH7wvfOT+stQwTi3e7J/s X-Received: by 2002:a05:622a:4005:b0:494:48b1:a03d with SMTP id d75a77b69052e-494b093a12dmr293141311cf.34.1747760899884; Tue, 20 May 2025 10:08:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBtN0Jtppega6vHyPnOfgc8RcpYEk1Blkg/X/w3cpR7PL0MqyYaq9MBBXSrJXS+WCq8G7avQ== X-Received: by 2002:a05:620a:4729:b0:7c5:5fa0:4617 with SMTP id af79cd13be357-7cd47fc5ad5mr2841983385a.40.1747760888467; Tue, 20 May 2025 10:08:08 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Stefan Hajnoczi , peterx@redhat.com, Prasad Pandit Subject: [PULL 09/12] tests/qtest/migration: add postcopy tests with multifd Date: Tue, 20 May 2025 13:07:48 -0400 Message-ID: <20250520170751.786787-10-peterx@redhat.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250520170751.786787-1-peterx@redhat.com> References: <20250520170751.786787-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: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.487, 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1747760974137116600 Content-Type: text/plain; charset="utf-8" From: Prasad Pandit Add new qtests to run postcopy migration with multifd channels enabled. Signed-off-by: Prasad Pandit Link: https://lore.kernel.org/r/20250512125124.147064-4-ppandit@redhat.com [peterx: rename all new tests to be under /migration/multifd+postcopy/] Signed-off-by: Peter Xu --- tests/qtest/migration/compression-tests.c | 18 ++++++++ tests/qtest/migration/postcopy-tests.c | 27 ++++++++++++ tests/qtest/migration/precopy-tests.c | 28 ++++++++++++- tests/qtest/migration/tls-tests.c | 51 +++++++++++++++++++++++ 4 files changed, 122 insertions(+), 2 deletions(-) diff --git a/tests/qtest/migration/compression-tests.c b/tests/qtest/migrat= ion/compression-tests.c index 41e79f031b..b827665b8e 100644 --- a/tests/qtest/migration/compression-tests.c +++ b/tests/qtest/migration/compression-tests.c @@ -42,6 +42,20 @@ static void test_multifd_tcp_zstd(void) }; test_precopy_common(&args); } + +static void test_multifd_postcopy_tcp_zstd(void) +{ + MigrateCommon args =3D { + .listen_uri =3D "defer", + .start =3D { + .caps[MIGRATION_CAPABILITY_MULTIFD] =3D true, + .caps[MIGRATION_CAPABILITY_POSTCOPY_RAM] =3D true, + }, + .start_hook =3D migrate_hook_start_precopy_tcp_multifd_zstd, + }; + + test_precopy_common(&args); +} #endif /* CONFIG_ZSTD */ =20 #ifdef CONFIG_QATZIP @@ -184,6 +198,10 @@ void migration_test_add_compression(MigrationTestEnv *= env) #ifdef CONFIG_ZSTD migration_test_add("/migration/multifd/tcp/plain/zstd", test_multifd_tcp_zstd); + if (env->has_uffd) { + migration_test_add("/migration/multifd+postcopy/tcp/plain/zstd", + test_multifd_postcopy_tcp_zstd); + } #endif =20 #ifdef CONFIG_QATZIP diff --git a/tests/qtest/migration/postcopy-tests.c b/tests/qtest/migration= /postcopy-tests.c index 483e3ff99f..3773525843 100644 --- a/tests/qtest/migration/postcopy-tests.c +++ b/tests/qtest/migration/postcopy-tests.c @@ -94,6 +94,29 @@ static void migration_test_add_postcopy_smoke(MigrationT= estEnv *env) } } =20 +static void test_multifd_postcopy(void) +{ + MigrateCommon args =3D { + .start =3D { + .caps[MIGRATION_CAPABILITY_MULTIFD] =3D true, + }, + }; + + test_postcopy_common(&args); +} + +static void test_multifd_postcopy_preempt(void) +{ + MigrateCommon args =3D { + .start =3D { + .caps[MIGRATION_CAPABILITY_MULTIFD] =3D true, + .caps[MIGRATION_CAPABILITY_POSTCOPY_PREEMPT] =3D true, + }, + }; + + test_postcopy_common(&args); +} + void migration_test_add_postcopy(MigrationTestEnv *env) { migration_test_add_postcopy_smoke(env); @@ -114,6 +137,10 @@ void migration_test_add_postcopy(MigrationTestEnv *env) "/migration/postcopy/recovery/double-failures/reconnect", test_postcopy_recovery_fail_reconnect); =20 + migration_test_add("/migration/multifd+postcopy/plain", + test_multifd_postcopy); + migration_test_add("/migration/multifd+postcopy/preempt/plain", + test_multifd_postcopy_preempt); if (env->is_x86) { migration_test_add("/migration/postcopy/suspend", test_postcopy_suspend); diff --git a/tests/qtest/migration/precopy-tests.c b/tests/qtest/migration/= precopy-tests.c index a62d3c5378..bb38292550 100644 --- a/tests/qtest/migration/precopy-tests.c +++ b/tests/qtest/migration/precopy-tests.c @@ -569,7 +569,7 @@ static void test_multifd_tcp_channels_none(void) * * And see that it works */ -static void test_multifd_tcp_cancel(void) +static void test_multifd_tcp_cancel(bool postcopy_ram) { MigrateStart args =3D { .hide_stderr =3D true, @@ -583,6 +583,11 @@ static void test_multifd_tcp_cancel(void) migrate_ensure_non_converge(from); migrate_prepare_for_dirty_mem(from); =20 + if (postcopy_ram) { + migrate_set_capability(from, "postcopy-ram", true); + migrate_set_capability(to, "postcopy-ram", true); + } + migrate_set_parameter_int(from, "multifd-channels", 16); migrate_set_parameter_int(to, "multifd-channels", 16); =20 @@ -624,6 +629,10 @@ static void test_multifd_tcp_cancel(void) return; } =20 + if (postcopy_ram) { + migrate_set_capability(to2, "postcopy-ram", true); + } + migrate_set_parameter_int(to2, "multifd-channels", 16); =20 migrate_set_capability(to2, "multifd", true); @@ -647,6 +656,16 @@ static void test_multifd_tcp_cancel(void) migrate_end(from, to2, true); } =20 +static void test_multifd_precopy_tcp_cancel(void) +{ + test_multifd_tcp_cancel(false); +} + +static void test_multifd_postcopy_tcp_cancel(void) +{ + test_multifd_tcp_cancel(true); +} + static void test_cancel_src_after_failed(QTestState *from, QTestState *to, const char *uri, const char *phas= e) { @@ -1233,7 +1252,12 @@ static void migration_test_add_precopy_smoke(Migrati= onTestEnv *env) migration_test_add("/migration/multifd/tcp/uri/plain/none", test_multifd_tcp_uri_none); migration_test_add("/migration/multifd/tcp/plain/cancel", - test_multifd_tcp_cancel); + test_multifd_precopy_tcp_cancel); + if (env->has_uffd) { + migration_test_add("/migration/multifd+postcopy/tcp/plain/cancel", + test_multifd_postcopy_tcp_cancel); + } + #ifdef CONFIG_RDMA migration_test_add("/migration/precopy/rdma/plain", test_precopy_rdma_plain); diff --git a/tests/qtest/migration/tls-tests.c b/tests/qtest/migration/tls-= tests.c index 72f44defbb..21e9fec87d 100644 --- a/tests/qtest/migration/tls-tests.c +++ b/tests/qtest/migration/tls-tests.c @@ -395,6 +395,19 @@ static void test_postcopy_recovery_tls_psk(void) test_postcopy_recovery_common(&args); } =20 +static void test_multifd_postcopy_recovery_tls_psk(void) +{ + MigrateCommon args =3D { + .start_hook =3D migrate_hook_start_tls_psk_match, + .end_hook =3D migrate_hook_end_tls_psk, + .start =3D { + .caps[MIGRATION_CAPABILITY_MULTIFD] =3D true, + }, + }; + + test_postcopy_recovery_common(&args); +} + /* This contains preempt+recovery+tls test altogether */ static void test_postcopy_preempt_all(void) { @@ -409,6 +422,20 @@ static void test_postcopy_preempt_all(void) test_postcopy_recovery_common(&args); } =20 +static void test_multifd_postcopy_preempt_recovery_tls_psk(void) +{ + MigrateCommon args =3D { + .start_hook =3D migrate_hook_start_tls_psk_match, + .end_hook =3D migrate_hook_end_tls_psk, + .start =3D { + .caps[MIGRATION_CAPABILITY_MULTIFD] =3D true, + .caps[MIGRATION_CAPABILITY_POSTCOPY_PREEMPT] =3D true, + }, + }; + + test_postcopy_recovery_common(&args); +} + static void test_precopy_unix_tls_psk(void) { g_autofree char *uri =3D g_strdup_printf("unix:%s/migsocket", tmpfs); @@ -657,6 +684,21 @@ static void test_multifd_tcp_tls_psk_mismatch(void) test_precopy_common(&args); } =20 +static void test_multifd_postcopy_tcp_tls_psk_match(void) +{ + MigrateCommon args =3D { + .start =3D { + .caps[MIGRATION_CAPABILITY_MULTIFD] =3D true, + .caps[MIGRATION_CAPABILITY_POSTCOPY_RAM] =3D true, + }, + .listen_uri =3D "defer", + .start_hook =3D migrate_hook_start_multifd_tcp_tls_psk_match, + .end_hook =3D migrate_hook_end_tls_psk, + }; + + test_precopy_common(&args); +} + #ifdef CONFIG_TASN1 static void test_multifd_tcp_tls_x509_default_host(void) { @@ -774,6 +816,11 @@ void migration_test_add_tls(MigrationTestEnv *env) test_postcopy_preempt_tls_psk); migration_test_add("/migration/postcopy/preempt/recovery/tls/psk", test_postcopy_preempt_all); + migration_test_add("/migration/multifd+postcopy/recovery/tls/psk", + test_multifd_postcopy_recovery_tls_psk); + migration_test_add( + "/migration/multifd+postcopy/preempt/recovery/tls/psk", + test_multifd_postcopy_preempt_recovery_tls_psk); } #ifdef CONFIG_TASN1 migration_test_add("/migration/precopy/unix/tls/x509/default-host", @@ -805,6 +852,10 @@ void migration_test_add_tls(MigrationTestEnv *env) test_multifd_tcp_tls_psk_match); migration_test_add("/migration/multifd/tcp/tls/psk/mismatch", test_multifd_tcp_tls_psk_mismatch); + if (env->has_uffd) { + migration_test_add("/migration/multifd+postcopy/tcp/tls/psk/match", + test_multifd_postcopy_tcp_tls_psk_match); + } #ifdef CONFIG_TASN1 migration_test_add("/migration/multifd/tcp/tls/x509/default-host", test_multifd_tcp_tls_x509_default_host); --=20 2.49.0 From nobody Sat Nov 15 20:49:56 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=1747760921; cv=none; d=zohomail.com; s=zohoarc; b=RoZQPioq0FW/isszdFzsd1J8H0bHLZEcx/Qmz3xG5LPAh9F2k1O4i2T0oZElfoNBCXQKFVwrpxDsySCNhyGT3lF4LAmt2mlCJGb7iqKeC+VgySbQ1Ye4HO0BuiSskW6dsmQVIE6CGMthFHAgMrKX3O7aNUFUeThbqlkV8JrwXwI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747760921; 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=OtWneoMVo461co8B0dUaF2ECam+CQefc0LeGbVUreg4=; b=FNJYVaskLiuU4kX13DJfpl/dV7WbvQ1k207bH9ESJKhMrUgE7LWECZMBOLXB+p49bheLUxqKnRvocB4qdMce2/elOdRXcptckeCutWMMknsTowf3K55CCiOgKCtZBxp7UHyoGtm6x7qDlds0ui/ABtCwGh+oI5fgadNCchTH8Ls= 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 174776092121775.7161999433539; Tue, 20 May 2025 10:08:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uHQRv-0000Fx-Jf; Tue, 20 May 2025 13:08:19 -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 1uHQRs-0000A3-67 for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:16 -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 1uHQRq-0001AQ-GR for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:15 -0400 Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-341-jCmF3QHFMSyVffvg0z7j0g-1; Tue, 20 May 2025 13:08:11 -0400 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-7c7c30d8986so1805474785a.2 for ; Tue, 20 May 2025 10:08:11 -0700 (PDT) Received: from x1.com ([85.131.185.92]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7cd467be47bsm763846585a.16.2025.05.20.10.08.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 May 2025 10:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747760893; 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=OtWneoMVo461co8B0dUaF2ECam+CQefc0LeGbVUreg4=; b=g64QvOYTMZ21c510417rLTTQ977MJ+VwFdOH111OC4QJWOMppjFpiIzUdvQfl/FQJp76dP N3C3aBuwXQ2sjaj0bIeLL7rNFnLRqakWuZMwV4jJF/AEsOTSzaDW/euPhRMatYTYwGqHDh J7eSuVisMOYAfAFsTrFo3CFnA8aCVZM= X-MC-Unique: jCmF3QHFMSyVffvg0z7j0g-1 X-Mimecast-MFC-AGG-ID: jCmF3QHFMSyVffvg0z7j0g_1747760891 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747760890; x=1748365690; 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=OtWneoMVo461co8B0dUaF2ECam+CQefc0LeGbVUreg4=; b=W8T3G9KHznT9eyGj43TtZOb8Jlv+byeDRultm73FqB3WHRU0Z3T/yAeph57lD05u4T 0UzPjshylkmsznPuenDBtXNGloQbiSv+eCJCUwU3tqaq4DYsAjewUy2S/5rhFGbVkZcZ N2S1gPWuvehA0wbmR/aDTZYF6/tPhg/L5qIO4fjPuj8IuiGFFDDOgiIaaH1wJ1QeO3/c m8B0H9Vid/0c9KJLZsfUalseEWNAybTM9HkQttF/b3XC13tErVvJ2hC6FKPvgOxUQ6YH UNhlIeGlEY3pFwAk6oxAzbz70+/9kYjto92fmL+QwhidepEMIsvQCVmMKgCTQG+3z/Yj GwNg== X-Gm-Message-State: AOJu0Yxm5cPjKbwRWmLslfChLoMagY1CZlB8+NPaJ1i6pm0XObKKob+6 jcOrcWRb5fQxVyum1cM6CK0YAdOXwU90Ja3dQbNnbQrwXEqcEPbDNC8XYCLSX3Wa/3drE8dKoU/ kg67KCrWdZ1oAZ4wasfSbDatJQybd2D6rkaXy6fJSPgOtGnhsPqZFRDe+iZKrOcqATcOtJ7mYXx qmDdtGkxt72oyxy+86YNoytbH2JAj+rVtXRd7I0A== X-Gm-Gg: ASbGncudKVb80Z2JPS6FlOu3ngRWWLkjsbSYuPtc8dxnJ3vcMmX0aoj+xbfOki94TQQ QLh3UP0eCdTdulxt5mGLLZ1hTGawpiHLE3kaswi0KjVpdjmFm3W2ytkzCGyhtGrOJejqHg8hs0A vIthA9T1ufuNU24LQ/FP72y2UJKNvvf2Gthf74G5sHVVdQV2Vd8CR+qDMxHej1Yo6f/M5O8osId dPYhQl1jNEJIJ8qh1EPSOTjIHMTuHe9CX5nn8pbYZGAiyanlVzW4DmiSqlgeg4jkjVURDw9KFVk X-Received: by 2002:a05:620a:410c:b0:7ce:cb67:1ddf with SMTP id af79cd13be357-7cecb671ecemr347093285a.49.1747760890206; Tue, 20 May 2025 10:08:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGgfUsBPquxPzooxF4OwspK2hQUz3R0HiZg6gkOR9RCg5zyHzDu0/+aFcyYWY6oyk6C3fzuEw== X-Received: by 2002:a05:620a:410c:b0:7ce:cb67:1ddf with SMTP id af79cd13be357-7cecb671ecemr347087885a.49.1747760889629; Tue, 20 May 2025 10:08:09 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Stefan Hajnoczi , peterx@redhat.com, "Maciej S. Szmigiero" Subject: [PULL 10/12] migration/multifd: Don't send device state packets with zerocopy flag Date: Tue, 20 May 2025 13:07:49 -0400 Message-ID: <20250520170751.786787-11-peterx@redhat.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250520170751.786787-1-peterx@redhat.com> References: <20250520170751.786787-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: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.487, 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1747760923177116600 Content-Type: text/plain; charset="utf-8" From: "Maciej S. Szmigiero" If zerocopy is enabled for multifd then QIO_CHANNEL_WRITE_FLAG_ZERO_COPY flag is forced into all multifd channel write calls via p->write_flags that was setup in multifd_nocomp_send_setup(). However, device state packets aren't compatible with zerocopy - the data buffer isn't getting kept pinned until multifd channel flush. Make sure to mask that QIO_CHANNEL_WRITE_FLAG_ZERO_COPY flag in a multifd send thread if the data being sent is device state. Fixes: 0525b91a0b99 ("migration/multifd: Device state transfer support - se= nd side") Signed-off-by: Maciej S. Szmigiero Reviewed-by: Fabiano Rosas Link: https://lore.kernel.org/r/3bd5f48578e29f3a78f41b1e4fbea3d4b2d9b136.17= 47403393.git.maciej.szmigiero@oracle.com Signed-off-by: Peter Xu --- migration/multifd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/migration/multifd.c b/migration/multifd.c index f18b166bcf..b255778855 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -690,6 +690,7 @@ static void *multifd_send_thread(void *opaque) if (qatomic_load_acquire(&p->pending_job)) { bool is_device_state =3D multifd_payload_device_state(p->data); size_t total_size; + int write_flags_masked =3D 0; =20 p->flags =3D 0; p->iovs_num =3D 0; @@ -697,6 +698,9 @@ static void *multifd_send_thread(void *opaque) =20 if (is_device_state) { multifd_device_state_send_prepare(p); + + /* Device state packets cannot be sent via zerocopy */ + write_flags_masked |=3D QIO_CHANNEL_WRITE_FLAG_ZERO_COPY; } else { ret =3D multifd_send_state->ops->send_prepare(p, &local_er= r); if (ret !=3D 0) { @@ -718,7 +722,8 @@ static void *multifd_send_thread(void *opaque) &p->data->u.ram, &local_err); } else { ret =3D qio_channel_writev_full_all(p->c, p->iov, p->iovs_= num, - NULL, 0, p->write_flags, + NULL, 0, + p->write_flags & ~write_= flags_masked, &local_err); } =20 --=20 2.49.0 From nobody Sat Nov 15 20:49:56 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=1747760907; cv=none; d=zohomail.com; s=zohoarc; b=TKp5t4q46uSZoSlh1Fod/Pk/I9uXG0AqbSxnxLa6qlolL71Q+IhWSsjO0GMfPxOAaAWRGNfaYxikYmJqe6VcytfL3WZxnq9Mc4F4mHTQaluPDud8Ta672JFjGsvow8mMjxjyOlNuVRfCEJy/sYgJkwN/jdHS30JxKvWzVIzhQMw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747760907; 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=XMKQccz4NfqoEUSihdV88pqT2wjsRf3oFYxwpJIsn2I=; b=CXjaN0J5hl6XTFM4Zv8jHMScsGimtXQ7Za/jDn3D7cvjtBdaMeTFzOO423eNn1V5NOjH5/HY99u8iWjmJZU5Gkpn1FLa8pWE/GUOS/Mm8NUeFo49UjUSBsyYcZ0oUkn6qc9oKAISGTwBTb0gaRbYXoEwIhg6wwXagndSvfIYlkw= 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 1747760907732440.86655995146623; Tue, 20 May 2025 10:08:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uHQRu-0000FK-SS; Tue, 20 May 2025 13:08: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 1uHQRs-0000CR-M3 for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:16 -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 1uHQRr-0001Ac-4U for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:16 -0400 Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-175-BSiT8sSSNeW1iwAAJg3A8w-1; Tue, 20 May 2025 13:08:13 -0400 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-7c53e316734so1073591485a.2 for ; Tue, 20 May 2025 10:08:13 -0700 (PDT) Received: from x1.com ([85.131.185.92]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7cd467be47bsm763846585a.16.2025.05.20.10.08.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 May 2025 10:08:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747760894; 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=XMKQccz4NfqoEUSihdV88pqT2wjsRf3oFYxwpJIsn2I=; b=C1+zug/E9/lkdovXklhImBzRCubeWeX/Qa13T4GQT2BmE8LKPTP8mMzecZSogyR7hA2XmH ubymDdnKvgK9Yx+krQ0rD3wZuOj8arRkntubmUmxL5ZhounWglwZeNZV6j3QZOrk/ohMuK w5nmVwDlum9Z9PVQ4FVXLdScumF3gaI= X-MC-Unique: BSiT8sSSNeW1iwAAJg3A8w-1 X-Mimecast-MFC-AGG-ID: BSiT8sSSNeW1iwAAJg3A8w_1747760893 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747760892; x=1748365692; 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=XMKQccz4NfqoEUSihdV88pqT2wjsRf3oFYxwpJIsn2I=; b=U59SE3GvWL/PyG7RvhMwl3vnBuSiq2Ojum5Iy/pQvUGvpRls1kYdez7os/L25w2j9T tlGkCrrOwMOhIPIaTjKL4h/q1RXcH6Rko3QMhiSKOpdayF93uZNBTzDomqFDxnlP7d4n Wy0XjSftk8/Bllx2z8AlIA81YETNwsQ35VKb9HN3MpVImnxrG/sHr0sHc/xVScAEdXgw 5E+2ZLnLYHUIH5CVBc0/Leg2KYnys0rRojbiZrsHHbfT5/dgptJf/7M9Q+J8qOp2gATd at+6ttbPNly8NLLIDm/4rh47E0zLi8o3RieHCHamPAz99SSrebKcRbAuE5Xb+r4852HS kufA== X-Gm-Message-State: AOJu0YwbBWzXquD0e3HTRdizr64GodaUe/NDPhoEeBY7GznnKceEDsab tlTk87Wkn3/n4MbFnNUuyABA3Ny8PbsfXFs+gUIDctnSQEHZZm5Q3AesTvA7dpb9OSpjtBO1b0g SjQDAaIOHcm5fapnQCeyrk5CKbrGajwyoIEbEtIAgvNil1r6pHv0khM+Ib9rh6m3SzZ4Qz0ggvo CNipNQcOtJ6UifWsUTiQaZd6F3L7hbCJMt9Ui+mQ== X-Gm-Gg: ASbGncsL+iy5yzQG+e0hmxMNqkvKVqXUgRoIrV5QlW545SqhwB4r/SB1GGYOzxwbV5W 4Rawqvzwtqh9b4J8Ieu0L/XyBxNB2wWcTKNeFrqcvraEQamsOXSQ1yo3xITaGO8aTpaFnoA5RlA mRCUiIjexMPa40PSeKkag+/wUWOWPW6npYAAnb6fmw7J02dmwhtF0mLM2P30IycYjI7R+DB5hKb UyW0Td6xyPYW8f9lfNN+49EX+JNlTmp2CHL8FVgSUNxG76XK9OAPlHIYE4zWZTSzAkmVXCbJzNr X-Received: by 2002:a05:620a:2848:b0:7ca:cd70:718b with SMTP id af79cd13be357-7cd4679c9dcmr2793400685a.35.1747760891899; Tue, 20 May 2025 10:08:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFE0mqoXb04w4Aa1zfWjUQc/fNc75N1Hkcyl3zALqNroJmsJxWlZlHVmuXnpQsZRf3HbLghQA== X-Received: by 2002:a05:620a:2848:b0:7ca:cd70:718b with SMTP id af79cd13be357-7cd4679c9dcmr2793394985a.35.1747760891535; Tue, 20 May 2025 10:08:11 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Stefan Hajnoczi , peterx@redhat.com, "Dr. David Alan Gilbert" , Juraj Marcin Subject: [PULL 11/12] migration: Allow caps to be set when preempt or multifd cap enabled Date: Tue, 20 May 2025 13:07:50 -0400 Message-ID: <20250520170751.786787-12-peterx@redhat.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250520170751.786787-1-peterx@redhat.com> References: <20250520170751.786787-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: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.487, 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1747760908958116600 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") Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juraj Marcin Signed-off-by: Peter Xu --- 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:56 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=1747760978; cv=none; d=zohomail.com; s=zohoarc; b=Ck0kD1aHozhGansoz610aMfdjlbPgLlcQ8dYNVdcnEz8lIFQReQb/7lgNKtvDGTPbxmF2ae1vxVXkq3GTjn6VI0Z7KDdOupjguO9sUm9hJc9u7t/fkWegsIuSq1Ykj6Xo1wlrqKjbOwCh87jeLI+uD4TE7+s/1N8QCEeJP60z2g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747760978; 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=I1t580PshyRViX4u6aQJtTxFf+hQIfkQ/JxQslXSAcE=; b=RXxsoBHb465AXscz5XKEHmQYqp526zABn9eHbq/omdpTsSZdvWbr1eERbfOOj4euOZJ05kPQ7l6QBTWtXd6XndUxlKL98AelmFBpy6XhSHuPnTIuNI1IndSxcvHYvPz9U9F0kxr1NZkl2LaT19UHZGoChrMsYthp8MESVXFjnX4= 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 1747760978417912.1574608480911; Tue, 20 May 2025 10:09:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uHQRz-0000HH-2Y; Tue, 20 May 2025 13:08:23 -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 1uHQRv-0000Fs-G6 for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:19 -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 1uHQRt-0001BT-5p for qemu-devel@nongnu.org; Tue, 20 May 2025 13:08:19 -0400 Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-518-h1UaXgdePluVSAgYa5scaQ-1; Tue, 20 May 2025 13:08:15 -0400 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-7c543ab40d3so898923085a.2 for ; Tue, 20 May 2025 10:08:15 -0700 (PDT) Received: from x1.com ([85.131.185.92]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7cd467be47bsm763846585a.16.2025.05.20.10.08.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 May 2025 10:08:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747760896; 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=I1t580PshyRViX4u6aQJtTxFf+hQIfkQ/JxQslXSAcE=; b=WdW/4RwrV+uojEcf8GGgDa0zN80iUjrVbb6c7LULU1E50sPMsFHCrWoTahu3h88f0NdYP7 N+wHTtSd4650Nen2BNZ45G2XNaSNSVj8FPPnDydFgzOrcT8mSpWAwLhPCMWz9WGVUUnUEg TXbqf7ukmGzttTYqdwNnqL2carZ3ko0= X-MC-Unique: h1UaXgdePluVSAgYa5scaQ-1 X-Mimecast-MFC-AGG-ID: h1UaXgdePluVSAgYa5scaQ_1747760895 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747760894; x=1748365694; 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=I1t580PshyRViX4u6aQJtTxFf+hQIfkQ/JxQslXSAcE=; b=McppNix/jOwFy8GSmN+AToJEBpNaoDSVj12sAXamXZT4rPNsJPNZZfyx3/8PyQiuaF Ukr6lAJHFUiyB+RShBPZtb3E4b/ZAEKbIJP0nRLdIra6JYJygIf7IBDGFPEgGoTImFac qamEZ96O4fKhsUZtB6/KljbqGQ8JYYJa0GqjG7wWFBIxKbbzINBikL4gCYkFCd43L0Ra epZCpgmV1CviX8zgVf/XHfM0lZ8BAS1GmvUTz6PdYyhaDvcSgvDpl0kUjKBRZMX8KGa3 OpLoYusKauERkNFqS1NSeziHLpqF0fl0EJmPb8P39ncw1kiBxvEO1UCqLjdI+fVOCqJ+ m9FA== X-Gm-Message-State: AOJu0Yx7XxZaTuzjuvcCSs82a4p6maGpbGYQ98u2Q+RNdLWCTqskyCa2 ZoN9D2TvewbYdbwBBsF1bj7DZloptOe5uRPCmnVBL7QgmL86x25erIAbc7gnpMfa+3LCGi/ij22 tRBFbZcueRxNlFOAqpqPAbnY96ySa6nLdwu4vxRYi+Ulzdlzui6TTL7DxvxD1eESgGqZGZj/DCo bwycpqpcfgwHweCfT3S7G4nUMkeufP1saCyDwdNQ== X-Gm-Gg: ASbGncuPblCudzgW8VeNamdmkSlgxXQmCTearn/lSOOeG1y/MiqWXrRMzuP3ft4AIou tBEaIpJ5tIPT4OkktM2taznRDnIQxyHE/Yw6ok0Sn2bCKIHULmGh6SuLquPCu4iYW89eCdyUOoR mTVYDuLF7baQsOkFnXpXHoX9hiMi5Awq76E2JFuJaduDM5kh+QGZ8pLdYB5ZWL3ASvREv3m2BIS Dp8/By6AhA1kQEZNs68zdLcCGqINx1E8jx3b1FXUmgK1X9Rn1PCNx0eRYpFX4sm24B796H5FSKd X-Received: by 2002:a05:620a:1786:b0:7c7:a543:dcfe with SMTP id af79cd13be357-7cd46733519mr2802472285a.32.1747760893833; Tue, 20 May 2025 10:08:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEybWnckE09Bi4ELiXcAz9KYQWh6FzCZrdiAjiHDr6IqWh0pYqePAjANtrGMPX51lFwwYB1bA== X-Received: by 2002:a05:620a:1786:b0:7c7:a543:dcfe with SMTP id af79cd13be357-7cd46733519mr2802465985a.32.1747760893299; Tue, 20 May 2025 10:08:13 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Stefan Hajnoczi , peterx@redhat.com, "Dr. David Alan Gilbert" , Mario Casquero Subject: [PULL 12/12] migration/hmp: Add "info migrate -a", reorg the dump Date: Tue, 20 May 2025 13:07:51 -0400 Message-ID: <20250520170751.786787-13-peterx@redhat.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250520170751.786787-1-peterx@redhat.com> References: <20250520170751.786787-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: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.487, 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1747760980213116600 Content-Type: text/plain; charset="utf-8" A new parameter "-a" is added to "info migrate" to dump all info, while when not specified it only dumps the important ones. When at it, reorg everything to make it easier to read for human. 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): 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, sample output (default, no "-a" specified): 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 Sample output when "-a" specified: Status: active Time (ms): total=3D3040, setup=3D4, exp_down=3D300 RAM info: Throughput (mbps): 10.51 Sizes (KB): psize=3D4, total=3D4211528, transferred=3D3979, remain=3D4206452, precopy=3D3978, multifd=3D0, postcopy=3D0 Pages: normal=3D992, zero=3D277, rate_per_sec=3D320 Others: dirty_syncs=3D1 Globals: store-global-state: on only-migratable: off send-configuration: on send-section-footer: on send-switchover-start: on clear-bitmap-shift: 18 XBZRLE: size=3D67108864, transferred=3D0, pages=3D0, miss=3D188451 miss_rate=3D0.00, encode_rate=3D0.00, overflow=3D0 CPU Throttle (%): 0 Dirty-limit Throttle (us): 0 Dirty-limit Ring Full (us): 0 Postcopy Blocktime (ms): 0 Postcopy vCPU Blocktime: ... Reviewed-by: Dr. David Alan Gilbert Tested-by: Mario Casquero [peterx: print "," too in 1st line of RAM info] Signed-off-by: Peter Xu --- migration/migration-hmp-cmds.c | 186 +++++++++++++++++---------------- hmp-commands-info.hx | 6 +- 2 files changed, 99 insertions(+), 93 deletions(-) diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index 49c26daed3..e8a563c7d8 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -37,29 +37,28 @@ static void migration_global_dump(Monitor *mon) { MigrationState *ms =3D migrate_get_current(); =20 - monitor_printf(mon, "globals:\n"); - monitor_printf(mon, "store-global-state: %s\n", + monitor_printf(mon, "Globals:\n"); + monitor_printf(mon, " store-global-state: %s\n", ms->store_global_state ? "on" : "off"); - monitor_printf(mon, "only-migratable: %s\n", + monitor_printf(mon, " only-migratable: %s\n", only_migratable ? "on" : "off"); - monitor_printf(mon, "send-configuration: %s\n", + monitor_printf(mon, " send-configuration: %s\n", ms->send_configuration ? "on" : "off"); - monitor_printf(mon, "send-section-footer: %s\n", + monitor_printf(mon, " send-section-footer: %s\n", ms->send_section_footer ? "on" : "off"); - monitor_printf(mon, "send-switchover-start: %s\n", + monitor_printf(mon, " send-switchover-start: %s\n", ms->send_switchover_start ? "on" : "off"); - monitor_printf(mon, "clear-bitmap-shift: %u\n", + monitor_printf(mon, " clear-bitmap-shift: %u\n", ms->clear_bitmap_shift); } =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); =20 - migration_global_dump(mon); - if (info->blocked_reasons) { strList *reasons =3D info->blocked_reasons; monitor_printf(mon, "Outgoing migration blocked:\n"); @@ -70,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); @@ -78,107 +77,130 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdic= t) 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, " Throughput (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 (KiB): pagesize=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"); + } + + if (!show_all) { + goto out; } =20 + migration_global_dump(mon); + 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 (info->has_cpu_throttle_percentage) { - monitor_printf(mon, "cpu throttle percentage: %" PRIu64 "\n", + monitor_printf(mon, "CPU Throttle (%%): %" PRIu64 "\n", info->cpu_throttle_percentage); } =20 if (info->has_dirty_limit_throttle_time_per_round) { - monitor_printf(mon, "dirty-limit throttle time: %" PRIu64 " us\n", + monitor_printf(mon, "Dirty-limit Throttle (us): %" PRIu64 "\n", info->dirty_limit_throttle_time_per_round); } =20 if (info->has_dirty_limit_ring_full_time) { - monitor_printf(mon, "dirty-limit ring full time: %" PRIu64 " us\n", + monitor_printf(mon, "Dirty-limit Ring Full (us): %" PRIu64 "\n", info->dirty_limit_ring_full_time); } =20 if (info->has_postcopy_blocktime) { - monitor_printf(mon, "postcopy blocktime: %u\n", + monitor_printf(mon, "Postcopy Blocktime (ms): %" PRIu32 "\n", info->postcopy_blocktime); } =20 @@ -189,28 +211,12 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdic= t) visit_type_uint32List(v, NULL, &info->postcopy_vcpu_blocktime, &error_abort); visit_complete(v, &str); - monitor_printf(mon, "postcopy vcpu blocktime: %s\n", str); + monitor_printf(mon, "Postcopy vCPU Blocktime: %s\n", str); 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