From patchwork Mon May 9 09:52:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 94747 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E254DB6F69 for ; Mon, 9 May 2011 19:49:57 +1000 (EST) Received: from localhost ([::1]:58587 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJN6A-0002Zm-K3 for incoming@patchwork.ozlabs.org; Mon, 09 May 2011 05:49:54 -0400 Received: from eggs.gnu.org ([140.186.70.92]:50495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJN64-0002Zh-Bm for qemu-devel@nongnu.org; Mon, 09 May 2011 05:49:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJN60-0008Rd-Eb for qemu-devel@nongnu.org; Mon, 09 May 2011 05:49:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJN60-0008RV-6c for qemu-devel@nongnu.org; Mon, 09 May 2011 05:49:44 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p499nhWw009323 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 9 May 2011 05:49:43 -0400 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p499nfd2001326; Mon, 9 May 2011 05:49:42 -0400 From: Kevin Wolf To: qemu-devel@nongnu.org Date: Mon, 9 May 2011 11:52:22 +0200 Message-Id: <1304934742-5193-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com Subject: [Qemu-devel] [PATCH] ide: Turn debug messages into assertions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org These printfs aren't really debug messages, but clearly indicate a bug if they ever become effective. Noone uses DEBUG_IDE, let's re-enable the check unconditionally and make it an assertion instead of printfs in the device emulation. Signed-off-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- hw/ide/pci.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/ide/pci.c b/hw/ide/pci.c index f5ac932..a4726ad 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -296,12 +296,8 @@ void bmdma_cmd_writeb(void *opaque, uint32_t addr, uint32_t val) */ if (bm->bus->dma->aiocb) { qemu_aio_flush(); -#ifdef DEBUG_IDE - if (bm->bus->dma->aiocb) - printf("ide_dma_cancel: aiocb still pending\n"); - if (bm->status & BM_STATUS_DMAING) - printf("ide_dma_cancel: BM_STATUS_DMAING still pending\n"); -#endif + assert(bm->bus->dma->aiocb == NULL); + assert((bm->status & BM_STATUS_DMAING) == 0); } } else { bm->cur_addr = bm->addr;