hw/char/serial: Make 'wakeup' property boolean
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Mon, 7 Sep 2020 01:55:33 +0000 (03:55 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 30 Sep 2020 17:09:20 +0000 (19:09 +0200)
Make the "wakeup" property introduced in commit 9826fd597df
("suspend: make serial ports wakeup the guest") a boolean.

As we want to reuse the generic serial properties in the
ISA model (next commit), expose this property.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200907015535.827885-6-f4bug@amsat.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/char/serial-isa.c
hw/char/serial.c
include/hw/char/serial.h

index 32c2fc0ebe0edc82e030f0ab9ca0501b4b68f159..fc8ff7823a873c332d1b9b2f2b76bb3be12d1ab9 100644 (file)
@@ -117,7 +117,7 @@ static Property serial_isa_properties[] = {
     DEFINE_PROP_UINT32("iobase",  ISASerialState, iobase,  -1),
     DEFINE_PROP_UINT32("irq",    ISASerialState, isairq,  -1),
     DEFINE_PROP_CHR("chardev",   ISASerialState, state.chr),
-    DEFINE_PROP_UINT32("wakeup", ISASerialState, state.wakeup, 0),
+    DEFINE_PROP_BOOL("wakeup",   ISASerialState, state.wakeup, false),
     DEFINE_PROP_END_OF_LIST(),
 };
 
index 7b5ef872bd742b1b615e00578ed9f210e854fd4d..4386adabd4669f6c410363e677af59ac1638a298 100644 (file)
@@ -975,6 +975,7 @@ const MemoryRegionOps serial_io_ops = {
 static Property serial_properties[] = {
     DEFINE_PROP_CHR("chardev", SerialState, chr),
     DEFINE_PROP_UINT32("baudbase", SerialState, baudbase, 115200),
+    DEFINE_PROP_BOOL("wakeup", SerialState, wakeup, false),
     DEFINE_PROP_END_OF_LIST(),
 };
 
index 23bd7d3ddeddf83a07b6333c48f3007ab291e8d7..8ba7eca3d6725267ad96d7a9ded61ff48170c3fd 100644 (file)
@@ -61,7 +61,7 @@ struct SerialState {
     uint32_t baudbase;
     uint32_t tsr_retry;
     guint watch_tag;
-    uint32_t wakeup;
+    bool wakeup;
 
     /* Time when the last byte was successfully sent out of the tsr */
     uint64_t last_xmit_ts;