mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
qdev: Move global validation to a single function
Currently GlobalProperty.not_used=false has multiple meanings: * It may be a property for a hotpluggable device, which may or may not have been used by a device; * It may be a machine-type-provided property, which may or may not have been used by a device. * It may be a user-provided property that was actually not used by any device. Simplify the logic by having two separate fields: 'user_provided' and 'used'. This allows the entire global property validation logic to be contained in a single function, and allows more specific error messages. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
d828c430eb
commit
b3ce84fea4
4 changed files with 83 additions and 39 deletions
|
@ -242,16 +242,16 @@ struct PropertyInfo {
|
|||
|
||||
/**
|
||||
* GlobalProperty:
|
||||
* @not_used: Track use of a global property. Defaults to false in all C99
|
||||
* struct initializations.
|
||||
*
|
||||
* This prevents reports of .compat_props when they are not used.
|
||||
* @user_provided: Set to true if property comes from user-provided config
|
||||
* (command-line or config file).
|
||||
* @used: Set to true if property was used when initializing a device.
|
||||
*/
|
||||
typedef struct GlobalProperty {
|
||||
const char *driver;
|
||||
const char *property;
|
||||
const char *value;
|
||||
bool not_used;
|
||||
bool user_provided;
|
||||
bool used;
|
||||
QTAILQ_ENTRY(GlobalProperty) next;
|
||||
} GlobalProperty;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue