)]}'
{
  "commit": "51e72bc1dd6ace6e91d675f41a1f09bd00ab8043",
  "tree": "ce8eccf21a3dfa59301dcea8cc9bd96fcf01854c",
  "parents": [
    "4fa45492c3387c0fa51e8e81160ac9a7814f44a2"
  ],
  "author": {
    "name": "Eric Blake",
    "email": "eblake@redhat.com",
    "time": "Fri Jan 29 06:48:54 2016 -0700"
  },
  "committer": {
    "name": "Markus Armbruster",
    "email": "armbru@redhat.com",
    "time": "Mon Feb 08 17:29:56 2016 +0100"
  },
  "message": "qapi: Swap visit_* arguments for consistent \u0027name\u0027 placement\n\nJSON uses \"name\":value, but many of our visitor interfaces were\ncalled with visit_type_FOO(v, \u0026value, name, errp).  This can be\na bit confusing to have to mentally swap the parameter order to\nmatch JSON order.  It\u0027s particularly bad for visit_start_struct(),\nwhere the \u0027name\u0027 parameter is smack in the middle of the\notherwise-related group of \u0027obj, kind, size\u0027 parameters! It\u0027s\ntime to do a global swap of the parameter ordering, so that the\n\u0027name\u0027 parameter is always immediately after the Visitor argument.\n\nAdditional reason in favor of the swap: the existing include/qjson.h\nprefers listing \u0027name\u0027 first in json_prop_*(), and I have plans to\nunify that file with the qapi visitors; listing \u0027name\u0027 first in\nqapi will minimize churn to the (admittedly few) qjson.h clients.\n\nLater patches will then fix docs, object.h, visitor-impl.h, and\nthose clients to match.\n\nDone by first patching scripts/qapi*.py by hand to make generated\nfiles do what I want, then by running the following Coccinelle\nscript to affect the rest of the code base:\n $ spatch --sp-file script `git grep -l \u0027\\bvisit_\u0027 -- \u0027**/*.[ch]\u0027`\nI then had to apply some touchups (Coccinelle insisted on TAB\nindentation in visitor.h, and botched the signature of\nvisit_type_enum() by rewriting \u0027const char *const strings[]\u0027 to\nthe syntactically invalid \u0027const char*const[] strings\u0027).  The\nmovement of parameters is sufficient to provoke compiler errors\nif any callers were missed.\n\n    // Part 1: Swap declaration order\n    @@\n    type TV, TErr, TObj, T1, T2;\n    identifier OBJ, ARG1, ARG2;\n    @@\n     void visit_start_struct\n    -(TV v, TObj OBJ, T1 ARG1, const char *name, T2 ARG2, TErr errp)\n    +(TV v, const char *name, TObj OBJ, T1 ARG1, T2 ARG2, TErr errp)\n     { ... }\n\n    @@\n    type bool, TV, T1;\n    identifier ARG1;\n    @@\n     bool visit_optional\n    -(TV v, T1 ARG1, const char *name)\n    +(TV v, const char *name, T1 ARG1)\n     { ... }\n\n    @@\n    type TV, TErr, TObj, T1;\n    identifier OBJ, ARG1;\n    @@\n     void visit_get_next_type\n    -(TV v, TObj OBJ, T1 ARG1, const char *name, TErr errp)\n    +(TV v, const char *name, TObj OBJ, T1 ARG1, TErr errp)\n     { ... }\n\n    @@\n    type TV, TErr, TObj, T1, T2;\n    identifier OBJ, ARG1, ARG2;\n    @@\n     void visit_type_enum\n    -(TV v, TObj OBJ, T1 ARG1, T2 ARG2, const char *name, TErr errp)\n    +(TV v, const char *name, TObj OBJ, T1 ARG1, T2 ARG2, TErr errp)\n     { ... }\n\n    @@\n    type TV, TErr, TObj;\n    identifier OBJ;\n    identifier VISIT_TYPE \u003d~ \"^visit_type_\";\n    @@\n     void VISIT_TYPE\n    -(TV v, TObj OBJ, const char *name, TErr errp)\n    +(TV v, const char *name, TObj OBJ, TErr errp)\n     { ... }\n\n    // Part 2: swap caller order\n    @@\n    expression V, NAME, OBJ, ARG1, ARG2, ERR;\n    identifier VISIT_TYPE \u003d~ \"^visit_type_\";\n    @@\n    (\n    -visit_start_struct(V, OBJ, ARG1, NAME, ARG2, ERR)\n    +visit_start_struct(V, NAME, OBJ, ARG1, ARG2, ERR)\n    |\n    -visit_optional(V, ARG1, NAME)\n    +visit_optional(V, NAME, ARG1)\n    |\n    -visit_get_next_type(V, OBJ, ARG1, NAME, ERR)\n    +visit_get_next_type(V, NAME, OBJ, ARG1, ERR)\n    |\n    -visit_type_enum(V, OBJ, ARG1, ARG2, NAME, ERR)\n    +visit_type_enum(V, NAME, OBJ, ARG1, ARG2, ERR)\n    |\n    -VISIT_TYPE(V, OBJ, NAME, ERR)\n    +VISIT_TYPE(V, NAME, OBJ, ERR)\n    )\n\nSigned-off-by: Eric Blake \u003ceblake@redhat.com\u003e\nReviewed-by: Marc-André Lureau \u003cmarcandre.lureau@redhat.com\u003e\nMessage-Id: \u003c1454075341-13658-19-git-send-email-eblake@redhat.com\u003e\nSigned-off-by: Markus Armbruster \u003carmbru@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "60e882c6287c79d739db907d1e2bd0336752ab66",
      "old_mode": 33188,
      "old_path": "backends/hostmem.c",
      "new_id": "da80662fcd61d596180ca7a5bd54dae4e55f8009",
      "new_mode": 33188,
      "new_path": "backends/hostmem.c"
    },
    {
      "type": "modify",
      "old_id": "2e8310591de1e160e495e6f48a6cb86982323318",
      "old_mode": 33188,
      "old_path": "block/qapi.c",
      "new_id": "67891b7d19199fcbbf1d1249069142745dcdd89c",
      "new_mode": 33188,
      "new_path": "block/qapi.c"
    },
    {
      "type": "modify",
      "old_id": "e1b6b0f0e1fad9733201b2d887b23a953727b81a",
      "old_mode": 33188,
      "old_path": "blockdev.c",
      "new_id": "1f7347821ceadf54b82c3e95767190fbc730e8e2",
      "new_mode": 33188,
      "new_path": "blockdev.c"
    },
    {
      "type": "modify",
      "old_id": "1ee7b117dee1188260ecc0ea2cdea792f492cc35",
      "old_mode": 33188,
      "old_path": "bootdevice.c",
      "new_id": "149ee3aaf03f824238d2699fe7cb8ec07656fd24",
      "new_mode": 33188,
      "new_path": "bootdevice.c"
    },
    {
      "type": "modify",
      "old_id": "6a49886138918bc1c6edc4dddf70bd93fde3c701",
      "old_mode": 33188,
      "old_path": "hmp.c",
      "new_id": "27d6867664a68c2a861fcb55f6ebfa17da3cbbc2",
      "new_mode": 33188,
      "new_path": "hmp.c"
    },
    {
      "type": "modify",
      "old_id": "edf3f960a771b4c7d40e0abcf0292e97ad912157",
      "old_mode": 33188,
      "old_path": "hw/acpi/core.c",
      "new_id": "3a14e90cd002bb7ce664de000e0f9b9c7d2952e9",
      "new_mode": 33188,
      "new_path": "hw/acpi/core.c"
    },
    {
      "type": "modify",
      "old_id": "746d8901e491399dc600eba799f5a2c1e83e019b",
      "old_mode": 33188,
      "old_path": "hw/acpi/ich9.c",
      "new_id": "c3b6035f3474f69c43cd1bdb6536a3e10eb2ae66",
      "new_mode": 33188,
      "new_path": "hw/acpi/ich9.c"
    },
    {
      "type": "modify",
      "old_id": "1261368add36eccc40016f382b887c104877766e",
      "old_mode": 33188,
      "old_path": "hw/core/machine.c",
      "new_id": "03d9a951b2b2fd4985056245819c5b1d63e52802",
      "new_mode": 33188,
      "new_path": "hw/core/machine.c"
    },
    {
      "type": "modify",
      "old_id": "ff00f5c9cb50d889e9add41d6f2cfbe6c4c6a15c",
      "old_mode": 33188,
      "old_path": "hw/core/qdev-properties-system.c",
      "new_id": "acbe403c63dd1f358c2ccff4f9dddb09f9e60a2f",
      "new_mode": 33188,
      "new_path": "hw/core/qdev-properties-system.c"
    },
    {
      "type": "modify",
      "old_id": "e878e80c67f406fef44163fe72f0b5580cc721fb",
      "old_mode": 33188,
      "old_path": "hw/core/qdev-properties.c",
      "new_id": "77f354233fe6f874f8b6e29581ac5493f6971e96",
      "new_mode": 33188,
      "new_path": "hw/core/qdev-properties.c"
    },
    {
      "type": "modify",
      "old_id": "779de2ba933cf55b01575614a57b8cd0843183ef",
      "old_mode": 33188,
      "old_path": "hw/core/qdev.c",
      "new_id": "c731bb203224c82e13564adcb5c6b82780e7efef",
      "new_mode": 33188,
      "new_path": "hw/core/qdev.c"
    },
    {
      "type": "modify",
      "old_id": "af2fe84ffba31b3f8c4b7373937a40955e4e384c",
      "old_mode": 33188,
      "old_path": "hw/i386/pc.c",
      "new_id": "5dcdde412e8e794b000e7fb2469681bf7abd763d",
      "new_mode": 33188,
      "new_path": "hw/i386/pc.c"
    },
    {
      "type": "modify",
      "old_id": "21607d99b9248f341241e946a6f71bacc129fda9",
      "old_mode": 33188,
      "old_path": "hw/ide/qdev.c",
      "new_id": "572f61dbd47e412f17eda39bec557511ecc2ce88",
      "new_mode": 33188,
      "new_path": "hw/ide/qdev.c"
    },
    {
      "type": "modify",
      "old_id": "cd91ddc4d1d9c0f7b8485d3bdbca5d67270bd53d",
      "old_mode": 33188,
      "old_path": "hw/intc/xics.c",
      "new_id": "dafcdeb1e095c6d1ab1970243c011e8d8c702bb8",
      "new_mode": 33188,
      "new_path": "hw/intc/xics.c"
    },
    {
      "type": "modify",
      "old_id": "d198945686e906ac7d2cad37b843283265888b89",
      "old_mode": 33188,
      "old_path": "hw/isa/lpc_ich9.c",
      "new_id": "e43995578912fbfb8a11e2a0488a23b70173dded",
      "new_mode": 33188,
      "new_path": "hw/isa/lpc_ich9.c"
    },
    {
      "type": "modify",
      "old_id": "32d00ddee7580fcb2216672ed29d29e65971ee4f",
      "old_mode": 33188,
      "old_path": "hw/mem/pc-dimm.c",
      "new_id": "651442826586299227bc7d8d71cbc779f3ac3574",
      "new_mode": 33188,
      "new_path": "hw/mem/pc-dimm.c"
    },
    {
      "type": "modify",
      "old_id": "65e8f20e850a49c6eff7fa8e245a99b63277cb44",
      "old_mode": 33188,
      "old_path": "hw/misc/edu.c",
      "new_id": "1486441d7c3b50e1dfb2b36c4dae05f52d033ff3",
      "new_mode": 33188,
      "new_path": "hw/misc/edu.c"
    },
    {
      "type": "modify",
      "old_id": "e102b407563172c5da592ebbf6723a966c9a4d9e",
      "old_mode": 33188,
      "old_path": "hw/misc/tmp105.c",
      "new_id": "562d8cc643d4cc9ad1b36dcdc4fec5d0af62b8bb",
      "new_mode": 33188,
      "new_path": "hw/misc/tmp105.c"
    },
    {
      "type": "modify",
      "old_id": "ac7277bb0f055ae0eed4ee9bf763c4a7d4179ccc",
      "old_mode": 33188,
      "old_path": "hw/net/ne2000-isa.c",
      "new_id": "6d1e963fc12ca960e58994ba2c19cc6ad8654a1a",
      "new_mode": 33188,
      "new_path": "hw/net/ne2000-isa.c"
    },
    {
      "type": "modify",
      "old_id": "3832ed6893e4f88b11c956881d4bd35f5b90ec9c",
      "old_mode": 33188,
      "old_path": "hw/pci-host/piix.c",
      "new_id": "8ff5c6b0b084df3ba457c1a3be64e9a501c77e43",
      "new_mode": 33188,
      "new_path": "hw/pci-host/piix.c"
    },
    {
      "type": "modify",
      "old_id": "42b421edfbd20a18c1db0ad331e2b61b4bf28705",
      "old_mode": 33188,
      "old_path": "hw/pci-host/q35.c",
      "new_id": "0966eb5c89446ca8621d1abb51b3f40ecdc14ead",
      "new_mode": 33188,
      "new_path": "hw/pci-host/q35.c"
    },
    {
      "type": "modify",
      "old_id": "90016e63a10f9c0fdc2df61618a636389b42f574",
      "old_mode": 33188,
      "old_path": "hw/ppc/spapr_drc.c",
      "new_id": "fda6a9528854b0026854814ed31955f57d723beb",
      "new_mode": 33188,
      "new_path": "hw/ppc/spapr_drc.c"
    },
    {
      "type": "modify",
      "old_id": "f7ab741a5b3deba521d8776deff3bc0c99926548",
      "old_mode": 33188,
      "old_path": "hw/usb/dev-storage.c",
      "new_id": "dafbea348453aa40dfbf2463e7a04b9775a54e64",
      "new_mode": 33188,
      "new_path": "hw/usb/dev-storage.c"
    },
    {
      "type": "modify",
      "old_id": "7d05d3fc962a6a6626df53c30aecbefb37f2c23c",
      "old_mode": 33188,
      "old_path": "hw/virtio/virtio-balloon.c",
      "new_id": "b46cb580a041a2c4849cc62943aef9f33842c0f2",
      "new_mode": 33188,
      "new_path": "hw/virtio/virtio-balloon.c"
    },
    {
      "type": "modify",
      "old_id": "83ac3ad279b4e2efe9a657ddd47252bc6ecf1037",
      "old_mode": 33188,
      "old_path": "include/qapi/visitor.h",
      "new_id": "0b5cd4179ee43e1a1a422a148448dacf5c932bea",
      "new_mode": 33188,
      "new_path": "include/qapi/visitor.h"
    },
    {
      "type": "modify",
      "old_id": "39c539cd59debe4f8ca791da1725c8f43bce6907",
      "old_mode": 33188,
      "old_path": "memory.c",
      "new_id": "1618dc8914d1e7276be0788a49d1e2814a84b57f",
      "new_mode": 33188,
      "new_path": "memory.c"
    },
    {
      "type": "modify",
      "old_id": "dc0f33948dbba8ec030fbf1c525c5fe49e10a0aa",
      "old_mode": 33188,
      "old_path": "net/dump.c",
      "new_id": "60bc5ce66e76a7da57dc23f84bb31aaf7a6f54f5",
      "new_mode": 33188,
      "new_path": "net/dump.c"
    },
    {
      "type": "modify",
      "old_id": "2353d5bc756614137aa536013afbc159c41c82d2",
      "old_mode": 33188,
      "old_path": "net/filter-buffer.c",
      "new_id": "236d950c316c05cb3da01e7a4ecc6b0edc7e2c0b",
      "new_mode": 33188,
      "new_path": "net/filter-buffer.c"
    },
    {
      "type": "modify",
      "old_id": "c5e414fe3c00364619d19e2be5a7642566c32198",
      "old_mode": 33188,
      "old_path": "net/net.c",
      "new_id": "aebf7531a8f91050ab22ba344af4bfffa1077c6f",
      "new_mode": 33188,
      "new_path": "net/net.c"
    },
    {
      "type": "modify",
      "old_id": "e1a05698a9f8c6b098b01fdeaa7e6cbc0190bafc",
      "old_mode": 33188,
      "old_path": "numa.c",
      "new_id": "4c4f7f572ef8609d37b52343f48c61173c38d553",
      "new_mode": 33188,
      "new_path": "numa.c"
    },
    {
      "type": "modify",
      "old_id": "7228dc2350beebf12049588a11e164874532b991",
      "old_mode": 33188,
      "old_path": "qapi/qapi-visit-core.c",
      "new_id": "cd8e6031c5a3c288d511d447feaea851c55fe304",
      "new_mode": 33188,
      "new_path": "qapi/qapi-visit-core.c"
    },
    {
      "type": "modify",
      "old_id": "f121980707dfe28bd73e3512b6604b704ac02827",
      "old_mode": 33188,
      "old_path": "qemu-img.c",
      "new_id": "163d8c166464ca4339790e799bd68d26e6c72e06",
      "new_mode": 33188,
      "new_path": "qemu-img.c"
    },
    {
      "type": "modify",
      "old_id": "3506a988031ce4410aaaeb6077a7673b4bcac1f0",
      "old_mode": 33188,
      "old_path": "qom/object.c",
      "new_id": "66cafacf9a4cbcb7ba4dd9c9d0bfdf6314aefb05",
      "new_mode": 33188,
      "new_path": "qom/object.c"
    },
    {
      "type": "modify",
      "old_id": "4270ca183701f4a46c4915b9d003a3b941873595",
      "old_mode": 33188,
      "old_path": "replay/replay-input.c",
      "new_id": "93616be930572bd69eff5e23dce8d22943365481",
      "new_mode": 33188,
      "new_path": "replay/replay-input.c"
    },
    {
      "type": "modify",
      "old_id": "561e47a42be35db3ced73f2ffa6b4105dc632acd",
      "old_mode": 33188,
      "old_path": "scripts/qapi-commands.py",
      "new_id": "91c5a4e8cdb7836182da27a2f43f98cd0f1d1467",
      "new_mode": 33188,
      "new_path": "scripts/qapi-commands.py"
    },
    {
      "type": "modify",
      "old_id": "0f5534f6c3f683d800087b54583c7750fd6a506d",
      "old_mode": 33188,
      "old_path": "scripts/qapi-event.py",
      "new_id": "edd446b74d5f1c9ff5e2153268e7030c561f4c6f",
      "new_mode": 33188,
      "new_path": "scripts/qapi-event.py"
    },
    {
      "type": "modify",
      "old_id": "0d862698a46e0286492fc9b670a0e6fd607814df",
      "old_mode": 33188,
      "old_path": "scripts/qapi-types.py",
      "new_id": "d3f631a2f4a53d33180891652930220bba5ec38e",
      "new_mode": 33188,
      "new_path": "scripts/qapi-types.py"
    },
    {
      "type": "modify",
      "old_id": "ba75667e033f39b33e0efb416bd060433f30f3a7",
      "old_mode": 33188,
      "old_path": "scripts/qapi-visit.py",
      "new_id": "35505acd98fa7bd5c9e5dedac3aded7ee83adc9a",
      "new_mode": 33188,
      "new_path": "scripts/qapi-visit.py"
    },
    {
      "type": "modify",
      "old_id": "9254e48fe37528cbe64f7858d08463331359b617",
      "old_mode": 33188,
      "old_path": "scripts/qapi.py",
      "new_id": "7519cf8e7a36707df8306408d9cf370aae14ad03",
      "new_mode": 33188,
      "new_path": "scripts/qapi.py"
    },
    {
      "type": "modify",
      "old_id": "60bfa80a70f86f0c7a4879a42de709e134e6389a",
      "old_mode": 33188,
      "old_path": "target-i386/cpu.c",
      "new_id": "c9b8b16b3a7c3066c8eba58a454eed5f13d064e3",
      "new_mode": 33188,
      "new_path": "target-i386/cpu.c"
    },
    {
      "type": "modify",
      "old_id": "cdd18ac630ce70eb655782a73edb13cb3707825a",
      "old_mode": 33188,
      "old_path": "target-ppc/translate_init.c",
      "new_id": "82f85f9ba2bf7e9afa475d3e3de602b1567e934c",
      "new_mode": 33188,
      "new_path": "target-ppc/translate_init.c"
    },
    {
      "type": "modify",
      "old_id": "1c753d982431c9504ff0fc4d0d2d3bd5449b1bc6",
      "old_mode": 33188,
      "old_path": "tests/test-opts-visitor.c",
      "new_id": "9600b970126aee6129ac85fac847d85f04319d87",
      "new_mode": 33188,
      "new_path": "tests/test-opts-visitor.c"
    },
    {
      "type": "modify",
      "old_id": "0be98355c08bcb3ac50560f276f8d4619ac644c5",
      "old_mode": 33188,
      "old_path": "tests/test-qdev-global-props.c",
      "new_id": "e728611b312a45271e0469bbdc0ac2bd2e191e99",
      "new_mode": 33188,
      "new_path": "tests/test-qdev-global-props.c"
    },
    {
      "type": "modify",
      "old_id": "9f35b80a45c31eb6ca208914398bdb956305bf9c",
      "old_mode": 33188,
      "old_path": "tests/test-qmp-commands.c",
      "new_id": "4d267b6a8372949ceef7d2d795f817c6a01a6ccf",
      "new_mode": 33188,
      "new_path": "tests/test-qmp-commands.c"
    },
    {
      "type": "modify",
      "old_id": "f1c2e3ba67403f9919aaca43587ae06f8db5b909",
      "old_mode": 33188,
      "old_path": "tests/test-qmp-input-strict.c",
      "new_id": "775ad39d937826d8dd79ffbf0f2ef957849db1f0",
      "new_mode": 33188,
      "new_path": "tests/test-qmp-input-strict.c"
    },
    {
      "type": "modify",
      "old_id": "b4a5bee6a55df6dad3e2cbf45ac8923e6de2a3a5",
      "old_mode": 33188,
      "old_path": "tests/test-qmp-input-visitor.c",
      "new_id": "f6bd408db3bf661589ee72d982b27144c1729ab3",
      "new_mode": 33188,
      "new_path": "tests/test-qmp-input-visitor.c"
    },
    {
      "type": "modify",
      "old_id": "30784424e4298f202ee3b502b7de24821c3885e0",
      "old_mode": 33188,
      "old_path": "tests/test-qmp-output-visitor.c",
      "new_id": "4df94bcb59de4e628d04d52c7ab13f41a25b3715",
      "new_mode": 33188,
      "new_path": "tests/test-qmp-output-visitor.c"
    },
    {
      "type": "modify",
      "old_id": "8e3433e0c79bdce56c5eb471a204c8c341cbdb70",
      "old_mode": 33188,
      "old_path": "tests/test-string-input-visitor.c",
      "new_id": "d99498d098a0a4293d85e0463a1c93b0f13ad208",
      "new_mode": 33188,
      "new_path": "tests/test-string-input-visitor.c"
    },
    {
      "type": "modify",
      "old_id": "7aecdfcefb8c8ceea2c0990b3c945e462ab267db",
      "old_mode": 33188,
      "old_path": "tests/test-string-output-visitor.c",
      "new_id": "4f4450fe7072dbe8e58d4726e6e7e26535c98e2f",
      "new_mode": 33188,
      "new_path": "tests/test-string-output-visitor.c"
    },
    {
      "type": "modify",
      "old_id": "9f67f9e0034f16936e0cfdeffdd548c37ddab896",
      "old_mode": 33188,
      "old_path": "tests/test-visitor-serialization.c",
      "new_id": "f74a6df97b95d7ba72a67cb7831d0c66fb253715",
      "new_mode": 33188,
      "new_path": "tests/test-visitor-serialization.c"
    },
    {
      "type": "modify",
      "old_id": "51354dfb6d1a81bc61a279f5ae215f03d880d355",
      "old_mode": 33188,
      "old_path": "util/qemu-sockets.c",
      "new_id": "b665cdb98f96e07d00817d4cb932908db45dfbaf",
      "new_mode": 33188,
      "new_path": "util/qemu-sockets.c"
    },
    {
      "type": "modify",
      "old_id": "300a6094798b0ab0f9555ff8c445aead003bb34d",
      "old_mode": 33188,
      "old_path": "vl.c",
      "new_id": "4379beccf7c9bbbf1d6d61479e378e0bc1975041",
      "new_mode": 33188,
      "new_path": "vl.c"
    }
  ]
}
