From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UeLee-00031s-Jg for qemu-devel@nongnu.org; Mon, 20 May 2013 04:41:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UeLeZ-0007SN-K5 for qemu-devel@nongnu.org; Mon, 20 May 2013 04:41:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63759) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UeLeZ-0007SH-CF for qemu-devel@nongnu.org; Mon, 20 May 2013 04:41:11 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4K8fABx016184 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 20 May 2013 04:41:10 -0400 Date: Mon, 20 May 2013 09:41:06 +0100 From: "Richard W.M. Jones" Message-ID: <20130520084106.GC18311@redhat.com> References: <1369033424-14594-1-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1369033424-14594-1-git-send-email-famz@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 00/10] curl: fix curl read List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com On Mon, May 20, 2013 at 03:03:34PM +0800, Fam Zheng wrote: > CURL library API has changed, the current curl driver is not working. > This patch rewrites the use of API as well as the structure of internal > states.=20 I tried this, but it segfaults: Program terminated with signal 11, Segmentation fault. #0 curl_read_cb (ptr=3D, size=3D,=20 nmemb=3D, opaque=3D0x7f09d2975340) at block/curl.c:240 240 size_t aio_base =3D acb->sector_num * SECTOR_SIZE; Missing separate debuginfos, use: debuginfo-install SDL-1.2.15-3.fc18.x86= _64 bluez-libs-4.101-6.fc18.x86_64 brlapi-0.5.6-12.fc18.x86_64 celt051-0.= 5.1.3-5.fc18.x86_64 ceph-devel-0.56.3-1.fc18.x86_64 ceph-libs-0.56.3-1.fc= 18.x86_64 cryptopp-5.6.2-2.fc18.x86_64 cyrus-sasl-lib-2.1.25-2.fc18.x86_6= 4 leveldb-1.7.0-4.fc18.x86_64 libfdt-1.3.0-5.fc18.x86_64 libseccomp-1.0.1= -0.fc18.x86_64 libselinux-2.1.12-7.3.fc18.x86_64 libusbx-1.0.14-1.fc18.x8= 6_64 nss-mdns-0.10-11.fc18.x86_64 snappy-1.0.5-2.fc18.x86_64 spice-server= -0.12.2-3.fc18.x86_64 usbredir-0.6-1.fc18.x86_64 xen-libs-4.2.2-3.fc18.x8= 6_64 (gdb) bt #0 curl_read_cb (ptr=3D, size=3D,=20 nmemb=3D, opaque=3D0x7f09d2975340) at block/curl.c:240 #1 0x00007f09cc7ee0e8 in Curl_client_write (conn=3Dconn@entry=3D0x7f09d2= 996c80,=20 type=3Dtype@entry=3D1, ptr=3D0x7f09d298e8f0 "", len=3D2046) at sendf.= c:449 #2 0x00007f09cc801c52 in readwrite_data (done=3D0x7ffff70dac77,=20 didwhat=3D, k=3D0x7f09d298e080, conn=3D0x7f09d2996= c80, data=3D 0x7f09d298e050) at transfer.c:705 #3 Curl_readwrite (conn=3D0x7f09d2996c80, done=3Ddone@entry=3D0x7ffff70d= ac77) at transfer.c:1023 #4 0x00007f09cc80a4d2 in multi_runsingle (multi=3Dmulti@entry=3D0x7f09d2= 9815b0,=20 now=3D..., easy=3D0x7f09d29756a0) at multi.c:1430 #5 0x00007f09cc80b559 in multi_socket (multi=3Dmulti@entry=3D0x7f09d2981= 5b0,=20 checkall=3Dcheckall@entry=3Dfalse, s=3D10, ev_bitmask=3D3,=20 running_handles=3Drunning_handles@entry=3D0x7ffff70dad88) at multi.c:= 2140 #6 0x00007f09cc80b64f in curl_multi_socket_action (multi_handle=3D 0x7f09d29815b0, s=3D, ev_bitmask=3D,=20 running_handles=3Drunning_handles@entry=3D0x7ffff70dad88) at multi.c:= 2258 #7 0x00007f09d0077043 in curl_fd_handler (arg=3D0x7f09d2997410) at block/curl.c:265 #8 0x00007f09d005abbb in aio_dispatch (ctx=3D0x7f09d296e3f0, ctx=3D0x7f0= 9d296e3f0) at aio-posix.c:149 #9 0x00007f09d005b0b1 in aio_poll (ctx=3D0x7f09d296e3f0,=20 blocking=3Dblocking@entry=3Dtrue) at aio-posix.c:248 #10 0x00007f09d019f9c9 in qemu_aio_wait () at main-loop.c:484 #11 0x00007f09d0070b65 in bdrv_rwv_co (bs=3Dbs@entry=3D0x7f09d29746e0,=20 sector_num=3Dsector_num@entry=3D0, qiov=3Dqiov@entry=3D0x7ffff70daea0= ,=20 is_write=3Dis_write@entry=3Dfalse) at block.c:2215 #12 0x00007f09d0070c90 in bdrv_rw_co (is_write=3Dfalse,=20 nb_sectors=3D, buf=3D, sector_num=3D0, = bs=3D 0x7f09d29746e0) at block.c:2234 #13 bdrv_read (bs=3Dbs@entry=3D0x7f09d29746e0, sector_num=3Dsector_num@en= try=3D0,=20 buf=3Dbuf@entry=3D0x7ffff70db190 "3\300\216=D0=BC", nb_sectors=3Dnb_s= ectors@entry=3D4) at block.c:2241 #14 0x00007f09d0070d82 in bdrv_pread (bs=3D0x7f09d29746e0, offset=3Doffse= t@entry=3D 0, buf=3Dbuf@entry=3D0x7ffff70db190, count1=3Dcount1@entry=3D2048) at= block.c:2303 #15 0x00007f09d0071460 in find_image_format (pdrv=3D,=20 filename=3D0x7f09d2971b40 "http://192.168.0.249/scratch/winxp.img",=20 bs=3D) at block.c:533 #16 bdrv_open (bs=3D0x7f09d2971cc0, filename=3Dfilename@entry=3D 0x7f09d2971b40 "http://192.168.0.249/scratch/winxp.img", options=3D 0x7f09d29726a0, options@entry=3D0x7f09d2970980, flags=3D8258, drv=3Dd= rv@entry=3D 0x0) at block.c:1047 #17 0x00007f09d00a4093 in drive_init (all_opts=3D0x7f09d296d420,=20 block_default_type=3DIF_NONE) at blockdev.c:698 #18 0x00007f09d020e54b in drive_init_func (opts=3D,=20 opaque=3D) at vl.c:1117 #19 0x00007f09d03386f3 in qemu_opts_foreach (list=3D,=20 func=3Dfunc@entry=3D0x7f09d020e530 , opaque=3Dopaque= @entry=3D 0x7f09d07318f0 ,=20 abort_on_failure=3Dabort_on_failure@entry=3D1) at util/qemu-option.c:= 1162 #20 0x00007f09d0055b89 in main (argc=3D, argv=3D,=20 envp=3D) at vl.c:4201 I am using qemu from git + your patches, and curl-7_30_0-147-gae26ee3. - - - - A second, unrelated problem with the curl driver is to do with the way it resolves hostnames. I have a host which has IPv6 and IPv4 records in DNS (ie. AAAA and A). For some reason the IPv6 address isn't reachable, but this doesn't matter for most clients since they fall back to using the IPv4 address after a brief timeout. However the qemu curl driver does *not* fallback. It gives up after the IPv6 address fails. It'd be nice if this problem could be fixed too. Rich. --=20 Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rj= ones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top