]> git.proxmox.com Git - mirror_qemu.git/commit - include/hw/qdev-core.h
qdev: Move global validation to a single function
authorEduardo Habkost <ehabkost@redhat.com>
Fri, 8 Aug 2014 19:03:31 +0000 (16:03 -0300)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 18 Sep 2014 18:51:24 +0000 (21:51 +0300)
commitb3ce84fea466f3bca2ff85d158744f00c0f429bd
treeac624099ecb8667083bda728ee89f451d923bc49
parentd828c430eb7dd481d6399f8b56e9641e47a40cea
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>
hw/core/qdev-properties-system.c
hw/core/qdev-properties.c
include/hw/qdev-core.h
tests/test-qdev-global-props.c