Blame 0012-usb-redir-Call-qemu_chr_guest_open-close.patch

Justin M. Forbes 13f703
>From eea72a6f70c7b4cf632c3637e12d4689ce6ff0f5 Mon Sep 17 00:00:00 2001
Justin M. Forbes 5e10b1
From: Hans de Goede <hdegoede@redhat.com>
Justin M. Forbes 5e10b1
Date: Thu, 21 Jul 2011 16:28:06 +0200
Justin M. Forbes 13f703
Subject: [PATCH 12/25] usb-redir: Call qemu_chr_guest_open/close
Justin M. Forbes 5e10b1
Justin M. Forbes 5e10b1
To let the chardev now we're ready start receiving data. This is necessary
Justin M. Forbes 5e10b1
with the spicevmc chardev to get it registered with the spice-server.
Justin M. Forbes 5e10b1
Justin M. Forbes 5e10b1
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Justin M. Forbes 5e10b1
---
Justin M. Forbes 5e10b1
 usb-redir.c |    3 +++
Justin M. Forbes 5e10b1
 1 files changed, 3 insertions(+), 0 deletions(-)
Justin M. Forbes 5e10b1
Justin M. Forbes 5e10b1
diff --git a/usb-redir.c b/usb-redir.c
Justin M. Forbes 5e10b1
index 6932beb..d1aafda 100644
Justin M. Forbes 5e10b1
--- a/usb-redir.c
Justin M. Forbes 5e10b1
+++ b/usb-redir.c
Justin M. Forbes 5e10b1
@@ -840,6 +840,8 @@ static int usbredir_initfn(USBDevice *udev)
Justin M. Forbes 5e10b1
     udev->auto_attach = 0;
Justin M. Forbes 5e10b1
 
Justin M. Forbes 5e10b1
     qemu_chr_add_handlers(dev->cs, &usbredir_chr_handlers, dev);
Justin M. Forbes 5e10b1
+    /* Let the other side know we are ready */
Justin M. Forbes 5e10b1
+    qemu_chr_guest_open(dev->cs);
Justin M. Forbes 5e10b1
 
Justin M. Forbes 5e10b1
     return 0;
Justin M. Forbes 5e10b1
 }
Justin M. Forbes 5e10b1
@@ -861,6 +863,7 @@ static void usbredir_handle_destroy(USBDevice *udev)
Justin M. Forbes 5e10b1
 {
Justin M. Forbes 5e10b1
     USBRedirDevice *dev = DO_UPCAST(USBRedirDevice, dev, udev);
Justin M. Forbes 5e10b1
 
Justin M. Forbes 5e10b1
+    qemu_chr_guest_close(dev->cs);
Justin M. Forbes 5e10b1
     qemu_chr_close(dev->cs);
Justin M. Forbes 5e10b1
     /* Note must be done after qemu_chr_close, as that causes a close event */
Justin M. Forbes 5e10b1
     qemu_bh_delete(dev->open_close_bh);
Justin M. Forbes 5e10b1
-- 
Justin M. Forbes 5e10b1
1.7.5.1
Justin M. Forbes 5e10b1