qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: Hans de Goede <hdegoede@redhat.com>, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 1/2] usb-redir: Change usbredir_open_chardev into usbredir_create_parser
Date: Thu, 27 Sep 2012 17:25:44 +0200	[thread overview]
Message-ID: <1348759545-14645-1-git-send-email-hdegoede@redhat.com> (raw)

As we need to create the parser at more places.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 hw/usb/redirect.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 78e93a7..5d16aff 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -872,15 +872,11 @@ static void usbredir_chardev_close_bh(void *opaque)
     }
 }
 
-static void usbredir_chardev_open(USBRedirDevice *dev)
+static void usbredir_create_parser(USBRedirDevice *dev)
 {
     uint32_t caps[USB_REDIR_CAPS_SIZE] = { 0, };
     int flags = 0;
 
-    /* Make sure any pending closes are handled (no-op if none pending) */
-    usbredir_chardev_close_bh(dev);
-    qemu_bh_cancel(dev->chardev_close_bh);
-
     DPRINTF("creating usbredirparser\n");
 
     dev->parser = qemu_oom_check(usbredirparser_create());
@@ -992,7 +988,10 @@ static void usbredir_chardev_event(void *opaque, int event)
     switch (event) {
     case CHR_EVENT_OPENED:
         DPRINTF("chardev open\n");
-        usbredir_chardev_open(dev);
+        /* Make sure any pending closes are handled (no-op if none pending) */
+        usbredir_chardev_close_bh(dev);
+        qemu_bh_cancel(dev->chardev_close_bh);
+        usbredir_create_parser(dev);
         break;
     case CHR_EVENT_CLOSED:
         DPRINTF("chardev close\n");
-- 
1.7.12

             reply	other threads:[~2012-09-27 15:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-27 15:25 Hans de Goede [this message]
2012-09-27 15:25 ` [Qemu-devel] [PATCH 2/2] usb-redir: Don't make migration fail in none seamless case Hans de Goede
2012-10-08 14:10 ` [Qemu-devel] [PATCH 1/2] usb-redir: Change usbredir_open_chardev into usbredir_create_parser Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1348759545-14645-1-git-send-email-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).