From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgAWd-0002xj-HZ for qemu-devel@nongnu.org; Wed, 05 Dec 2012 03:40:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TgAWW-0002Zz-Jt for qemu-devel@nongnu.org; Wed, 05 Dec 2012 03:40:15 -0500 Received: from cantor2.suse.de ([195.135.220.15]:56714 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgAWW-0002Eb-53 for qemu-devel@nongnu.org; Wed, 05 Dec 2012 03:40:08 -0500 Message-ID: <50BF0836.7050106@suse.de> Date: Wed, 05 Dec 2012 09:39:18 +0100 From: Tim Hardeck MIME-Version: 1.0 References: <1353697247-20805-1-git-send-email-thardeck@suse.de> <20121203162214.GB12912@stefanha-thinkpad.redhat.com> In-Reply-To: <20121203162214.GB12912@stefanha-thinkpad.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig6D55D3B4B88BA42C28F8E2A0" Subject: Re: [Qemu-devel] [PATCH v3] vnc: added initial websocket protocol support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: aliguori@us.ibm.com, github@martintribe.org, qemu-devel@nongnu.org, alevy@redhat.com, kraxel@redhat.com, corentin.chary@gmail.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig6D55D3B4B88BA42C28F8E2A0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Stefan, On 12/03/2012 05:22 PM, Stefan Hajnoczi wrote: > Thanks for the patch, Tim. Some general code review comments below. Thanks for the code review. I am going to incorporate them in my new patc= h. > I hope someone has time to review the VNC and WebSocket specific stuff.= =20 > I didn't check the details of buffers, whether the WebSocket spec is > correctly implemented, etc. I have mainly tested my websockets implementation with the guest OS openSUSE 12.2 which worked fine during all my tests on several browsers. I recently found out though that when I run Firefox in openSUSE 12.1, noVNC complains about an unsupported VNC encoding and QEMU crashes. I have attached the back trace at the end of this mail. This issue could be fixed by not encoding Websocket frames directly in vnc_write but in vnc_client_write_locked. This should also decrease the overhead through websocket frame headers. Nevertheless it looks like QEMU did crash because of the sudden disconnect which shouldn't happen. I have created a vnc_client_write_ws function which is used instead of vnc_client_write_plain. I have also moved the decoding part to vnc_client_read_ws to keep consistency? Is this Ok or should I add the websocket en/decoding to the existing vnc plain functions? Regards Tim #0 0x00007ffff3f92d25 in __GI_raise (sig=3Dsig@entry=3D6) at =2E./nptl/sysdeps/unix/sysv/linux/raise.c:64 resultvar =3D 0 pid =3D 24308 selftid =3D 24312 #1 0x00007ffff3f941a8 in __GI_abort () at abort.c:91 save_stage =3D 2 act =3D {__sigaction_handler =3D {sa_handler =3D 0x5555559153c0 <__func__.4908>, sa_sigaction =3D 0x5555559153c0 <__func__.4908>}, sa_mask =3D {__val =3D {140737287809753, 0, 18374686479671623680, 0, 140737286898450, 131072, 93825010082032, 2064448, 93825010157472, 1989008, 22, 140737218422160, 1, 140737488346032, 0, 140737218426624}}, sa_flags =3D -201457138, sa_restorer =3D 0x6d940} sigs =3D {__val =3D {32, 0 }} #2 0x000055555577b5c2 in error_exit (err=3D22, msg=3D0x5555559153c0 <__func__.4908> "qemu_mutex_lock") at qemu-thread-posix.c:28 No locals. #3 0x000055555577b6e1 in qemu_mutex_lock (mutex=3D0x555556666328) at qemu-thread-posix.c:59 err =3D 22 __func__ =3D "qemu_mutex_lock" #4 0x00005555557bb075 in vnc_lock_output (vs=3D0x55555665a100) at ui/vnc-jobs.h:63 No locals. #5 0x00005555557bb5eb in vnc_jobs_consume_buffer (vs=3D0x55555665a100) a= t ui/vnc-jobs.c:166 flush =3D false #6 0x00005555557bb5ae in vnc_jobs_join (vs=3D0x55555665a100) at ui/vnc-jobs.c:159 No locals. #7 0x00005555557bf9d9 in vnc_update_client_sync (vs=3D0x55555665a100, has_dirty=3D1) at ui/vnc.c:876 ret =3D 0 ---Type to continue, or q to quit--- #8 0x00005555557bf308 in vnc_dpy_copy (ds=3D0x555556583240, src_x=3D99, src_y=3D143, dst_x=3D99, dst_y=3D 146, w=3D8, h=3D1) at ui/vnc.c:752 vd =3D 0x7fffeea48010 vs =3D 0x55555665a100 vn =3D 0x0 src_row =3D 0x1800000000
dst_row =3D 0xc0000000c00
i =3D 768 x =3D -1 y =3D 24 pitch =3D 1024 inc =3D 0 w_lim =3D 0 s =3D 8 cmp_bytes =3D 2359296 #9 0x0000555555623e78 in dpy_gfx_copy (s=3D0x555556583240, src_x=3D99, src_y=3D143, dst_x=3D99, dst_y=3D146, w=3D8, h=3D1) at console.h:275 dcl =3D 0x5555565f38e0 #10 0x00005555556281f4 in qemu_console_copy (ds=3D0x555556583240, src_x=3D99, src_y=3D143, dst_x=3D99, dst_y=3D146, w=3D8, h=3D1) at console.c:1598 No locals. #11 0x000055555566a79a in cirrus_do_copy (s=3D0x5555565afc08, dst=3D44883= 2, src=3D439616, w=3D8, h=3D1) at hw/cirrus_vga.c:732 sx =3D 99 sy =3D 143 dx =3D 99 ---Type to continue, or q to quit--- dy =3D 146 depth =3D 3 notify =3D 1 #12 0x000055555566a8f7 in cirrus_bitblt_videotovideo_copy (s=3D0x5555565afc08) at hw/cirrus_vga.c:750 No locals. #13 0x000055555566ae8b in cirrus_bitblt_videotovideo (s=3D0x5555565afc08)= at hw/cirrus_vga.c:872 ret =3D 1 #14 0x000055555566b61c in cirrus_bitblt_start (s=3D0x5555565afc08) at hw/cirrus_vga.c:1013 blt_rop =3D 13 '\r' #15 0x000055555566b6c8 in cirrus_write_bitblt (s=3D0x5555565afc08, reg_value=3D2) at hw/cirrus_vga.c:1034 old_value =3D 0 #16 0x000055555566c589 in cirrus_vga_write_gr (s=3D0x5555565afc08, reg_index=3D49, reg_value=3D2) at hw/cirrus_vga.c:1529 No locals. #17 0x000055555566cebb in cirrus_mmio_blt_write (s=3D0x5555565afc08, address=3D64, value=3D2 '\002') at hw/cirrus_vga.c:1883 No locals. #18 0x000055555566ed4c in cirrus_mmio_write (opaque=3D0x5555565afc08, addr=3D320, val=3D2, size=3D1) at hw/cirrus_vga.c:2659 s =3D 0x5555565afc08 #19 0x000055555584b7ca in memory_region_write_accessor (opaque=3D0x5555565c0538, addr=3D320, value=3D 0x7fffefe92a98, size=3D1, shift=3D0, mask=3D255) at /suse/thardeck/Development/qemu/memory.c:334 mr =3D 0x5555565c0538 tmp =3D 2 #20 0x000055555584b8ac in access_with_adjusted_size (addr=3D320, value=3D0x7fffefe92a98, size=3D4, ---Type to continue, or q to quit--- access_size_min=3D1, access_size_max=3D1, access=3D0x55555584b745 , opaque=3D0x5555565c0538) at /suse/thardeck/Development/qemu/memory.c:= 364 access_mask =3D 255 access_size =3D 1 i =3D 0 #21 0x000055555584e51a in memory_region_dispatch_write (mr=3D0x5555565c0538, addr=3D320, data=3D 4294967042, size=3D4) at /suse/thardeck/Development/qemu/memory.c:916= No locals. #22 0x000055555585154a in io_mem_write (mr=3D0x5555565c0538, addr=3D320, val=3D4294967042, size=3D4) at /suse/thardeck/Development/qemu/memory.c:1581 No locals. #23 0x00005555557ea58f in address_space_rw (as=3D0x5555564ec440 , addr=3D 4273930560, buf=3D0x7ffff7ff2028 "\002\377\377\377", len=3D4, is_writ= e=3Dtrue) at /suse/thardeck/Development/qemu/exec.c:3397 addr1 =3D 320 d =3D 0x555556561860 l =3D 4 ptr =3D 0x555555808a39 "H\213E\370dH3\004= %(" val =3D 4294967042 page =3D 4273930240 section =3D 0x55555664f1a0 #24 0x00005555557ea953 in cpu_physical_memory_rw (addr=3D4273930560, buf=3D= 0x7ffff7ff2028 "\002\377\377\377", len=3D4, is_write=3D1) at /suse/thardeck/Development/qemu/exec.c:3479 No locals. #25 0x000055555584886e in kvm_cpu_exec (env=3D0x555556569300) ---Type to continue, or q to quit--- at /suse/thardeck/Development/qemu/kvm-all.c:1580 run =3D 0x7ffff7ff2000 ret =3D 0 run_ret =3D 0 #26 0x00005555557dc6a0 in qemu_kvm_cpu_thread_fn (arg=3D0x555556569300) at /suse/thardeck/Development/qemu/cpus.c:757 env =3D 0x555556569300 cpu =3D 0x5555565692a0 r =3D 65536 #27 0x00007ffff4fdce0e in start_thread (arg=3D0x7fffefe93700) at pthread_create.c:305 __res =3D pd =3D 0x7fffefe93700 now =3D unwind_buf =3D {cancel_jmp_buf =3D {{jmp_buf =3D {140737218426624= , -6613775898926182534, 1, 140737488346032, 0, 140737218426624, 6613810991376830330, 6613760524492017530}, mask_was_saved =3D 0}}, priv =3D {pad =3D {0x0, 0x0, 0x0, 0= x0}, data =3D {prev =3D 0x0, cleanup =3D 0x0, canceltype =3D 0}}} not_first_call =3D 0 pagesize_m1 =3D sp =3D freesize =3D __PRETTY_FUNCTION__ =3D "start_thread" #28 0x00007ffff40422bd in clone () at =2E./sysdeps/unix/sysv/linux/x86_64/clone.S:115 No locals. --=20 SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer, HRB 16746 (AG N=FCrnberg) Maxfeldstr. 5, 90409 N=FCrnberg, Germany T: +49 (0) 911 74053-0 F: +49 (0) 911 74053-483 http://www.suse.de/ --------------enig6D55D3B4B88BA42C28F8E2A0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQEcBAEBAgAGBQJQvwg6AAoJENur/L6EMd677J8H/iuiaicc3tYOiPDbCFmjE9Pz ctSRI1ZpI7SEZMv0LLjbJyWWYsXuVPAhWJUtTmhDTNptKgxN34o7S6XUa/MjikCU YfTX1b95QDmfMlx6ElliOvTSsNxKCT/2a2dt6f8kEW4Dd2ZEYv3piC2dRJu5IADq tw8NULPJQvdj/YiTqMkzvc71g2UJdDHMsXXY/MxmhEzcBoYFnxORY4mAh56UIhaI HlD8bszyMg2Ve5WALgqMannsr2s9mCLo3UwwKTN8jt3OHdvJSL9RblCc5XywaEq/ rHra2JpFsLDzQYsD1fOuX/aEke032lon3ewpckgRNIIeODjGzbA/Lv6VZ2R4gQA= =VXR/ -----END PGP SIGNATURE----- --------------enig6D55D3B4B88BA42C28F8E2A0--