qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

Revert "ide/ahci: Check for -ECANCELED in aio callbacks"

This reverts commit 0d910cfeaf2076b116b4517166d5deb0fea76394.

It's not correct to just ignore an error code in a callback; we need to
handle that error and possible report failure to the guest so that they
don't wait indefinitely for an operation that will now never finish.

This ought to help cases reported by Nutanix where iSCSI returns a
legitimate -ECANCELED for certain operations which should be propagated
normally.

Reported-by: Shaju Abraham <shaju.abraham@nutanix.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 20190729223605.7163-1-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>

-17
-3
hw/ide/ahci.c
··· 1025 1025 IDEState *ide_state = &ncq_tfs->drive->port.ifs[0]; 1026 1026 1027 1027 ncq_tfs->aiocb = NULL; 1028 - if (ret == -ECANCELED) { 1029 - return; 1030 - } 1031 1028 1032 1029 if (ret < 0) { 1033 1030 bool is_read = ncq_tfs->cmd == READ_FPDMA_QUEUED;
-14
hw/ide/core.c
··· 723 723 s->pio_aiocb = NULL; 724 724 s->status &= ~BUSY_STAT; 725 725 726 - if (ret == -ECANCELED) { 727 - return; 728 - } 729 726 if (ret != 0) { 730 727 if (ide_handle_rw_error(s, -ret, IDE_RETRY_PIO | 731 728 IDE_RETRY_READ)) { ··· 840 837 int64_t sector_num; 841 838 uint64_t offset; 842 839 bool stay_active = false; 843 - 844 - if (ret == -ECANCELED) { 845 - return; 846 - } 847 840 848 841 if (ret == -EINVAL) { 849 842 ide_dma_error(s); ··· 976 969 IDEState *s = opaque; 977 970 int n; 978 971 979 - if (ret == -ECANCELED) { 980 - return; 981 - } 982 - 983 972 s->pio_aiocb = NULL; 984 973 s->status &= ~BUSY_STAT; 985 974 ··· 1059 1048 1060 1049 s->pio_aiocb = NULL; 1061 1050 1062 - if (ret == -ECANCELED) { 1063 - return; 1064 - } 1065 1051 if (ret < 0) { 1066 1052 /* XXX: What sector number to set here? */ 1067 1053 if (ide_handle_rw_error(s, -ret, IDE_RETRY_FLUSH)) {