From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTaai-00085j-1R for qemu-devel@nongnu.org; Wed, 10 Feb 2016 14:38:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTaah-00037p-4l for qemu-devel@nongnu.org; Wed, 10 Feb 2016 14:38:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42946) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTaag-00037K-VL for qemu-devel@nongnu.org; Wed, 10 Feb 2016 14:38:19 -0500 From: John Snow Date: Wed, 10 Feb 2016 14:38:03 -0500 Message-Id: <1455133089-31903-7-git-send-email-jsnow@redhat.com> In-Reply-To: <1455133089-31903-1-git-send-email-jsnow@redhat.com> References: <1455133089-31903-1-git-send-email-jsnow@redhat.com> Subject: [Qemu-devel] [PULL 05/11] ide: Add silent DRQ cancellation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, jsnow@redhat.com Split apart the ide_transfer_stop function into two versions: one that interrupts and one that doesn't. The one that doesn't can be used to halt any PIO transfers that are in the DRQ phase. It will not halt any PIO transfers that are currently in the process of buffering data for the guest to read. Signed-off-by: John Snow Reported-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi [Renamed 'etf' to 'end_transfer_func' --js] Message-id: 1453225191-11871-6-git-send-email-jsnow@redhat.com --- hw/ide/core.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index 40b6cc8..3c32b39 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -487,13 +487,28 @@ static void ide_cmd_done(IDEState *s) } } -void ide_transfer_stop(IDEState *s) +static void ide_transfer_halt(IDEState *s, + void(*end_transfer_func)(IDEState *), + bool notify) { - s->end_transfer_func = ide_transfer_stop; + s->end_transfer_func = end_transfer_func; s->data_ptr = s->io_buffer; s->data_end = s->io_buffer; s->status &= ~DRQ_STAT; - ide_cmd_done(s); + if (notify) { + ide_cmd_done(s); + } +} + +void ide_transfer_stop(IDEState *s) +{ + ide_transfer_halt(s, ide_transfer_stop, true); +} + +__attribute__((__unused__)) +static void ide_transfer_cancel(IDEState *s) +{ + ide_transfer_halt(s, ide_transfer_cancel, false); } int64_t ide_get_sector(IDEState *s) -- 2.4.3