All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] iothread: cleanup after adding a new parameter to IOThread
@ 2021-07-27 14:59 Stefano Garzarella
  2021-07-27 14:59 ` [PATCH 1/2] iothread: rename PollParamInfo to IOThreadParamInfo Stefano Garzarella
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Stefano Garzarella @ 2021-07-27 14:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Stefan Hajnoczi

We recently added a new parameter (aio-max-batch) to IOThread.
This series cleans up the code a bit, no functional changes.

Stefano Garzarella (2):
  iothread: rename PollParamInfo to IOThreadParamInfo
  iothread: use IOThreadParamInfo in iothread_[set|get]_param()

 iothread.c | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

-- 
2.31.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] iothread: rename PollParamInfo to IOThreadParamInfo
  2021-07-27 14:59 [PATCH 0/2] iothread: cleanup after adding a new parameter to IOThread Stefano Garzarella
@ 2021-07-27 14:59 ` Stefano Garzarella
  2021-09-08 14:40   ` Stefan Hajnoczi
  2021-07-27 14:59 ` [PATCH 2/2] iothread: use IOThreadParamInfo in iothread_[set|get]_param() Stefano Garzarella
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Stefano Garzarella @ 2021-07-27 14:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Stefan Hajnoczi

Commit 1793ad0247 ("iothread: add aio-max-batch parameter") added
a new parameter (aio-max-batch) to IOThread and used PollParamInfo
structure to handle it.

Since it is not a parameter of the polling mechanism, we rename the
structure to a more generic IOThreadParamInfo.

Suggested-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
---
 iothread.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/iothread.c b/iothread.c
index ddbbde61f7..a73e560ba0 100644
--- a/iothread.c
+++ b/iothread.c
@@ -215,18 +215,18 @@ static void iothread_complete(UserCreatable *obj, Error **errp)
 typedef struct {
     const char *name;
     ptrdiff_t offset; /* field's byte offset in IOThread struct */
-} PollParamInfo;
+} IOThreadParamInfo;
 
-static PollParamInfo poll_max_ns_info = {
+static IOThreadParamInfo poll_max_ns_info = {
     "poll-max-ns", offsetof(IOThread, poll_max_ns),
 };
-static PollParamInfo poll_grow_info = {
+static IOThreadParamInfo poll_grow_info = {
     "poll-grow", offsetof(IOThread, poll_grow),
 };
-static PollParamInfo poll_shrink_info = {
+static IOThreadParamInfo poll_shrink_info = {
     "poll-shrink", offsetof(IOThread, poll_shrink),
 };
-static PollParamInfo aio_max_batch_info = {
+static IOThreadParamInfo aio_max_batch_info = {
     "aio-max-batch", offsetof(IOThread, aio_max_batch),
 };
 
@@ -234,7 +234,7 @@ static void iothread_get_param(Object *obj, Visitor *v,
         const char *name, void *opaque, Error **errp)
 {
     IOThread *iothread = IOTHREAD(obj);
-    PollParamInfo *info = opaque;
+    IOThreadParamInfo *info = opaque;
     int64_t *field = (void *)iothread + info->offset;
 
     visit_type_int64(v, name, field, errp);
@@ -244,7 +244,7 @@ static bool iothread_set_param(Object *obj, Visitor *v,
         const char *name, void *opaque, Error **errp)
 {
     IOThread *iothread = IOTHREAD(obj);
-    PollParamInfo *info = opaque;
+    IOThreadParamInfo *info = opaque;
     int64_t *field = (void *)iothread + info->offset;
     int64_t value;
 
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] iothread: use IOThreadParamInfo in iothread_[set|get]_param()
  2021-07-27 14:59 [PATCH 0/2] iothread: cleanup after adding a new parameter to IOThread Stefano Garzarella
  2021-07-27 14:59 ` [PATCH 1/2] iothread: rename PollParamInfo to IOThreadParamInfo Stefano Garzarella
@ 2021-07-27 14:59 ` Stefano Garzarella
  2021-09-08 14:42   ` Stefan Hajnoczi
  2021-09-06 13:46 ` [PATCH 0/2] iothread: cleanup after adding a new parameter to IOThread Stefano Garzarella
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Stefano Garzarella @ 2021-07-27 14:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Stefan Hajnoczi

Commit 0445409d74 ("iothread: generalize
iothread_set_param/iothread_get_param") moved common code to set and
get IOThread parameters in two new functions.

These functions are called inside callbacks, so we don't need to use an
opaque pointer. Let's replace `void *opaque` parameter with
`IOThreadParamInfo *info`.

Suggested-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
---
 iothread.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/iothread.c b/iothread.c
index a73e560ba0..0f98af0f2a 100644
--- a/iothread.c
+++ b/iothread.c
@@ -231,20 +231,18 @@ static IOThreadParamInfo aio_max_batch_info = {
 };
 
 static void iothread_get_param(Object *obj, Visitor *v,
-        const char *name, void *opaque, Error **errp)
+        const char *name, IOThreadParamInfo *info, Error **errp)
 {
     IOThread *iothread = IOTHREAD(obj);
-    IOThreadParamInfo *info = opaque;
     int64_t *field = (void *)iothread + info->offset;
 
     visit_type_int64(v, name, field, errp);
 }
 
 static bool iothread_set_param(Object *obj, Visitor *v,
-        const char *name, void *opaque, Error **errp)
+        const char *name, IOThreadParamInfo *info, Error **errp)
 {
     IOThread *iothread = IOTHREAD(obj);
-    IOThreadParamInfo *info = opaque;
     int64_t *field = (void *)iothread + info->offset;
     int64_t value;
 
@@ -266,16 +264,18 @@ static bool iothread_set_param(Object *obj, Visitor *v,
 static void iothread_get_poll_param(Object *obj, Visitor *v,
         const char *name, void *opaque, Error **errp)
 {
+    IOThreadParamInfo *info = opaque;
 
-    iothread_get_param(obj, v, name, opaque, errp);
+    iothread_get_param(obj, v, name, info, errp);
 }
 
 static void iothread_set_poll_param(Object *obj, Visitor *v,
         const char *name, void *opaque, Error **errp)
 {
     IOThread *iothread = IOTHREAD(obj);
+    IOThreadParamInfo *info = opaque;
 
-    if (!iothread_set_param(obj, v, name, opaque, errp)) {
+    if (!iothread_set_param(obj, v, name, info, errp)) {
         return;
     }
 
@@ -291,16 +291,18 @@ static void iothread_set_poll_param(Object *obj, Visitor *v,
 static void iothread_get_aio_param(Object *obj, Visitor *v,
         const char *name, void *opaque, Error **errp)
 {
+    IOThreadParamInfo *info = opaque;
 
-    iothread_get_param(obj, v, name, opaque, errp);
+    iothread_get_param(obj, v, name, info, errp);
 }
 
 static void iothread_set_aio_param(Object *obj, Visitor *v,
         const char *name, void *opaque, Error **errp)
 {
     IOThread *iothread = IOTHREAD(obj);
+    IOThreadParamInfo *info = opaque;
 
-    if (!iothread_set_param(obj, v, name, opaque, errp)) {
+    if (!iothread_set_param(obj, v, name, info, errp)) {
         return;
     }
 
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/2] iothread: cleanup after adding a new parameter to IOThread
  2021-07-27 14:59 [PATCH 0/2] iothread: cleanup after adding a new parameter to IOThread Stefano Garzarella
  2021-07-27 14:59 ` [PATCH 1/2] iothread: rename PollParamInfo to IOThreadParamInfo Stefano Garzarella
  2021-07-27 14:59 ` [PATCH 2/2] iothread: use IOThreadParamInfo in iothread_[set|get]_param() Stefano Garzarella
@ 2021-09-06 13:46 ` Stefano Garzarella
  2021-09-06 14:20 ` Philippe Mathieu-Daudé
  2021-09-08 15:04 ` Stefan Hajnoczi
  4 siblings, 0 replies; 8+ messages in thread
From: Stefano Garzarella @ 2021-09-06 13:46 UTC (permalink / raw)
  To: Kevin Wolf, Stefan Hajnoczi; +Cc: qemu-devel

Ping :-)

Looks like it went into the crack during feature freeze,
should I resend it?

On Tue, Jul 27, 2021 at 04:59:34PM +0200, Stefano Garzarella wrote:
>We recently added a new parameter (aio-max-batch) to IOThread.
>This series cleans up the code a bit, no functional changes.
>
>Stefano Garzarella (2):
>  iothread: rename PollParamInfo to IOThreadParamInfo
>  iothread: use IOThreadParamInfo in iothread_[set|get]_param()
>
> iothread.c | 28 +++++++++++++++-------------
> 1 file changed, 15 insertions(+), 13 deletions(-)
>
>-- 
>2.31.1
>
>



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/2] iothread: cleanup after adding a new parameter to IOThread
  2021-07-27 14:59 [PATCH 0/2] iothread: cleanup after adding a new parameter to IOThread Stefano Garzarella
                   ` (2 preceding siblings ...)
  2021-09-06 13:46 ` [PATCH 0/2] iothread: cleanup after adding a new parameter to IOThread Stefano Garzarella
@ 2021-09-06 14:20 ` Philippe Mathieu-Daudé
  2021-09-08 15:04 ` Stefan Hajnoczi
  4 siblings, 0 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-09-06 14:20 UTC (permalink / raw)
  To: Stefano Garzarella, qemu-devel; +Cc: Kevin Wolf, QEMU Trivial, Stefan Hajnoczi

On 7/27/21 4:59 PM, Stefano Garzarella wrote:
> We recently added a new parameter (aio-max-batch) to IOThread.
> This series cleans up the code a bit, no functional changes.
> 
> Stefano Garzarella (2):
>   iothread: rename PollParamInfo to IOThreadParamInfo
>   iothread: use IOThreadParamInfo in iothread_[set|get]_param()
> 
>  iothread.c | 28 +++++++++++++++-------------
>  1 file changed, 15 insertions(+), 13 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] iothread: rename PollParamInfo to IOThreadParamInfo
  2021-07-27 14:59 ` [PATCH 1/2] iothread: rename PollParamInfo to IOThreadParamInfo Stefano Garzarella
@ 2021-09-08 14:40   ` Stefan Hajnoczi
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Hajnoczi @ 2021-09-08 14:40 UTC (permalink / raw)
  To: Stefano Garzarella; +Cc: Kevin Wolf, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 618 bytes --]

On Tue, Jul 27, 2021 at 04:59:35PM +0200, Stefano Garzarella wrote:
> Commit 1793ad0247 ("iothread: add aio-max-batch parameter") added
> a new parameter (aio-max-batch) to IOThread and used PollParamInfo
> structure to handle it.
> 
> Since it is not a parameter of the polling mechanism, we rename the
> structure to a more generic IOThreadParamInfo.
> 
> Suggested-by: Kevin Wolf <kwolf@redhat.com>
> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
> ---
>  iothread.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] iothread: use IOThreadParamInfo in iothread_[set|get]_param()
  2021-07-27 14:59 ` [PATCH 2/2] iothread: use IOThreadParamInfo in iothread_[set|get]_param() Stefano Garzarella
@ 2021-09-08 14:42   ` Stefan Hajnoczi
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Hajnoczi @ 2021-09-08 14:42 UTC (permalink / raw)
  To: Stefano Garzarella; +Cc: Kevin Wolf, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 669 bytes --]

On Tue, Jul 27, 2021 at 04:59:36PM +0200, Stefano Garzarella wrote:
> Commit 0445409d74 ("iothread: generalize
> iothread_set_param/iothread_get_param") moved common code to set and
> get IOThread parameters in two new functions.
> 
> These functions are called inside callbacks, so we don't need to use an
> opaque pointer. Let's replace `void *opaque` parameter with
> `IOThreadParamInfo *info`.
> 
> Suggested-by: Kevin Wolf <kwolf@redhat.com>
> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
> ---
>  iothread.c | 18 ++++++++++--------
>  1 file changed, 10 insertions(+), 8 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/2] iothread: cleanup after adding a new parameter to IOThread
  2021-07-27 14:59 [PATCH 0/2] iothread: cleanup after adding a new parameter to IOThread Stefano Garzarella
                   ` (3 preceding siblings ...)
  2021-09-06 14:20 ` Philippe Mathieu-Daudé
@ 2021-09-08 15:04 ` Stefan Hajnoczi
  4 siblings, 0 replies; 8+ messages in thread
From: Stefan Hajnoczi @ 2021-09-08 15:04 UTC (permalink / raw)
  To: Stefano Garzarella; +Cc: Kevin Wolf, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]

On Tue, Jul 27, 2021 at 04:59:34PM +0200, Stefano Garzarella wrote:
> We recently added a new parameter (aio-max-batch) to IOThread.
> This series cleans up the code a bit, no functional changes.
> 
> Stefano Garzarella (2):
>   iothread: rename PollParamInfo to IOThreadParamInfo
>   iothread: use IOThreadParamInfo in iothread_[set|get]_param()
> 
>  iothread.c | 28 +++++++++++++++-------------
>  1 file changed, 15 insertions(+), 13 deletions(-)
> 
> -- 
> 2.31.1
> 

Thanks, applied to my block tree:
https://gitlab.com/stefanha/qemu/commits/block

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-09-08 15:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-27 14:59 [PATCH 0/2] iothread: cleanup after adding a new parameter to IOThread Stefano Garzarella
2021-07-27 14:59 ` [PATCH 1/2] iothread: rename PollParamInfo to IOThreadParamInfo Stefano Garzarella
2021-09-08 14:40   ` Stefan Hajnoczi
2021-07-27 14:59 ` [PATCH 2/2] iothread: use IOThreadParamInfo in iothread_[set|get]_param() Stefano Garzarella
2021-09-08 14:42   ` Stefan Hajnoczi
2021-09-06 13:46 ` [PATCH 0/2] iothread: cleanup after adding a new parameter to IOThread Stefano Garzarella
2021-09-06 14:20 ` Philippe Mathieu-Daudé
2021-09-08 15:04 ` Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.