From patchwork Thu Nov 11 10:03:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12614551 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BD7DC433F5 for ; Thu, 11 Nov 2021 10:06:21 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4CCD461215 for ; Thu, 11 Nov 2021 10:06:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4CCD461215 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:39104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ml6yJ-0001vE-Fm for qemu-devel@archiver.kernel.org; Thu, 11 Nov 2021 05:06:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ml6w9-0006gu-0w for qemu-devel@nongnu.org; Thu, 11 Nov 2021 05:04:05 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:46394) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ml6w1-0000zy-8N for qemu-devel@nongnu.org; Thu, 11 Nov 2021 05:03:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636625035; 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; bh=xwgIx9hoiN9LQl/eH4d4ODaedX7FxxS9K5Qy5HvuTyQ=; b=L7ll8xTqFa7ikugz1vLjJeV8GBypzdk2dvYE83CIvBHVfmknScmkLczUNVmnCDuQctv5n+ MyQjMg2GankrMJRkV8A13pg257G/9bWx5jGdoEsSJnPl8PVT1g0J38W1Abg2VW6Zkb5HZD VbRwW8lirIsD8Pb/l+WruIQ5MfjBg+M= 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-7-xTIlMjyTNNO58yjiNzJVqQ-1; Thu, 11 Nov 2021 05:03:54 -0500 X-MC-Unique: xTIlMjyTNNO58yjiNzJVqQ-1 Received: by mail-wm1-f72.google.com with SMTP id b145-20020a1c8097000000b003335872db8dso1865703wmd.2 for ; Thu, 11 Nov 2021 02:03:54 -0800 (PST) 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:mime-version :content-transfer-encoding; bh=KMX2CvlR0Rym6m80/hmFZoDaPhmQ8CaqGxT+5uHBq2g=; b=OkRCltSFAUZhMmXeNR0U76EkH5fuGkwcQWyrsp8PRCYwLXXcq5jA2MHjwvCUQwaVa3 i30JbkPeCxqftljyDyIt8ZMToR3tTyxqqHmqz7HbjJHxkQgEN/lHKKH4S7761s6l+qPM tv4wIxbxLKs9ZVrelwFWf5mSNfGTlQkD0mneCOz6TZ//3QklOQykGh4lK7Pfmxv4g6S4 h3Jl8bNlX7UZZWYQP74VqRiu26yiUZYSiYEcR7cVdOemvOUaFg6hHFkmdc978bPu74sz qCv/4nAz+oYlr9o/8fBBdNAqu18/ozE12Qf2YCUkY8noxKop+UK49EI4HwEb+7t6s7kx 1sZA== X-Gm-Message-State: AOAM531OFjVGXlQovVChbCkz9ZjU78eaW9gZQijjfkftnC/aRP+o/c9o P5FOlfoQ2KIDqpjqmLht0pLeaIJF5EKs9i4nT+mhPAyyGOkQV7Qi0wgadC25IkQskQlwrDnkn8P 7WKk6lYoPDbHEKtAzguaHH+iB/T6zkpaeRSyfD0tRO53bU6eSSXEvyPKPhiNWdeFc X-Received: by 2002:a05:6000:184e:: with SMTP id c14mr7348272wri.241.1636625033169; Thu, 11 Nov 2021 02:03:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8uKUyk48KXtBsvvZJmR27nxNoFZ4oYnJaypC7Hcg+O/VJxmmX5wsW3wxJWP5VWIsRUph72w== X-Received: by 2002:a05:6000:184e:: with SMTP id c14mr7348229wri.241.1636625032854; Thu, 11 Nov 2021 02:03:52 -0800 (PST) Received: from x1w.. (62.red-83-57-168.dynamicip.rima-tde.net. [83.57.168.62]) by smtp.gmail.com with ESMTPSA id 9sm3434666wry.0.2021.11.11.02.03.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Nov 2021 02:03:52 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH-for-6.2 v3 0/6] tests/unit: Fix test-smp-parse Date: Thu, 11 Nov 2021 11:03:45 +0100 Message-Id: <20211111100351.2153662-1-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 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 Received-SPF: pass client-ip=170.10.129.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=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: , Cc: Thomas Huth , Andrew Jones , Eduardo Habkost , Markus Armbruster , Yanan Wang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Yet another approach to fix test-smp-parse. v2 from Yanan Wang: https://lore.kernel.org/qemu-devel/20211111024429.10568-1-wangyanan55@huawei.com/ Here we use the QOM class_init() to avoid having to deal with object_unref() and deinit(). I suggest to rename smp_parse() -> machine_parse_smp_config() after the rc0 more as a documentation change rather than an API change, since this method got added last week and doesn't follow the rest of the machine API. Supersedes: <20211111024429.10568-1-wangyanan55@huawei.com> Philippe Mathieu-Daudé (6): tests/unit/test-smp-parse: Restore MachineClass fields after modifying tests/unit/test-smp-parse: QOM'ify smp_machine_class_init() tests/unit/test-smp-parse: Explicit MachineClass name tests/unit/test-smp-parse: Simplify pointer to compound literal use tests/unit/test-smp-parse: Constify some pointer/struct hw/core: Rename smp_parse() -> machine_parse_smp_config() include/hw/boards.h | 3 +- hw/core/machine-smp.c | 6 +- hw/core/machine.c | 2 +- tests/unit/test-smp-parse.c | 123 +++++++++++++++++++----------------- 4 files changed, 72 insertions(+), 62 deletions(-) Reviewed-by: Andrew Jones