mirror of https://gitlab.com/qemu-project/qemu
Merge remote-tracking branch 'kraxel/usb.67' into staging
* kraxel/usb.67: uhci: Raise interrupt when requested even for non active tds usb-redir: Don't make migration fail in none seamless case usb-redir: Change usbredir_open_chardev into usbredir_create_parser
This commit is contained in:
commit
628cc97df7
|
@ -826,8 +826,16 @@ static int uhci_handle_td(UHCIState *s, uint32_t addr, UHCI_TD *td,
|
||||||
USBEndpoint *ep;
|
USBEndpoint *ep;
|
||||||
|
|
||||||
/* Is active ? */
|
/* Is active ? */
|
||||||
if (!(td->ctrl & TD_CTRL_ACTIVE))
|
if (!(td->ctrl & TD_CTRL_ACTIVE)) {
|
||||||
|
/*
|
||||||
|
* ehci11d spec page 22: "Even if the Active bit in the TD is already
|
||||||
|
* cleared when the TD is fetched ... an IOC interrupt is generated"
|
||||||
|
*/
|
||||||
|
if (td->ctrl & TD_CTRL_IOC) {
|
||||||
|
*int_mask |= 0x01;
|
||||||
|
}
|
||||||
return TD_RESULT_NEXT_QH;
|
return TD_RESULT_NEXT_QH;
|
||||||
|
}
|
||||||
|
|
||||||
async = uhci_async_find_td(s, addr, td);
|
async = uhci_async_find_td(s, addr, td);
|
||||||
if (async) {
|
if (async) {
|
||||||
|
|
|
@ -862,15 +862,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, };
|
uint32_t caps[USB_REDIR_CAPS_SIZE] = { 0, };
|
||||||
int flags = 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");
|
DPRINTF("creating usbredirparser\n");
|
||||||
|
|
||||||
dev->parser = qemu_oom_check(usbredirparser_create());
|
dev->parser = qemu_oom_check(usbredirparser_create());
|
||||||
|
@ -982,7 +978,10 @@ static void usbredir_chardev_event(void *opaque, int event)
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case CHR_EVENT_OPENED:
|
case CHR_EVENT_OPENED:
|
||||||
DPRINTF("chardev open\n");
|
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;
|
break;
|
||||||
case CHR_EVENT_CLOSED:
|
case CHR_EVENT_CLOSED:
|
||||||
DPRINTF("chardev close\n");
|
DPRINTF("chardev close\n");
|
||||||
|
@ -1615,12 +1614,17 @@ static int usbredir_get_parser(QEMUFile *f, void *priv, size_t unused)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Our chardev should be open already at this point, otherwise
|
* If our chardev is not open already at this point the usbredir connection
|
||||||
* the usbredir channel will be broken (ie spice without seamless)
|
* 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) {
|
if (dev->parser == NULL) {
|
||||||
ERROR("get_parser called with closed chardev, failing migration\n");
|
WARNING("usb-redir connection broken during migration\n");
|
||||||
return -1;
|
usbredir_create_parser(dev);
|
||||||
|
qemu_bh_schedule(dev->chardev_close_bh);
|
||||||
}
|
}
|
||||||
|
|
||||||
data = g_malloc(len);
|
data = g_malloc(len);
|
||||||
|
|
Loading…
Reference in New Issue