Rebuild against latest spice-server and spice-protocol

- Fix non-seamless migration failing with vms with usb-redir devices,
  to allow boxes to load such vms from disk
This commit is contained in:
Hans de Goede 2012-09-28 12:23:45 +02:00
parent 5ba1a77e21
commit ca70dc3e47
3 changed files with 105 additions and 4 deletions

View File

@ -0,0 +1,49 @@
From 0ef8cdced724a03efea3523410ffd51cf1ec308d Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 27 Sep 2012 16:59:50 +0200
Subject: [PATCH 371/372] usb-redir: Change usbredir_open_chardev into
usbredir_create_parser
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

View File

@ -0,0 +1,43 @@
From adbc805b1f775ef8565bf8d074b45813daa2e779 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 27 Sep 2012 16:57:41 +0200
Subject: [PATCH 372/372] usb-redir: Don't make migration fail in none
seamless case
Instead simple disconnect the device like host redirection does on
migration.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
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

View File

@ -39,7 +39,7 @@
Summary: QEMU is a FAST! processor emulator
Name: qemu
Version: 1.2.0
Release: 10%{?dist}
Release: 11%{?dist}
# Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped
Epoch: 2
License: GPLv2+ and LGPLv2+ and BSD
@ -205,6 +205,8 @@ Patch0368: 0368-uhci-Don-t-queue-up-packets-after-one-with-the-SPD-f.patch
# Not yet upstream but should get there real soon
Patch0369: 0369-ehci-Fix-interrupt-packet-MULT-handling.patch
Patch0370: 0370-usb-redir-Adjust-pkg-config-check-for-usbredirparser.patch
Patch0371: 0371-usb-redir-Change-usbredir_open_chardev-into-usbredir.patch
Patch0372: 0372-usb-redir-Don-t-make-migration-fail-in-none-seamless.patch
# Revert c3767ed0eb5d0.
# NOT upstream (hopefully will be soon).
@ -229,8 +231,8 @@ BuildRequires: libattr-devel
BuildRequires: usbredir-devel >= 0.5.2
BuildRequires: texinfo
%ifarch %{ix86} x86_64
BuildRequires: spice-protocol >= 0.12.1
BuildRequires: spice-server-devel >= 0.11.3
BuildRequires: spice-protocol >= 0.12.2
BuildRequires: spice-server-devel >= 0.12.0
BuildRequires: libseccomp-devel >= 1.0.0
%endif
# For network block driver
@ -607,6 +609,8 @@ such as kvm_stat.
%patch368 -p1
%patch369 -p1
%patch370 -p1
%patch371 -p1
%patch372 -p1
%patch900 -p1
@ -1077,7 +1081,12 @@ fi
%{_mandir}/man1/qemu-img.1*
%changelog
* Tue Sep 25 2012 Hans de Goede <hdegoede@redhat.com> - 2:1.2.0-9
* Fri Sep 28 2012 Hans de Goede <hdegoede@redhat.com> - 2:1.2.0-11
- Rebuild against latest spice-server and spice-protocol
- Fix non-seamless migration failing with vms with usb-redir devices,
to allow boxes to load such vms from disk
* Tue Sep 25 2012 Hans de Goede <hdegoede@redhat.com> - 2:1.2.0-10
- Sync Spice patchsets with upstream (rhbz#860238)
- Fix building with usbredir >= 0.5.2