qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "wangyanan (Y)" <wangyanan55@huawei.com>,
	Andrew Jones <drjones@redhat.com>,
	Cornelia Huck <cohuck@redhat.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Pierre Morel" <pmorel@linux.ibm.com>,
	"Pankaj Gupta" <pankaj.gupta.linux@gmail.com>,
	qemu-devel@nongnu.org, "Markus Armbruster" <armbru@redhat.com>,
	yuzenghui@huawei.com, wanghaibin.wang@huawei.com
Subject: Re: [PATCH for-6.1 0/1] machine: Disallow specifying topology parameters as zero
Date: Thu, 22 Jul 2021 16:38:45 +0200	[thread overview]
Message-ID: <333c63ff-4ccd-9346-1d02-e1316ec365b0@redhat.com> (raw)
In-Reply-To: <93fb73cb-86e7-dc22-cd37-2d61718927e0@huawei.com>

On 22/07/21 16:12, wangyanan (Y) wrote:
> The smp_parse and pc_smp_parse are going to be converted into a
> generic parser, and the added sanity-check in this patch will also be
> tested in an unit test. So is it probably better to keep the check in the
> parser instead of the caller? The duplication will be eliminated anyway
> when there is one single parser.
> 
> But I can also implement the check in machine_set_smp as you mentioned
> if it's more reasonable and preferred. :)

Yes, I would prefer to avoid having duplicate code.  There are some 
common checks already in machine_set_smp, e.g. comparing ms->smp.cpus 
against mc->min_cpus and mc->max_cpus.

Paolo



  reply	other threads:[~2021-07-22 14:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22  2:15 [PATCH for-6.1 0/1] machine: Disallow specifying topology parameters as zero Yanan Wang
2021-07-22  2:15 ` [PATCH for-6.1 1/1] " Yanan Wang
2021-07-22  6:02 ` [PATCH for-6.1 0/1] " Cornelia Huck
2021-07-22 10:59   ` wangyanan (Y)
2021-07-22 13:37   ` Andrew Jones
2021-07-22 13:48     ` Cornelia Huck
2021-07-22 13:55     ` Paolo Bonzini
2021-07-22 14:12       ` wangyanan (Y)
2021-07-22 14:38         ` Paolo Bonzini [this message]
2021-07-22 15:00           ` 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=333c63ff-4ccd-9346-1d02-e1316ec365b0@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=drjones@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=pankaj.gupta.linux@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=pmorel@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wanghaibin.wang@huawei.com \
    --cc=wangyanan55@huawei.com \
    --cc=yuzenghui@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).