diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-04-28 08:37:54 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-04-28 08:37:54 -0500 |
commit | 71ef18e1f2291b47ed7bc6dd65a840d4fc42d395 (patch) | |
tree | a4dcefebfd4089ca481159a66f95cf41098bda7f /hw/virtio-console.c | |
parent | e77976a247a9fcefe95cf97b25bf01dbe574e66b (diff) | |
parent | 5c1c9bb24b20fb5844d01ac67d51c26941db5af1 (diff) | |
download | qemu-71ef18e1f2291b47ed7bc6dd65a840d4fc42d395.zip qemu-71ef18e1f2291b47ed7bc6dd65a840d4fc42d395.tar.gz qemu-71ef18e1f2291b47ed7bc6dd65a840d4fc42d395.tar.bz2 |
Merge remote-tracking branch 'amitshah/for-anthony' into staging
Diffstat (limited to 'hw/virtio-console.c')
-rw-r--r-- | hw/virtio-console.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/hw/virtio-console.c b/hw/virtio-console.c index 6b5237b..de539c4 100644 --- a/hw/virtio-console.c +++ b/hw/virtio-console.c @@ -28,6 +28,22 @@ static ssize_t flush_buf(VirtIOSerialPort *port, const uint8_t *buf, size_t len) return qemu_chr_write(vcon->chr, buf, len); } +/* Callback function that's called when the guest opens the port */ +static void guest_open(VirtIOSerialPort *port) +{ + VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port); + + qemu_chr_guest_open(vcon->chr); +} + +/* Callback function that's called when the guest closes the port */ +static void guest_close(VirtIOSerialPort *port) +{ + VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port); + + qemu_chr_guest_close(vcon->chr); +} + /* Readiness of the guest to accept data on a port */ static int chr_can_read(void *opaque) { @@ -64,6 +80,8 @@ static int generic_port_init(VirtConsole *vcon, VirtIOSerialPort *port) qemu_chr_add_handlers(vcon->chr, chr_can_read, chr_read, chr_event, vcon); vcon->port.info->have_data = flush_buf; + vcon->port.info->guest_open = guest_open; + vcon->port.info->guest_close = guest_close; } return 0; } |