Received: from eggs.gnu.org ([2001:4830:134:3::10]:37997) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vr6gi-0006Y4-Q2 for qemu-devel@nongnu.org; Thu, 12 Dec 2013 08:52:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vr6gc-0004cV-Jm for qemu-devel@nongnu.org; Thu, 12 Dec 2013 08:52:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:61905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vr6gc-0004c1-Ci for qemu-devel@nongnu.org; Thu, 12 Dec 2013 08:52:18 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBCDqGtG018432 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 12 Dec 2013 08:52:17 -0500 From: Markus Armbruster References: <1386836626-6436-1-git-send-email-famz@redhat.com> <1386836626-6436-8-git-send-email-famz@redhat.com> Date: Thu, 12 Dec 2013 14:52:14 +0100 In-Reply-To: <1386836626-6436-8-git-send-email-famz@redhat.com> (Fam Zheng's message of "Thu, 12 Dec 2013 16:23:43 +0800") Message-ID: <87r49i89dd.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v7 07/10] block: Pass error in bdrv_snapshot_create List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, qemu-devel@nongnu.org, rjones@redhat.com, imain@redhat.com, stefanha@redhat.com, pbonzini@redhat.com Fam Zheng writes: > This allows descent error information to be reported. > > Signed-off-by: Fam Zheng > --- > block/snapshot.c | 5 +++-- > blockdev.c | 2 +- > include/block/snapshot.h | 3 ++- > qemu-img.c | 2 +- > savevm.c | 2 +- > 5 files changed, 8 insertions(+), 6 deletions(-) > > diff --git a/block/snapshot.c b/block/snapshot.c > index 9047f8d..02cfb07 100644 > --- a/block/snapshot.c > +++ b/block/snapshot.c > @@ -157,7 +157,8 @@ int bdrv_can_snapshot(BlockDriverState *bs) > } > > int bdrv_snapshot_create(BlockDriverState *bs, > - QEMUSnapshotInfo *sn_info) > + QEMUSnapshotInfo *sn_info, > + Error **errp) > { > BlockDriver *drv = bs->drv; > if (!drv) { > @@ -167,7 +168,7 @@ int bdrv_snapshot_create(BlockDriverState *bs, > return drv->bdrv_snapshot_create(bs, sn_info); > } > if (bs->file) { > - return bdrv_snapshot_create(bs->file, sn_info); > + return bdrv_snapshot_create(bs->file, sn_info, errp); > } > return -ENOTSUP; > } > diff --git a/blockdev.c b/blockdev.c > index 369d8da..404159e 100644 > --- a/blockdev.c > +++ b/blockdev.c > @@ -1138,7 +1138,7 @@ static void internal_snapshot_prepare(BlkTransactionState *common, > sn->date_nsec = tv.tv_usec * 1000; > sn->vm_clock_nsec = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); > > - ret1 = bdrv_snapshot_create(bs, sn); > + ret1 = bdrv_snapshot_create(bs, sn, errp); > if (ret1 < 0) { > error_setg_errno(errp, -ret1, > "Failed to create snapshot '%s' on device '%s'", I'm afraid this will fail the assertion in error_set_errno() as soon as bdrv_snapshot_create() actually uses errp, and errp isn't null. Do you defuse this time bomb later in your series? [...]