From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zgeat-0004uL-QF for qemu-devel@nongnu.org; Mon, 28 Sep 2015 16:00:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zgear-0008Ut-2l for qemu-devel@nongnu.org; Mon, 28 Sep 2015 16:00:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38194) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zgeaq-0008Uh-RO for qemu-devel@nongnu.org; Mon, 28 Sep 2015 16:00:13 -0400 References: <1443308129-19965-1-git-send-email-somlo@cmu.edu> <560940F4.2010003@redhat.com> <56099919.10704@redhat.com> <20150928195125.GS2080@HEDWIG.INI.CMU.EDU> From: Eric Blake Message-ID: <56099C45.6060707@redhat.com> Date: Mon, 28 Sep 2015 14:00:05 -0600 MIME-Version: 1.0 In-Reply-To: <20150928195125.GS2080@HEDWIG.INI.CMU.EDU> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7M0vew4tlD1fxb8IL7rVlJETD70olEOxl" Subject: Re: [Qemu-devel] [PATCH] fw_cfg: insert string blobs via qemu cmdline List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gabriel L. Somlo" Cc: pbonzini@redhat.com, Laszlo Ersek , qemu-devel@nongnu.org, jordan.l.justen@intel.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --7M0vew4tlD1fxb8IL7rVlJETD70olEOxl Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/28/2015 01:51 PM, Gabriel L. Somlo wrote: > On Mon, Sep 28, 2015 at 01:46:33PM -0600, Eric Blake wrote: >> On 09/28/2015 07:30 AM, Laszlo Ersek wrote: >> >>>> =20 >>>> +Small enough items may be provided directly as strings on the comma= nd >>>> +line, using the syntax: >>>> + >>>> + -fw_cfg [name=3D],content=3D >>>> + >>> >>> Please consider spelling out that these blobs will NOT be NUL-termina= ted >>> when viewed on the guest. (It kinda follows from all the other fw_cfg= >>> things, but once we leave host-side files for qemu command line strin= gs, >>> it might become non-obvious to users.) >> >> Or else GUARANTEE that it will be NUL-terminated (and the only way to >> get blobs that are not NUL terminated is to use files rather than cont= ent=3D). >=20 > I went with the first suggestion (leave out the trailing '\0' from the > blob payload, and say so in docs/specs/fw_cfg.txt) in v2 of the patch. >=20 > Do you feel strongly about including the \0 ? Otherwise, we're already > there :) I don't know what users are more likely to want to push through. A trailing NUL implies a binary file (as text files cannot contain \0), but even without a trailing NUL, a file is not a text file (per the POSIX definition) unless it is either empty or ends in a newline. Use of content=3D... is unlikely to have users remembering to place a newline= there if examples don't suggest it. And I don't know if guests are expecting text data from these blobs, or are okay with binary blobs. That's a long-winded way of stating that omitting the NUL is fine by me, as long as you document it, and as long as you are catering to the most common user usage of the feature. Either that, or it's my way of dreaming about alternative 3: guarantee a trailing newline (rather than NUL), so that 'content=3D"abc"' on the command line results in the 4-byte blob "abc\n" in the guest. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --7M0vew4tlD1fxb8IL7rVlJETD70olEOxl 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/ iQEcBAEBCAAGBQJWCZxGAAoJEKeha0olJ0Nq8aIIAJaqPYEOHqt9erceSGFCypUP C4h0UwmCov+A3soL9QEMqSSUQjl8pib4E5XX6Fu5+NHgxmKyHtfJaK1yYaSjF/lB ZeimysIs17yMjsFRvG7Iy5S3vLXiuHsWGxzB46ziLR83yGYb7bjXjNsLWb/0s9g3 M68uGjF9JaSln2v9knXoYU6nz+IYLvQKeKEc4qlIZYxHS47OzDGCCQSnmFIp8haX /zguCFMdqrNczGaqGAu2NKfnk2bJklOsssr0RV1ybq/CUWZxX9CEPPmezPZnSMjj 5OOvpgPvLG0LKXVzs79c7aw58ws13xDqyl8fY9mFFzZFTcUFVY1XNFgNiau36AI= =n5SN -----END PGP SIGNATURE----- --7M0vew4tlD1fxb8IL7rVlJETD70olEOxl--