diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2016-10-22 12:52:51 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-10-24 15:27:20 +0200 |
commit | becdfa00cfa2995e859ccefa4b7d72a72eb96581 (patch) | |
tree | 8973236c181dcde0dbcd9fd36d122fc7a4bac6d7 /hw/char/etraxfs_ser.c | |
parent | ecb672d14f092f481000ac9cd9d7dc0500692eba (diff) | |
download | qemu-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/etraxfs_ser.c')
-rw-r--r-- | hw/char/etraxfs_ser.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/char/etraxfs_ser.c b/hw/char/etraxfs_ser.c index c99cc5d..99c4801 100644 --- a/hw/char/etraxfs_ser.c +++ b/hw/char/etraxfs_ser.c @@ -53,7 +53,7 @@ typedef struct ETRAXSerial { SysBusDevice parent_obj; MemoryRegion mmio; - CharDriverState *chr; + CharBackend chr; qemu_irq irq; int pending_tx; @@ -128,7 +128,7 @@ ser_write(void *opaque, hwaddr addr, case RW_DOUT: /* XXX this blocks entire thread. Rewrite to use * qemu_chr_fe_write and background I/O callbacks */ - qemu_chr_fe_write_all(s->chr, &ch, 1); + qemu_chr_fe_write_all(s->chr.chr, &ch, 1); s->regs[R_INTR] |= 3; s->pending_tx = 1; s->regs[addr] = value; @@ -231,8 +231,8 @@ static void etraxfs_ser_realize(DeviceState *dev, Error **errp) { ETRAXSerial *s = ETRAX_SERIAL(dev); - if (s->chr) { - qemu_chr_add_handlers(s->chr, + if (s->chr.chr) { + qemu_chr_add_handlers(s->chr.chr, serial_can_receive, serial_receive, serial_event, s); } |