From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:33503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTc62-00025n-75 for qemu-devel@nongnu.org; Mon, 06 Jun 2011 11:52:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QTc60-0006dl-Ok for qemu-devel@nongnu.org; Mon, 06 Jun 2011 11:52:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47302) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTc5z-0006dL-TQ for qemu-devel@nongnu.org; Mon, 06 Jun 2011 11:52:04 -0400 Message-ID: <4DECF84D.5030600@redhat.com> Date: Mon, 06 Jun 2011 17:54:53 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1305808412-16994-1-git-send-email-kwolf@redhat.com> <1305808412-16994-6-git-send-email-kwolf@redhat.com> <20110526181208.46aba2ae@doriath> <20110601104456.5469329b@doriath> In-Reply-To: <20110601104456.5469329b@doriath> Content-Type: text/plain; charset=ISO-8859-1 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: Stefan Hajnoczi , qemu-devel@nongnu.org Am 01.06.2011 15:44, schrieb Luiz Capitulino: > 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). Okay, so I think we have at least two problems here: * qcow2 doesn't implement bdrv_is_inserted, so the IDE emulation thinks there is a medium when there isn't. Reading produces only errors. * This seems to be an error case where bdrv_aio_readv fails immediately. In this case, qcow2 calls the callback directly, but it should use a bottom half. This leads to an unexpected state in IDE and lets the assertion fail. I think we must fix the latter. Not sure what to do about the former, it's probably similar to forwarding bdrv_eject(). Kevin