Re: [Qemu-devel] [PATCH 1/2] ide: convert ide_sector_read() to asynchronous I/O

2012-03-29 Thread Paolo Bonzini
Il 29/03/2012 10:29, Stefan Hajnoczi ha scritto: > This was kind of a wart in the interface because it created 2 error > handling paths: one immediate return and one callback with error. I > think Paolo and Kevin were the ones to address this. I think you did that when adding the coroutines. I j

Re: [Qemu-devel] [PATCH 1/2] ide: convert ide_sector_read() to asynchronous I/O

2012-03-29 Thread Stefan Hajnoczi
On Thu, Mar 29, 2012 at 7:42 AM, Michael Tokarev wrote: > On 28.03.2012 19:43, Stefan Hajnoczi wrote: >>  void ide_sector_read(IDEState *s) >>  { > [] >> +    s->iov.iov_base = s->io_buffer; >> +    s->iov.iov_len  = n * BDRV_SECTOR_SIZE; >> +    qemu_iovec_init_external(&s->qiov, &s->iov, 1); >>

Re: [Qemu-devel] [PATCH 1/2] ide: convert ide_sector_read() to asynchronous I/O

2012-03-29 Thread Michael Tokarev
On 29.03.2012 10:46, Michael Tokarev wrote: > On 28.03.2012 19:43, Stefan Hajnoczi wrote: > ... > >> void ide_sector_read(IDEState *s) >> { > ... >> +s->iov.iov_base = s->io_buffer; >> +s->iov.iov_len = n * BDRV_SECTOR_SIZE; >> +qemu_iovec_init_external(&s->qiov, &s->iov, 1); >> +

Re: [Qemu-devel] [PATCH 1/2] ide: convert ide_sector_read() to asynchronous I/O

2012-03-28 Thread Michael Tokarev
On 28.03.2012 19:43, Stefan Hajnoczi wrote: ... > void ide_sector_read(IDEState *s) > { ... > +s->iov.iov_base = s->io_buffer; > +s->iov.iov_len = n * BDRV_SECTOR_SIZE; > +qemu_iovec_init_external(&s->qiov, &s->iov, 1); > +bdrv_aio_readv(s->bs, sector_num, &s->qiov, n, > +

Re: [Qemu-devel] [PATCH 1/2] ide: convert ide_sector_read() to asynchronous I/O

2012-03-28 Thread Michael Tokarev
On 28.03.2012 19:43, Stefan Hajnoczi wrote: > void ide_sector_read(IDEState *s) > { [] > +s->iov.iov_base = s->io_buffer; > +s->iov.iov_len = n * BDRV_SECTOR_SIZE; > +qemu_iovec_init_external(&s->qiov, &s->iov, 1); > + > +bdrv_acct_start(s->bs, &s->acct, n * BDRV_SECTOR_SIZE, BDR

[Qemu-devel] [PATCH 1/2] ide: convert ide_sector_read() to asynchronous I/O

2012-03-28 Thread Stefan Hajnoczi
The IDE PIO interface currently uses bdrv_read() to perform reads synchronously. Synchronous I/O in the vcpu thread is bad because it prevents the guest from executing code - it makes the guest unresponsive. This patch converts IDE PIO to use bdrv_aio_readv(). We simply need to use the BUSY_STAT