Patchwork [3/5] usb-redir: Call qemu_chr_guest_open/close

login
register
mail settings
Submitter Hans de Goede
Date Aug. 11, 2011, 12:25 p.m.
Message ID <1313065515-3815-3-git-send-email-hdegoede@redhat.com>
Download mbox | patch
Permalink /patch/109606/
State New
Headers show

Comments

Hans de Goede - Aug. 11, 2011, 12:25 p.m.
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(-)
Anthony Liguori - Aug. 12, 2011, 1:56 p.m.
On 08/11/2011 07:25 AM, Hans de Goede wrote:
> 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
> index 6932beb..9ce2c8b 100644
> --- a/usb-redir.c
> +++ b/usb-redir.c
> @@ -839,6 +839,8 @@ static int usbredir_initfn(USBDevice *udev)
>       /* We'll do the attach once we receive the speed from the usb-host */
>       udev->auto_attach = 0;
>
> +    /* Let the other side know we are ready */
> +    qemu_chr_guest_open(dev->cs);
>       qemu_chr_add_handlers(dev->cs,&usbredir_chr_handlers, dev);

Not sure what tree this is against, but it's not qemu.git.

Regards,

Anthony Liguori

>
>       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);

Patch

diff --git a/usb-redir.c b/usb-redir.c
index 6932beb..9ce2c8b 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -839,6 +839,8 @@  static int usbredir_initfn(USBDevice *udev)
     /* We'll do the attach once we receive the speed from the usb-host */
     udev->auto_attach = 0;
 
+    /* Let the other side know we are ready */
+    qemu_chr_guest_open(dev->cs);
     qemu_chr_add_handlers(dev->cs, &usbredir_chr_handlers, dev);
 
     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);