get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 813530,
    "url": "http://patchwork.ozlabs.org/api/patches/813530/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/1505318697-77161-4-git-send-email-imammedo@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": "<1505318697-77161-4-git-send-email-imammedo@redhat.com>",
    "list_archive_url": null,
    "date": "2017-09-13T16:04:55",
    "name": "[v2,3/5] vl.c: convert cpu_model to cpu type and set of global properties before machine_init()",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "4463e7ea78edf92b2e5bd46b99858f0356b4ec08",
    "submitter": {
        "id": 11305,
        "url": "http://patchwork.ozlabs.org/api/people/11305/?format=api",
        "name": "Igor Mammedov",
        "email": "imammedo@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/1505318697-77161-4-git-send-email-imammedo@redhat.com/mbox/",
    "series": [
        {
            "id": 2945,
            "url": "http://patchwork.ozlabs.org/api/series/2945/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=2945",
            "date": "2017-09-13T16:04:52",
            "name": "generalize parsing of cpu_model (x86/arm)",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/2945/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/813530/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/813530/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-mx08.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com",
            "ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=imammedo@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 3xsn8s5DF6z9sPk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 02:26:05 +1000 (AEST)",
            "from localhost ([::1]:43466 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 1dsAUF-0006si-MW\n\tfor incoming@patchwork.ozlabs.org; Wed, 13 Sep 2017 12:26:03 -0400",
            "from eggs.gnu.org ([2001:4830:134:3::10]:46246)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <imammedo@redhat.com>) id 1dsA9z-0002PY-7b\n\tfor qemu-devel@nongnu.org; Wed, 13 Sep 2017 12:05:12 -0400",
            "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <imammedo@redhat.com>) id 1dsA9v-0006ZZ-6N\n\tfor qemu-devel@nongnu.org; Wed, 13 Sep 2017 12:05:07 -0400",
            "from mx1.redhat.com ([209.132.183.28]:35114)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <imammedo@redhat.com>) id 1dsA9u-0006Z4-Ti\n\tfor qemu-devel@nongnu.org; Wed, 13 Sep 2017 12:05:03 -0400",
            "from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\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 EF67FC058EA9\n\tfor <qemu-devel@nongnu.org>; Wed, 13 Sep 2017 16:05:01 +0000 (UTC)",
            "from dell-r430-03.lab.eng.brq.redhat.com\n\t(dell-r430-03.lab.eng.brq.redhat.com [10.34.112.60])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 744F45D963\n\tfor <qemu-devel@nongnu.org>; Wed, 13 Sep 2017 16:05:01 +0000 (UTC)"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com EF67FC058EA9",
        "From": "Igor Mammedov <imammedo@redhat.com>",
        "To": "qemu-devel@nongnu.org",
        "Date": "Wed, 13 Sep 2017 18:04:55 +0200",
        "Message-Id": "<1505318697-77161-4-git-send-email-imammedo@redhat.com>",
        "In-Reply-To": "<1505318697-77161-1-git-send-email-imammedo@redhat.com>",
        "References": "<1505318697-77161-1-git-send-email-imammedo@redhat.com>",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.14",
        "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.32]);\n\tWed, 13 Sep 2017 16:05:02 +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 v2 3/5] vl.c: convert cpu_model to cpu type and\n\tset of global properties before machine_init()",
        "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>",
        "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": "All machines that support user specified cpu_model either call\ncpu_generic_init() or cpu_class_by_name()/CPUClass::parse_features\nto parse feature string and to get CPU type to create.\n\nWhich leads to code duplication and hard-codding default CPU model\nwithin machine_foo_init() code. Which makes it impossible to\nget CPU type before machine_init() is run.\n\nSo instead of setting default CPUs models and doing parsing in\ntarget specific machine_foo_init() in various ways, provide\na generic data driven cpu_model parsing before machine_init()\nis called.\n\nin follow up per target patches, it will allow to:\n  * define default CPU type in consistent/generic manner\n    per machine type and drop custom code that fallbacks\n    to default if cpu_model is NULL\n  * drop custom features parsing in targets and do it\n    in centralized way.\n  * for cases of\n      cpu_generic_init(TYPE_BASE/DEFAULT_CPU, \"some_cpu\")\n    replace it with\n      cpu_create(machine->cpu_type) || cpu_create(TYPE_FOO)\n    depending if CPU type is user settable or not.\n    not doing useless parsing and clearly documenting where\n    CPU model is user settable or fixed one.\n\nPatch allows machine subclasses to define default CPU type\nper machine class at class_init() time and if that is set\ngeneric code will parse cpu_model into a MachineState::cpu_type\nwhich will be used to create CPUs for that machine instance\nand allows gradual per board conversion.\n\nSigned-off-by: Igor Mammedov <imammedo@redhat.com>\n---\nTarget specific changes will split into separate per target/machine\npatches to make changes reviewable.\n---\n include/hw/boards.h |  6 ++++++\n vl.c                | 10 ++++++++++\n 2 files changed, 16 insertions(+)",
    "diff": "diff --git a/include/hw/boards.h b/include/hw/boards.h\nindex 7f044d1..6b67ada 100644\n--- a/include/hw/boards.h\n+++ b/include/hw/boards.h\n@@ -125,6 +125,10 @@ typedef struct {\n  *    Caller is responsible for freeing returned list.\n  * @has_hotpluggable_cpus:\n  *    If true, board supports CPUs creation with -device/device_add.\n+ * @default_cpu_type:\n+ *    specifies default CPU_TYPE, which will be used for parsing target\n+ *    specific features and for creating CPUs if CPU name wasn't provided\n+ *    explicitly at CLI\n  * @minimum_page_bits:\n  *    If non-zero, the board promises never to create a CPU with a page size\n  *    smaller than this, so QEMU can use a more efficient larger page\n@@ -177,6 +181,7 @@ struct MachineClass {\n     GArray *compat_props;\n     const char *hw_version;\n     ram_addr_t default_ram_size;\n+    const char *default_cpu_type;\n     bool option_rom_has_mr;\n     bool rom_file_has_mr;\n     int minimum_page_bits;\n@@ -231,6 +236,7 @@ struct MachineState {\n     char *kernel_cmdline;\n     char *initrd_filename;\n     const char *cpu_model;\n+    const char *cpu_type;\n     AccelState *accelerator;\n     CPUArchIdList *possible_cpus;\n };\ndiff --git a/vl.c b/vl.c\nindex fb1f05b..034180f 100644\n--- a/vl.c\n+++ b/vl.c\n@@ -4636,6 +4636,16 @@ int main(int argc, char **argv, char **envp)\n     current_machine->boot_order = boot_order;\n     current_machine->cpu_model = cpu_model;\n \n+\n+    /* parse features once if machine provides default cpu_type */\n+    if (machine_class->default_cpu_type) {\n+        current_machine->cpu_type = machine_class->default_cpu_type;\n+        if (cpu_model) {\n+            current_machine->cpu_type =\n+                cpu_parse_cpu_model(machine_class->default_cpu_type, cpu_model);\n+        }\n+    }\n+\n     machine_run_board_init(current_machine);\n \n     realtime_init();\n",
    "prefixes": [
        "v2",
        "3/5"
    ]
}