From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TitQJ-0003sd-Mi for qemu-devel@nongnu.org; Wed, 12 Dec 2012 16:01:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TitQD-0007E1-T9 for qemu-devel@nongnu.org; Wed, 12 Dec 2012 16:00:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:63895) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TitQD-0007Dx-Kv for qemu-devel@nongnu.org; Wed, 12 Dec 2012 16:00:53 -0500 Message-ID: <50C8F075.4000206@redhat.com> Date: Wed, 12 Dec 2012 22:00:37 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <20121212143038.GD15555@redhat.com> <50C8965A.7020004@redhat.com> <20121212144758.GF15555@redhat.com> <50C89C47.7040108@redhat.com> <20121212152508.GB16750@redhat.com> <50C8A855.4050607@redhat.com> <20121212163713.GD17446@redhat.com> <50C8B627.606@redhat.com> <20121212171423.GB18597@redhat.com> <50C8C143.2010503@redhat.com> <20121212192336.GA20201@redhat.com> In-Reply-To: <20121212192336.GA20201@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv2] virtio: verify that all outstanding buffers are flushed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Stefan Hajnoczi , Anthony Liguori , Rusty Russell , qemu-devel@nongnu.org, Stefan Hajnoczi Il 12/12/2012 20:23, Michael S. Tsirkin ha scritto: >>> Saving inuse counter is useless. We need to know which requests >>> are outstanding if we want to retry them on remote. >> >> And that's what virtio-blk and virtio-scsi have been doing for years. > > I don't see it - all I see in save is virtio_save. static void virtio_blk_save(QEMUFile *f, void *opaque) { VirtIOBlock *s = opaque; VirtIOBlockReq *req = s->rq; virtio_save(&s->vdev, f); while (req) { qemu_put_sbyte(f, 1); qemu_put_buffer(f, (unsigned char*)&req->elem, sizeof(req->elem)); req = req->next; } qemu_put_sbyte(f, 0); } virtio-scsi does it in virtio_scsi_save_request. > You need to retry A1 on remote. How do you do that? There's > no way to find out it has not been completed > from the ring itself. virtio_blk_dma_restart_bh and scsi_dma_restart_bh do it. Paolo