* [Qemu-devel] [PATCH] qemu-iotests: filter QEMU monitor \r\n
@ 2013-11-14 14:34 Stefan Hajnoczi
2013-11-14 14:58 ` Eric Blake
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2013-11-14 14:34 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Stefan Hajnoczi, Luiz Capitulino
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).
This patch filters the QEMU monitor output so the golden master file
uses UNIX newlines exclusively.
The result is that patches touching 051.out will apply cleanly without
mangling newlines after this commit.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
If you have trouble applying this patch, you can use by git repo:
git://github.com/stefanha/qemu.git fix-qemu-io-cr
Luiz: CCed you just because I was surprised monitor.c uses \r\n. Perhaps this
is because terminal or telnet emulation is somehow mixed into the core
monitor.c code?
tests/qemu-iotests/051.out | 112 +++++++++++++++++++--------------------
tests/qemu-iotests/common.filter | 3 +-
2 files changed, 58 insertions(+), 57 deletions(-)
diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out
index 15deef6..186a5f3 100644
--- a/tests/qemu-iotests/051.out
+++ b/tests/qemu-iotests/051.out
@@ -30,12 +30,12 @@ ide0-hd0: TEST_DIR/t.qcow2 (qcow2)
=== Enable and disable lazy refcounting on the command line, plus some invalid values ===
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=on
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=off
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=: could not open disk image TEST_DIR/t.qcow2: Parameter 'lazy-refcounts' expects 'on' or 'off'
@@ -54,71 +54,71 @@ Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=on
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=on: could not open disk image TEST_DIR/t.qcow2: Lazy refcounts require a qcow2 image with at least qemu 1.1 compatibility level
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=off
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
=== No medium ===
Testing: -drive if=floppy
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive if=ide,media=cdrom
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive if=scsi,media=cdrom
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive if=ide
-QEMU X.Y.Z monitor - type 'help' for more information
+QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: Device needs media, but drive is empty
QEMU_PROG: Device initialization failed.
QEMU_PROG: Initialization of device ide-hd failed
Testing: -drive if=virtio
-QEMU X.Y.Z monitor - type 'help' for more information
+QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -drive if=virtio: Device needs media, but drive is empty
QEMU_PROG: -drive if=virtio: Device initialization failed.
QEMU_PROG: -drive if=virtio: Device initialization failed.
QEMU_PROG: -drive if=virtio: Device 'virtio-blk-pci' could not be initialized
Testing: -drive if=scsi
-QEMU X.Y.Z monitor - type 'help' for more information
+QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -drive if=scsi: Device needs media, but drive is empty
QEMU_PROG: Device initialization failed.
QEMU_PROG: Initialization of device lsi53c895a failed
Testing: -drive if=none,id=disk -device ide-cd,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-cd,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive if=none,id=disk -device ide-drive,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
+QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -device ide-drive,drive=disk: Device needs media, but drive is empty
QEMU_PROG: -device ide-drive,drive=disk: Device initialization failed.
QEMU_PROG: -device ide-drive,drive=disk: Device 'ide-drive' could not be initialized
Testing: -drive if=none,id=disk -device ide-hd,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
+QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -device ide-hd,drive=disk: Device needs media, but drive is empty
QEMU_PROG: -device ide-hd,drive=disk: Device initialization failed.
QEMU_PROG: -device ide-hd,drive=disk: Device 'ide-hd' could not be initialized
Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-disk,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
+QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -device scsi-disk,drive=disk: Device needs media, but drive is empty
QEMU_PROG: -device scsi-disk,drive=disk: Device initialization failed.
QEMU_PROG: -device scsi-disk,drive=disk: Device 'scsi-disk' could not be initialized
Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
+QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -device scsi-hd,drive=disk: Device needs media, but drive is empty
QEMU_PROG: -device scsi-hd,drive=disk: Device initialization failed.
QEMU_PROG: -device scsi-hd,drive=disk: Device 'scsi-hd' could not be initialized
@@ -127,81 +127,81 @@ QEMU_PROG: -device scsi-hd,drive=disk: Device 'scsi-hd' could not be initialized
=== Read-only ===
Testing: -drive file=TEST_DIR/t.qcow2,if=floppy,readonly=on
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive file=TEST_DIR/t.qcow2,if=ide,media=cdrom,readonly=on
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive file=TEST_DIR/t.qcow2,if=scsi,media=cdrom,readonly=on
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive file=TEST_DIR/t.qcow2,if=ide,readonly=on
-QEMU X.Y.Z monitor - type 'help' for more information
+QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: Can't use a read-only drive
QEMU_PROG: Device initialization failed.
QEMU_PROG: Initialization of device ide-hd failed
Testing: -drive file=TEST_DIR/t.qcow2,if=virtio,readonly=on
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive file=TEST_DIR/t.qcow2,if=scsi,readonly=on
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device ide-cd,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-cd,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device ide-drive,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
+QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -device ide-drive,drive=disk: Can't use a read-only drive
QEMU_PROG: -device ide-drive,drive=disk: Device initialization failed.
QEMU_PROG: -device ide-drive,drive=disk: Device 'ide-drive' could not be initialized
Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device ide-hd,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
+QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -device ide-hd,drive=disk: Can't use a read-only drive
QEMU_PROG: -device ide-hd,drive=disk: Device initialization failed.
QEMU_PROG: -device ide-hd,drive=disk: Device 'ide-hd' could not be initialized
Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
=== Cache modes ===
Testing: -drive media=cdrom,cache=none
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive media=cdrom,cache=directsync
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive media=cdrom,cache=writeback
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive media=cdrom,cache=writethrough
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive media=cdrom,cache=unsafe
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive media=cdrom,cache=invalid_value
QEMU_PROG: -drive media=cdrom,cache=invalid_value: invalid cache option
@@ -210,8 +210,8 @@ QEMU_PROG: -drive media=cdrom,cache=invalid_value: invalid cache option
=== Specifying the protocol layer ===
Testing: -drive file=TEST_DIR/t.qcow2,file.driver=file
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
Testing: -drive file=TEST_DIR/t.qcow2,file.driver=qcow2
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,file.driver=qcow2: could not open disk image TEST_DIR/t.qcow2: Can't use 'qcow2' as a block driver for the protocol level
diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
index 8e7b1a4..efa9ac1 100644
--- a/tests/qemu-iotests/common.filter
+++ 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 monitor#'
+ -e 's#^QEMU [0-9]\+\.[0-9]\+\.[0-9]\+ monitor#QEMU X.Y.Z monitor#' \
+ -e 's#\r##' # QEMU monitor uses \r\n line endings
}
# replace problematic QMP output like timestamps
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] qemu-iotests: filter QEMU monitor \r\n
2013-11-14 14:34 [Qemu-devel] [PATCH] qemu-iotests: filter QEMU monitor \r\n Stefan Hajnoczi
@ 2013-11-14 14:58 ` Eric Blake
2013-11-15 8:35 ` Stefan Hajnoczi
2013-11-15 2:29 ` Luiz Capitulino
2013-12-05 16:01 ` Stefan Hajnoczi
2 siblings, 1 reply; 5+ messages in thread
From: Eric Blake @ 2013-11-14 14:58 UTC (permalink / raw)
To: Stefan Hajnoczi, qemu-devel; +Cc: Kevin Wolf, Luiz Capitulino
[-- Attachment #1: Type: text/plain, Size: 1773 bytes --]
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).
>
> This patch filters the QEMU monitor output so the golden master file
> uses UNIX newlines exclusively.
>
> The result is that patches touching 051.out will apply cleanly without
> mangling newlines after this commit.
The idea makes sense. However...
>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> If you have trouble applying this patch, you can use by git repo:
> git://github.com/stefanha/qemu.git fix-qemu-io-cr
>
> +++ 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 monitor#'
> + -e 's#^QEMU [0-9]\+\.[0-9]\+\.[0-9]\+ monitor#QEMU X.Y.Z monitor#' \
> + -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).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] qemu-iotests: filter QEMU monitor \r\n
2013-11-14 14:58 ` Eric Blake
@ 2013-11-15 8:35 ` Stefan Hajnoczi
0 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2013-11-15 8:35 UTC (permalink / raw)
To: Eric Blake; +Cc: Kevin Wolf, qemu-devel, Luiz Capitulino
On Thu, Nov 14, 2013 at 07:58:00AM -0700, Eric Blake wrote:
> 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).
> >
> > This patch filters the QEMU monitor output so the golden master file
> > uses UNIX newlines exclusively.
> >
> > The result is that patches touching 051.out will apply cleanly without
> > mangling newlines after this commit.
>
> The idea makes sense. However...
>
> >
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > ---
> > If you have trouble applying this patch, you can use by git repo:
> > git://github.com/stefanha/qemu.git fix-qemu-io-cr
> >
>
> > +++ 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 monitor#'
> > + -e 's#^QEMU [0-9]\+\.[0-9]\+\.[0-9]\+ monitor#QEMU X.Y.Z monitor#' \
> > + -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).
Thanks Eric. I'd rather not fix up existing code in the same commit but
we can switch to the portable bash version. In general, qemu-iotests
only supports Linux today.
Kevin (or note to self): use "-e $'s#\r##'" when merging.
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] qemu-iotests: filter QEMU monitor \r\n
2013-11-14 14:34 [Qemu-devel] [PATCH] qemu-iotests: filter QEMU monitor \r\n Stefan Hajnoczi
2013-11-14 14:58 ` Eric Blake
@ 2013-11-15 2:29 ` Luiz Capitulino
2013-12-05 16:01 ` Stefan Hajnoczi
2 siblings, 0 replies; 5+ messages in thread
From: Luiz Capitulino @ 2013-11-15 2:29 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: Kevin Wolf, qemu-devel
On Thu, 14 Nov 2013 15:34:06 +0100
Stefan Hajnoczi <stefanha@redhat.com> 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).
>
> This patch filters the QEMU monitor output so the golden master file
> uses UNIX newlines exclusively.
>
> The result is that patches touching 051.out will apply cleanly without
> mangling newlines after this commit.
>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> If you have trouble applying this patch, you can use by git repo:
> git://github.com/stefanha/qemu.git fix-qemu-io-cr
>
> Luiz: CCed you just because I was surprised monitor.c uses \r\n. Perhaps this
> is because terminal or telnet emulation is somehow mixed into the core
> monitor.c code?
Yes, it's telnet support (we allow a telnet client to connect to the
monitor).
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] qemu-iotests: filter QEMU monitor \r\n
2013-11-14 14:34 [Qemu-devel] [PATCH] qemu-iotests: filter QEMU monitor \r\n Stefan Hajnoczi
2013-11-14 14:58 ` Eric Blake
2013-11-15 2:29 ` Luiz Capitulino
@ 2013-12-05 16:01 ` Stefan Hajnoczi
2 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2013-12-05 16:01 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: Kevin Wolf, qemu-devel, Luiz Capitulino
On Thu, Nov 14, 2013 at 03:34:06PM +0100, 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).
>
> This patch filters the QEMU monitor output so the golden master file
> uses UNIX newlines exclusively.
>
> The result is that patches touching 051.out will apply cleanly without
> mangling newlines after this commit.
>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> If you have trouble applying this patch, you can use by git repo:
> git://github.com/stefanha/qemu.git fix-qemu-io-cr
>
> Luiz: CCed you just because I was surprised monitor.c uses \r\n. Perhaps this
> is because terminal or telnet emulation is somehow mixed into the core
> monitor.c code?
>
> tests/qemu-iotests/051.out | 112 +++++++++++++++++++--------------------
> tests/qemu-iotests/common.filter | 3 +-
> 2 files changed, 58 insertions(+), 57 deletions(-)
Applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-12-05 16:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-14 14:34 [Qemu-devel] [PATCH] qemu-iotests: filter QEMU monitor \r\n Stefan Hajnoczi
2013-11-14 14:58 ` Eric Blake
2013-11-15 8:35 ` Stefan Hajnoczi
2013-11-15 2:29 ` Luiz Capitulino
2013-12-05 16:01 ` Stefan Hajnoczi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).