diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2015-08-24 18:46:57 +0100 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2016-02-01 14:11:35 +0000 |
commit | 9884abee8f3f52002f33616cd86bc4a5d8d7b6d1 (patch) | |
tree | 26feab528d28d4e4b1f9c5e8b57afcefc4b8a224 /crypto/secret.c | |
parent | 07982d2ee9a57bf4f04fc18f77f0f56fa9a33c08 (diff) | |
download | qemu-9884abee8f3f52002f33616cd86bc4a5d8d7b6d1.zip qemu-9884abee8f3f52002f33616cd86bc4a5d8d7b6d1.tar.gz qemu-9884abee8f3f52002f33616cd86bc4a5d8d7b6d1.tar.bz2 |
crypto: register properties against the class instead of object
This converts the tlscredsx509, tlscredsanon and secret objects
to register their properties against the class rather than object.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'crypto/secret.c')
-rw-r--r-- | crypto/secret.c | 60 |
1 files changed, 27 insertions, 33 deletions
diff --git a/crypto/secret.c b/crypto/secret.c index 90592c0..be736f2 100644 --- a/crypto/secret.c +++ b/crypto/secret.c @@ -353,38 +353,6 @@ qcrypto_secret_complete(UserCreatable *uc, Error **errp) static void -qcrypto_secret_init(Object *obj) -{ - object_property_add_bool(obj, "loaded", - qcrypto_secret_prop_get_loaded, - qcrypto_secret_prop_set_loaded, - NULL); - object_property_add_enum(obj, "format", - "QCryptoSecretFormat", - QCryptoSecretFormat_lookup, - qcrypto_secret_prop_get_format, - qcrypto_secret_prop_set_format, - NULL); - object_property_add_str(obj, "data", - qcrypto_secret_prop_get_data, - qcrypto_secret_prop_set_data, - NULL); - object_property_add_str(obj, "file", - qcrypto_secret_prop_get_file, - qcrypto_secret_prop_set_file, - NULL); - object_property_add_str(obj, "keyid", - qcrypto_secret_prop_get_keyid, - qcrypto_secret_prop_set_keyid, - NULL); - object_property_add_str(obj, "iv", - qcrypto_secret_prop_get_iv, - qcrypto_secret_prop_set_iv, - NULL); -} - - -static void qcrypto_secret_finalize(Object *obj) { QCryptoSecret *secret = QCRYPTO_SECRET(obj); @@ -402,6 +370,33 @@ qcrypto_secret_class_init(ObjectClass *oc, void *data) UserCreatableClass *ucc = USER_CREATABLE_CLASS(oc); ucc->complete = qcrypto_secret_complete; + + object_class_property_add_bool(oc, "loaded", + qcrypto_secret_prop_get_loaded, + qcrypto_secret_prop_set_loaded, + NULL); + object_class_property_add_enum(oc, "format", + "QCryptoSecretFormat", + QCryptoSecretFormat_lookup, + qcrypto_secret_prop_get_format, + qcrypto_secret_prop_set_format, + NULL); + object_class_property_add_str(oc, "data", + qcrypto_secret_prop_get_data, + qcrypto_secret_prop_set_data, + NULL); + object_class_property_add_str(oc, "file", + qcrypto_secret_prop_get_file, + qcrypto_secret_prop_set_file, + NULL); + object_class_property_add_str(oc, "keyid", + qcrypto_secret_prop_get_keyid, + qcrypto_secret_prop_set_keyid, + NULL); + object_class_property_add_str(oc, "iv", + qcrypto_secret_prop_get_iv, + qcrypto_secret_prop_set_iv, + NULL); } @@ -493,7 +488,6 @@ static const TypeInfo qcrypto_secret_info = { .parent = TYPE_OBJECT, .name = TYPE_QCRYPTO_SECRET, .instance_size = sizeof(QCryptoSecret), - .instance_init = qcrypto_secret_init, .instance_finalize = qcrypto_secret_finalize, .class_size = sizeof(QCryptoSecretClass), .class_init = qcrypto_secret_class_init, |