From nobody Mon Feb 9 10:48:30 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1637016501; cv=none; d=zohomail.com; s=zohoarc; b=IIf8H9uWzs1cT3pHIym0HHsQ394CDvweLkWgsXbh6tCn03RNIs3KEFkJ9V285liztB0O8AXgflWgQbONkyhrHFKzft62NM6f4nQFqXI+DX/f+b34RMUTroGtgmM2vfxBC6M2h4d3sZga09B7GbLmFgmNfS8zwB3W8ZGiFrMMbzQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637016501; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=byTizwcSSoKyIq1puLjEKJm8typeg4ZcFgPzEW52fJE=; b=nkGag8fn3cB3pFclMHEWYo8y8lch+PaQY/tz3ZrPnGQR13V1purfQtC8Ieda9sTKKsUZARHCxnigvu9zY+Sq/B7Dsu+I0lB5qwXKFttWUCH2j4Lw5bYOfL2z1LyUNkLP0/EjZ5HGcJ8iAHZ/f2+SJTF7qCcYuHpLTJxf+xDPTxs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1637016501675585.7049179177458; Mon, 15 Nov 2021 14:48:21 -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-413-DjA3aKVxOges8qAPgzZALA-1; Mon, 15 Nov 2021 17:48:18 -0500 Received: by mail-wm1-f72.google.com with SMTP id m14-20020a05600c3b0e00b0033308dcc933so550763wms.7 for ; Mon, 15 Nov 2021 14:48:18 -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 o63sm613510wme.2.2021.11.15.14.48.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Nov 2021 14:48:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637016500; 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=byTizwcSSoKyIq1puLjEKJm8typeg4ZcFgPzEW52fJE=; b=KjzxV5dWLf/HPWl/qiocO0oXSIVO9LY7VqfiSyLgXAlfXl0Da1iPNUZFQuP4FPwJ2cMK0C hr4ri5D9hezYiiTEIlN1A/01HxlDn+TRWbD5ZVAlHJ9UUSkd76EpSrYpSUIin0zhQrbCIc QZUcy7gdtMOrfBSJL/+rYezIanKZfRs= X-MC-Unique: DjA3aKVxOges8qAPgzZALA-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=byTizwcSSoKyIq1puLjEKJm8typeg4ZcFgPzEW52fJE=; b=ZMkJtFGAhG6W8Qtp9TK6ks0z5fUN+PJURISWKm0uBP7MiaYeC0XZoB9PZGb3WsXcIE msvlCYpkFvZh1F0PVzgqSwiL/ybxmGMfHw2ZHkn5EMrQgxPry401tExBpMhE/M1hpeoO aLimIPlvPlOgx/wEn2j0hVlV4MPlWsL0RBRDUt4TyMwPTAGVC3NQ3DQdGcl9DfF5ElBy FhOVhln9miJmMzoUlcfiQaK/CF2PgGdod9M3bV3/E9yCWPK+n1DIRu+Jv98titPGn+Zy Tq0lvLZlC0yxaEmmvblflmQhi9bc6j+LUoxcFLDGawJQrsnRsq4gZVLIKa4mju5T4GUz bvFA== X-Gm-Message-State: AOAM531SO9bcYK4sT10RF3m/6WJKOiHpwarJSnEUraEcDw7LPWqikg7J k9Vv22DBjhLd7H3M+80YDM0c27G62ns7xAUzkxk4Bu8xopBkM9at8KXnbty+pWpZTDj6zozGAwg T+UbGIUJM/76PSg== X-Received: by 2002:a7b:c157:: with SMTP id z23mr63780280wmi.113.1637016497506; Mon, 15 Nov 2021 14:48:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwyUxgeyIf+IubjhuVTfJfUFbfIMBiJ1BfbKXAXROwmjorBqnPkThWuY9iSPlyvdjTF1Du8kw== X-Received: by 2002:a7b:c157:: with SMTP id z23mr63780256wmi.113.1637016497309; Mon, 15 Nov 2021 14:48:17 -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 3/3] tests/unit/test-smp-parse: Explicit MachineClass name Date: Mon, 15 Nov 2021 23:48:02 +0100 Message-Id: <20211115224802.2602894-4-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: 1637016502291100001 If the MachineClass::name pointer is not explicitly set, it is NULL. Per the C standard, passing a NULL pointer to printf "%s" format is undefined. Some implementations display it as 'NULL', other as 'null'. Since we are comparing the formatted output, we need a stable value. The easiest is to explicit a machine name string. 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-4-philmd@redhat.com> --- tests/unit/test-smp-parse.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 3fff2af4e27..b02450e25a3 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -23,6 +23,8 @@ #define MIN_CPUS 1 /* set the min CPUs supported by the machine as 1 */ #define MAX_CPUS 512 /* set the max CPUs supported by the machine as 512 */ =20 +#define SMP_MACHINE_NAME "TEST-SMP" + /* * Used to define the generic 3-level CPU topology hierarchy * -sockets/cores/threads @@ -307,13 +309,13 @@ static struct SMPTestData data_generic_invalid[] =3D { * should tweak the supported min CPUs to 2 for testing */ .config =3D SMP_CONFIG_GENERIC(T, 1, F, 0, F, 0, F, 0, F, 0), .expect_error =3D "Invalid SMP CPUs 1. The min CPUs supported " - "by machine '(null)' is 2", + "by machine '" SMP_MACHINE_NAME "' is 2", }, { /* config: -smp 512 * should tweak the supported max CPUs to 511 for testing */ .config =3D SMP_CONFIG_GENERIC(T, 512, F, 0, F, 0, F, 0, F, 0), .expect_error =3D "Invalid SMP CPUs 512. The max CPUs supported " - "by machine '(null)' is 511", + "by machine '" SMP_MACHINE_NAME "' is 511", }, }; =20 @@ -481,6 +483,8 @@ static void machine_base_class_init(ObjectClass *oc, vo= id *data) =20 mc->smp_props.prefer_sockets =3D true; mc->smp_props.dies_supported =3D false; + + mc->name =3D g_strdup(SMP_MACHINE_NAME); } =20 static void test_generic(void) --=20 2.31.1