diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-06-29 13:39:04 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-06-29 13:39:04 +0100 |
commit | ac8076ac8638428e2a96d5f6c7e80f2014f9e379 (patch) | |
tree | a6e38f0da9323a58408c44070ea97b526c0a6f14 /hw | |
parent | 76fbbec9315f8712d921411fbb4dad1fbcf1b151 (diff) | |
parent | a22d8e47f7efb15a96162b92b50f8fb108b1c5d9 (diff) |
Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging
* remotes/qmp-unstable/queue/qmp:
docs/qmp: Fix documentation of BLOCK_JOB_READY to match code
char: report frontend open/closed state in 'query-chardev'
virtio-serial: report frontend connection state via monitor
qmp: add qmp-events.txt back
qapi event: clean up in callers
qapi script: clean up in scripts
qapi: ignore generated event files
qapi: move event defines
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/char/virtio-console.c | 12 | ||||
-rw-r--r-- | hw/watchdog/watchdog.c | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c index 6c8be0fe26..54eb15f3af 100644 --- a/hw/char/virtio-console.c +++ b/hw/char/virtio-console.c @@ -14,6 +14,7 @@ #include "qemu/error-report.h" #include "trace.h" #include "hw/virtio/virtio-serial.h" +#include "qapi-event.h" #define TYPE_VIRTIO_CONSOLE_SERIAL_PORT "virtserialport" #define VIRTIO_CONSOLE(obj) \ @@ -81,11 +82,16 @@ static ssize_t flush_buf(VirtIOSerialPort *port, static void set_guest_connected(VirtIOSerialPort *port, int guest_connected) { VirtConsole *vcon = VIRTIO_CONSOLE(port); + DeviceState *dev = DEVICE(port); - if (!vcon->chr) { - return; + if (vcon->chr) { + qemu_chr_fe_set_open(vcon->chr, guest_connected); + } + + if (dev->id) { + qapi_event_send_vserport_change(dev->id, guest_connected, + &error_abort); } - qemu_chr_fe_set_open(vcon->chr, guest_connected); } /* Readiness of the guest to accept data on a port */ diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c index 4aebd34924..9f607d42bb 100644 --- a/hw/watchdog/watchdog.c +++ b/hw/watchdog/watchdog.c @@ -106,7 +106,7 @@ int select_watchdog_action(const char *p) */ void watchdog_perform_action(void) { - switch(watchdog_action) { + switch (watchdog_action) { case WDT_RESET: /* same as 'system_reset' in monitor */ qapi_event_send_watchdog(WATCHDOG_EXPIRATION_ACTION_RESET, &error_abort); qemu_system_reset_request(); |