[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 15/23] rng: make opened property read-only
From: |
Paolo Bonzini |
Subject: |
[PULL 15/23] rng: make opened property read-only |
Date: |
Mon, 16 May 2022 17:55:55 +0200 |
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>
---
backends/rng.c | 18 ++----------------
docs/about/deprecated.rst | 9 ---------
docs/about/removed-features.rst | 6 ++++++
3 files changed, 8 insertions(+), 25 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 = {
diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index 2a022f2300..1f961b9e6e 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -90,15 +90,6 @@ the process listing. This is replaced by the new
``password-secret``
option which lets the password be securely provided on the command
line using a ``secret`` object instance.
-``opened`` property of ``rng-*`` objects (since 6.0)
-''''''''''''''''''''''''''''''''''''''''''''''''''''
-
-The only effect of specifying ``opened=on`` in the command line or QMP
-``object-add`` is that the device is opened immediately, possibly before all
-other options have been processed. This will either have no effect (if
-``opened`` was the last option) or cause errors. The property is therefore
-useless and should not be specified.
-
``-display sdl,window_close=...`` (since 6.1)
'''''''''''''''''''''''''''''''''''''''''''''
diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.rst
index 81ceeb9000..69498efd51 100644
--- a/docs/about/removed-features.rst
+++ b/docs/about/removed-features.rst
@@ -363,6 +363,12 @@ no effect (if ``loaded`` was the last option) or caused
options to be
effectively ignored as if they were not given. The property is therefore
useless and should simply be removed.
+``opened`` property of ``rng-*`` objects (removed in 7.1)
+'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+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 should simply be removed.
QEMU Machine Protocol (QMP) commands
------------------------------------
--
2.36.0
- [PULL 05/23] qdev-properties: Add a new macro with bitmask check for uint64_t property, (continued)
- [PULL 05/23] qdev-properties: Add a new macro with bitmask check for uint64_t property, Paolo Bonzini, 2022/05/16
- [PULL 04/23] i386/cpu: Remove the deprecated cpu model 'Icelake-Client', Paolo Bonzini, 2022/05/16
- [PULL 06/23] target/i386: Add lbr-fmt vPMU option to support guest LBR, Paolo Bonzini, 2022/05/16
- [PULL 07/23] target/i386: Add kvm_get_one_msr helper, Paolo Bonzini, 2022/05/16
- [PULL 09/23] target/i386: Add XSAVES support for Arch LBR, Paolo Bonzini, 2022/05/16
- [PULL 08/23] target/i386: Enable support for XSAVES based features, Paolo Bonzini, 2022/05/16
- [PULL 10/23] target/i386: Add MSR access interface for Arch LBR, Paolo Bonzini, 2022/05/16
- [PULL 11/23] target/i386: Enable Arch LBR migration states in vmstate, Paolo Bonzini, 2022/05/16
- [PULL 12/23] target/i386: introduce helper to access supported CPUID, Paolo Bonzini, 2022/05/16
- [PULL 13/23] target/i386: Support Arch LBR in CPUID enumeration, Paolo Bonzini, 2022/05/16
- [PULL 15/23] rng: make opened property read-only,
Paolo Bonzini <=
- [PULL 16/23] soundhw: remove ability to create multiple soundcards, Paolo Bonzini, 2022/05/16
- [PULL 17/23] soundhw: extract soundhw help to a separate function, Paolo Bonzini, 2022/05/16
- [PULL 18/23] soundhw: unify initialization for ISA and PCI soundhw, Paolo Bonzini, 2022/05/16
- [PULL 23/23] configure: remove duplicate help messages, Paolo Bonzini, 2022/05/16
- [PULL 22/23] configure: remove another dead variable, Paolo Bonzini, 2022/05/16
- [PULL 14/23] crypto: make loaded property read-only, Paolo Bonzini, 2022/05/16
- [PULL 19/23] soundhw: move help handling to vl.c, Paolo Bonzini, 2022/05/16
- [PULL 20/23] introduce -audio as a replacement for -soundhw, Paolo Bonzini, 2022/05/16
- [PULL 21/23] build: remove useless dependency, Paolo Bonzini, 2022/05/16
- Re: [PULL 00/23] Misc QEMU patches for 2022-05-16, Richard Henderson, 2022/05/16