[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/18] chardev: Rename PTY_CHARDEV to CHARDEV_PTY
From: |
Eduardo Habkost |
Subject: |
[PATCH 09/18] chardev: Rename PTY_CHARDEV to CHARDEV_PTY |
Date: |
Thu, 10 Sep 2020 15:48:54 -0400 |
Rename instance and class type checkers to match the
TYPE_CHARDEV_* constant names and the QOM type name strings
("chardev-*").
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
chardev/char-pty.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/chardev/char-pty.c b/chardev/char-pty.c
index a2d1e7c985..4c1c877097 100644
--- a/chardev/char-pty.c
+++ b/chardev/char-pty.c
@@ -45,7 +45,7 @@ struct PtyChardev {
};
typedef struct PtyChardev PtyChardev;
-DECLARE_INSTANCE_CHECKER(PtyChardev, PTY_CHARDEV,
+DECLARE_INSTANCE_CHECKER(PtyChardev, CHARDEV_PTY,
TYPE_CHARDEV_PTY)
static void pty_chr_state(Chardev *chr, int connected);
@@ -62,7 +62,7 @@ static void pty_chr_timer_cancel(PtyChardev *s)
static gboolean pty_chr_timer(gpointer opaque)
{
struct Chardev *chr = CHARDEV(opaque);
- PtyChardev *s = PTY_CHARDEV(opaque);
+ PtyChardev *s = CHARDEV_PTY(opaque);
pty_chr_timer_cancel(s);
if (!s->connected) {
@@ -74,7 +74,7 @@ static gboolean pty_chr_timer(gpointer opaque)
static void pty_chr_rearm_timer(Chardev *chr, int ms)
{
- PtyChardev *s = PTY_CHARDEV(chr);
+ PtyChardev *s = CHARDEV_PTY(chr);
char *name;
pty_chr_timer_cancel(s);
@@ -86,7 +86,7 @@ static void pty_chr_rearm_timer(Chardev *chr, int ms)
static void pty_chr_update_read_handler(Chardev *chr)
{
- PtyChardev *s = PTY_CHARDEV(chr);
+ PtyChardev *s = CHARDEV_PTY(chr);
GPollFD pfd;
int rc;
QIOChannelFile *fioc = QIO_CHANNEL_FILE(s->ioc);
@@ -108,7 +108,7 @@ static void pty_chr_update_read_handler(Chardev *chr)
static int char_pty_chr_write(Chardev *chr, const uint8_t *buf, int len)
{
- PtyChardev *s = PTY_CHARDEV(chr);
+ PtyChardev *s = CHARDEV_PTY(chr);
if (!s->connected) {
return len;
@@ -118,7 +118,7 @@ static int char_pty_chr_write(Chardev *chr, const uint8_t
*buf, int len)
static GSource *pty_chr_add_watch(Chardev *chr, GIOCondition cond)
{
- PtyChardev *s = PTY_CHARDEV(chr);
+ PtyChardev *s = CHARDEV_PTY(chr);
if (!s->connected) {
return NULL;
}
@@ -128,7 +128,7 @@ static GSource *pty_chr_add_watch(Chardev *chr,
GIOCondition cond)
static int pty_chr_read_poll(void *opaque)
{
Chardev *chr = CHARDEV(opaque);
- PtyChardev *s = PTY_CHARDEV(opaque);
+ PtyChardev *s = CHARDEV_PTY(opaque);
s->read_bytes = qemu_chr_be_can_write(chr);
return s->read_bytes;
@@ -137,7 +137,7 @@ static int pty_chr_read_poll(void *opaque)
static gboolean pty_chr_read(QIOChannel *chan, GIOCondition cond, void *opaque)
{
Chardev *chr = CHARDEV(opaque);
- PtyChardev *s = PTY_CHARDEV(opaque);
+ PtyChardev *s = CHARDEV_PTY(opaque);
gsize len;
uint8_t buf[CHR_READ_BUF_LEN];
ssize_t ret;
@@ -162,7 +162,7 @@ static gboolean pty_chr_read(QIOChannel *chan, GIOCondition
cond, void *opaque)
static void pty_chr_state(Chardev *chr, int connected)
{
- PtyChardev *s = PTY_CHARDEV(chr);
+ PtyChardev *s = CHARDEV_PTY(chr);
if (!connected) {
remove_fd_in_watch(chr);
@@ -189,7 +189,7 @@ static void pty_chr_state(Chardev *chr, int connected)
static void char_pty_finalize(Object *obj)
{
Chardev *chr = CHARDEV(obj);
- PtyChardev *s = PTY_CHARDEV(obj);
+ PtyChardev *s = CHARDEV_PTY(obj);
pty_chr_state(chr, 0);
object_unref(OBJECT(s->ioc));
@@ -220,7 +220,7 @@ static void char_pty_open(Chardev *chr,
qemu_printf("char device redirected to %s (label %s)\n",
pty_name, chr->label);
- s = PTY_CHARDEV(chr);
+ s = CHARDEV_PTY(chr);
s->ioc = QIO_CHANNEL(qio_channel_file_new_fd(master_fd));
name = g_strdup_printf("chardev-pty-%s", chr->label);
qio_channel_set_name(QIO_CHANNEL(s->ioc), name);
--
2.26.2
- [PATCH 00/18] chardev: QOM cleanups, Eduardo Habkost, 2020/09/10
- [PATCH 01/18] chardev: Move PARALLEL_CHARDEV macro to common code, Eduardo Habkost, 2020/09/10
- [PATCH 02/18] chardev: Move ParallelChardev typedef to common code, Eduardo Habkost, 2020/09/10
- [PATCH 03/18] chardev: Use DECLARE_INSTANCE_CHECKER macro for PARALLEL_CHARDEV, Eduardo Habkost, 2020/09/10
- [PATCH 04/18] chardev: Rename MOUSE_CHARDEV to CHARDEV_MSMOUSE, Eduardo Habkost, 2020/09/10
- [PATCH 05/18] chardev: Rename BAUM_CHARDEV to CHARDEV_BRAILLE, Eduardo Habkost, 2020/09/10
- [PATCH 06/18] chardev: Rename FD_CHARDEV to CHARDEV_FD, Eduardo Habkost, 2020/09/10
- [PATCH 07/18] chardev: Rename MUX_CHARDEV to CHARDEV_MUX, Eduardo Habkost, 2020/09/10
- [PATCH 08/18] chardev: Rename PARALLEL_CHARDEV to CHARDEV_PARALLEL, Eduardo Habkost, 2020/09/10
- [PATCH 10/18] chardev: Rename RINGBUF_CHARDEV to CHARDEV_RINGBUF, Eduardo Habkost, 2020/09/10
- [PATCH 09/18] chardev: Rename PTY_CHARDEV to CHARDEV_PTY,
Eduardo Habkost <=
- [PATCH 11/18] chardev: Rename SOCKET_CHARDEV to CHARDEV_SOCKET, Eduardo Habkost, 2020/09/10
- [PATCH 12/18] chardev: Rename SPICE_CHARDEV to CHARDEV_SPICE, Eduardo Habkost, 2020/09/10
- [PATCH 13/18] chardev: Rename TESTDEV_CHARDEV to CHARDEV_TESTDEV, Eduardo Habkost, 2020/09/10
- [PATCH 14/18] chardev: Rename UDP_CHARDEV to CHARDEV_UDP, Eduardo Habkost, 2020/09/10
- [PATCH 15/18] chardev: Rename VC_CHARDEV to CHARDEV_VC, Eduardo Habkost, 2020/09/10
- [PATCH 16/18] chardev: Rename WCTABLET_CHARDEV to CHARDEV_WCTABLET, Eduardo Habkost, 2020/09/10
- [PATCH 17/18] chardev: Rename WIN_CHARDEV to CHARDEV_WIN, Eduardo Habkost, 2020/09/10
- [PATCH 18/18] chardev: Rename WIN_STDIO_CHARDEV to CHARDEV_WIN_STDIO, Eduardo Habkost, 2020/09/10
- Re: [PATCH 00/18] chardev: QOM cleanups, Marc-André Lureau, 2020/09/11