All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "wangyanan (Y)" <wangyanan55@huawei.com>
Cc: "Andrew Jones" <drjones@redhat.com>,
	"Daniel P.Berrangé" <berrange@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Pierre Morel" <pmorel@linux.ibm.com>,
	qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	wanghaibin.wang@huawei.com,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: Re: [PATCH 1/2] hw/core/machine: Split out smp_parse as an inline API
Date: Tue, 12 Oct 2021 16:36:05 +0200	[thread overview]
Message-ID: <87a6je48fe.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <b088fc9a-de73-31c9-5caa-de5f758e7a54@huawei.com> (wangyanan's message of "Mon, 11 Oct 2021 15:54:24 +0800")

"wangyanan (Y)" <wangyanan55@huawei.com> writes:

> Hi Markus,
>
> On 2021/10/11 13:26, Markus Armbruster wrote:
>> Yanan Wang <wangyanan55@huawei.com> writes:
>>
>>> Functionally smp_parse() is only called once and in one place
>>> i.e. machine_set_smp, the possible second place where it'll be
>>> called should be some unit tests if any.
>>>
>>> Actually we are going to introduce an unit test for the parser.
>>> For necessary isolation of the tested code, split smp_parse out
>>> into a separate header as an inline API.
>> Why inline?
> The motivation of the splitting is to isolate the tested smp_parse
> from the other unrelated code in machine.c, so that we can solve
> the build dependency problem for the unit test.
>
> I once tried to split smp_parse out into a source file in [1] for the
> test, but it looks more concise and convenient to make it as an
> inline function in a header compared to [1]. Given that we only call
> it in one place, it may not be harmful to keep it an inline.
>
> Anyway, I not sure the method in this patch is most appropriate
> and compliant. If it's just wrong I can change back to [1]. :)
>
> [1]
> https://lore.kernel.org/qemu-devel/20210910073025.16480-16-wangyanan55@huawei.com/#t

I'd prefer to keep it in .c, but I'm not the maintainer.



  reply	other threads:[~2021-10-12 14:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-10 10:39 [PATCH 0/2] hw/core/machine: An an unit test for smp_parse Yanan Wang
2021-10-10 10:39 ` [PATCH 1/2] hw/core/machine: Split out smp_parse as an inline API Yanan Wang
2021-10-11  5:26   ` Markus Armbruster
2021-10-11  7:54     ` wangyanan (Y)
2021-10-12 14:36       ` Markus Armbruster [this message]
2021-10-13  1:37         ` wangyanan (Y)
2021-10-10 10:39 ` [PATCH 2/2] tests/unit: Add an unit test for smp parsing Yanan Wang
2021-10-12 13:51   ` Andrew Jones
2021-10-13  1:23     ` wangyanan (Y)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a6je48fe.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=drjones@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=pmorel@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wanghaibin.wang@huawei.com \
    --cc=wangyanan55@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.