aboutsummaryrefslogtreecommitdiff
path: root/include/hw
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2014-08-08 16:03:31 -0300
committerMichael S. Tsirkin <mst@redhat.com>2014-09-18 21:51:24 +0300
commitb3ce84fea466f3bca2ff85d158744f00c0f429bd (patch)
treeac624099ecb8667083bda728ee89f451d923bc49 /include/hw
parentd828c430eb7dd481d6399f8b56e9641e47a40cea (diff)
downloadqemu-b3ce84fea466f3bca2ff85d158744f00c0f429bd.zip
qemu-b3ce84fea466f3bca2ff85d158744f00c0f429bd.tar.gz
qemu-b3ce84fea466f3bca2ff85d158744f00c0f429bd.tar.bz2
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>
Diffstat (limited to 'include/hw')
-rw-r--r--include/hw/qdev-core.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index 0799ff2..178fee2 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -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;