aboutsummaryrefslogtreecommitdiff
path: root/hw/char/spapr_vty.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-10-22 12:52:51 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2016-10-24 15:27:20 +0200
commitbecdfa00cfa2995e859ccefa4b7d72a72eb96581 (patch)
tree8973236c181dcde0dbcd9fd36d122fc7a4bac6d7 /hw/char/spapr_vty.c
parentecb672d14f092f481000ac9cd9d7dc0500692eba (diff)
downloadqemu-becdfa00cfa2995e859ccefa4b7d72a72eb96581.zip
qemu-becdfa00cfa2995e859ccefa4b7d72a72eb96581.tar.gz
qemu-becdfa00cfa2995e859ccefa4b7d72a72eb96581.tar.bz2
char: replace PROP_CHR with CharBackend
Store the property in a CharBackend instead of CharDriverState*. This also replace systematically chr by chr.chr to access the CharDriverState*. The following patches will replace it with calls to qemu_chr_fe CharBackend functions. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20161022095318.17775-12-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/char/spapr_vty.c')
-rw-r--r--hw/char/spapr_vty.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/char/spapr_vty.c b/hw/char/spapr_vty.c
index 9aeafc0..dcb4a85 100644
--- a/hw/char/spapr_vty.c
+++ b/hw/char/spapr_vty.c
@@ -11,7 +11,7 @@
typedef struct VIOsPAPRVTYDevice {
VIOsPAPRDevice sdev;
- CharDriverState *chardev;
+ CharBackend chardev;
uint32_t in, out;
uint8_t buf[VTERM_BUFSIZE];
} VIOsPAPRVTYDevice;
@@ -51,7 +51,7 @@ static int vty_getchars(VIOsPAPRDevice *sdev, uint8_t *buf, int max)
buf[n++] = dev->buf[dev->out++ % VTERM_BUFSIZE];
}
- qemu_chr_accept_input(dev->chardev);
+ qemu_chr_accept_input(dev->chardev.chr);
return n;
}
@@ -62,19 +62,19 @@ void vty_putchars(VIOsPAPRDevice *sdev, uint8_t *buf, int len)
/* XXX this blocks entire thread. Rewrite to use
* qemu_chr_fe_write and background I/O callbacks */
- qemu_chr_fe_write_all(dev->chardev, buf, len);
+ qemu_chr_fe_write_all(dev->chardev.chr, buf, len);
}
static void spapr_vty_realize(VIOsPAPRDevice *sdev, Error **errp)
{
VIOsPAPRVTYDevice *dev = VIO_SPAPR_VTY_DEVICE(sdev);
- if (!dev->chardev) {
+ if (!dev->chardev.chr) {
error_setg(errp, "chardev property not set");
return;
}
- qemu_chr_add_handlers(dev->chardev, vty_can_receive,
+ qemu_chr_add_handlers(dev->chardev.chr, vty_can_receive,
vty_receive, NULL, dev);
}