From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40341) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRv3Z-0001oK-7S for qemu-devel@nongnu.org; Wed, 01 Jun 2011 19:42:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QRv3W-0007PH-W4 for qemu-devel@nongnu.org; Wed, 01 Jun 2011 19:42:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRljR-0001wb-DH for qemu-devel@nongnu.org; Wed, 01 Jun 2011 09:45:09 -0400 Date: Wed, 1 Jun 2011 10:44:56 -0300 From: Luiz Capitulino Message-ID: <20110601104456.5469329b@doriath> In-Reply-To: <20110526181208.46aba2ae@doriath> References: <1305808412-16994-1-git-send-email-kwolf@redhat.com> <1305808412-16994-6-git-send-email-kwolf@redhat.com> <20110526181208.46aba2ae@doriath> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 05/18] ide: Turn debug messages into assertions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: Kevin Wolf , Stefan Hajnoczi , qemu-devel@nongnu.org On Thu, 26 May 2011 18:12:08 -0300 Luiz Capitulino wrote: > On Thu, 19 May 2011 14:33:19 +0200 > Kevin Wolf 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)' I found out why this is happening. I'm passing '-snapshot' to the command-line, sorry for not mentioning it (I forgot I was using my devel alias). I also found out that /usr/bin/eject in the guest won't work when -snapshot is used. Shouldn't qemu ignore this flag when using cdrom passthrough? > > > 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; >