[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/4] autz/listfile: Use object_class_property_add_bool_ptr()
From: |
Eduardo Habkost |
Subject: |
[PATCH 2/4] autz/listfile: Use object_class_property_add_bool_ptr() |
Date: |
Thu, 22 Oct 2020 18:31:38 -0400 |
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 --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;
}
--
2.28.0