qemu/0026-usb-redir-Call-qemu_ch...

38 lines
1.2 KiB
Diff
Raw Normal View History

2011-08-14 19:24:40 +00:00
>From c8a865625b713ffc1cff6ff97fc3e4c01aeeb0f7 Mon Sep 17 00:00:00 2001
2011-07-28 17:10:09 +00:00
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 21 Jul 2011 16:28:06 +0200
2011-08-14 19:24:40 +00:00
Subject: [PATCH 26/28] usb-redir: Call qemu_chr_guest_open/close
2011-07-28 17:10:09 +00:00
To let the chardev now we're ready start receiving data. This is necessary
with the spicevmc chardev to get it registered with the spice-server.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
usb-redir.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/usb-redir.c b/usb-redir.c
2011-08-14 19:24:40 +00:00
index 6932beb..9ce2c8b 100644
2011-07-28 17:10:09 +00:00
--- a/usb-redir.c
+++ b/usb-redir.c
2011-08-14 19:24:40 +00:00
@@ -839,6 +839,8 @@ static int usbredir_initfn(USBDevice *udev)
/* We'll do the attach once we receive the speed from the usb-host */
2011-07-28 17:10:09 +00:00
udev->auto_attach = 0;
+ /* Let the other side know we are ready */
+ qemu_chr_guest_open(dev->cs);
2011-08-14 19:24:40 +00:00
qemu_chr_add_handlers(dev->cs, &usbredir_chr_handlers, dev);
2011-07-28 17:10:09 +00:00
return 0;
@@ -861,6 +863,7 @@ static void usbredir_handle_destroy(USBDevice *udev)
{
USBRedirDevice *dev = DO_UPCAST(USBRedirDevice, dev, udev);
+ qemu_chr_guest_close(dev->cs);
qemu_chr_close(dev->cs);
/* Note must be done after qemu_chr_close, as that causes a close event */
qemu_bh_delete(dev->open_close_bh);
--
1.7.5.1