qdev: Introduce PropertyInfo.create

This allows property implementation to provide a specialized property
creation method.

Update conditions guarding property types accordingly.

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20170714021509.23681-3-famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Fam Zheng 2017-07-14 10:14:51 +08:00 committed by Paolo Bonzini
parent 8f5d58ef2c
commit faabdbb792
3 changed files with 21 additions and 13 deletions

2
qmp.c
View file

@ -480,7 +480,7 @@ static DevicePropertyInfo *make_device_property_info(ObjectClass *klass,
* for removal. This conditional should be removed along with
* it.
*/
if (!prop->info->set) {
if (!prop->info->set && !prop->info->create) {
return NULL; /* no way to set it, don't show */
}