get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/812897/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 812897,
    "url": "http://patchwork.ozlabs.org/api/patches/812897/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170912144459.11359-11-pbonzini@redhat.com/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api",
        "name": "QEMU Development",
        "link_name": "qemu-devel",
        "list_id": "qemu-devel.nongnu.org",
        "list_email": "qemu-devel@nongnu.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170912144459.11359-11-pbonzini@redhat.com>",
    "list_archive_url": null,
    "date": "2017-09-12T14:44:59",
    "name": "[10/10] qemu-iotests: merge \"check\" and \"common\"",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "7713adc93a868e2c117ab7ce5da6f5079dfc44ff",
    "submitter": {
        "id": 2701,
        "url": "http://patchwork.ozlabs.org/api/people/2701/?format=api",
        "name": "Paolo Bonzini",
        "email": "pbonzini@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170912144459.11359-11-pbonzini@redhat.com/mbox/",
    "series": [
        {
            "id": 2722,
            "url": "http://patchwork.ozlabs.org/api/series/2722/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=2722",
            "date": "2017-09-12T14:44:51",
            "name": "cleanup qemu-iotests",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/2722/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/812897/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/812897/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)",
            "ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com",
            "ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=pbonzini@redhat.com"
        ],
        "Received": [
            "from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xs77v5W6vz9sNV\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 00:52:59 +1000 (AEST)",
            "from localhost ([::1]:36340 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1drmYb-0001ek-IS\n\tfor incoming@patchwork.ozlabs.org; Tue, 12 Sep 2017 10:52:57 -0400",
            "from eggs.gnu.org ([2001:4830:134:3::10]:51970)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1drmRZ-00049y-24\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 10:45:49 -0400",
            "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1drmRU-0001xd-2F\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 10:45:41 -0400",
            "from mx1.redhat.com ([209.132.183.28]:50506)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <pbonzini@redhat.com>)\n\tid 1drmRN-0001te-6w; Tue, 12 Sep 2017 10:45:29 -0400",
            "from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 29595285D0;\n\tTue, 12 Sep 2017 14:45:28 +0000 (UTC)",
            "from donizetti.redhat.com (ovpn-117-43.ams2.redhat.com\n\t[10.36.117.43])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id A21B877DD4;\n\tTue, 12 Sep 2017 14:45:26 +0000 (UTC)"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com 29595285D0",
        "From": "Paolo Bonzini <pbonzini@redhat.com>",
        "To": "qemu-devel@nongnu.org",
        "Date": "Tue, 12 Sep 2017 16:44:59 +0200",
        "Message-Id": "<20170912144459.11359-11-pbonzini@redhat.com>",
        "In-Reply-To": "<20170912144459.11359-1-pbonzini@redhat.com>",
        "References": "<20170912144459.11359-1-pbonzini@redhat.com>",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.12",
        "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tTue, 12 Sep 2017 14:45:28 +0000 (UTC)",
        "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]",
        "X-Received-From": "209.132.183.28",
        "Subject": "[Qemu-devel] [PATCH 10/10] qemu-iotests: merge \"check\" and \"common\"",
        "X-BeenThere": "qemu-devel@nongnu.org",
        "X-Mailman-Version": "2.1.21",
        "Precedence": "list",
        "List-Id": "<qemu-devel.nongnu.org>",
        "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.nongnu.org/archive/html/qemu-devel/>",
        "List-Post": "<mailto:qemu-devel@nongnu.org>",
        "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>",
        "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>",
        "Cc": "kwolf@redhat.com, qemu-block@nongnu.org",
        "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org",
        "Sender": "\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"
    },
    "content": "\"check\" is full of qemu-iotests--specific details.  Separating it\nfrom \"common\" does not make much sense anymore.\n\nSigned-off-by: Paolo Bonzini <pbonzini@redhat.com>\n---\n tests/qemu-iotests/check  | 533 +++++++++++++++++++++++++++++++++++++++++++-\n tests/qemu-iotests/common | 552 ----------------------------------------------\n 2 files changed, 531 insertions(+), 554 deletions(-)\n delete mode 100644 tests/qemu-iotests/common",
    "diff": "diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check\nindex 5dfd4bd51d..2a2f7c604f 100755\n--- a/tests/qemu-iotests/check\n+++ b/tests/qemu-iotests/check\n@@ -69,8 +69,537 @@ then\n     _init_error \"failed to source common.config\"\n fi\n \n-# we need common\n-. \"$source_iotests/common\"\n+_full_imgfmt_details()\n+{\n+    if [ -n \"$IMGOPTS\" ]; then\n+        echo \"$IMGFMT ($IMGOPTS)\"\n+    else\n+        echo \"$IMGFMT\"\n+    fi\n+}\n+\n+_full_platform_details()\n+{\n+    os=`uname -s`\n+    host=`hostname -s`\n+    kernel=`uname -r`\n+    platform=`uname -m`\n+    echo \"$os/$platform $host $kernel\"\n+}\n+\n+# $1 = prog to look for\n+set_prog_path()\n+{\n+    p=`command -v $1 2> /dev/null`\n+    if [ -n \"$p\" -a -x \"$p\" ]; then\n+        realpath -- \"$(type -p \"$p\")\"\n+    else\n+        return 1\n+    fi\n+}\n+\n+if [ -z \"$TEST_DIR\" ]; then\n+        TEST_DIR=`pwd`/scratch\n+fi\n+\n+if [ ! -e \"$TEST_DIR\" ]; then\n+        mkdir \"$TEST_DIR\"\n+fi\n+\n+diff=\"diff -u\"\n+verbose=false\n+debug=false\n+group=false\n+xgroup=false\n+imgopts=false\n+showme=false\n+sortme=false\n+expunge=true\n+have_test_arg=false\n+cachemode=false\n+\n+tmp=\"${TEST_DIR}\"/$$\n+rm -f $tmp.list $tmp.tmp $tmp.sed\n+\n+export IMGFMT=raw\n+export IMGFMT_GENERIC=true\n+export IMGPROTO=file\n+export IMGOPTS=\"\"\n+export CACHEMODE=\"writeback\"\n+export QEMU_IO_OPTIONS=\"\"\n+export QEMU_IO_OPTIONS_NO_FMT=\"\"\n+export CACHEMODE_IS_DEFAULT=true\n+export QEMU_OPTIONS=\"-nodefaults -machine accel=qtest\"\n+export VALGRIND_QEMU=\n+export IMGKEYSECRET=\n+export IMGOPTSSYNTAX=false\n+\n+for r\n+do\n+\n+    if $group\n+    then\n+        # arg after -g\n+        group_list=`sed -n <\"$source_iotests/group\" -e 's/$/ /' -e \"/^[0-9][0-9][0-9].* $r /\"'{\n+s/ .*//p\n+}'`\n+        if [ -z \"$group_list\" ]\n+        then\n+            echo \"Group \\\"$r\\\" is empty or not defined?\"\n+            exit 1\n+        fi\n+        [ ! -s $tmp.list ] && touch $tmp.list\n+        for t in $group_list\n+        do\n+            if grep -s \"^$t\\$\" $tmp.list >/dev/null\n+            then\n+                :\n+            else\n+                echo \"$t\" >>$tmp.list\n+            fi\n+        done\n+        group=false\n+        continue\n+\n+    elif $xgroup\n+    then\n+        # arg after -x\n+        # Populate $tmp.list with all tests\n+        awk '/^[0-9]{3,}/ {print $1}' \"${source_iotests}/group\" > $tmp.list 2>/dev/null\n+        group_list=`sed -n <\"$source_iotests/group\" -e 's/$/ /' -e \"/^[0-9][0-9][0-9].* $r /\"'{\n+s/ .*//p\n+}'`\n+        if [ -z \"$group_list\" ]\n+        then\n+            echo \"Group \\\"$r\\\" is empty or not defined?\"\n+            exit 1\n+        fi\n+        numsed=0\n+        rm -f $tmp.sed\n+        for t in $group_list\n+        do\n+            if [ $numsed -gt 100 ]\n+            then\n+                sed -f $tmp.sed <$tmp.list >$tmp.tmp\n+                mv $tmp.tmp $tmp.list\n+                numsed=0\n+                rm -f $tmp.sed\n+            fi\n+            echo \"/^$t\\$/d\" >>$tmp.sed\n+            numsed=`expr $numsed + 1`\n+        done\n+        sed -f $tmp.sed <$tmp.list >$tmp.tmp\n+        mv $tmp.tmp $tmp.list\n+        xgroup=false\n+        continue\n+\n+    elif $imgopts\n+    then\n+        IMGOPTS=\"$r\"\n+        imgopts=false\n+        continue\n+    elif $cachemode\n+    then\n+        CACHEMODE=\"$r\"\n+        CACHEMODE_IS_DEFAULT=false\n+        cachemode=false\n+        continue\n+    fi\n+\n+    xpand=true\n+    case \"$r\"\n+    in\n+\n+        -\\? | -h | --help)        # usage\n+            echo \"Usage: $0 [options] [testlist]\"'\n+\n+common options\n+    -v                  verbose\n+    -d                  debug\n+\n+image format options\n+    -raw                test raw (default)\n+    -bochs              test bochs\n+    -cloop              test cloop\n+    -parallels          test parallels\n+    -qcow               test qcow\n+    -qcow2              test qcow2\n+    -qed                test qed\n+    -vdi                test vdi\n+    -vpc                test vpc\n+    -vhdx               test vhdx\n+    -vmdk               test vmdk\n+    -luks               test luks\n+\n+image protocol options\n+    -file               test file (default)\n+    -rbd                test rbd\n+    -sheepdog           test sheepdog\n+    -nbd                test nbd\n+    -ssh                test ssh\n+    -nfs                test nfs\n+    -vxhs               test vxhs\n+\n+other options\n+    -xdiff              graphical mode diff\n+    -nocache            use O_DIRECT on backing file\n+    -misalign           misalign memory allocations\n+    -n                  show me, do not run tests\n+    -o options          -o options to pass to qemu-img create/convert\n+    -T                  output timestamps\n+    -c mode             cache mode\n+\n+testlist options\n+    -g group[,group...]        include tests from these groups\n+    -x group[,group...]        exclude tests from these groups\n+    NNN                        include test NNN\n+    NNN-NNN                    include test range (eg. 012-021)\n+'\n+            exit 0\n+            ;;\n+\n+        -raw)\n+            IMGFMT=raw\n+            xpand=false\n+            ;;\n+\n+        -bochs)\n+            IMGFMT=bochs\n+            IMGFMT_GENERIC=false\n+            xpand=false\n+            ;;\n+\n+        -cloop)\n+            IMGFMT=cloop\n+            IMGFMT_GENERIC=false\n+            xpand=false\n+            ;;\n+\n+        -parallels)\n+            IMGFMT=parallels\n+            IMGFMT_GENERIC=false\n+            xpand=false\n+            ;;\n+\n+        -qcow)\n+            IMGFMT=qcow\n+            xpand=false\n+            ;;\n+\n+        -qcow2)\n+            IMGFMT=qcow2\n+            xpand=false\n+            ;;\n+\n+        -luks)\n+            IMGOPTSSYNTAX=true\n+            IMGFMT=luks\n+            IMGKEYSECRET=123456\n+            xpand=false\n+            ;;\n+\n+        -qed)\n+            IMGFMT=qed\n+            xpand=false\n+            ;;\n+\n+        -vdi)\n+            IMGFMT=vdi\n+            xpand=false\n+            ;;\n+\n+        -vmdk)\n+            IMGFMT=vmdk\n+            xpand=false\n+            ;;\n+\n+        -vpc)\n+            IMGFMT=vpc\n+            xpand=false\n+            ;;\n+\n+        -vhdx)\n+            IMGFMT=vhdx\n+            xpand=false\n+            ;;\n+\n+        -file)\n+            IMGPROTO=file\n+            xpand=false\n+            ;;\n+\n+        -rbd)\n+            IMGPROTO=rbd\n+            xpand=false\n+            ;;\n+\n+        -sheepdog)\n+            IMGPROTO=sheepdog\n+            xpand=false\n+            ;;\n+\n+        -nbd)\n+            IMGPROTO=nbd\n+            xpand=false\n+            ;;\n+\n+        -vxhs)\n+            IMGPROTO=vxhs\n+            xpand=false\n+            ;;\n+\n+        -ssh)\n+            IMGPROTO=ssh\n+            xpand=false\n+            ;;\n+\n+        -nfs)\n+            IMGPROTO=nfs\n+            xpand=false\n+            ;;\n+\n+        -nocache)\n+            CACHEMODE=\"none\"\n+            CACHEMODE_IS_DEFAULT=false\n+            xpand=false\n+            ;;\n+\n+        -misalign)\n+            QEMU_IO_OPTIONS=\"$QEMU_IO_OPTIONS --misalign\"\n+            xpand=false\n+            ;;\n+\n+        -valgrind)\n+            VALGRIND_QEMU='y'\n+            xpand=false\n+            ;;\n+\n+        -g)        # -g group ... pick from group file\n+            group=true\n+            xpand=false\n+            ;;\n+\n+        -xdiff)        # graphical diff mode\n+            xpand=false\n+\n+            if [ ! -z \"$DISPLAY\" ]\n+            then\n+                command -v xdiff >/dev/null 2>&1 && diff=xdiff\n+                command -v gdiff >/dev/null 2>&1 && diff=gdiff\n+                command -v tkdiff >/dev/null 2>&1 && diff=tkdiff\n+                command -v xxdiff >/dev/null 2>&1 && diff=xxdiff\n+            fi\n+            ;;\n+\n+        -n)        # show me, don't do it\n+            showme=true\n+            xpand=false\n+            ;;\n+        -o)\n+            imgopts=true\n+            xpand=false\n+            ;;\n+        -c)\n+            cachemode=true\n+            xpand=false\n+            ;;\n+        -T)        # turn on timestamp output\n+            timestamp=true\n+            xpand=false\n+            ;;\n+\n+        -v)\n+            verbose=true\n+            xpand=false\n+            ;;\n+        -d)\n+            debug=true\n+            xpand=false\n+            ;;\n+        -x)        # -x group ... exclude from group file\n+            xgroup=true\n+            xpand=false\n+            ;;\n+        '[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]')\n+            echo \"No tests?\"\n+            status=1\n+            exit $status\n+            ;;\n+\n+        [0-9]*-[0-9]*)\n+            eval `echo $r | sed -e 's/^/start=/' -e 's/-/ end=/'`\n+            ;;\n+\n+        [0-9]*-)\n+            eval `echo $r | sed -e 's/^/start=/' -e 's/-//'`\n+            end=`echo [0-9][0-9][0-9] [0-9][0-9][0-9][0-9] | sed -e 's/\\[0-9]//g' -e 's/  *$//' -e 's/.* //'`\n+            if [ -z \"$end\" ]\n+            then\n+                echo \"No tests in range \\\"$r\\\"?\"\n+                status=1\n+                exit $status\n+            fi\n+            ;;\n+\n+        *)\n+            start=$r\n+            end=$r\n+            ;;\n+\n+    esac\n+\n+    # get rid of leading 0s as can be interpreted as octal\n+    start=`echo $start | sed 's/^0*//'`\n+    end=`echo $end | sed 's/^0*//'`\n+\n+    if $xpand\n+    then\n+        have_test_arg=true\n+        awk </dev/null '\n+BEGIN        { for (t='$start'; t<='$end'; t++) printf \"%03d\\n\",t }' \\\n+        | while read id\n+        do\n+            if grep -s \"^$id \" \"$source_iotests/group\" >/dev/null\n+            then\n+                # in group file ... OK\n+                echo $id >>$tmp.list\n+            else\n+                if [ -f expunged ] && $expunge && egrep \"^$id([         ]|\\$)\" expunged >/dev/null\n+                then\n+                    # expunged ... will be reported, but not run, later\n+                    echo $id >>$tmp.list\n+                else\n+                    # oops\n+                    if [ \"$start\" == \"$end\" -a \"$id\" == \"$end\" ]\n+                    then\n+                        echo \"$id - unknown test\"\n+                        exit 1\n+                    else\n+                        echo \"$id - unknown test, ignored\"\n+                    fi\n+                fi\n+            fi\n+        done || exit 1\n+    fi\n+\n+done\n+\n+# Set qemu-io cache mode with $CACHEMODE we have\n+QEMU_IO_OPTIONS=\"$QEMU_IO_OPTIONS --cache $CACHEMODE\"\n+\n+QEMU_IO_OPTIONS_NO_FMT=\"$QEMU_IO_OPTIONS\"\n+if [ \"$IMGOPTSSYNTAX\" != \"true\" ]; then\n+    QEMU_IO_OPTIONS=\"$QEMU_IO_OPTIONS -f $IMGFMT\"\n+fi\n+\n+# Set default options for qemu-img create -o if they were not specified\n+if [ \"$IMGFMT\" == \"qcow2\" ] && ! (echo \"$IMGOPTS\" | grep \"compat=\" > /dev/null); then\n+    IMGOPTS=$(_optstr_add \"$IMGOPTS\" \"compat=1.1\")\n+fi\n+if [ \"$IMGFMT\" == \"luks\" ] && ! (echo \"$IMGOPTS\" | grep \"iter-time=\" > /dev/null); then\n+    IMGOPTS=$(_optstr_add \"$IMGOPTS\" \"iter-time=10\")\n+fi\n+\n+if [ -z \"$SAMPLE_IMG_DIR\" ]; then\n+        SAMPLE_IMG_DIR=\"$source_iotests/sample_images\"\n+fi\n+\n+export TEST_DIR\n+export SAMPLE_IMG_DIR\n+\n+if [ -s $tmp.list ]\n+then\n+    # found some valid test numbers ... this is good\n+    :\n+else\n+    if $have_test_arg\n+    then\n+        # had test numbers, but none in group file ... do nothing\n+        touch $tmp.list\n+    else\n+        # no test numbers, do everything from group file\n+        sed -n -e '/^[0-9][0-9][0-9]*/s/[         ].*//p' <\"$source_iotests/group\" >$tmp.list\n+    fi\n+fi\n+\n+# should be sort -n, but this did not work for Linux when this\n+# was ported from IRIX\n+#\n+list=`sort $tmp.list`\n+rm -f $tmp.list $tmp.tmp $tmp.sed\n+\n+if [ -z \"$QEMU_PROG\" ]\n+then\n+    if [ -x \"$build_iotests/qemu\" ]; then\n+        export QEMU_PROG=\"$build_iotests/qemu\"\n+    elif [ -x \"$build_root/$arch-softmmu/qemu-system-$arch\" ]; then\n+        export QEMU_PROG=\"$build_root/$arch-softmmu/qemu-system-$arch\"\n+    else\n+        pushd \"$build_root\" > /dev/null\n+        for binary in *-softmmu/qemu-system-*\n+        do\n+            if [ -x \"$binary\" ]\n+            then\n+                export QEMU_PROG=\"$build_root/$binary\"\n+                break\n+            fi\n+        done\n+        popd > /dev/null\n+        [ \"$QEMU_PROG\" = \"\" ] && _init_error \"qemu not found\"\n+    fi\n+fi\n+export QEMU_PROG=$(realpath -- \"$(type -p \"$QEMU_PROG\")\")\n+\n+if [ -z \"$QEMU_IMG_PROG\" ]; then\n+    if [ -x \"$build_iotests/qemu-img\" ]; then\n+        export QEMU_IMG_PROG=\"$build_iotests/qemu-img\"\n+    elif [ -x \"$build_root/qemu-img\" ]; then\n+        export QEMU_IMG_PROG=\"$build_root/qemu-img\"\n+    else\n+        _init_error \"qemu-img not found\"\n+    fi\n+fi\n+export QEMU_IMG_PROG=$(realpath -- \"$(type -p \"$QEMU_IMG_PROG\")\")\n+\n+if [ -z \"$QEMU_IO_PROG\" ]; then\n+    if [ -x \"$build_iotests/qemu-io\" ]; then\n+        export QEMU_IO_PROG=\"$build_iotests/qemu-io\"\n+    elif [ -x \"$build_root/qemu-io\" ]; then\n+        export QEMU_IO_PROG=\"$build_root/qemu-io\"\n+    else\n+        _init_error \"qemu-io not found\"\n+    fi\n+fi\n+export QEMU_IO_PROG=$(realpath -- \"$(type -p \"$QEMU_IO_PROG\")\")\n+\n+if [ -z $QEMU_NBD_PROG ]; then\n+    if [ -x \"$build_iotests/qemu-nbd\" ]; then\n+        export QEMU_NBD_PROG=\"$build_iotests/qemu-nbd\"\n+    elif [ -x \"$build_root/qemu-nbd\" ]; then\n+        export QEMU_NBD_PROG=\"$build_root/qemu-nbd\"\n+    else\n+        _init_error \"qemu-nbd not found\"\n+    fi\n+fi\n+export QEMU_NBD_PROG=$(realpath -- \"$(type -p \"$QEMU_NBD_PROG\")\")\n+\n+if [ -z \"$QEMU_VXHS_PROG\" ]; then\n+  export QEMU_VXHS_PROG=\"`set_prog_path qnio_server`\"\n+fi\n+\n+if [ -x \"$build_iotests/socket_scm_helper\" ]\n+then\n+    export SOCKET_SCM_HELPER=\"$build_iotests/socket_scm_helper\"\n+fi\n+\n+default_machine=$($QEMU_PROG -machine help | sed -n '/(default)/ s/ .*//p')\n+default_alias_machine=$($QEMU_PROG -machine help | \\\n+   sed -n \"/(alias of $default_machine)/ { s/ .*//p; q; }\")\n+if [[ \"$default_alias_machine\" ]]; then\n+    default_machine=\"$default_alias_machine\"\n+fi\n+\n+export QEMU_DEFAULT_MACHINE=\"$default_machine\"\n \n TIMESTAMP_FILE=check.time-$IMGPROTO-$IMGFMT\n \ndiff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common\ndeleted file mode 100644\nindex 365d3c4349..0000000000\n--- a/tests/qemu-iotests/common\n+++ /dev/null\n@@ -1,552 +0,0 @@\n-#!/bin/bash\n-#\n-# Copyright (C) 2009 Red Hat, Inc.\n-# Copyright (c) 2000-2005 Silicon Graphics, Inc.  All Rights Reserved.\n-#\n-# This program is free software; you can redistribute it and/or\n-# modify it under the terms of the GNU General Public License as\n-# published by the Free Software Foundation.\n-#\n-# This program is distributed in the hope that it would be useful,\n-# but WITHOUT ANY WARRANTY; without even the implied warranty of\n-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n-# GNU General Public License for more details.\n-#\n-# You should have received a copy of the GNU General Public License\n-# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n-#\n-#\n-# common procedures for QA scripts\n-#\n-\n-_full_imgfmt_details()\n-{\n-    if [ -n \"$IMGOPTS\" ]; then\n-        echo \"$IMGFMT ($IMGOPTS)\"\n-    else\n-        echo \"$IMGFMT\"\n-    fi\n-}\n-\n-_full_platform_details()\n-{\n-    os=`uname -s`\n-    host=`hostname -s`\n-    kernel=`uname -r`\n-    platform=`uname -m`\n-    echo \"$os/$platform $host $kernel\"\n-}\n-\n-# $1 = prog to look for\n-set_prog_path()\n-{\n-    p=`command -v $1 2> /dev/null`\n-    if [ -n \"$p\" -a -x \"$p\" ]; then\n-        realpath -- \"$(type -p \"$p\")\"\n-    else\n-        return 1\n-    fi\n-}\n-\n-if [ -z \"$TEST_DIR\" ]; then\n-        TEST_DIR=`pwd`/scratch\n-fi\n-\n-if [ ! -e \"$TEST_DIR\" ]; then\n-        mkdir \"$TEST_DIR\"\n-fi\n-\n-diff=\"diff -u\"\n-verbose=false\n-debug=false\n-group=false\n-xgroup=false\n-imgopts=false\n-showme=false\n-sortme=false\n-expunge=true\n-have_test_arg=false\n-cachemode=false\n-\n-tmp=\"${TEST_DIR}\"/$$\n-rm -f $tmp.list $tmp.tmp $tmp.sed\n-\n-export IMGFMT=raw\n-export IMGFMT_GENERIC=true\n-export IMGPROTO=file\n-export IMGOPTS=\"\"\n-export CACHEMODE=\"writeback\"\n-export QEMU_IO_OPTIONS=\"\"\n-export QEMU_IO_OPTIONS_NO_FMT=\"\"\n-export CACHEMODE_IS_DEFAULT=true\n-export QEMU_OPTIONS=\"-nodefaults -machine accel=qtest\"\n-export VALGRIND_QEMU=\n-export IMGKEYSECRET=\n-export IMGOPTSSYNTAX=false\n-\n-for r\n-do\n-\n-    if $group\n-    then\n-        # arg after -g\n-        group_list=`sed -n <\"$source_iotests/group\" -e 's/$/ /' -e \"/^[0-9][0-9][0-9].* $r /\"'{\n-s/ .*//p\n-}'`\n-        if [ -z \"$group_list\" ]\n-        then\n-            echo \"Group \\\"$r\\\" is empty or not defined?\"\n-            exit 1\n-        fi\n-        [ ! -s $tmp.list ] && touch $tmp.list\n-        for t in $group_list\n-        do\n-            if grep -s \"^$t\\$\" $tmp.list >/dev/null\n-            then\n-                :\n-            else\n-                echo \"$t\" >>$tmp.list\n-            fi\n-        done\n-        group=false\n-        continue\n-\n-    elif $xgroup\n-    then\n-        # arg after -x\n-        # Populate $tmp.list with all tests\n-        awk '/^[0-9]{3,}/ {print $1}' \"${source_iotests}/group\" > $tmp.list 2>/dev/null\n-        group_list=`sed -n <\"$source_iotests/group\" -e 's/$/ /' -e \"/^[0-9][0-9][0-9].* $r /\"'{\n-s/ .*//p\n-}'`\n-        if [ -z \"$group_list\" ]\n-        then\n-            echo \"Group \\\"$r\\\" is empty or not defined?\"\n-            exit 1\n-        fi\n-        numsed=0\n-        rm -f $tmp.sed\n-        for t in $group_list\n-        do\n-            if [ $numsed -gt 100 ]\n-            then\n-                sed -f $tmp.sed <$tmp.list >$tmp.tmp\n-                mv $tmp.tmp $tmp.list\n-                numsed=0\n-                rm -f $tmp.sed\n-            fi\n-            echo \"/^$t\\$/d\" >>$tmp.sed\n-            numsed=`expr $numsed + 1`\n-        done\n-        sed -f $tmp.sed <$tmp.list >$tmp.tmp\n-        mv $tmp.tmp $tmp.list\n-        xgroup=false\n-        continue\n-\n-    elif $imgopts\n-    then\n-        IMGOPTS=\"$r\"\n-        imgopts=false\n-        continue\n-    elif $cachemode\n-    then\n-        CACHEMODE=\"$r\"\n-        CACHEMODE_IS_DEFAULT=false\n-        cachemode=false\n-        continue\n-    fi\n-\n-    xpand=true\n-    case \"$r\"\n-    in\n-\n-        -\\? | -h | --help)        # usage\n-            echo \"Usage: $0 [options] [testlist]\"'\n-\n-common options\n-    -v                  verbose\n-    -d                  debug\n-\n-image format options\n-    -raw                test raw (default)\n-    -bochs              test bochs\n-    -cloop              test cloop\n-    -parallels          test parallels\n-    -qcow               test qcow\n-    -qcow2              test qcow2\n-    -qed                test qed\n-    -vdi                test vdi\n-    -vpc                test vpc\n-    -vhdx               test vhdx\n-    -vmdk               test vmdk\n-    -luks               test luks\n-\n-image protocol options\n-    -file               test file (default)\n-    -rbd                test rbd\n-    -sheepdog           test sheepdog\n-    -nbd                test nbd\n-    -ssh                test ssh\n-    -nfs                test nfs\n-    -vxhs               test vxhs\n-\n-other options\n-    -xdiff              graphical mode diff\n-    -nocache            use O_DIRECT on backing file\n-    -misalign           misalign memory allocations\n-    -n                  show me, do not run tests\n-    -o options          -o options to pass to qemu-img create/convert\n-    -T                  output timestamps\n-    -c mode             cache mode\n-\n-testlist options\n-    -g group[,group...]        include tests from these groups\n-    -x group[,group...]        exclude tests from these groups\n-    NNN                        include test NNN\n-    NNN-NNN                    include test range (eg. 012-021)\n-'\n-            exit 0\n-            ;;\n-\n-        -raw)\n-            IMGFMT=raw\n-            xpand=false\n-            ;;\n-\n-        -bochs)\n-            IMGFMT=bochs\n-            IMGFMT_GENERIC=false\n-            xpand=false\n-            ;;\n-\n-        -cloop)\n-            IMGFMT=cloop\n-            IMGFMT_GENERIC=false\n-            xpand=false\n-            ;;\n-\n-        -parallels)\n-            IMGFMT=parallels\n-            IMGFMT_GENERIC=false\n-            xpand=false\n-            ;;\n-\n-        -qcow)\n-            IMGFMT=qcow\n-            xpand=false\n-            ;;\n-\n-        -qcow2)\n-            IMGFMT=qcow2\n-            xpand=false\n-            ;;\n-\n-        -luks)\n-            IMGOPTSSYNTAX=true\n-            IMGFMT=luks\n-            IMGKEYSECRET=123456\n-            xpand=false\n-            ;;\n-\n-        -qed)\n-            IMGFMT=qed\n-            xpand=false\n-            ;;\n-\n-        -vdi)\n-            IMGFMT=vdi\n-            xpand=false\n-            ;;\n-\n-        -vmdk)\n-            IMGFMT=vmdk\n-            xpand=false\n-            ;;\n-\n-        -vpc)\n-            IMGFMT=vpc\n-            xpand=false\n-            ;;\n-\n-        -vhdx)\n-            IMGFMT=vhdx\n-            xpand=false\n-            ;;\n-\n-        -file)\n-            IMGPROTO=file\n-            xpand=false\n-            ;;\n-\n-        -rbd)\n-            IMGPROTO=rbd\n-            xpand=false\n-            ;;\n-\n-        -sheepdog)\n-            IMGPROTO=sheepdog\n-            xpand=false\n-            ;;\n-\n-        -nbd)\n-            IMGPROTO=nbd\n-            xpand=false\n-            ;;\n-\n-        -vxhs)\n-            IMGPROTO=vxhs\n-            xpand=false\n-            ;;\n-\n-        -ssh)\n-            IMGPROTO=ssh\n-            xpand=false\n-            ;;\n-\n-        -nfs)\n-            IMGPROTO=nfs\n-            xpand=false\n-            ;;\n-\n-        -nocache)\n-            CACHEMODE=\"none\"\n-            CACHEMODE_IS_DEFAULT=false\n-            xpand=false\n-            ;;\n-\n-        -misalign)\n-            QEMU_IO_OPTIONS=\"$QEMU_IO_OPTIONS --misalign\"\n-            xpand=false\n-            ;;\n-\n-        -valgrind)\n-            VALGRIND_QEMU='y'\n-            xpand=false\n-            ;;\n-\n-        -g)        # -g group ... pick from group file\n-            group=true\n-            xpand=false\n-            ;;\n-\n-        -xdiff)        # graphical diff mode\n-            xpand=false\n-\n-            if [ ! -z \"$DISPLAY\" ]\n-            then\n-                command -v xdiff >/dev/null 2>&1 && diff=xdiff\n-                command -v gdiff >/dev/null 2>&1 && diff=gdiff\n-                command -v tkdiff >/dev/null 2>&1 && diff=tkdiff\n-                command -v xxdiff >/dev/null 2>&1 && diff=xxdiff\n-            fi\n-            ;;\n-\n-        -n)        # show me, don't do it\n-            showme=true\n-            xpand=false\n-            ;;\n-        -o)\n-            imgopts=true\n-            xpand=false\n-            ;;\n-        -c)\n-            cachemode=true\n-            xpand=false\n-            ;;\n-        -T)        # turn on timestamp output\n-            timestamp=true\n-            xpand=false\n-            ;;\n-\n-        -v)\n-            verbose=true\n-            xpand=false\n-            ;;\n-        -d)\n-            debug=true\n-            xpand=false\n-            ;;\n-        -x)        # -x group ... exclude from group file\n-            xgroup=true\n-            xpand=false\n-            ;;\n-        '[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]')\n-            echo \"No tests?\"\n-            status=1\n-            exit $status\n-            ;;\n-\n-        [0-9]*-[0-9]*)\n-            eval `echo $r | sed -e 's/^/start=/' -e 's/-/ end=/'`\n-            ;;\n-\n-        [0-9]*-)\n-            eval `echo $r | sed -e 's/^/start=/' -e 's/-//'`\n-            end=`echo [0-9][0-9][0-9] [0-9][0-9][0-9][0-9] | sed -e 's/\\[0-9]//g' -e 's/  *$//' -e 's/.* //'`\n-            if [ -z \"$end\" ]\n-            then\n-                echo \"No tests in range \\\"$r\\\"?\"\n-                status=1\n-                exit $status\n-            fi\n-            ;;\n-\n-        *)\n-            start=$r\n-            end=$r\n-            ;;\n-\n-    esac\n-\n-    # get rid of leading 0s as can be interpreted as octal\n-    start=`echo $start | sed 's/^0*//'`\n-    end=`echo $end | sed 's/^0*//'`\n-\n-    if $xpand\n-    then\n-        have_test_arg=true\n-        awk </dev/null '\n-BEGIN        { for (t='$start'; t<='$end'; t++) printf \"%03d\\n\",t }' \\\n-        | while read id\n-        do\n-            if grep -s \"^$id \" \"$source_iotests/group\" >/dev/null\n-            then\n-                # in group file ... OK\n-                echo $id >>$tmp.list\n-            else\n-                if [ -f expunged ] && $expunge && egrep \"^$id([         ]|\\$)\" expunged >/dev/null\n-                then\n-                    # expunged ... will be reported, but not run, later\n-                    echo $id >>$tmp.list\n-                else\n-                    # oops\n-                    if [ \"$start\" == \"$end\" -a \"$id\" == \"$end\" ]\n-                    then\n-                        echo \"$id - unknown test\"\n-                        exit 1\n-                    else\n-                        echo \"$id - unknown test, ignored\"\n-                    fi\n-                fi\n-            fi\n-        done || exit 1\n-    fi\n-\n-done\n-\n-# Set qemu-io cache mode with $CACHEMODE we have\n-QEMU_IO_OPTIONS=\"$QEMU_IO_OPTIONS --cache $CACHEMODE\"\n-\n-QEMU_IO_OPTIONS_NO_FMT=\"$QEMU_IO_OPTIONS\"\n-if [ \"$IMGOPTSSYNTAX\" != \"true\" ]; then\n-    QEMU_IO_OPTIONS=\"$QEMU_IO_OPTIONS -f $IMGFMT\"\n-fi\n-\n-# Set default options for qemu-img create -o if they were not specified\n-if [ \"$IMGFMT\" == \"qcow2\" ] && ! (echo \"$IMGOPTS\" | grep \"compat=\" > /dev/null); then\n-    IMGOPTS=$(_optstr_add \"$IMGOPTS\" \"compat=1.1\")\n-fi\n-if [ \"$IMGFMT\" == \"luks\" ] && ! (echo \"$IMGOPTS\" | grep \"iter-time=\" > /dev/null); then\n-    IMGOPTS=$(_optstr_add \"$IMGOPTS\" \"iter-time=10\")\n-fi\n-\n-if [ -z \"$SAMPLE_IMG_DIR\" ]; then\n-        SAMPLE_IMG_DIR=\"$source_iotests/sample_images\"\n-fi\n-\n-export TEST_DIR\n-export SAMPLE_IMG_DIR\n-\n-if [ -s $tmp.list ]\n-then\n-    # found some valid test numbers ... this is good\n-    :\n-else\n-    if $have_test_arg\n-    then\n-        # had test numbers, but none in group file ... do nothing\n-        touch $tmp.list\n-    else\n-        # no test numbers, do everything from group file\n-        sed -n -e '/^[0-9][0-9][0-9]*/s/[         ].*//p' <\"$source_iotests/group\" >$tmp.list\n-    fi\n-fi\n-\n-# should be sort -n, but this did not work for Linux when this\n-# was ported from IRIX\n-#\n-list=`sort $tmp.list`\n-rm -f $tmp.list $tmp.tmp $tmp.sed\n-\n-if [ -z \"$QEMU_PROG\" ]\n-then\n-    if [ -x \"$build_iotests/qemu\" ]; then\n-        export QEMU_PROG=\"$build_iotests/qemu\"\n-    elif [ -x \"$build_root/$arch-softmmu/qemu-system-$arch\" ]; then\n-        export QEMU_PROG=\"$build_root/$arch-softmmu/qemu-system-$arch\"\n-    else\n-        pushd \"$build_root\" > /dev/null\n-        for binary in *-softmmu/qemu-system-*\n-        do\n-            if [ -x \"$binary\" ]\n-            then\n-                export QEMU_PROG=\"$build_root/$binary\"\n-                break\n-            fi\n-        done\n-        popd > /dev/null\n-        [ \"$QEMU_PROG\" = \"\" ] && _init_error \"qemu not found\"\n-    fi\n-fi\n-export QEMU_PROG=$(realpath -- \"$(type -p \"$QEMU_PROG\")\")\n-\n-if [ -z \"$QEMU_IMG_PROG\" ]; then\n-    if [ -x \"$build_iotests/qemu-img\" ]; then\n-        export QEMU_IMG_PROG=\"$build_iotests/qemu-img\"\n-    elif [ -x \"$build_root/qemu-img\" ]; then\n-        export QEMU_IMG_PROG=\"$build_root/qemu-img\"\n-    else\n-        _init_error \"qemu-img not found\"\n-    fi\n-fi\n-export QEMU_IMG_PROG=$(realpath -- \"$(type -p \"$QEMU_IMG_PROG\")\")\n-\n-if [ -z \"$QEMU_IO_PROG\" ]; then\n-    if [ -x \"$build_iotests/qemu-io\" ]; then\n-        export QEMU_IO_PROG=\"$build_iotests/qemu-io\"\n-    elif [ -x \"$build_root/qemu-io\" ]; then\n-        export QEMU_IO_PROG=\"$build_root/qemu-io\"\n-    else\n-        _init_error \"qemu-io not found\"\n-    fi\n-fi\n-export QEMU_IO_PROG=$(realpath -- \"$(type -p \"$QEMU_IO_PROG\")\")\n-\n-if [ -z $QEMU_NBD_PROG ]; then\n-    if [ -x \"$build_iotests/qemu-nbd\" ]; then\n-        export QEMU_NBD_PROG=\"$build_iotests/qemu-nbd\"\n-    elif [ -x \"$build_root/qemu-nbd\" ]; then\n-        export QEMU_NBD_PROG=\"$build_root/qemu-nbd\"\n-    else\n-        _init_error \"qemu-nbd not found\"\n-    fi\n-fi\n-export QEMU_NBD_PROG=$(realpath -- \"$(type -p \"$QEMU_NBD_PROG\")\")\n-\n-if [ -z \"$QEMU_VXHS_PROG\" ]; then\n-  export QEMU_VXHS_PROG=\"`set_prog_path qnio_server`\"\n-fi\n-\n-if [ -x \"$build_iotests/socket_scm_helper\" ]\n-then\n-    export SOCKET_SCM_HELPER=\"$build_iotests/socket_scm_helper\"\n-fi\n-\n-default_machine=$($QEMU_PROG -machine help | sed -n '/(default)/ s/ .*//p')\n-default_alias_machine=$($QEMU_PROG -machine help | \\\n-   sed -n \"/(alias of $default_machine)/ { s/ .*//p; q; }\")\n-if [[ \"$default_alias_machine\" ]]; then\n-    default_machine=\"$default_alias_machine\"\n-fi\n-\n-export QEMU_DEFAULT_MACHINE=\"$default_machine\"\n",
    "prefixes": [
        "10/10"
    ]
}