From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWnad-0007k9-Jl for qemu-devel@nongnu.org; Thu, 17 Oct 2013 09:26:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VWnaV-0000Gl-6r for qemu-devel@nongnu.org; Thu, 17 Oct 2013 09:26:11 -0400 Received: from mail-bk0-x22a.google.com ([2a00:1450:4008:c01::22a]:59523) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWnaU-0000Gb-Qr for qemu-devel@nongnu.org; Thu, 17 Oct 2013 09:26:03 -0400 Received: by mail-bk0-f42.google.com with SMTP id my10so837807bkb.1 for ; Thu, 17 Oct 2013 06:26:01 -0700 (PDT) Date: Thu, 17 Oct 2013 15:25:59 +0200 From: Stefan Hajnoczi Message-ID: <20131017132559.GC17903@stefanha-thinkpad.redhat.com> References: <1381478139-11003-1-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1381478139-11003-1-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH] vmdk: Only read cid from image file when opening List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com On Fri, Oct 11, 2013 at 03:55:39PM +0800, Fam Zheng wrote: > @@ -378,6 +359,22 @@ static int vmdk_parent_open(BlockDriverState *bs) > } > > pstrcpy(bs->backing_file, end_name - p_name + 1, p_name); > + > + ret = bdrv_open_backing_file(bs, NULL, errp); This breaks 'backing.' options since we ignore them here. I suggest letting the block layer open the backing file as normal instead of duplicating the code here. Simply add a bool s->cid_checked field to remember whether the CID needs to be checked. Then it will only be done once.