qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH v3 10/10] system/replay: Rename some method parameters
Date: Wed, 12 Nov 2025 14:41:43 +0100	[thread overview]
Message-ID: <20251112134143.27194-11-philmd@linaro.org> (raw)
In-Reply-To: <20251112134143.27194-1-philmd@linaro.org>

replay_char_read_all_save_error() saves %errno, so rename as @errcode,
replay_char_write_event_save() saves the number of bytes written, so
rename as @nbytes (same for replay_char_write_event_load).

Use the forward declaration in both replay_register_char_driver() and
replay_chr_be_write() declarations, matching their definitions.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/system/replay.h | 16 ++++++++--------
 replay/replay-char.c    | 14 +++++++-------
 stubs/replay-tools.c    | 10 +++++-----
 3 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/include/system/replay.h b/include/system/replay.h
index 68f91bdfbf2..56d2aebac7f 100644
--- a/include/system/replay.h
+++ b/include/system/replay.h
@@ -136,18 +136,18 @@ uint64_t blkreplay_next_id(void);
 
 /* Character device */
 
-/*! Registers char driver to save it's events */
-void replay_register_char_driver(struct Chardev *chr);
-/*! Saves write to char device event to the log */
-void replay_chr_be_write(struct Chardev *s, const uint8_t *buf, int len);
+/*! Registers @chr char driver to save it's events */
+void replay_register_char_driver(Chardev *chr);
+/*! Saves write to char device @s event to the log */
+void replay_chr_be_write(Chardev *s, const uint8_t *buf, int len);
 /*! Writes char write return value to the replay log. */
-void replay_char_write_event_save(int res, int offset);
+void replay_char_write_event_save(int nbytes, int offset);
 /*! Reads char write return value from the replay log. */
-void replay_char_write_event_load(int *res, int *offset);
+void replay_char_write_event_load(int *nbytes, int *offset);
 /*! Reads information about read_all character event. */
 int replay_char_read_all_load(uint8_t *buf);
-/*! Writes character read_all error code into the replay log. */
-void replay_char_read_all_save_error(int res);
+/*! Writes character read_all error code @errcode into the replay log. */
+void replay_char_read_all_save_error(int errcode);
 /*! Writes character read_all execution result into the replay log. */
 void replay_char_read_all_save_buf(uint8_t *buf, int offset);
 
diff --git a/replay/replay-char.c b/replay/replay-char.c
index 81dc416e988..023159b155f 100644
--- a/replay/replay-char.c
+++ b/replay/replay-char.c
@@ -93,23 +93,23 @@ void *replay_event_char_read_load(void)
     return event;
 }
 
-void replay_char_write_event_save(int res, int offset)
+void replay_char_write_event_save(int nbytes, int offset)
 {
     g_assert(replay_mutex_locked());
 
     replay_save_instructions();
     replay_put_event(EVENT_CHAR_WRITE);
-    replay_put_dword(res);
+    replay_put_dword(nbytes);
     replay_put_dword(offset);
 }
 
-void replay_char_write_event_load(int *res, int *offset)
+void replay_char_write_event_load(int *nbytes, int *offset)
 {
     g_assert(replay_mutex_locked());
 
     replay_account_executed_instructions();
     if (replay_next_event_is(EVENT_CHAR_WRITE)) {
-        *res = replay_get_dword();
+        *nbytes = replay_get_dword();
         *offset = replay_get_dword();
         replay_finish_event();
     } else {
@@ -138,13 +138,13 @@ int replay_char_read_all_load(uint8_t *buf)
     }
 }
 
-void replay_char_read_all_save_error(int res)
+void replay_char_read_all_save_error(int errcode)
 {
     g_assert(replay_mutex_locked());
-    assert(res < 0);
+    assert(errcode < 0);
     replay_save_instructions();
     replay_put_event(EVENT_CHAR_READ_ALL_ERROR);
-    replay_put_dword(res);
+    replay_put_dword(errcode);
 }
 
 void replay_char_read_all_save_buf(uint8_t *buf, int offset)
diff --git a/stubs/replay-tools.c b/stubs/replay-tools.c
index c537485f401..df21475cec5 100644
--- a/stubs/replay-tools.c
+++ b/stubs/replay-tools.c
@@ -49,21 +49,21 @@ void replay_mutex_unlock(void)
 {
 }
 
-void replay_register_char_driver(struct Chardev *chr)
+void replay_register_char_driver(Chardev *chr)
 {
 }
 
-void replay_chr_be_write(struct Chardev *s, const uint8_t *buf, int len)
+void replay_chr_be_write(Chardev *s, const uint8_t *buf, int len)
 {
     abort();
 }
 
-void replay_char_write_event_save(int res, int offset)
+void replay_char_write_event_save(int nbytes, int offset)
 {
     abort();
 }
 
-void replay_char_write_event_load(int *res, int *offset)
+void replay_char_write_event_load(int *nbytes, int *offset)
 {
     abort();
 }
@@ -73,7 +73,7 @@ int replay_char_read_all_load(uint8_t *buf)
     abort();
 }
 
-void replay_char_read_all_save_error(int res)
+void replay_char_read_all_save_error(int errcode)
 {
     abort();
 }
-- 
2.51.0



  parent reply	other threads:[~2025-11-12 13:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-12 13:41 [PATCH v3 00/10] chardev: Improve @docstring and clarify qemu_chr_write() uses Philippe Mathieu-Daudé
2025-11-12 13:41 ` [PATCH v3 01/10] chardev/char-fe: Improve @docstrings Philippe Mathieu-Daudé
2025-11-12 13:58   ` Daniel P. Berrangé
2025-11-13 11:31   ` Marc-André Lureau
2025-11-12 13:41 ` [PATCH v3 02/10] chardev/char-io: Add @docstrings for io_channel_send[_full]() Philippe Mathieu-Daudé
2025-11-13 11:32   ` Marc-André Lureau
2025-11-12 13:41 ` [PATCH v3 03/10] chardev/char: Improve ChardevClass::chr_write() docstring Philippe Mathieu-Daudé
2025-11-12 13:41 ` [PATCH v3 04/10] chardev/char: Document qemu_chr_write[_all]() Philippe Mathieu-Daudé
2025-11-12 13:41 ` [PATCH v3 05/10] chardev/char-pty: Do not ignore chr_write() failures Philippe Mathieu-Daudé
2025-11-12 13:41 ` [PATCH v3 06/10] chardev/char: Allow partial writes in qemu_chr_write() Philippe Mathieu-Daudé
2025-11-13 11:30   ` Marc-André Lureau
2025-11-12 13:41 ` [PATCH v3 07/10] chardev/char: Preserve %errno " Philippe Mathieu-Daudé
2025-11-12 13:41 ` [PATCH v3 08/10] chardev/char: Document qemu_chr_fe_write()'s return value Philippe Mathieu-Daudé
2025-11-13 11:32   ` Marc-André Lureau
2025-11-12 13:41 ` [PATCH v3 09/10] hw/char: Simplify when qemu_chr_fe_write() could not write Philippe Mathieu-Daudé
2025-11-12 13:41 ` Philippe Mathieu-Daudé [this message]
2025-11-12 13:44 ` [PATCH v3 00/10] chardev: Improve @docstring and clarify qemu_chr_write() uses 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=20251112134143.27194-11-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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).