peterdelevoryas / rpms / qemu

Forked from rpms/qemu 2 years ago
Clone

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

Justin M. Forbes fc5c27
>From c8a865625b713ffc1cff6ff97fc3e4c01aeeb0f7 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 fc5c27
Subject: [PATCH 26/28] 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 fc5c27
index 6932beb..9ce2c8b 100644
Justin M. Forbes 5e10b1
--- a/usb-redir.c
Justin M. Forbes 5e10b1
+++ b/usb-redir.c
Justin M. Forbes fc5c27
@@ -839,6 +839,8 @@ static int usbredir_initfn(USBDevice *udev)
Justin M. Forbes fc5c27
     /* We'll do the attach once we receive the speed from the usb-host */
Justin M. Forbes 5e10b1
     udev->auto_attach = 0;
Justin M. Forbes 5e10b1
 
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 fc5c27
     qemu_chr_add_handlers(dev->cs, &usbredir_chr_handlers, dev);
Justin M. Forbes 5e10b1
 
Justin M. Forbes 5e10b1
     return 0;
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