From patchwork Sat Nov 19 09:22:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 126530 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C3896B723C for ; Sat, 19 Nov 2011 20:22:54 +1100 (EST) Received: from localhost ([::1]:42079 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RRh8L-0000MQ-VS for incoming@patchwork.ozlabs.org; Sat, 19 Nov 2011 04:22:49 -0500 Received: from eggs.gnu.org ([140.186.70.92]:34068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RRh7s-0007g0-CW for qemu-devel@nongnu.org; Sat, 19 Nov 2011 04:22:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RRh7q-0008AK-Nf for qemu-devel@nongnu.org; Sat, 19 Nov 2011 04:22:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:30492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RRh7q-0008A6-Gg for qemu-devel@nongnu.org; Sat, 19 Nov 2011 04:22:18 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pAJ9MH9T022768 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 19 Nov 2011 04:22:17 -0500 Received: from shalem.localdomain.com (vpn1-6-161.ams2.redhat.com [10.36.6.161]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pAJ9MCq1032695; Sat, 19 Nov 2011 04:22:16 -0500 From: Hans de Goede To: Gerd Hoffmann Date: Sat, 19 Nov 2011 10:22:45 +0100 Message-Id: <1321694567-2855-4-git-send-email-hdegoede@redhat.com> In-Reply-To: <1321694567-2855-1-git-send-email-hdegoede@redhat.com> References: <1321694567-2855-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Cc: Hans de Goede , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 3/5] usb-redir: Call qemu_chr_fe_open/close X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- usb-redir.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/usb-redir.c b/usb-redir.c index c74b156..9e13410 100644 --- a/usb-redir.c +++ b/usb-redir.c @@ -814,6 +814,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 backend know we are ready */ + qemu_chr_fe_open(dev->cs); qemu_chr_add_handlers(dev->cs, usbredir_chardev_can_read, usbredir_chardev_read, usbredir_chardev_event, dev); @@ -837,6 +839,7 @@ static void usbredir_handle_destroy(USBDevice *udev) { USBRedirDevice *dev = DO_UPCAST(USBRedirDevice, dev, udev); + qemu_chr_fe_close(dev->cs); qemu_chr_delete(dev->cs); /* Note must be done after qemu_chr_close, as that causes a close event */ qemu_bh_delete(dev->open_close_bh);