aboutsummaryrefslogtreecommitdiff
path: root/chardev
diff options
context:
space:
mode:
authorArwed Meyer <arwed.meyer@gmx.de>2022-09-11 20:18:37 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2022-09-29 14:38:05 +0400
commit8f9abdf586d48552273abe38cf55058f7d0c85fd (patch)
treedcc0fd036654a1e40fdc920e5f54da661b8b5ef3 /chardev
parenta39fe10557462648b8bee7aec5e24aad75ebd32d (diff)
chardev: src buffer const for write functions
Make source buffers const for char be write functions. This allows using buffers returned by fifo as buf parameter and source buffer should not be changed by write functions anyway. Signed-off-by: Arwed Meyer <arwed.meyer@gmx.de> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220911181840.8933-3-arwed.meyer@gmx.de>
Diffstat (limited to 'chardev')
-rw-r--r--chardev/char.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/chardev/char.c b/chardev/char.c
index 0169d8dde4..b005df3ccf 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -193,7 +193,7 @@ int qemu_chr_be_can_write(Chardev *s)
return be->chr_can_read(be->opaque);
}
-void qemu_chr_be_write_impl(Chardev *s, uint8_t *buf, int len)
+void qemu_chr_be_write_impl(Chardev *s, const uint8_t *buf, int len)
{
CharBackend *be = s->be;
@@ -202,7 +202,7 @@ void qemu_chr_be_write_impl(Chardev *s, uint8_t *buf, int len)
}
}
-void qemu_chr_be_write(Chardev *s, uint8_t *buf, int len)
+void qemu_chr_be_write(Chardev *s, const uint8_t *buf, int len)
{
if (qemu_chr_replay(s)) {
if (replay_mode == REPLAY_MODE_PLAY) {