diff options
author | Paolo Bonzini | 2022-05-09 11:46:03 +0200 |
---|---|---|
committer | Paolo Bonzini | 2022-05-14 12:33:44 +0200 |
commit | 6e577937485080f2dcebc6a3e5a4a9e8db841762 (patch) | |
tree | cdcdfb5548f3616d103273a97a497e39279ffcd3 /backends | |
parent | crypto: make loaded property read-only (diff) | |
download | qemu-6e577937485080f2dcebc6a3e5a4a9e8db841762.tar.gz qemu-6e577937485080f2dcebc6a3e5a4a9e8db841762.tar.xz qemu-6e577937485080f2dcebc6a3e5a4a9e8db841762.zip |
rng: make opened property read-only
The ``opened=on`` option in the command line or QMP ``object-add`` either had
no effect (if ``opened`` was the last option) or caused errors. The property
is therefore useless and was deprecated in 6.0; make it read-only now.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'backends')
-rw-r--r-- | backends/rng.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/backends/rng.c b/backends/rng.c index 3757b04485..6c7bf64426 100644 --- a/backends/rng.c +++ b/backends/rng.c @@ -48,24 +48,10 @@ static bool rng_backend_prop_get_opened(Object *obj, Error **errp) static void rng_backend_complete(UserCreatable *uc, Error **errp) { - object_property_set_bool(OBJECT(uc), "opened", true, errp); -} - -static void rng_backend_prop_set_opened(Object *obj, bool value, Error **errp) -{ - RngBackend *s = RNG_BACKEND(obj); + RngBackend *s = RNG_BACKEND(uc); RngBackendClass *k = RNG_BACKEND_GET_CLASS(s); Error *local_err = NULL; - if (value == s->opened) { - return; - } - - if (!value && s->opened) { - error_setg(errp, QERR_PERMISSION_DENIED); - return; - } - if (k->opened) { k->opened(s, &local_err); if (local_err) { @@ -122,7 +108,7 @@ static void rng_backend_class_init(ObjectClass *oc, void *data) object_class_property_add_bool(oc, "opened", rng_backend_prop_get_opened, - rng_backend_prop_set_opened); + NULL); } static const TypeInfo rng_backend_info = { |