[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] i386: Allow cpuid bit override
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] i386: Allow cpuid bit override |
Date: |
Tue, 28 Mar 2017 18:35:09 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 |
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