diff options
author | Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> | 2012-03-29 10:31:30 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2012-04-19 16:03:27 +0200 |
commit | bef0fd5958120542f126f2dedbfce65d8839a94d (patch) | |
tree | bd1dab13e51821dc3ad80d8fb18faf39e6a24475 /hw/ide/internal.h | |
parent | 592fa07043095ba3141fb9d413693d3c202cba9a (diff) |
ide: convert ide_sector_read() to asynchronous I/O
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 status so the guest knows to wait while we are busy.
The only external user of ide_sector_read() is restart behavior on I/O
errors and it is not affected by this change. We still need to restart
I/O in the same way.
Migration is also unaffected if I understand the code correctly. We
continue to use the same transfer function and the BUSY_STAT status
should never be migrated since we flush I/O before migrating device
state.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Tested-by: Richard Davies <richard@arachsys.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/ide/internal.h')
-rw-r--r-- | hw/ide/internal.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/ide/internal.h b/hw/ide/internal.h index 100efd3076..f8a027d0e4 100644 --- a/hw/ide/internal.h +++ b/hw/ide/internal.h @@ -385,6 +385,9 @@ struct IDEState { int cd_sector_size; int atapi_dma; /* true if dma is requested for the packet cmd */ BlockAcctCookie acct; + BlockDriverAIOCB *pio_aiocb; + struct iovec iov; + QEMUIOVector qiov; /* ATA DMA state */ int io_buffer_size; QEMUSGList sg; |