qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Alexander Graf <agraf@suse.de>,
	qemu-devel@nongnu.org, Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH] i386: Allow cpuid bit override
Date: Tue, 28 Mar 2017 18:35:09 +0200	[thread overview]
Message-ID: <25c017ff-8d42-b3a3-309b-abdde25ece10@redhat.com> (raw)
In-Reply-To: <20170328160119.GA7295@thinpad.lan.raisama.net>



On 28/03/2017 18:01, Eduardo Habkost wrote:
>> Using an on/off/force enum sounds like the right thing to do.
>>
>> However, I would open code the getters and setters completely (using
>> visit_type_str) instead of using visit_type_FooEnum+visit_type_bool.
>> Then you can easily map yes/true to on and no/false to off.
> I am wondering if it isn't simpler to define the enum to be
> (on, off, force, yes, true, no, false), and document
> (yes, true, no, false) as deprecated.

This would require checks everywhere (plus I doubt that the deprecation
would actually lead to anything).  Doing the conversion in the getters
and setters provides the right level of abstraction; the question is
only whether to open code it or to use multiple calls to visit_type_*.

Paolo

      reply	other threads:[~2017-03-28 16:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-27 22:19 [Qemu-devel] [PATCH] i386: Allow cpuid bit override Alexander Graf
2017-03-28  0:41 ` Eduardo Habkost
2017-03-28 11:26   ` Alexander Graf
2017-03-28 12:31     ` Eduardo Habkost
2017-03-28 12:35       ` Alexander Graf
2017-03-30 14:22         ` Eduardo Habkost
2017-03-30 14:23           ` Alexander Graf
2017-03-30 14:25             ` Eduardo Habkost
2017-03-30 14:27               ` Alexander Graf
2017-04-13 17:20       ` Eduardo Habkost
2017-03-28 12:41     ` Paolo Bonzini
2017-03-28 16:01       ` Eduardo Habkost
2017-03-28 16:35         ` Paolo Bonzini [this message]

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=25c017ff-8d42-b3a3-309b-abdde25ece10@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=agraf@suse.de \
    --cc=ehabkost@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).