From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPvi9-0008KO-IV for qemu-devel@nongnu.org; Mon, 23 Feb 2015 11:18:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YPvi3-00053f-Dl for qemu-devel@nongnu.org; Mon, 23 Feb 2015 11:18:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPvi3-00053U-5R for qemu-devel@nongnu.org; Mon, 23 Feb 2015 11:18:15 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1NGIEgg026106 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 23 Feb 2015 11:18:14 -0500 From: John Snow Date: Mon, 23 Feb 2015 11:17:54 -0500 Message-Id: <1424708286-16483-6-git-send-email-jsnow@redhat.com> In-Reply-To: <1424708286-16483-1-git-send-email-jsnow@redhat.com> References: <1424708286-16483-1-git-send-email-jsnow@redhat.com> Subject: [Qemu-devel] [PATCH v4 05/17] ide: pass IDEBus to the restart_cb List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, mst@redhat.com, armbru@redhat.com, mreitz@redhat.com, stefanha@redhat.com, pbonzini@redhat.com, John Snow From: Paolo Bonzini Pass the containing IDEBus to the restart_cb instead of the more specific BMDMAState child. Signed-off-by: Paolo Bonzini Signed-off-by: John Snow --- hw/ide/core.c | 2 +- hw/ide/pci.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index 5a42771..9d510b1 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -2332,7 +2332,7 @@ static const IDEDMAOps ide_dma_nop_ops = { void ide_register_restart_cb(IDEBus *bus) { - qemu_add_vm_change_state_handler(bus->dma->ops->restart_cb, bus->dma); + qemu_add_vm_change_state_handler(bus->dma->ops->restart_cb, bus); } static IDEDMA ide_dma_nop = { diff --git a/hw/ide/pci.c b/hw/ide/pci.c index 62c88d7..45254d4 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -208,8 +208,8 @@ static void ide_restart_dma(IDEState *s, enum ide_dma_cmd dma_cmd) /* TODO This should be common IDE code */ static void bmdma_restart_bh(void *opaque) { - BMDMAState *bm = opaque; - IDEBus *bus = bm->bus; + IDEBus *bus = opaque; + BMDMAState *bm = DO_UPCAST(BMDMAState, dma, bus->dma); IDEState *s; bool is_read; int error_status; @@ -260,14 +260,14 @@ static void bmdma_restart_bh(void *opaque) static void bmdma_restart_cb(void *opaque, int running, RunState state) { - IDEDMA *dma = opaque; - BMDMAState *bm = DO_UPCAST(BMDMAState, dma, dma); + IDEBus *bus = opaque; + BMDMAState *bm = DO_UPCAST(BMDMAState, dma, bus->dma); if (!running) return; if (!bm->bh) { - bm->bh = qemu_bh_new(bmdma_restart_bh, &bm->dma); + bm->bh = qemu_bh_new(bmdma_restart_bh, bus); qemu_bh_schedule(bm->bh); } } -- 1.9.3