From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THFx3-0008VH-U1 for qemu-devel@nongnu.org; Thu, 27 Sep 2012 11:24:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1THFww-0004fQ-D8 for qemu-devel@nongnu.org; Thu, 27 Sep 2012 11:24:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46937) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THFww-0004fM-3w for qemu-devel@nongnu.org; Thu, 27 Sep 2012 11:24:26 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8RFOPhN006184 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 27 Sep 2012 11:24:25 -0400 From: Hans de Goede Date: Thu, 27 Sep 2012 17:25:45 +0200 Message-Id: <1348759545-14645-2-git-send-email-hdegoede@redhat.com> In-Reply-To: <1348759545-14645-1-git-send-email-hdegoede@redhat.com> References: <1348759545-14645-1-git-send-email-hdegoede@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] usb-redir: Don't make migration fail in none seamless case List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Hans de Goede , qemu-devel@nongnu.org Instead simple disconnect the device like host redirection does on migration. Signed-off-by: Hans de Goede --- hw/usb/redirect.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 5d16aff..022ba42 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -1637,12 +1637,17 @@ static int usbredir_get_parser(QEMUFile *f, void *priv, size_t unused) } /* - * Our chardev should be open already at this point, otherwise - * the usbredir channel will be broken (ie spice without seamless) + * If our chardev is not open already at this point the usbredir connection + * has been broken (non seamless migration, or restore from disk). + * + * In this case create a temporary parser to receive the migration data, + * and schedule the close_bh to report the device as disconnected to the + * guest and to destroy the parser again. */ if (dev->parser == NULL) { - ERROR("get_parser called with closed chardev, failing migration\n"); - return -1; + WARNING("usb-redir connection broken during migration\n"); + usbredir_create_parser(dev); + qemu_bh_schedule(dev->chardev_close_bh); } data = g_malloc(len); -- 1.7.12