aboutsummaryrefslogtreecommitdiff
path: root/hw/char/serial.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-10-22 01:14:43 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2020-01-07 16:50:48 +0400
commitb9975000a008c5b0801e3d24ed113a1bd2767ed5 (patch)
treed2b17e8a550c5de7ebd0cb018a77410e4ebd4493 /hw/char/serial.c
parentc9808d602813bce4fada7bf9ecc463aa779b73f7 (diff)
serial: replace serial_exit_core() with unrealize
Instead of calling serial_exit_core() directly, use the QDev unrealize callback. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'hw/char/serial.c')
-rw-r--r--hw/char/serial.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/char/serial.c b/hw/char/serial.c
index 8328cc62c3..ec388f3876 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -950,8 +950,10 @@ static void serial_realize(DeviceState *dev, Error **errp)
serial_reset(s);
}
-void serial_exit_core(SerialState *s)
+static void serial_unrealize(DeviceState *dev, Error **errp)
{
+ SerialState *s = SERIAL(dev);
+
qemu_chr_fe_deinit(&s->chr, false);
timer_del(s->modem_status_poll);
@@ -1014,6 +1016,7 @@ static void serial_class_init(ObjectClass *klass, void* data)
/* internal device for serialio/serialmm, not user-creatable */
dc->user_creatable = false;
dc->realize = serial_realize;
+ dc->unrealize = serial_unrealize;
dc->vmsd = &vmstate_serial;
dc->props = serial_properties;
}