From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UobcA-0004L4-2V for qemu-devel@nongnu.org; Mon, 17 Jun 2013 11:45:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uobc8-0005A8-V9 for qemu-devel@nongnu.org; Mon, 17 Jun 2013 11:45:06 -0400 Received: from mail-wg0-x236.google.com ([2a00:1450:400c:c00::236]:37918) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uobc8-00058v-Pg for qemu-devel@nongnu.org; Mon, 17 Jun 2013 11:45:04 -0400 Received: by mail-wg0-f54.google.com with SMTP id n11so2486716wgh.21 for ; Mon, 17 Jun 2013 08:45:04 -0700 (PDT) Date: Mon, 17 Jun 2013 17:45:01 +0200 From: Stefan Hajnoczi Message-ID: <20130617154501.GE31444@stefanha-thinkpad.redhat.com> References: <1371124063-12971-1-git-send-email-kwolf@redhat.com> <1371124063-12971-5-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1371124063-12971-5-git-send-email-kwolf@redhat.com> Subject: Re: [Qemu-devel] [PATCH 4/5] qcow2: Batch discards List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, stefanha@redhat.com On Thu, Jun 13, 2013 at 01:47:42PM +0200, Kevin Wolf wrote: > @@ -420,6 +420,77 @@ fail_block: > return ret; > } > > +void qcow2_process_discards(BlockDriverState *bs, int ret) > +{ > + BDRVQcowState *s = bs->opaque; > + Qcow2DiscardRegion *d, *next; > + > + QTAILQ_FOREACH_SAFE(d, &s->discards, next, next) { > + QTAILQ_REMOVE(&s->discards, d, next); > + > + /* Discard is optional, ignore the return value */ > + if (ret >= 0) { > + fprintf(stderr, "discard: %lx + %lx\n", > + d->offset >> BDRV_SECTOR_BITS, > + d->bytes >> BDRV_SECTOR_BITS); Debug code. This doesn't happen with --enable-trace-backend=stderr ;).