From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vgxzv-0006RQ-Vd for qemu-devel@nongnu.org; Thu, 14 Nov 2013 09:34:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vgxzq-00017B-3f for qemu-devel@nongnu.org; Thu, 14 Nov 2013 09:34:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60242) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vgxzp-00015k-PK for qemu-devel@nongnu.org; Thu, 14 Nov 2013 09:34:14 -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 rAEEYCYZ005365 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 14 Nov 2013 09:34:12 -0500 From: Stefan Hajnoczi Date: Thu, 14 Nov 2013 15:34:06 +0100 Message-Id: <1384439646-19703-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH] qemu-iotests: filter QEMU monitor \r\n List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 --- 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) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=off -QEMU X.Y.Z monitor - type 'help' for more information -(qemu) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit 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) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit === No medium === Testing: -drive if=floppy -QEMU X.Y.Z monitor - type 'help' for more information -(qemu) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit Testing: -drive if=ide,media=cdrom -QEMU X.Y.Z monitor - type 'help' for more information -(qemu) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit Testing: -drive if=scsi,media=cdrom -QEMU X.Y.Z monitor - type 'help' for more information -(qemu) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit 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) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-cd,drive=disk -QEMU X.Y.Z monitor - type 'help' for more information -(qemu) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit 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) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit Testing: -drive file=TEST_DIR/t.qcow2,if=ide,media=cdrom,readonly=on -QEMU X.Y.Z monitor - type 'help' for more information -(qemu) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit Testing: -drive file=TEST_DIR/t.qcow2,if=scsi,media=cdrom,readonly=on -QEMU X.Y.Z monitor - type 'help' for more information -(qemu) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit 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) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit Testing: -drive file=TEST_DIR/t.qcow2,if=scsi,readonly=on -QEMU X.Y.Z monitor - type 'help' for more information -(qemu) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit 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) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit 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) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit 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) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit 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) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit === Cache modes === Testing: -drive media=cdrom,cache=none -QEMU X.Y.Z monitor - type 'help' for more information -(qemu) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit Testing: -drive media=cdrom,cache=directsync -QEMU X.Y.Z monitor - type 'help' for more information -(qemu) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit Testing: -drive media=cdrom,cache=writeback -QEMU X.Y.Z monitor - type 'help' for more information -(qemu) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit Testing: -drive media=cdrom,cache=writethrough -QEMU X.Y.Z monitor - type 'help' for more information -(qemu) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit Testing: -drive media=cdrom,cache=unsafe -QEMU X.Y.Z monitor - type 'help' for more information -(qemu) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit 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) qququiquit +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qququiquit 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