From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Markus Armbruster" <armbru@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Aurelien Jarno" <aurelien@aurel32.net>
Subject: [PATCH 2/4] autz/listfile: Use object_class_property_add_bool_ptr()
Date: Thu, 22 Oct 2020 18:31:38 -0400 [thread overview]
Message-ID: <20201022223140.2083123-3-ehabkost@redhat.com> (raw)
In-Reply-To: <20201022223140.2083123-1-ehabkost@redhat.com>
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
next prev parent reply other threads:[~2020-10-22 22:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-22 22:31 [PATCH 0/4] qom: Introduce object*_property_add_bool_ptr() functions Eduardo Habkost
2020-10-22 22:31 ` [PATCH 1/4] qom: " Eduardo Habkost
2020-10-22 22:31 ` Eduardo Habkost [this message]
2020-10-22 22:31 ` [PATCH 3/4] machine: Use object_class_property_add_bool_ptr() when possible Eduardo Habkost
2020-10-22 22:31 ` [PATCH 4/4] pc: Use object_class_property_add_bool_ptr() Eduardo Habkost
2020-10-23 7:37 ` [PATCH 0/4] qom: Introduce object*_property_add_bool_ptr() functions Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201022223140.2083123-3-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=armbru@redhat.com \
--cc=aurelien@aurel32.net \
--cc=berrange@redhat.com \
--cc=f4bug@amsat.org \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).