get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 819533,
    "url": "http://patchwork.ozlabs.org/api/patches/819533/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/150659511184.25889.10868411111377268218.stgit@aravinda/",
    "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": "<150659511184.25889.10868411111377268218.stgit@aravinda>",
    "list_archive_url": null,
    "date": "2017-09-28T10:38:31",
    "name": "[v5,6/6] migration: Block migration while handling machine check",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "de0f58ac3f561b416f03b6622d7b9722fcf8aec8",
    "submitter": {
        "id": 18580,
        "url": "http://patchwork.ozlabs.org/api/people/18580/?format=api",
        "name": "Aravinda Prasad",
        "email": "aravinda@linux.vnet.ibm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/150659511184.25889.10868411111377268218.stgit@aravinda/mbox/",
    "series": [
        {
            "id": 5534,
            "url": "http://patchwork.ozlabs.org/api/series/5534/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=5534",
            "date": "2017-09-28T10:37:28",
            "name": "target-ppc/spapr: Add FWNMI support in QEMU for PowerKVM guests",
            "version": 5,
            "mbox": "http://patchwork.ozlabs.org/series/5534/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/819533/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/819533/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>)",
        "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 3y2rs52GQJz9t38\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 28 Sep 2017 20:43:53 +1000 (AEST)",
            "from localhost ([::1]:58395 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 1dxWIJ-0007q1-Dq\n\tfor incoming@patchwork.ozlabs.org; Thu, 28 Sep 2017 06:43:51 -0400",
            "from eggs.gnu.org ([2001:4830:134:3::10]:50799)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <aravinda@linux.vnet.ibm.com>) id 1dxWDX-0004KA-I5\n\tfor qemu-devel@nongnu.org; Thu, 28 Sep 2017 06:38:59 -0400",
            "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <aravinda@linux.vnet.ibm.com>) id 1dxWDT-0007wz-Kw\n\tfor qemu-devel@nongnu.org; Thu, 28 Sep 2017 06:38:55 -0400",
            "from mx0a-001b2d01.pphosted.com ([148.163.156.1]:37564)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <aravinda@linux.vnet.ibm.com>)\n\tid 1dxWDT-0007wi-B9\n\tfor qemu-devel@nongnu.org; Thu, 28 Sep 2017 06:38:51 -0400",
            "from pps.filterd (m0098399.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv8SAcobB081710\n\tfor <qemu-devel@nongnu.org>; Thu, 28 Sep 2017 06:38:50 -0400",
            "from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2d8v752tcn-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <qemu-devel@nongnu.org>; Thu, 28 Sep 2017 06:38:50 -0400",
            "from localhost\n\tby e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <qemu-devel@nongnu.org> from <aravinda@linux.vnet.ibm.com>;\n\tThu, 28 Sep 2017 06:38:40 -0400",
            "from b01cxnp23033.gho.pok.ibm.com (9.57.198.28)\n\tby e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tThu, 28 Sep 2017 06:38:39 -0400",
            "from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com\n\t[9.57.199.108])\n\tby b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP\n\tid v8SAcbOx3539320; Thu, 28 Sep 2017 10:38:37 GMT",
            "from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 81B39B20B7;\n\tThu, 28 Sep 2017 06:35:56 -0400 (EDT)",
            "from [127.0.1.1] (unknown [9.84.218.194])\n\tby b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id 1872FB20B6;\n\tThu, 28 Sep 2017 06:35:52 -0400 (EDT)"
        ],
        "From": "Aravinda Prasad <aravinda@linux.vnet.ibm.com>",
        "To": "qemu-ppc@nongnu.org, qemu-devel@nongnu.org, david@gibson.dropbear.id.au",
        "Date": "Thu, 28 Sep 2017 16:08:31 +0530",
        "In-Reply-To": "<150659494872.25889.2069124544245723984.stgit@aravinda>",
        "References": "<150659494872.25889.2069124544245723984.stgit@aravinda>",
        "User-Agent": "StGit/0.17.1-dirty",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "7bit",
        "X-TM-AS-GCONF": "00",
        "x-cbid": "17092810-0052-0000-0000-00000268FE6F",
        "X-IBM-SpamModules-Scores": "",
        "X-IBM-SpamModules-Versions": "BY=3.00007804; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000232; SDB=6.00923539; UDB=6.00464295;\n\tIPR=6.00703678; \n\tBA=6.00005611; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009;\n\tZB=6.00000000; \n\tZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017301;\n\tXFM=3.00000015; UTC=2017-09-28 10:38:40",
        "X-IBM-AV-DETECTION": "SAVI=unused REMOTE=unused XFE=unused",
        "x-cbparentid": "17092810-0053-0000-0000-000052268878",
        "Message-Id": "<150659511184.25889.10868411111377268218.stgit@aravinda>",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-28_04:, , signatures=0",
        "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=2\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1709280159",
        "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy]",
        "X-Received-From": "148.163.156.1",
        "Subject": "[Qemu-devel] [PATCH v5 6/6] migration: Block migration while\n\thandling machine check",
        "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": "aik@ozlabs.ru, benh@au1.ibm.com, paulus@samba.org,\n\tsam.bobroff@au1.ibm.com",
        "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": "Block VM migration requests until the machine check\nerror handling is complete as (i) these errors are\nspecific to the source hardware and is irrelevant on\nthe target hardware, (ii) these errors cause data\ncorruption and should be handled before migration.\n\nSigned-off-by: Aravinda Prasad <aravinda@linux.vnet.ibm.com>\n---\n hw/ppc/spapr_rtas.c    |    3 +++\n include/hw/ppc/spapr.h |    2 ++\n target/ppc/kvm.c       |   17 +++++++++++++++++\n 3 files changed, 22 insertions(+)",
    "diff": "diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c\nindex d017a67..17f6567 100644\n--- a/hw/ppc/spapr_rtas.c\n+++ b/hw/ppc/spapr_rtas.c\n@@ -47,6 +47,7 @@\n #include \"trace.h\"\n #include \"hw/ppc/fdt.h\"\n #include \"kvm_ppc.h\"\n+#include \"migration/blocker.h\"\n \n static void rtas_display_character(PowerPCCPU *cpu, sPAPRMachineState *spapr,\n                                    uint32_t token, uint32_t nargs,\n@@ -390,6 +391,8 @@ static void rtas_ibm_nmi_interlock(PowerPCCPU *cpu,\n         spapr->mc_status = -1;\n         qemu_cond_signal(&spapr->mc_delivery_cond);\n         rtas_st(rets, 0, RTAS_OUT_SUCCESS);\n+        migrate_del_blocker(spapr->migration_blocker);\n+        error_free(spapr->migration_blocker);\n     }\n }\n \ndiff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h\nindex a75e9cf..0890a44 100644\n--- a/include/hw/ppc/spapr.h\n+++ b/include/hw/ppc/spapr.h\n@@ -7,6 +7,7 @@\n #include \"hw/ppc/spapr_drc.h\"\n #include \"hw/mem/pc-dimm.h\"\n #include \"hw/ppc/spapr_ovec.h\"\n+#include \"qapi/error.h\"\n \n struct VIOsPAPRBus;\n struct sPAPRPHBState;\n@@ -136,6 +137,7 @@ struct sPAPRMachineState {\n     MemoryHotplugState hotplug_memory;\n \n     const char *icp_type;\n+    Error *migration_blocker;\n };\n \n #define H_SUCCESS         0\ndiff --git a/target/ppc/kvm.c b/target/ppc/kvm.c\nindex 59b3322..58de7ea 100644\n--- a/target/ppc/kvm.c\n+++ b/target/ppc/kvm.c\n@@ -52,6 +52,7 @@\n #endif\n #include \"elf.h\"\n #include \"sysemu/kvm_int.h\"\n+#include \"migration/blocker.h\"\n \n //#define DEBUG_KVM\n \n@@ -2770,10 +2771,26 @@ int kvm_handle_nmi(PowerPCCPU *cpu, struct kvm_run *run)\n     sPAPRMachineState *spapr = SPAPR_MACHINE(qdev_get_machine());\n     PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);\n     target_ulong msr = 0;\n+    Error *local_err = NULL;\n+    int ret;\n     bool type, le;\n \n     cpu_synchronize_state(CPU(cpu));\n \n+    error_setg(&spapr->migration_blocker,\n+            \"Live migration not supported during machine check error handling\");\n+    ret = migrate_add_blocker(spapr->migration_blocker, &local_err);\n+    if (ret < 0) {\n+        /*\n+         * We don't want to abort and let the migration to continue. In a\n+         * rare case, the machine check handler will run on the target\n+         * hardware. Though this is not preferable, it is better than aborting\n+         * the migration or killing the VM.\n+         */\n+        error_free(spapr->migration_blocker);\n+        fprintf(stderr, \"Warning: Machine check during VM migration\\n\");\n+    }\n+\n     /*\n      * Properly set bits in MSR before we invoke the handler.\n      * SRR0/1, DAR and DSISR are properly set by KVM\n",
    "prefixes": [
        "v5",
        "6/6"
    ]
}