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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user