From patchwork Thu Aug 11 12:25:13 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: 109606 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 4D71CB70B9 for ; Thu, 11 Aug 2011 22:24:15 +1000 (EST) Received: from localhost ([::1]:53408 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QrUIs-0003Hy-9a for incoming@patchwork.ozlabs.org; Thu, 11 Aug 2011 08:24:02 -0400 Received: from eggs.gnu.org ([140.186.70.92]:35967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QrUI9-0001Ad-3T for qemu-devel@nongnu.org; Thu, 11 Aug 2011 08:23:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QrUI4-0006Sb-HW for qemu-devel@nongnu.org; Thu, 11 Aug 2011 08:23:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32713) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QrUI4-0006SW-9J for qemu-devel@nongnu.org; Thu, 11 Aug 2011 08:23:12 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7BCNBZX008968 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 11 Aug 2011 08:23:11 -0400 Received: from shalem.localdomain.com (vpn1-5-213.ams2.redhat.com [10.36.5.213]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p7BCN6ex023599; Thu, 11 Aug 2011 08:23:10 -0400 From: Hans de Goede To: Gerd Hoffmann Date: Thu, 11 Aug 2011 14:25:13 +0200 Message-Id: <1313065515-3815-3-git-send-email-hdegoede@redhat.com> In-Reply-To: <1313065515-3815-1-git-send-email-hdegoede@redhat.com> References: <1313065515-3815-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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_guest_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 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);