diff options
author | Igor Mammedov <imammedo@redhat.com> | 2017-07-14 10:14:50 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2017-07-14 12:04:42 +0200 |
commit | 8f5d58ef2c92d7b82d9a6eeefd7c8854a183ba4a (patch) | |
tree | e2829b8ca3d04cdee2f37cc1a01419786ac494c9 /hw | |
parent | d40d3da00c10f0169a26985ecb65033bff536f2c (diff) |
qom: enforce readonly nature of link's check callback
link's check callback is supposed to verify/permit setting it,
however currently nothing restricts it from misusing it
and modifying target object from within.
Make sure that readonly semantics are checked by compiler
to prevent callback's misuse.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20170714021509.23681-2-famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/core/qdev-properties.c | 3 | ||||
-rw-r--r-- | hw/display/xlnx_dp.c | 2 | ||||
-rw-r--r-- | hw/ipmi/ipmi.c | 2 | ||||
-rw-r--r-- | hw/mem/pc-dimm.c | 2 | ||||
-rw-r--r-- | hw/misc/ivshmem.c | 2 | ||||
-rw-r--r-- | hw/virtio/virtio-crypto.c | 2 |
6 files changed, 7 insertions, 6 deletions
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index f11d57831b..113ce7df46 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -25,7 +25,8 @@ void qdev_prop_set_after_realize(DeviceState *dev, const char *name, } } -void qdev_prop_allow_set_link_before_realize(Object *obj, const char *name, +void qdev_prop_allow_set_link_before_realize(const Object *obj, + const char *name, Object *val, Error **errp) { DeviceState *dev = DEVICE(obj); diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c index a77d7db22f..561f828e7a 100644 --- a/hw/display/xlnx_dp.c +++ b/hw/display/xlnx_dp.c @@ -515,7 +515,7 @@ static void xlnx_dp_aux_set_command(XlnxDPState *s, uint32_t value) s->core_registers[DP_INTERRUPT_SIGNAL_STATE] |= 0x04; } -static void xlnx_dp_set_dpdma(Object *obj, const char *name, Object *val, +static void xlnx_dp_set_dpdma(const Object *obj, const char *name, Object *val, Error **errp) { XlnxDPState *s = XLNX_DP(obj); diff --git a/hw/ipmi/ipmi.c b/hw/ipmi/ipmi.c index afafe1400f..b27babd504 100644 --- a/hw/ipmi/ipmi.c +++ b/hw/ipmi/ipmi.c @@ -90,7 +90,7 @@ static TypeInfo ipmi_interface_type_info = { .class_init = ipmi_interface_class_init, }; -static void isa_ipmi_bmc_check(Object *obj, const char *name, +static void isa_ipmi_bmc_check(const Object *obj, const char *name, Object *val, Error **errp) { IPMIBmc *bmc = IPMI_BMC(val); diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index b72258e28f..5e23495473 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -367,7 +367,7 @@ static void pc_dimm_get_size(Object *obj, Visitor *v, const char *name, visit_type_uint64(v, name, &value, errp); } -static void pc_dimm_check_memdev_is_busy(Object *obj, const char *name, +static void pc_dimm_check_memdev_is_busy(const Object *obj, const char *name, Object *val, Error **errp) { Error *local_err = NULL; diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 7f678d0197..731f3c1d4f 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -1009,7 +1009,7 @@ static const TypeInfo ivshmem_common_info = { .class_init = ivshmem_common_class_init, }; -static void ivshmem_check_memdev_is_busy(Object *obj, const char *name, +static void ivshmem_check_memdev_is_busy(const Object *obj, const char *name, Object *val, Error **errp) { if (host_memory_backend_is_mapped(MEMORY_BACKEND(val))) { diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c index 0353eb6d5d..2590893016 100644 --- a/hw/virtio/virtio-crypto.c +++ b/hw/virtio/virtio-crypto.c @@ -889,7 +889,7 @@ static void virtio_crypto_class_init(ObjectClass *klass, void *data) } static void -virtio_crypto_check_cryptodev_is_used(Object *obj, const char *name, +virtio_crypto_check_cryptodev_is_used(const Object *obj, const char *name, Object *val, Error **errp) { if (cryptodev_backend_is_used(CRYPTODEV_BACKEND(val))) { |