From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zkd15-0005lF-1Y for qemu-devel@nongnu.org; Fri, 09 Oct 2015 15:07:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zkd13-0006uR-QR for qemu-devel@nongnu.org; Fri, 09 Oct 2015 15:07:42 -0400 References: <1443161858-20533-1-git-send-email-wency@cn.fujitsu.com> <1443161858-20533-2-git-send-email-wency@cn.fujitsu.com> From: Eric Blake Message-ID: <56181072.1020805@redhat.com> Date: Fri, 9 Oct 2015 13:07:30 -0600 MIME-Version: 1.0 In-Reply-To: <1443161858-20533-2-git-send-email-wency@cn.fujitsu.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hGbDaCU75H9Fh5l0XtN64tWGeCaoMBPcf" Subject: Re: [Qemu-devel] [PATCH v10 01/10] allow writing to the backing file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wen Congyang , qemu devel , Fam Zheng , Max Reitz , Paolo Bonzini , Stefan Hajnoczi Cc: Kevin Wolf , zhanghailiang , qemu block , Jiang Yunhong , Dong Eddie , "Dr. David Alan Gilbert" , "Michael R. Hines" , Gonglei , Yang Hongyang This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --hGbDaCU75H9Fh5l0XtN64tWGeCaoMBPcf Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/25/2015 12:17 AM, Wen Congyang wrote: > For block replication, we have such backing chain: > secondary disk <-- hidden disk <-- active disk > secondary disk is top BDS(use bacing reference), so it can be opened in= s/BDS(use bacing/BDS (use backing/ > read-write mode. But hidden disk is read only, and we need to write to > hidden disk(backup job will write data to it). s/disk(/disk (/ >=20 > TODO: support opening backing file in read-write mode if the BDS is > created by QMP command blockdev-add. >=20 > Signed-off-by: Wen Congyang > Signed-off-by: zhanghailiang > Signed-off-by: Gonglei > --- > block.c | 41 ++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 40 insertions(+), 1 deletion(-) >=20 I really don't like this patch. We are able to automatically (re-)open backing files for write during block-commit, without having to expose a knob to the user then, so exposing a knob to the user here feels wrong. > +#define ALLOW_WRITE_BACKING_FILE "allow-write-backing-file" > +static QemuOptsList backing_file_opts =3D { > + .name =3D "backing_file", > + .head =3D QTAILQ_HEAD_INITIALIZER(backing_file_opts.head), > + .desc =3D { > + { > + .name =3D ALLOW_WRITE_BACKING_FILE, > + .type =3D QEMU_OPT_BOOL, > + .help =3D "allow writes to backing file", > + }, And even if we DO need this knob (which I doubt), you need corresponding documentation of the knob in qapi/block-core.json, since we are trying to keep the command line and QMP in sync when it comes to adding new options. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --hGbDaCU75H9Fh5l0XtN64tWGeCaoMBPcf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWGBByAAoJEKeha0olJ0NqzF0H/RFp/4nIbCEzez4Ka5DG8f0K Jb0KWiFzfj9SOe/dZdd/znJYdlp8NuWBU1Glm1lSZ7znrZu6CgjA94gd3Olbhjk2 U8Hlvt9/+xZdwJxVNBG3U7BMBwb7Fv2NDVkus1rT1ddHLHdwZU3G0CIJAaZ64lkc n/rMjMx1w9bb9S7Yts/TkNmsk1RkmKHda2rYm15ZsCue+Vh7MwjgJ+x90dcpXl+Q R+Glo5kYGGgmGZZhx5g3psuc3jNEmHkbztc49zyFb3SkPAK/X9tk9T7e04N32WS3 hWhLLy4Wfdnjxtlu50uvXbmMDOxOMwZIe2ZjB+j0xUhjC9z0F/Ag3DzzHkf1vO4= =Gpo5 -----END PGP SIGNATURE----- --hGbDaCU75H9Fh5l0XtN64tWGeCaoMBPcf--