bugfixes: xhci, input-linux and vnc
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAABAgAGBQJY4iMZAAoJEEy22O7T6HE4gCoP/jxw4AdWRGaL6NBoezJ+8WcS cCl/tkP4lJPkv/r4zpQkTKgk7pBURfZXBmRbkr3YuvGWr6R1auc/Im257A6rzb66 2V1c3y+Fk3npvpYmB1z5BsTRyoJC5oi+GiAw0ah9P/WgYO3lVDOsQCYqdA+ov3SM /vGjV+85cfUPsoBOdWjCW0gmTDeHS95qDcgYmA14cKaQwX8oFIqM8h8HaMBgiSOV makivT9UGb4pVgFRY5K4IqCo6JuF+2W5DQJpyk14ZEOiURcZ7/Dr0v7LcaMGqulw 2j3I331l36sbdcfh+OuMS/dDRu2I1v1eQ3l0fqHV1QDZGKq2yBSYLkDLRr8UHE9H rpyXX7bGLTmWEdz0i0Ufck6oYgA0p9pK+LH0QJ+74PJn7XB5gFmJkSUyNOkoLMTg O0nnq8uXAVFAm2uGabMas8CB+4ZwVnXgEmgF3M6KYYWs3vHHF4mO+Xi51gvBdm9u WGltHS+qjRI2MCrAwnHURp//uo6nGhHt4vPh+fqkfxAEHy5vjh6XuXxKMV3FvyeD 30RDYNigDE4oaa1Q0LuTCcWS3vlr7y1J5hzx5uufGfHn4O9cNma/PPIqrR16kdXW ml2n0sFKykQiJU4hdQDw4Kh9nRnnfPxGl9iOg79mZe5Etp8D5xhtkfycLz65K/FI JAluJoF3TO3TqQepX4VE =dZQS -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/kraxel/tags/pull-fixes-20170403-1' into staging bugfixes: xhci, input-linux and vnc # gpg: Signature made Mon 03 Apr 2017 11:25:29 BST # gpg: using RSA key 0x4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/pull-fixes-20170403-1: vnc: allow to connect with add_client when -vnc none Fix input-linux reading from device xhci: flush dequeue pointer to endpoint context Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
f9e46d37bd
@ -2063,7 +2063,7 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid,
|
||||
static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid)
|
||||
{
|
||||
XHCIState *xhci = epctx->xhci;
|
||||
XHCIStreamContext *stctx;
|
||||
XHCIStreamContext *stctx = NULL;
|
||||
XHCITransfer *xfer;
|
||||
XHCIRing *ring;
|
||||
USBEndpoint *ep = NULL;
|
||||
@ -2186,6 +2186,8 @@ static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid)
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* update ring dequeue ptr */
|
||||
xhci_set_ep_state(xhci, epctx, stctx, epctx->state);
|
||||
epctx->kick_active--;
|
||||
|
||||
ep = xhci_epid_to_usbep(epctx);
|
||||
|
@ -169,6 +169,8 @@ struct InputLinux {
|
||||
bool has_abs_x;
|
||||
int num_keys;
|
||||
int num_btns;
|
||||
struct input_event event;
|
||||
int read_offset;
|
||||
|
||||
QTAILQ_ENTRY(InputLinux) next;
|
||||
};
|
||||
@ -327,25 +329,30 @@ static void input_linux_handle_mouse(InputLinux *il, struct input_event *event)
|
||||
static void input_linux_event(void *opaque)
|
||||
{
|
||||
InputLinux *il = opaque;
|
||||
struct input_event event;
|
||||
int rc;
|
||||
int read_size;
|
||||
uint8_t *p = (uint8_t *)&il->event;
|
||||
|
||||
for (;;) {
|
||||
rc = read(il->fd, &event, sizeof(event));
|
||||
if (rc != sizeof(event)) {
|
||||
read_size = sizeof(il->event) - il->read_offset;
|
||||
rc = read(il->fd, &p[il->read_offset], read_size);
|
||||
if (rc != read_size) {
|
||||
if (rc < 0 && errno != EAGAIN) {
|
||||
fprintf(stderr, "%s: read: %s\n", __func__, strerror(errno));
|
||||
qemu_set_fd_handler(il->fd, NULL, NULL, NULL);
|
||||
close(il->fd);
|
||||
} else if (rc > 0) {
|
||||
il->read_offset += rc;
|
||||
}
|
||||
break;
|
||||
}
|
||||
il->read_offset = 0;
|
||||
|
||||
if (il->num_keys) {
|
||||
input_linux_handle_keyboard(il, &event);
|
||||
input_linux_handle_keyboard(il, &il->event);
|
||||
}
|
||||
if (il->has_rel_x && il->num_btns) {
|
||||
input_linux_handle_mouse(il, &event);
|
||||
input_linux_handle_mouse(il, &il->event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
8
ui/vnc.c
8
ui/vnc.c
@ -3786,10 +3786,6 @@ void vnc_display_open(const char *id, Error **errp)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (saddr == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
password = qemu_opt_get_bool(opts, "password", false);
|
||||
if (password) {
|
||||
if (fips_get_state()) {
|
||||
@ -3974,6 +3970,10 @@ void vnc_display_open(const char *id, Error **errp)
|
||||
register_displaychangelistener(&vd->dcl);
|
||||
}
|
||||
|
||||
if (saddr == NULL) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (reverse) {
|
||||
if (vnc_display_connect(vd, saddr, nsaddr, wsaddr, nwsaddr, errp) < 0) {
|
||||
goto fail;
|
||||
|
Loading…
Reference in New Issue
Block a user