qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Cody <jcody@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: qemu-block@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
	qemu-stable@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 2/2] iotests: Add case for a corrupted inactive image
Date: Mon, 4 Jun 2018 16:10:20 -0400	[thread overview]
Message-ID: <20180604201020.GB14298@localhost.localdomain> (raw)
In-Reply-To: <20180604141437.22758-3-mreitz@redhat.com>

On Mon, Jun 04, 2018 at 04:14:37PM +0200, Max Reitz wrote:
> Signed-off-by: Max Reitz <mreitz@redhat.com>

Aborts without patch 1, passes with it, so a twofer:

Tested-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>


> ---
>  tests/qemu-iotests/060     | 30 ++++++++++++++++++++++++++++++
>  tests/qemu-iotests/060.out | 14 ++++++++++++++
>  2 files changed, 44 insertions(+)
> 
> diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060
> index 6c7407f499..7bdf609f3f 100755
> --- a/tests/qemu-iotests/060
> +++ b/tests/qemu-iotests/060
> @@ -440,6 +440,36 @@ echo "{'execute': 'qmp_capabilities'}
>              -drive if=none,node-name=drive,file="$TEST_IMG",driver=qcow2 \
>      | _filter_qmp | _filter_qemu_io
>  
> +echo
> +echo "=== Testing incoming inactive corrupted image ==="
> +echo
> +
> +_make_test_img 64M
> +# Create an unaligned L1 entry, so qemu will signal a corruption when
> +# reading from the covered area
> +poke_file "$TEST_IMG" "$l1_offset" "\x00\x00\x00\x00\x2a\x2a\x2a\x2a"
> +
> +# Inactive images are effectively read-only images, so this should be a
> +# non-fatal corruption (which does not modify the image)
> +echo "{'execute': 'qmp_capabilities'}
> +      {'execute': 'human-monitor-command',
> +       'arguments': {'command-line': 'qemu-io drive \"read 0 512\"'}}
> +      {'execute': 'quit'}" \
> +    | $QEMU -qmp stdio -nographic -nodefaults \
> +            -blockdev "{'node-name': 'drive',
> +                        'driver': 'qcow2',
> +                        'file': {
> +                            'driver': 'file',
> +                            'filename': '$TEST_IMG'
> +                        }}" \
> +            -incoming exec:'cat /dev/null' \
> +            2>&1 \
> +    | _filter_qmp | _filter_qemu_io
> +
> +echo
> +# Image should not have been marked corrupt
> +_img_info --format-specific | grep 'corrupt:'
> +
>  # success, all done
>  echo "*** done"
>  rm -f $seq.full
> diff --git a/tests/qemu-iotests/060.out b/tests/qemu-iotests/060.out
> index 5f4264cff6..bff023d889 100644
> --- a/tests/qemu-iotests/060.out
> +++ b/tests/qemu-iotests/060.out
> @@ -420,4 +420,18 @@ write failed: Input/output error
>  {"return": ""}
>  {"return": {}}
>  {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}}
> +
> +=== Testing incoming inactive corrupted image ===
> +
> +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
> +QMP_VERSION
> +{"return": {}}
> +qcow2: Image is corrupt: L2 table offset 0x2a2a2a00 unaligned (L1 index: 0); further non-fatal corruption events will be suppressed
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_IMAGE_CORRUPTED", "data": {"device": "", "msg": "L2 table offset 0x2a2a2a00 unaligned (L1 index: 0)", "node-name": "drive", "fatal": false}}
> +read failed: Input/output error
> +{"return": ""}
> +{"return": {}}
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}}
> +
> +    corrupt: false
>  *** done
> -- 
> 2.17.0
> 
> 

  reply	other threads:[~2018-06-04 20:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-04 14:14 [Qemu-devel] [PATCH 0/2] qcow2: Do not mark inactive images corrupt Max Reitz
2018-06-04 14:14 ` [Qemu-devel] [PATCH 1/2] " Max Reitz
2018-06-04 20:06   ` [Qemu-devel] [Qemu-block] " Jeff Cody
2018-06-06 10:22     ` Max Reitz
2018-06-04 14:14 ` [Qemu-devel] [PATCH 2/2] iotests: Add case for a corrupted inactive image Max Reitz
2018-06-04 20:10   ` Jeff Cody [this message]
2018-06-04 18:58 ` [Qemu-devel] [Qemu-block] [PATCH 0/2] qcow2: Do not mark inactive images corrupt John Snow
2018-06-06 19:32   ` Max Reitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180604201020.GB14298@localhost.localdomain \
    --to=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).