Re: [Qemu-devel] [PATCH v10 2/3] block: add I/O throttling algorithm

2011-11-01 Thread Zhi Yong Wu
On Tue, Nov 1, 2011 at 7:33 PM, Stefan Hajnoczi wrote: > On Tue, Nov 1, 2011 at 7:40 AM, Zhi Yong Wu wrote: >> +static void bdrv_io_limits_intercept(BlockDriverState *bs, >> +                                     int nb_sectors) >> +{ >> +    int64_t wait_time = -1; >> + >> +    if (!qemu_co_queue

Re: [Qemu-devel] [PATCH v10 2/3] block: add I/O throttling algorithm

2011-11-01 Thread Stefan Hajnoczi
On Tue, Nov 1, 2011 at 7:40 AM, Zhi Yong Wu wrote: > +static void bdrv_io_limits_intercept(BlockDriverState *bs, > +                                     int nb_sectors) > +{ > +    int64_t wait_time = -1; > + > +    if (!qemu_co_queue_empty(&bs->throttled_reqs)) { > +        qemu_co_queue_wait(&bs