From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgyN1-0002sw-Cr for qemu-devel@nongnu.org; Thu, 14 Nov 2013 09:58:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VgyMw-0000AZ-Mc for qemu-devel@nongnu.org; Thu, 14 Nov 2013 09:58:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20949) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgyMw-0000AU-Dz for qemu-devel@nongnu.org; Thu, 14 Nov 2013 09:58:06 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAEEw5vS018482 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 14 Nov 2013 09:58:05 -0500 Message-ID: <5284E4F8.9040301@redhat.com> Date: Thu, 14 Nov 2013 07:58:00 -0700 From: Eric Blake MIME-Version: 1.0 References: <1384439646-19703-1-git-send-email-stefanha@redhat.com> In-Reply-To: <1384439646-19703-1-git-send-email-stefanha@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Px7gsK0bUFPmFWTsFUT7tQ0B8N2qb98UR" Subject: Re: [Qemu-devel] [PATCH] qemu-iotests: filter QEMU monitor \r\n List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Kevin Wolf , Luiz Capitulino This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Px7gsK0bUFPmFWTsFUT7tQ0B8N2qb98UR Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 11/14/2013 07:34 AM, Stefan Hajnoczi wrote: > SMTP does not preserve newlines. This is normally not a problem if the= > email body uses DOS or UNIX newlines consistently. In 051.out we mix > UNIX newlines with DOS newlines (since QEMU monitor output uses \r\n). >=20 > This patch filters the QEMU monitor output so the golden master file > uses UNIX newlines exclusively. >=20 > The result is that patches touching 051.out will apply cleanly without > mangling newlines after this commit. The idea makes sense. However... >=20 > Signed-off-by: Stefan Hajnoczi > --- > If you have trouble applying this patch, you can use by git repo: > git://github.com/stefanha/qemu.git fix-qemu-io-cr >=20 > +++ b/tests/qemu-iotests/common.filter > @@ -156,7 +156,8 @@ _filter_qemu_io() > _filter_qemu() > { > sed -e "s#\\(^\\|(qemu) \\)$(basename $QEMU_PROG):#\1QEMU_PROG:#" = \ > - -e 's#^QEMU [0-9]\+\.[0-9]\+\.[0-9]\+ monitor#QEMU X.Y.Z monit= or#' > + -e 's#^QEMU [0-9]\+\.[0-9]\+\.[0-9]\+ monitor#QEMU X.Y.Z monit= or#' \ > + -e 's#\r##' # QEMU monitor uses \r\n line endings \r is not portable sed (some implementations match a literal \ followed by a literal r; some treat it as a syntax error; while you want it to be treated as an escape sequence for CR). Then again, \+ is not portable sed either, so we already fail to run on non-GNU sed. Both problems could be avoided: write '[0-9][0-9]*' instead of '[0-9]\+'; and exploit the fact that common.filter already requires bash by writing "-e $'s#\r##'" (using $'' to do the \r interpolation prior to handing the argument to sed). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Px7gsK0bUFPmFWTsFUT7tQ0B8N2qb98UR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJShOT4AAoJEKeha0olJ0NqpLgIAJB0TGFrsS1mY0PoFbfY4b4m akowTFDZVnZxNQ0UNb4xt+5g2+BD4WvMoRFMoGCpNfV3QXOoNTuFtcfvdrfDxHWn yJiIwdVkI4yD4K0QC4ZEn4r/5+f/cNvX4hnBGLi+Rgh08RaQo6ZML29wZC7BZN+1 C0izkbUAd8sm+y5GM80HXm4bO8XF40bxJO5lYZwr8KZBVHCS0QGMeoYXb3nGYOEG v5QhLB9wInCSpEe6Mz9UHIY6BhN4BSDEIHKyo9UqhAhiVqRoTJPs82MX12EFfW7F R7C/dZ++ShZG3tpA584jMNpvYyUNDH0mxpzYRhB31lj9R1/wh2C7ZhVLqAhnXUU= =5ggK -----END PGP SIGNATURE----- --Px7gsK0bUFPmFWTsFUT7tQ0B8N2qb98UR--