Re: [Qemu-devel] [PATCH v5 06/11] curl: introduce CURLDataCache

2013-05-23 Thread Fam Zheng
On Thu, 05/23 16:09, Stefan Hajnoczi wrote: > On Thu, May 23, 2013 at 11:38:04AM +0800, Fam Zheng wrote: > > +typedef struct CURLDataCache { > > +char *data; > > +size_t base_pos; > > Must be int64_t. QEMU compiled on 32-bit hosts would only allow 4 GB > images with size_t! OK. > > > +

Re: [Qemu-devel] [PATCH v5 06/11] curl: introduce CURLDataCache

2013-05-23 Thread Stefan Hajnoczi
On Thu, May 23, 2013 at 11:38:04AM +0800, Fam Zheng wrote: > +typedef struct CURLDataCache { > +char *data; > +size_t base_pos; Must be int64_t. QEMU compiled on 32-bit hosts would only allow 4 GB images with size_t! > +size_t data_len; > +size_t write_pos; > +/* Ref count fo

[Qemu-devel] [PATCH v5 06/11] curl: introduce CURLDataCache

2013-05-22 Thread Fam Zheng
Data buffer was contained by CURLState, they are allocated and freed together. This patch try to isolate them, by introducing a dedicated cache list to BDRVCURLState. The benifit is we can now release the CURLState (and associated sockets) while keep the fetched data for later use, and simplies the