From nobody Mon Feb 9 09:09:14 2026 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=1637016491; cv=none; d=zohomail.com; s=zohoarc; b=b+ZmfNCEWzErchXlXN5EIxm8CfDq3KdkkbfhU/bIrlH8mNrpS+zqZ6ynIVMMNEAhDPJ/EdDjzncjA72+yieBjYnlfNyyozh3aQ6Dxr0j5dWysQ51nU0UX++ZwmtRvwYKzXCObXaVHSi+yzG1ad4gAwIAEeOC0NmJixa8Kta8H54= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637016491; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=DWI+cx9qApZnpufdk+eCQH7BppqYrJuE51M3l3XNNKQ=; b=En0B5owwdD+M/D/JjWXoXMTE2cUbesZQTHuheO3kpZ9cwTEbpOxSd2PJxx+HUFebr+cUpI0zo8Zyg18ocp27rELjgcDgtjRRLs287zhUZI+pY3F7bU2+5Nicj2gvFQUuXzyN+r4aS13uo+RBi0xmkEiUBtGefEjTCbS4Ffae1F0= 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 1637016491831656.1554306231907; Mon, 15 Nov 2021 14:48:11 -0800 (PST) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-283-GL6-xRhZNVyQr5mDH6Nb3w-1; Mon, 15 Nov 2021 17:48:09 -0500 Received: by mail-wm1-f72.google.com with SMTP id o22-20020a1c7516000000b0030d6f9c7f5fso6549855wmc.1 for ; Mon, 15 Nov 2021 14:48:09 -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 t8sm669534wmq.32.2021.11.15.14.48.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Nov 2021 14:48:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637016490; 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=DWI+cx9qApZnpufdk+eCQH7BppqYrJuE51M3l3XNNKQ=; b=hVp6opzur603X66E7jYuJZGls4ENyLB4p9WoHwLwoRHcjDkwrERrNnGCtc/QtuZFEK6tJi eOD1FQSBdeEOwZLUNVD6g58RQGRGif3ETRbAp7SlXLMYNGB+S5/CDxfJa3VJ7yEhrWLN84 AeRLjRPLb+23EzkN/0v6Sly7Jw/Dfw8= X-MC-Unique: GL6-xRhZNVyQr5mDH6Nb3w-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=DWI+cx9qApZnpufdk+eCQH7BppqYrJuE51M3l3XNNKQ=; b=sCbPZ/5A/A5BuJk6Q8GkRDAKBetq5nxBTJxTEOYW3h4BWhCUkoljDiQC54lKsp9rM/ yG6RWJ0KPS8KwANi1DNtNdGIJQphVFI6/he9ninbyZGRzVzkqC37BAF9j+Iw1qvKCKml 0xJikPUwncIt0MU2jC0WISJ/vTPcNnSbMkKmQSIQdgCahPZMRO7hUVozbp4kwIHT0HSL yoREajhgP/j5P9VTjZS9eXBuoLiPUZ0jOFSJoHCm78ds3Bc8GBqsa9Oej81iDcbRdYtS frWZsuXCBxaXowEhnANl0cSyukU1N2QDVnzn3HDlydrXXpKzOzsVKQ+HqUpTMXZ4KWos Zi1A== X-Gm-Message-State: AOAM5326r/C7kx+MTnvwgK4K4S5+zgy4t+8+7Te7HwPxcdGrJz8niwbt tg+tCOY/i99N5t5CD3tN8raX58xO3JDhQmHERLHY/2jTweQCwjiA70l0jj2Lw8eh2SJD9CnE2gf oSuq0lVXNiwBdJA== X-Received: by 2002:a05:600c:4e8d:: with SMTP id f13mr64733391wmq.7.1637016488654; Mon, 15 Nov 2021 14:48:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwjlDNL5VzZGyDjQWO+VAHonka3hCNfH6XY6wn8DcCY//dndRnpHeVt3FfeNIur+zaAopOpZg== X-Received: by 2002:a05:600c:4e8d:: with SMTP id f13mr64733368wmq.7.1637016488472; Mon, 15 Nov 2021 14:48:08 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Andrew Jones , Richard Henderson , Yanan Wang Subject: [PULL 1/3] tests/unit/test-smp-parse: Restore MachineClass fields after modifying Date: Mon, 15 Nov 2021 23:48:00 +0100 Message-Id: <20211115224802.2602894-2-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211115224802.2602894-1-philmd@redhat.com> References: <20211115224802.2602894-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: 1637016493637100001 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. Reviewed-by: Andrew Jones Reviewed-by: Richard Henderson Reviewed-by: Yanan Wang Tested-by: Yanan Wang Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211115145900.2531865-2-philmd@redhat.com> --- tests/unit/test-smp-parse.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index cbe0c990494..47774c1ee2a 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 @@ -536,6 +540,7 @@ static void test_with_dies(void) int i; =20 smp_machine_class_init(mc); + /* Force the SMP compat properties */ mc->smp_props.dies_supported =3D true; =20 for (i =3D 0; i < ARRAY_SIZE(data_generic_valid); i++) { @@ -575,6 +580,9 @@ static void test_with_dies(void) smp_parse_test(ms, data, false); } =20 + /* Restore the SMP compat properties */ + mc->smp_props.dies_supported =3D false; + object_unref(obj); } =20 --=20 2.31.1