Skip to contentSkip to conversation

crypto: purge 'loaded' property that was documented as already removed

PATCH In review Daniel P. Berrangé 3 participants 5 messages Oct 30, 2024 – Nov 7, 2024 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: purge 'loaded' property that was documented as already removed

The 'loaded' property on TLS creds and secret objects was marked as deprected in 6.0.0 and then marked as removed in 7.1.0.

Except it wasn't actually removed, it was just made read-only, while claiming it was removed. Finish the long overdue removal job.

Fixes 0310641c06dd5f7ea031b2b6170cb2edc63e4cea
---
 crypto/secret_common.c          | 12 --------
 crypto/tlscredsanon.c           | 35 ----------------------
 crypto/tlscredspsk.c            | 34 ----------------------
 crypto/tlscredsx509.c           | 30 -------------------
 docs/about/removed-features.rst |  6 ++--
 qapi/crypto.json                | 51 +++------------------------------
 6 files changed, 7 insertions(+), 161 deletions(-)
crypto/secret_common.c +0 -12
index 2c141107a5..dbda998940 100644
@@ -191,15 +191,6 @@ qcrypto_secret_complete(UserCreatable *uc, Error **errp)
 }
 
 
-static bool
-qcrypto_secret_prop_get_loaded(Object *obj,
-                               Error **errp G_GNUC_UNUSED)
-{
-    QCryptoSecretCommon *secret = QCRYPTO_SECRET_COMMON(obj);
-    return secret->rawdata != NULL;
-}
-
-
 static void
 qcrypto_secret_prop_set_format(Object *obj,
                                int value,
@@ -278,9 +269,6 @@ qcrypto_secret_class_init(ObjectClass *oc, void *data)
 
     ucc->complete = qcrypto_secret_complete;
 
-    object_class_property_add_bool(oc, "loaded",
-                                   qcrypto_secret_prop_get_loaded,
-                                   NULL);
     object_class_property_add_enum(oc, "format",
                                    "QCryptoSecretFormat",
                                    &QCryptoSecretFormat_lookup,
crypto/tlscredsanon.c +0 -35
index c0d23a0ef3..476cf89c96 100644
@@ -127,37 +127,6 @@ qcrypto_tls_creds_anon_complete(UserCreatable *uc, Error **errp)
 }
 
 
-#ifdef CONFIG_GNUTLS
-
-
-static bool
-qcrypto_tls_creds_anon_prop_get_loaded(Object *obj,
-                                       Error **errp G_GNUC_UNUSED)
-{
-    QCryptoTLSCredsAnon *creds = QCRYPTO_TLS_CREDS_ANON(obj);
-
-    if (creds->parent_obj.endpoint == QCRYPTO_TLS_CREDS_ENDPOINT_SERVER) {
-        return creds->data.server != NULL;
-    } else {
-        return creds->data.client != NULL;
-    }
-}
-
-
-#else /* ! CONFIG_GNUTLS */
-
-
-static bool
-qcrypto_tls_creds_anon_prop_get_loaded(Object *obj G_GNUC_UNUSED,
-                                       Error **errp G_GNUC_UNUSED)
-{
-    return false;
-}
-
-
-#endif /* ! CONFIG_GNUTLS */
-
-
 static void
 qcrypto_tls_creds_anon_finalize(Object *obj)
 {
@@ -173,10 +142,6 @@ qcrypto_tls_creds_anon_class_init(ObjectClass *oc, void *data)
     UserCreatableClass *ucc = USER_CREATABLE_CLASS(oc);
 
     ucc->complete = qcrypto_tls_creds_anon_complete;
-
-    object_class_property_add_bool(oc, "loaded",
-                                   qcrypto_tls_creds_anon_prop_get_loaded,
-                                   NULL);
 }
 
 
crypto/tlscredspsk.c +0 -34
index 0d6b71a37c..aa270d7988 100644
@@ -206,37 +206,6 @@ qcrypto_tls_creds_psk_complete(UserCreatable *uc, Error **errp)
 }
 
 
-#ifdef CONFIG_GNUTLS
-
-
-static bool
-qcrypto_tls_creds_psk_prop_get_loaded(Object *obj,
-                                      Error **errp G_GNUC_UNUSED)
-{
-    QCryptoTLSCredsPSK *creds = QCRYPTO_TLS_CREDS_PSK(obj);
-
-    if (creds->parent_obj.endpoint == QCRYPTO_TLS_CREDS_ENDPOINT_SERVER) {
-        return creds->data.server != NULL;
-    } else {
-        return creds->data.client != NULL;
-    }
-}
-
-
-#else /* ! CONFIG_GNUTLS */
-
-
-static bool
-qcrypto_tls_creds_psk_prop_get_loaded(Object *obj G_GNUC_UNUSED,
-                                      Error **errp G_GNUC_UNUSED)
-{
-    return false;
-}
-
-
-#endif /* ! CONFIG_GNUTLS */
-
-
 static void
 qcrypto_tls_creds_psk_finalize(Object *obj)
 {
@@ -273,9 +242,6 @@ qcrypto_tls_creds_psk_class_init(ObjectClass *oc, void *data)
 
     ucc->complete = qcrypto_tls_creds_psk_complete;
 
-    object_class_property_add_bool(oc, "loaded",
-                                   qcrypto_tls_creds_psk_prop_get_loaded,
-                                   NULL);
     object_class_property_add_str(oc, "username",
                                   qcrypto_tls_creds_psk_prop_get_username,
                                   qcrypto_tls_creds_psk_prop_set_username);
crypto/tlscredsx509.c +0 -30
index d14313925d..24ec584922 100644
@@ -695,33 +695,6 @@ qcrypto_tls_creds_x509_complete(UserCreatable *uc, Error **errp)
 }
 
 
-#ifdef CONFIG_GNUTLS
-
-
-static bool
-qcrypto_tls_creds_x509_prop_get_loaded(Object *obj,
-                                       Error **errp G_GNUC_UNUSED)
-{
-    QCryptoTLSCredsX509 *creds = QCRYPTO_TLS_CREDS_X509(obj);
-
-    return creds->data != NULL;
-}
-
-
-#else /* ! CONFIG_GNUTLS */
-
-
-static bool
-qcrypto_tls_creds_x509_prop_get_loaded(Object *obj G_GNUC_UNUSED,
-                                       Error **errp G_GNUC_UNUSED)
-{
-    return false;
-}
-
-
-#endif /* ! CONFIG_GNUTLS */
-
-
 static void
 qcrypto_tls_creds_x509_prop_set_sanity(Object *obj,
                                        bool value,
@@ -838,9 +811,6 @@ qcrypto_tls_creds_x509_class_init(ObjectClass *oc, void *data)
 
     ucc->complete = qcrypto_tls_creds_x509_complete;
 
-    object_class_property_add_bool(oc, "loaded",
-                                   qcrypto_tls_creds_x509_prop_get_loaded,
-                                   NULL);
     object_class_property_add_bool(oc, "sanity-check",
                                    qcrypto_tls_creds_x509_prop_get_sanity,
                                    qcrypto_tls_creds_x509_prop_set_sanity);
docs/about/removed-features.rst +3 -3
index 912e0a1fcf..59a132b8ce 100644
@@ -355,13 +355,13 @@ The ``-writeconfig`` option was not able to serialize the entire contents
 of the QEMU command line.  It is thus considered a failed experiment
 and removed without a replacement.
 
-``loaded`` property of ``secret`` and ``secret_keyring`` objects (removed in 7.1)
-'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+``loaded`` property of secret and TLS credential objects (removed in 7.1)
+'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
 
 The ``loaded=on`` option in the command line or QMP ``object-add`` either had
 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.
+useless and has been removed.
 
 ``opened`` property of ``rng-*`` objects (removed in 7.1)
 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''
qapi/crypto.json +4 -47

106 lines not on this page · raw message

Signature · 1 line
2.46.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Daniel P. Berrangé

The 'loaded' property on TLS creds and secret objects was marked as deprected in 6.0.0 and then marked as removed in 7.1.0.

Except it wasn't actually removed, it was just made read-only, while claiming it was removed. Finish the long overdue removal job.

Fixes 0310641c06dd5f7ea031b2b6170cb2edc63e4cea
Quoted 8 lines
---
  crypto/secret_common.c          | 12 --------
  crypto/tlscredsanon.c           | 35 ----------------------
  crypto/tlscredspsk.c            | 34 ----------------------
  crypto/tlscredsx509.c           | 30 -------------------
  docs/about/removed-features.rst |  6 ++--
  qapi/crypto.json                | 51 +++------------------------------
  6 files changed, 7 insertions(+), 161 deletions(-)
Reviewed-by on v1 1/1
#2 lore raw
In reply to Daniel P. Berrangé
Quoted 2 lines · Daniel P. Berrangé

The 'loaded' property on TLS creds and secret objects was marked as deprected in 6.0.0 and then marked as removed in 7.1.0.

deprecated

Regarding "marked as removed": not quite. Its entry was moved from docs/about/deprecated.rst to docs/about/removed-features.rst, but the text there is "should simply be removed."

Quoted 5 lines

Except it wasn't actually removed, it was just made read-only, while claiming it was removed. Finish the long overdue removal job.

Fixes 0310641c06dd5f7ea031b2b6170cb2edc63e4cea

I'm not sure it fixes something that was broken. Commit 0310641c06d (crypto: make loaded property read-only) did what it said on the tin. What it did was unusual, and maybe a bad idea.

Anyway, not important now.

Quoted 1 line
#3 lore raw
Quoted 12 lines · Markus Armbruster
Quoted 2 lines · Daniel P. Berrangé

The 'loaded' property on TLS creds and secret objects was marked as deprected in 6.0.0 and then marked as removed in 7.1.0.

deprecated

Regarding "marked as removed": not quite. Its entry was moved from docs/about/deprecated.rst to docs/about/removed-features.rst, but the text there is "should simply be removed."

Quoted 1 line
Quoted 8 lines
Quoted 4 lines

Except it wasn't actually removed, it was just made read-only, while claiming it was removed. Finish the long overdue removal job.

Fixes 0310641c06dd5f7ea031b2b6170cb2edc63e4cea

I'm not sure it fixes something that was broken. Commit 0310641c06d (crypto: make loaded property read-only) did what it said on the tin. What it did was unusual, and maybe a bad idea.

I'm re-wording the commit message to:

The 'loaded' property on TLS creds and secret objects was marked as deprecated in 6.0.0. In 7.1.0 the deprecation info was moved into the 'removed-features.rst' file, but the property was not actually removed, just made read-only. This was a highly unusual practice, so finish the long overdue removal job.

and removing the "Fixes" tag

Quoted 7 lines

Anyway, not important now.

Quoted 1 line

With regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#4 lore raw
Quoted 24 lines · Daniel P. Berrangé
Quoted 12 lines · Markus Armbruster
Quoted 2 lines · Daniel P. Berrangé

The 'loaded' property on TLS creds and secret objects was marked as deprected in 6.0.0 and then marked as removed in 7.1.0.

deprecated

Regarding "marked as removed": not quite. Its entry was moved from docs/about/deprecated.rst to docs/about/removed-features.rst, but the text there is "should simply be removed."

Quoted 1 line
Quoted 8 lines
Quoted 4 lines

Except it wasn't actually removed, it was just made read-only, while claiming it was removed. Finish the long overdue removal job.

Fixes 0310641c06dd5f7ea031b2b6170cb2edc63e4cea

I'm not sure it fixes something that was broken. Commit 0310641c06d (crypto: make loaded property read-only) did what it said on the tin. What it did was unusual, and maybe a bad idea.

I'm re-wording the commit message to:

Quoted 7 lines

The 'loaded' property on TLS creds and secret objects was marked as deprecated in 6.0.0. In 7.1.0 the deprecation info was moved into the 'removed-features.rst' file, but the property was not actually removed, just made read-only. This was a highly unusual practice, so finish the long overdue removal job.

and removing the "Fixes" tag

Thanks!

[...]