From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4Vl7-0001Xc-Ee for qemu-devel@nongnu.org; Thu, 03 Dec 2015 10:25:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a4Vl3-0007t2-BB for qemu-devel@nongnu.org; Thu, 03 Dec 2015 10:25:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34685) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4Vl3-0007sw-3p for qemu-devel@nongnu.org; Thu, 03 Dec 2015 10:25:21 -0500 References: <1449123852-9260-1-git-send-email-den@openvz.org> From: Eric Blake Message-ID: <56605EDA.80705@redhat.com> Date: Thu, 3 Dec 2015 08:25:14 -0700 MIME-Version: 1.0 In-Reply-To: <1449123852-9260-1-git-send-email-den@openvz.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tLdkhMMHRX7IAqjG6F078tlBJldBGR86g" Subject: Re: [Qemu-devel] [PATCH for 2.6 1/1] qemu-char: append opt to stop truncation of serial file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" Cc: Olga Krishtal , Paolo Bonzini , qemu-devel@nongnu.org, Markus Armbruster This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --tLdkhMMHRX7IAqjG6F078tlBJldBGR86g Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/02/2015 11:24 PM, Denis V. Lunev wrote: > From: Olga Krishtal >=20 > Our QA teams wants to preserve serial output of the guest in between QE= MU > runs to perform post-analysis. >=20 > By default this behavior is off (file is truncated each time QEMU is st= arted > or device is plugged). >=20 > Signed-off-by: Olga Krishtal > Signed-off-by: Denis V. Lunev > CC: Eric Blake > CC: Markus Armbruster > CC: Paolo Bonzini > --- > qapi-schema.json | 7 ++++++- > qemu-char.c | 12 +++++++++++- > 2 files changed, 17 insertions(+), 2 deletions(-) >=20 > diff --git a/qapi-schema.json b/qapi-schema.json > index 8b1a423..802c138 100644 > --- a/qapi-schema.json > +++ b/qapi-schema.json > @@ -3020,11 +3020,16 @@ > # > # @in: #optional The name of the input file > # @out: The name of the output file > +# @append: #optional Open the file in append mode to preserve the cont= ent in > +# between QEMU runs. > +# > +# Since: 2.6 The 'Since' tag is wrong. Also, the wording might sound better as: # @append: #optional Open the file in append mode (default false to truncate) (Since 2.6) > # > # Since: 1.4 The way you wrote it makes it look like the since 2.6 and since 1.4 tags both apply to the overall struct, which is not true. > ## > { 'struct': 'ChardevFile', 'data': { '*in' : 'str', > - 'out' : 'str' } } > + 'out' : 'str', > + '*append': 'bool' } } > =20 > ## > # @ChardevHostdev: > diff --git a/qemu-char.c b/qemu-char.c > index 5448b0f..58454e2 100644 > --- a/qemu-char.c > +++ b/qemu-char.c > @@ -3479,6 +3479,7 @@ static void qemu_chr_parse_file_out(QemuOpts *opt= s, ChardevBackend *backend, > } > backend->u.file =3D g_new0(ChardevFile, 1); > backend->u.file->out =3D g_strdup(path); > + backend->u.file->append =3D qemu_opt_get_bool(opts, "append", fals= e); You also need to set backend->u.file->has_append. (Because you are always initializing it, with a default of false, you can set has_append to true, rather than worrying about whether the user provided an "append" option.) --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --tLdkhMMHRX7IAqjG6F078tlBJldBGR86g 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/ iQEcBAEBCAAGBQJWYF7aAAoJEKeha0olJ0Nqp5gH/RzkAbhLg+0HJyYgBAA34N9I 8hIqk5NnewvmpYa090Si0sk2vfAOwyvRmXYY+EdPTRt+oHNXyULZhj/Xh9yVMNKO 5WDheN3HlgERxd/0aTty0mvp4/DbwAOAyqWPhkUQVhPsdRjQ67YhBwLpVpsrZ6rY 7cdf/7ULrU3NxkEAfSIl3+5QU8DorCmH/5mOATyzNkBlph56kwttZgsl7w8TdwZV rJlAigMDkNv1oGJCEcSHLYe9XkhV5J1Xl8xJ6wTYGzIzroubLSoVONgfbFjes7r1 CfCMsMhduy7+nt0wygLEJ2NawQlNHpIGGt1pnp35aaDA4vQWDClHfF4vni3L81Y= =G1XV -----END PGP SIGNATURE----- --tLdkhMMHRX7IAqjG6F078tlBJldBGR86g--