diff mbox series

[2/4] autz/listfile: Use object_class_property_add_bool_ptr()

Message ID 20201022223140.2083123-3-ehabkost@redhat.com
State New
Headers show
Series qom: Introduce object*_property_add_bool_ptr() functions | expand

Commit Message

Eduardo Habkost Oct. 22, 2020, 10:31 p.m. UTC
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Cc: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org
---
 authz/listfile.c | 27 +++------------------------
 1 file changed, 3 insertions(+), 24 deletions(-)
diff mbox series

Patch

diff --git a/authz/listfile.c b/authz/listfile.c
index aaf930453d..911c4e45f2 100644
--- a/authz/listfile.c
+++ b/authz/listfile.c
@@ -184,27 +184,6 @@  qauthz_list_file_prop_get_filename(Object *obj,
 }
 
 
-static void
-qauthz_list_file_prop_set_refresh(Object *obj,
-                                  bool value,
-                                  Error **errp G_GNUC_UNUSED)
-{
-    QAuthZListFile *fauthz = QAUTHZ_LIST_FILE(obj);
-
-    fauthz->refresh = value;
-}
-
-
-static bool
-qauthz_list_file_prop_get_refresh(Object *obj,
-                                  Error **errp G_GNUC_UNUSED)
-{
-    QAuthZListFile *fauthz = QAUTHZ_LIST_FILE(obj);
-
-    return fauthz->refresh;
-}
-
-
 static void
 qauthz_list_file_finalize(Object *obj)
 {
@@ -227,9 +206,9 @@  qauthz_list_file_class_init(ObjectClass *oc, void *data)
     object_class_property_add_str(oc, "filename",
                                   qauthz_list_file_prop_get_filename,
                                   qauthz_list_file_prop_set_filename);
-    object_class_property_add_bool(oc, "refresh",
-                                   qauthz_list_file_prop_get_refresh,
-                                   qauthz_list_file_prop_set_refresh);
+    object_class_property_add_bool_ptr(oc, "refresh",
+                                       offsetof(QAuthZListFile, refresh),
+                                       OBJ_PROP_FLAG_READWRITE);
 
     authz->is_allowed = qauthz_list_file_is_allowed;
 }