From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlLLA-0003Pu-Iy for qemu-devel@nongnu.org; Tue, 26 Nov 2013 11:18:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlLL4-0000wa-5o for qemu-devel@nongnu.org; Tue, 26 Nov 2013 11:18:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlLL3-0000wI-U4 for qemu-devel@nongnu.org; Tue, 26 Nov 2013 11:18:14 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAQGICid021645 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 26 Nov 2013 11:18:12 -0500 Message-ID: <5294C9BF.1010405@redhat.com> Date: Tue, 26 Nov 2013 17:18:07 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1385438728-17924-1-git-send-email-famz@redhat.com> <1385438728-17924-6-git-send-email-famz@redhat.com> In-Reply-To: <1385438728-17924-6-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v5 5/7] block: Parse "backing" option to reference existing BDS List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, hbrock@redhat.com, qemu-devel@nongnu.org, rjones@redhat.com, imain@redhat.com, stefanha@redhat.com Il 26/11/2013 05:05, Fam Zheng ha scritto: > + if (backing_bs && *backing_bs != '\0') { > + bs->backing_hd = bdrv_find(backing_bs); > + if (!bs->backing_hd) { > + error_setg(errp, "Backing device not found: %s", backing_bs); > + return -ENOENT; > + } > + bdrv_ref(bs->backing_hd); > + assert(!bs->backing_blocker); > + error_setg(&bs->backing_blocker, > + "device is used as backing hd of '%s'", > + bs->device_name); > + bdrv_op_block_all(bs->backing_hd, bs->backing_blocker); Why should this blocker only apply to the "named backing file" case, and not to all backing files? Paolo > + pstrcpy(bs->backing_file, sizeof(bs->backing_file), > + bs->backing_hd->filename); > + pstrcpy(bs->backing_format, sizeof(bs->backing_format), > + bs->backing_hd->drv->format_name); > + }