get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 809695,
    "url": "http://patchwork.ozlabs.org/api/patches/809695/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/1504533662-198084-5-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": "<1504533662-198084-5-git-send-email-imammedo@redhat.com>",
    "list_archive_url": null,
    "date": "2017-09-04T14:01:00",
    "name": "[4/6] 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": "c5a20561c2cf215eefef793d945d2b4bacc835c3",
    "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/1504533662-198084-5-git-send-email-imammedo@redhat.com/mbox/",
    "series": [
        {
            "id": 1390,
            "url": "http://patchwork.ozlabs.org/api/series/1390/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=1390",
            "date": "2017-09-04T14:00:57",
            "name": "generalize parsing of cpu_model (x86/arm)",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/1390/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/809695/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/809695/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=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 3xmBQc5ftRz9s75\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 00:03:36 +1000 (AEST)",
            "from localhost ([::1]:44712 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 1doryP-0004es-VU\n\tfor incoming@patchwork.ozlabs.org; Mon, 04 Sep 2017 10:03:33 -0400",
            "from eggs.gnu.org ([2001:4830:134:3::10]:48029)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <imammedo@redhat.com>) id 1dorwJ-0003g4-Sx\n\tfor qemu-devel@nongnu.org; Mon, 04 Sep 2017 10:01:31 -0400",
            "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <imammedo@redhat.com>) id 1dorwF-00041H-6B\n\tfor qemu-devel@nongnu.org; Mon, 04 Sep 2017 10:01:23 -0400",
            "from mx1.redhat.com ([209.132.183.28]:39252)\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 1dorwE-00040D-TQ\n\tfor qemu-devel@nongnu.org; Mon, 04 Sep 2017 10:01:19 -0400",
            "from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\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 D9DC93F731;\n\tMon,  4 Sep 2017 14:01:17 +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 A0B8B820A2;\n\tMon,  4 Sep 2017 14:01:14 +0000 (UTC)"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com D9DC93F731",
        "From": "Igor Mammedov <imammedo@redhat.com>",
        "To": "qemu-devel@nongnu.org",
        "Date": "Mon,  4 Sep 2017 16:01:00 +0200",
        "Message-Id": "<1504533662-198084-5-git-send-email-imammedo@redhat.com>",
        "In-Reply-To": "<1504533662-198084-1-git-send-email-imammedo@redhat.com>",
        "References": "<1504533662-198084-1-git-send-email-imammedo@redhat.com>",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.16",
        "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tMon, 04 Sep 2017 14:01:18 +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 4/6] 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>",
        "Cc": "Marcel Apfelbaum <marcel@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>,\n\tAndrew Jones <drjones@redhat.com>,\n\tEduardo Habkost <ehabkost@redhat.com>, \n\tRichard Henderson <rth@twiddle.net>",
        "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\nCC: Marcel Apfelbaum <marcel@redhat.com>\nCC: Paolo Bonzini <pbonzini@redhat.com>\nCC: Eduardo Habkost <ehabkost@redhat.com>\n\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 3363dd1..b8f255a 100644\n--- a/include/hw/boards.h\n+++ b/include/hw/boards.h\n@@ -131,6 +131,10 @@ typedef struct {\n  *    size than the target architecture's minimum. (Attempting to create\n  *    such a CPU will fail.) Note that changing this is a migration\n  *    compatibility break for the machine.\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  */\n struct MachineClass {\n     /*< private >*/\n@@ -167,6 +171,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@@ -220,6 +225,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 8e247cc..9ae6001 100644\n--- a/vl.c\n+++ b/vl.c\n@@ -4630,6 +4630,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": [
        "4/6"
    ]
}