[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 05/18] ide: Turn debug messages into assertions
From: |
Luiz Capitulino |
Subject: |
Re: [Qemu-devel] [PATCH 05/18] ide: Turn debug messages into assertions |
Date: |
Thu, 26 May 2011 18:12:08 -0300 |
On Thu, 19 May 2011 14:33:19 +0200
Kevin Wolf <address@hidden> wrote:
> These printfs aren't really debug messages, but clearly indicate a bug if they
> ever become effective.
Then we have a bug somewhere, starting a VM with:
# qemu -hda disks/test.img -enable-kvm -m 1G -cdrom /dev/sr0
Where the host's CDROM is empty, triggers one of these asserts:
qmp-unstable/hw/ide/pci.c:299: bmdma_cmd_writeb: Assertion
`bm->bus->dma->aiocb == ((void *)0)'
> 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 <address@hidden>
> Reviewed-by: Stefan Hajnoczi <address@hidden>
> ---
> 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;
- [Qemu-devel] [PULL 00/18] Block patches, Kevin Wolf, 2011/05/19
- [Qemu-devel] [PATCH 04/18] hw/xen_disk: Remove unused local variable, Kevin Wolf, 2011/05/19
- [Qemu-devel] [PATCH 06/18] Add documentation for qemu_progress_{init, print}(), Kevin Wolf, 2011/05/19
- [Qemu-devel] [PATCH 08/18] qemu-tool: Stub out qemu-timer functions, Kevin Wolf, 2011/05/19
- [Qemu-devel] [PATCH 07/18] ahci: Fix crashes on duplicate BH registration, Kevin Wolf, 2011/05/19
- [Qemu-devel] [PATCH 09/18] qed: Periodically flush and clear need check bit, Kevin Wolf, 2011/05/19
- [Qemu-devel] [PATCH 11/18] qed: support for growing images, Kevin Wolf, 2011/05/19
- [Qemu-devel] [PATCH 12/18] ide: Split qdev "ide-drive" into "ide-hd" and "ide-cd", Kevin Wolf, 2011/05/19
- [Qemu-devel] [PATCH 10/18] qemu_img: is_not_zero() optimization, Kevin Wolf, 2011/05/19