SSH'ed to a machine (using -X) to start a qemu session and this is the nasty error that I got
X Error of failed request: BadWindow (invalid Window parameter) Major opcode of failed request: 25 (X_SendEvent) Resource id in failed request: 0x9e Serial number of failed request: 19 Current serial number in output stream: 22
But starting xterm or xclock worked perfectly fine. So some X programs worked fine while qemu did not. Thing was it was just one machine that could not bring up qemu forwarding X through SSH. It would get the above message. The thing that was killing me is that it could bring up all other X programs fine. Finally after searching the answer was as simple as using -Y instead of -X to forward X. -Y is enables trusted X11 forwarding. Trusted X11 forwardings are not subjected to the X11 SECURITY extension controls. Go figure.