Received: from eggs.gnu.org ([2001:4830:134:3::10]:42354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vapvb-00080V-Cu for qemu-devel@nongnu.org; Mon, 28 Oct 2013 12:44:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VapvT-0000Ue-07 for qemu-devel@nongnu.org; Mon, 28 Oct 2013 12:44:31 -0400 Received: from mail-qa0-x230.google.com ([2607:f8b0:400d:c00::230]:45345) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VapvS-0000UZ-SJ for qemu-devel@nongnu.org; Mon, 28 Oct 2013 12:44:22 -0400 Received: by mail-qa0-f48.google.com with SMTP id k4so2253990qaq.0 for ; Mon, 28 Oct 2013 09:44:22 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Mon, 28 Oct 2013 17:43:33 +0100 Message-Id: <1382978620-16641-18-git-send-email-pbonzini@redhat.com> In-Reply-To: <1382978620-16641-1-git-send-email-pbonzini@redhat.com> References: <1382978620-16641-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 17/24] ide: do not use BMDMA in restart callback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mst@redhat.com Whenever an error stops the VM, ide_handle_rw_error does "s->bus->dma->unit = s->unit". So we can just use idebus_active_if. Signed-off-by: Paolo Bonzini --- hw/ide/pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ide/pci.c b/hw/ide/pci.c index 4a1328d..4df50dc 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -208,17 +208,17 @@ static void bmdma_restart_bh(void *opaque) qemu_bh_delete(bm->bh); bm->bh = NULL; - if (bm->unit == (uint8_t) -1) { + error_status = bus->error_status; + if (bus->error_status == 0) { return; } - s = bmdma_active_if(bm); + s = idebus_active_if(bus); is_read = (bus->error_status & IDE_RETRY_READ) != 0; /* The error status must be cleared before resubmitting the request: The * request may fail again, and this case can only be distinguished if the * called function can set a new error status. */ - error_status = bus->error_status; bus->error_status = 0; if (error_status & IDE_RETRY_DMA) { -- 1.8.3.1