From nobody Fri Dec 19 07:15:47 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1636625043; cv=none; d=zohomail.com; s=zohoarc; b=OWFxMs6GTOpG4Vy6ykFYwMvC3U9treb6m8IC3w+awquk0bukGjvUsjpHitagaUbhFqLNtp484iX76d0N1v8bHXZiqp5FlmARAyXoiAaNKvYcTpqqzHmdgnFmgwdqy2iLdSMaWCrkxIrHoACneOTRrWOvNi4cLLPT0D01eLw7AqM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636625043; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=UAQJZocas4bPTljBjE8/4eZncm0k7SsFi5AABg6C/Aw=; b=cQQixm4/gwlCOxcUyDRNy2+ge9G1GgLjrPwxly1GbbTsjeHutgdZMvAxKCx1FpZska77wUpQGLIQLEEG7wziIiVVcs4mNoyzMXxNr8CVtc59YjuOrOtgEmzgI0xeDEJ9KE9Y3aR8nUj0AJHJvolYqPk+PFh1zDxhQIrjf0QPFn8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1636625043007367.3413466834613; Thu, 11 Nov 2021 02:04:03 -0800 (PST) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-63-G_OtEINeNVO7t8JbouwyLA-1; Thu, 11 Nov 2021 05:03:58 -0500 Received: by mail-wm1-f69.google.com with SMTP id z138-20020a1c7e90000000b003319c5f9164so4540415wmc.7 for ; Thu, 11 Nov 2021 02:03:58 -0800 (PST) Return-Path: Return-Path: Received: from x1w.. (62.red-83-57-168.dynamicip.rima-tde.net. [83.57.168.62]) by smtp.gmail.com with ESMTPSA id q18sm8600902wmc.7.2021.11.11.02.03.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Nov 2021 02:03:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636625041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UAQJZocas4bPTljBjE8/4eZncm0k7SsFi5AABg6C/Aw=; b=TzDl/iZcow1VA85+S5GBLSgfpkJwfZI0IesDZJgnib1a98ppM2xmclmpM//O5EEjIC/XOB pJIGIgyvIEt+SCiFVsf+fnazDYM5ZRGnZlNIQ2fcMMCBmpPVZhMMl1CHdgspYLn+Swg/oW 1xjsbWoEY6splz9bN0f3SAAU7oSIiC0= X-MC-Unique: G_OtEINeNVO7t8JbouwyLA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UAQJZocas4bPTljBjE8/4eZncm0k7SsFi5AABg6C/Aw=; b=wxe7bazp0iIJ88sXzWD5/IJgfxVUfGSKjXDDp7IgSIIDGeZNLG76JzUsFViA9tw99N Z/lqGUrtajjXtsLCezmpSDRb9PPL/Hqpii5XlqhsuT2p2u589OuRKqFrRzUOEzksUTkg iNkEybxSB+roNyItYtA6PmyVnBjJwwOTsUXsSWXbcrzZ+NmexoXodHQWv4koK9PAVB+X 5y2IXqp1E52kcEfxtaHSGriULSsicRL13ohOVEF9N8gMueA/5DLJCt8m0fjafhjyxQqW o8LxhtnpPKMtbIDih0p0Y3+6q4ywj25yLp0tQ12ve9kgFYqmJy5x36nOYjUgQi4b+9/B 5kSg== X-Gm-Message-State: AOAM531g3kH1n+29TVRPexyPQ9lxYnPBUD0S28RT+Jifl6pwpemiRD12 kQTFCLwe89xwoWGVSIxCVgeIWYGuLGiTPhMi4wmyG0cSlML3Bc/McI9smsxIt6QS1iYLLYSMBW7 eDnpnHRM6FLJpUQ== X-Received: by 2002:a1c:287:: with SMTP id 129mr9508544wmc.49.1636625037400; Thu, 11 Nov 2021 02:03:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJz57akgQK3IVeD5RUy1LWIKehQr3tvgNoTNXgmxUZBN1/3RmGFwrtdZ/cQ2MGMJyEUsbCPa2g== X-Received: by 2002:a1c:287:: with SMTP id 129mr9508521wmc.49.1636625037246; Thu, 11 Nov 2021 02:03:57 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Markus Armbruster , Yanan Wang , Marcel Apfelbaum , Eduardo Habkost , Andrew Jones Subject: [PATCH-for-6.2 v3 1/6] tests/unit/test-smp-parse: Restore MachineClass fields after modifying Date: Thu, 11 Nov 2021 11:03:46 +0100 Message-Id: <20211111100351.2153662-2-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211111100351.2153662-1-philmd@redhat.com> References: <20211111100351.2153662-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1636625045256100003 There is a single MachineClass object, registered with type_register_static(&smp_machine_info). Since the same object is used multiple times (an MachineState object is instantiated in both test_generic and test_with_dies), we should restore its internal state after modifying for the test purpose. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Yanan Wang Tested-by: Yanan Wang --- tests/unit/test-smp-parse.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index cbe0c990494..bd11fbe91de 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -512,7 +512,7 @@ static void test_generic(void) smp_parse_test(ms, data, true); } =20 - /* Reset the supported min CPUs and max CPUs */ + /* Force invalid min CPUs and max CPUs */ mc->min_cpus =3D 2; mc->max_cpus =3D 511; =20 @@ -523,6 +523,10 @@ static void test_generic(void) smp_parse_test(ms, data, false); } =20 + /* Reset the supported min CPUs and max CPUs */ + mc->min_cpus =3D MIN_CPUS; + mc->max_cpus =3D MAX_CPUS; + object_unref(obj); } =20 --=20 2.31.1