)]}'
{
  "commit": "32bafa8fdd098d52fbf1102d5a5e48d29398c0aa",
  "tree": "ca10fdb98f8c5c7cbecee273e64691c2c8f17728",
  "parents": [
    "861877a0dd0a8e1bdbcc9743530f4dc9745a736a"
  ],
  "author": {
    "name": "Eric Blake",
    "email": "eblake@redhat.com",
    "time": "Thu Mar 17 16:48:37 2016 -0600"
  },
  "committer": {
    "name": "Markus Armbruster",
    "email": "armbru@redhat.com",
    "time": "Fri Mar 18 10:29:26 2016 +0100"
  },
  "message": "qapi: Don\u0027t special-case simple union wrappers\n\nSimple unions were carrying a special case that hid their \u0027data\u0027\nQMP member from the resulting C struct, via the hack method\nQAPISchemaObjectTypeVariant.simple_union_type().  But by using\nthe work we started by unboxing flat union and alternate\nbranches, coupled with the ability to visit the members of an\nimplicit type, we can now expose the simple union\u0027s implicit\ntype in qapi-types.h:\n\n| struct q_obj_ImageInfoSpecificQCow2_wrapper {\n|     ImageInfoSpecificQCow2 *data;\n| };\n|\n| struct q_obj_ImageInfoSpecificVmdk_wrapper {\n|     ImageInfoSpecificVmdk *data;\n| };\n...\n| struct ImageInfoSpecific {\n|     ImageInfoSpecificKind type;\n|     union { /* union tag is @type */\n|         void *data;\n|-        ImageInfoSpecificQCow2 *qcow2;\n|-        ImageInfoSpecificVmdk *vmdk;\n|+        q_obj_ImageInfoSpecificQCow2_wrapper qcow2;\n|+        q_obj_ImageInfoSpecificVmdk_wrapper vmdk;\n|     } u;\n| };\n\nDoing this removes asymmetry between QAPI\u0027s QMP side and its\nC side (both sides now expose \u0027data\u0027), and means that the\ntreatment of a simple union as sugar for a flat union is now\nequivalent in both languages (previously the two approaches used\na different layer of dereferencing, where the simple union could\nbe converted to a flat union with equivalent C layout but\ndifferent {} on the wire, or to an equivalent QMP wire form\nbut with different C representation).  Using the implicit type\nalso lets us get rid of the simple_union_type() hack.\n\nOf course, now all clients of simple unions have to adjust from\nusing su-\u003eu.member to using su-\u003eu.member.data; while this touches\na number of files in the tree, some earlier cleanup patches\nhelped minimize the change to the initialization of a temporary\nvariable rather than every single member access.  The generated\nqapi-visit.c code is also affected by the layout change:\n\n|@@ -7393,10 +7393,10 @@ void visit_type_ImageInfoSpecific_member\n|     }\n|     switch (obj-\u003etype) {\n|     case IMAGE_INFO_SPECIFIC_KIND_QCOW2:\n|-        visit_type_ImageInfoSpecificQCow2(v, \"data\", \u0026obj-\u003eu.qcow2, \u0026err);\n|+        visit_type_q_obj_ImageInfoSpecificQCow2_wrapper_members(v, \u0026obj-\u003eu.qcow2, \u0026err);\n|         break;\n|     case IMAGE_INFO_SPECIFIC_KIND_VMDK:\n|-        visit_type_ImageInfoSpecificVmdk(v, \"data\", \u0026obj-\u003eu.vmdk, \u0026err);\n|+        visit_type_q_obj_ImageInfoSpecificVmdk_wrapper_members(v, \u0026obj-\u003eu.vmdk, \u0026err);\n|         break;\n|     default:\n|         abort();\n\nSigned-off-by: Eric Blake \u003ceblake@redhat.com\u003e\nMessage-Id: \u003c1458254921-17042-13-git-send-email-eblake@redhat.com\u003e\nSigned-off-by: Markus Armbruster \u003carmbru@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c11320eecfa247936511f0a231b8995a352befc4",
      "old_mode": 33188,
      "old_path": "backends/baum.c",
      "new_id": "eef3467c9f553ccaa2882964a8f4f3310fe45083",
      "new_mode": 33188,
      "new_path": "backends/baum.c"
    },
    {
      "type": "modify",
      "old_id": "5e1833c6e66f98e1bd0da9dfaed4ffa5e8d1887b",
      "old_mode": 33188,
      "old_path": "backends/msmouse.c",
      "new_id": "8dea5a130f5e01fc0b55ca171d84bd83a05d8e05",
      "new_mode": 33188,
      "new_path": "backends/msmouse.c"
    },
    {
      "type": "modify",
      "old_id": "9f333c9b11b9b3a2ffc4b9a4eab6bb64d1093a89",
      "old_mode": 33188,
      "old_path": "block/nbd.c",
      "new_id": "836424c88c6ee6e32e9538a3bd513cec02e951ae",
      "new_mode": 33188,
      "new_path": "block/nbd.c"
    },
    {
      "type": "modify",
      "old_id": "5f4fea6a55ebf442b52b9d11ed3d89ec8cfcb18b",
      "old_mode": 33188,
      "old_path": "block/qcow2.c",
      "new_id": "cec5bd02f274403aceb3b65ebcc4ee226e804615",
      "new_mode": 33188,
      "new_path": "block/qcow2.c"
    },
    {
      "type": "modify",
      "old_id": "80f033835e135313ba0e23c3459f63205c26f8a0",
      "old_mode": 33188,
      "old_path": "block/vmdk.c",
      "new_id": "29c8fc3d02c8212d5b199857c9cb4f47cc2579b2",
      "new_mode": 33188,
      "new_path": "block/vmdk.c"
    },
    {
      "type": "modify",
      "old_id": "85dee5787bb25cc1212fde966cd5ea3a1583ee9b",
      "old_mode": 33188,
      "old_path": "blockdev.c",
      "new_id": "24c886142a4e393580cb39d50fc69976ef2d8443",
      "new_mode": 33188,
      "new_path": "blockdev.c"
    },
    {
      "type": "modify",
      "old_id": "5b6084a56a7260542f079c62c5487e3aa20776e2",
      "old_mode": 33188,
      "old_path": "hmp.c",
      "new_id": "6ace227c6668f6533a80a2b9589cee3b48ec7ddd",
      "new_mode": 33188,
      "new_path": "hmp.c"
    },
    {
      "type": "modify",
      "old_id": "c7a24ac4214859577fc2099ec452494e028931c2",
      "old_mode": 33188,
      "old_path": "hw/char/escc.c",
      "new_id": "7bf09a0077803322127848a725248bbfe619550b",
      "new_mode": 33188,
      "new_path": "hw/char/escc.c"
    },
    {
      "type": "modify",
      "old_id": "41a9387460e865fa995b756a8eea5ce17ff66a23",
      "old_mode": 33188,
      "old_path": "hw/input/hid.c",
      "new_id": "59126776f5f86a55a5317b68a7b6ecbb6766562d",
      "new_mode": 33188,
      "new_path": "hw/input/hid.c"
    },
    {
      "type": "modify",
      "old_id": "86df1a0fd6d93db747546bac8247356e23d9be48",
      "old_mode": 33188,
      "old_path": "hw/input/ps2.c",
      "new_id": "58892d5ecdc6962605eaf5e16399ef2c7dc8fd39",
      "new_mode": 33188,
      "new_path": "hw/input/ps2.c"
    },
    {
      "type": "modify",
      "old_id": "e5480c3f3df62f7c053ec2c4eb1c7b4ad6804ac2",
      "old_mode": 33188,
      "old_path": "hw/input/virtio-input-hid.c",
      "new_id": "5d121571148593b61d65c68dbdcd6f1225fc8620",
      "new_mode": 33188,
      "new_path": "hw/input/virtio-input-hid.c"
    },
    {
      "type": "modify",
      "old_id": "973bf20bf6430b16140672b2043ad61ff5bb3894",
      "old_mode": 33188,
      "old_path": "hw/mem/pc-dimm.c",
      "new_id": "c4b44300eb7b07c2bf00a17ba85f6bf1b545fc65",
      "new_mode": 33188,
      "new_path": "hw/mem/pc-dimm.c"
    },
    {
      "type": "modify",
      "old_id": "61dec9d61dbd932fd95fe83fab8c5639ef02e030",
      "old_mode": 33188,
      "old_path": "net/dump.c",
      "new_id": "94ac32a39f826b8ec997e57cb27dcefe19ff7d5e",
      "new_mode": 33188,
      "new_path": "net/dump.c"
    },
    {
      "type": "modify",
      "old_id": "b6d44fd75ba0e98bced09c189f9e125d42554601",
      "old_mode": 33188,
      "old_path": "net/hub.c",
      "new_id": "6d90c6ee67dfe64d65746554bd5b4a1a8e069207",
      "new_mode": 33188,
      "new_path": "net/hub.c"
    },
    {
      "type": "modify",
      "old_id": "824161c5b82b6d1382efa931cbd8b5379f560a8c",
      "old_mode": 33188,
      "old_path": "net/l2tpv3.c",
      "new_id": "5c668f7376fbdff0811660e0d96bea39cea27e45",
      "new_mode": 33188,
      "new_path": "net/l2tpv3.c"
    },
    {
      "type": "modify",
      "old_id": "73cefbcb67325cf731b583834484f43b4f09f515",
      "old_mode": 33188,
      "old_path": "net/net.c",
      "new_id": "1a78edf751646b45fe8721a8961d490aac2a8b7d",
      "new_mode": 33188,
      "new_path": "net/net.c"
    },
    {
      "type": "modify",
      "old_id": "1b427287a7f67e2dc15581f53ce9bfe4115c93c1",
      "old_mode": 33188,
      "old_path": "net/netmap.c",
      "new_id": "6fa2c418a58af88c6db92c8f5b2ea409c3438ab1",
      "new_mode": 33188,
      "new_path": "net/netmap.c"
    },
    {
      "type": "modify",
      "old_id": "9954160de3a2d245a401c7c02cdb93cd98ab8c5f",
      "old_mode": 33188,
      "old_path": "net/slirp.c",
      "new_id": "95239bceb0fa7ac7c87387e9afbc4a0732b3f8b9",
      "new_mode": 33188,
      "new_path": "net/slirp.c"
    },
    {
      "type": "modify",
      "old_id": "73dc49a3a412e7f1b4c328d17d3805c8b7b60ada",
      "old_mode": 33188,
      "old_path": "net/socket.c",
      "new_id": "9826efb46f02c165d78179b2550bdc225db3ddd9",
      "new_mode": 33188,
      "new_path": "net/socket.c"
    },
    {
      "type": "modify",
      "old_id": "38bbac0cd92e881d9f82d3f4f8e2d13557a3b4e8",
      "old_mode": 33188,
      "old_path": "net/tap-win32.c",
      "new_id": "f1e142ace6f7127ec165272cc15c64870dbbd695",
      "new_mode": 33188,
      "new_path": "net/tap-win32.c"
    },
    {
      "type": "modify",
      "old_id": "cd7a7fc8609e145aa000fee935d1de9f243b9bc6",
      "old_mode": 33188,
      "old_path": "net/tap.c",
      "new_id": "8f790d15ff52f98d55f06ca2bc8e6f9fe4e589ce",
      "new_mode": 33188,
      "new_path": "net/tap.c"
    },
    {
      "type": "modify",
      "old_id": "973faf509004fe4ac75fd899b089616b81bd35ea",
      "old_mode": 33188,
      "old_path": "net/vde.c",
      "new_id": "9427eaa16f5dec307fa52fa5a8083896ea7cb273",
      "new_mode": 33188,
      "new_path": "net/vde.c"
    },
    {
      "type": "modify",
      "old_id": "58b8dae7668364997de3cfd66368bc329d8ad4ca",
      "old_mode": 33188,
      "old_path": "net/vhost-user.c",
      "new_id": "1b9e73a2dc33bc74d245caabca03b5bb5911d5bf",
      "new_mode": 33188,
      "new_path": "net/vhost-user.c"
    },
    {
      "type": "modify",
      "old_id": "da27bf8d4f74688938823e8429f1ca38a312ef4e",
      "old_mode": 33188,
      "old_path": "numa.c",
      "new_id": "572712ccf990ca7ec08e5d396e792f1c3c548179",
      "new_mode": 33188,
      "new_path": "numa.c"
    },
    {
      "type": "modify",
      "old_id": "bfcf80dd10918529760136de0350a6610d88d95d",
      "old_mode": 33188,
      "old_path": "qemu-char.c",
      "new_id": "f90e4c1208aa9dcb7bafc2d1539de6d5b022599b",
      "new_mode": 33188,
      "new_path": "qemu-char.c"
    },
    {
      "type": "modify",
      "old_id": "d5f847386f224b3920c299dd11371ee4230da763",
      "old_mode": 33188,
      "old_path": "qemu-nbd.c",
      "new_id": "f3528c8c0497aab69a4cae53d91213be0517d1b2",
      "new_mode": 33188,
      "new_path": "qemu-nbd.c"
    },
    {
      "type": "modify",
      "old_id": "c38af50f7482051e6ca34a7f62708fd4134d6a9d",
      "old_mode": 33188,
      "old_path": "replay/replay-input.c",
      "new_id": "2d5d9191caccd8edbf7adc50840d0c08c5ecd356",
      "new_mode": 33188,
      "new_path": "replay/replay-input.c"
    },
    {
      "type": "modify",
      "old_id": "79416b23aee112a8f3d458ed5de55d2e066595aa",
      "old_mode": 33188,
      "old_path": "scripts/qapi-types.py",
      "new_id": "92ae619fa4820f8b61d4f50b6f58f03073be15dc",
      "new_mode": 33188,
      "new_path": "scripts/qapi-types.py"
    },
    {
      "type": "modify",
      "old_id": "5220badf28318e0029631a0503b80ef058d3eb9d",
      "old_mode": 33188,
      "old_path": "scripts/qapi-visit.py",
      "new_id": "c147990efe9368739d945e1144d9d797a03d22ee",
      "new_mode": 33188,
      "new_path": "scripts/qapi-visit.py"
    },
    {
      "type": "modify",
      "old_id": "08d63bffc80c02aa9a64fe7ae517191c9febfae4",
      "old_mode": 33188,
      "old_path": "scripts/qapi.py",
      "new_id": "d91af94759b2b566eacc5a5e6e1b78443e63b910",
      "new_mode": 33188,
      "new_path": "scripts/qapi.py"
    },
    {
      "type": "modify",
      "old_id": "21885c526ba5bbb88ff38579ea72362937ea2389",
      "old_mode": 33188,
      "old_path": "spice-qemu-char.c",
      "new_id": "351fcaa033a5c2bc27f51217b46a9523e76ebb6d",
      "new_mode": 33188,
      "new_path": "spice-qemu-char.c"
    },
    {
      "type": "modify",
      "old_id": "87018acb8a83cb188b074b209e6fb9d551f9ee28",
      "old_mode": 33188,
      "old_path": "tests/test-io-channel-socket.c",
      "new_id": "be0c3003d4853698143ee05c05fb676d2de68264",
      "new_mode": 33188,
      "new_path": "tests/test-io-channel-socket.c"
    },
    {
      "type": "modify",
      "old_id": "650ba4681f4e2dbcb90dc5acc029321880abce78",
      "old_mode": 33188,
      "old_path": "tests/test-qmp-commands.c",
      "new_id": "14a9ebbd5a5d3092da2d2a404678bc6eba77bba7",
      "new_mode": 33188,
      "new_path": "tests/test-qmp-commands.c"
    },
    {
      "type": "modify",
      "old_id": "b05da5baa13370980430ca05b81184f7f813b731",
      "old_mode": 33188,
      "old_path": "tests/test-qmp-input-visitor.c",
      "new_id": "5941e90b35a25dc52267fab0c9ec312d5c37d548",
      "new_mode": 33188,
      "new_path": "tests/test-qmp-input-visitor.c"
    },
    {
      "type": "modify",
      "old_id": "a7f8b45c77a1bf5e7d45e3f45a5e1edb46a8db55",
      "old_mode": 33188,
      "old_path": "tests/test-qmp-output-visitor.c",
      "new_id": "dc3575296994b48e831f22060b20fbad59bc2f0e",
      "new_mode": 33188,
      "new_path": "tests/test-qmp-output-visitor.c"
    },
    {
      "type": "modify",
      "old_id": "9ed708e22b632a5cc2ca1fd6c78b1889621602f5",
      "old_mode": 33188,
      "old_path": "tpm.c",
      "new_id": "9a7c7114d388cf984e907e7b77db4f761440ee8f",
      "new_mode": 33188,
      "new_path": "tpm.c"
    },
    {
      "type": "modify",
      "old_id": "8027ba7d8f4a8611757828eaeac2d0bf7d26c886",
      "old_mode": 33188,
      "old_path": "ui/console.c",
      "new_id": "1fd4ea4d2e28e6246ba0cbfcc30c306b066b112a",
      "new_mode": 33188,
      "new_path": "ui/console.c"
    },
    {
      "type": "modify",
      "old_id": "fd2c09ddc214fc83b3abc721fdbaf8aa8762eb59",
      "old_mode": 33188,
      "old_path": "ui/input-keymap.c",
      "new_id": "f1e700d72038d3f81bf249ed2f08caaddf849228",
      "new_mode": 33188,
      "new_path": "ui/input-keymap.c"
    },
    {
      "type": "modify",
      "old_id": "f1c5cb4a5ea48b63ef8d9ab1c4b890d86ae3f96a",
      "old_mode": 33188,
      "old_path": "ui/input-legacy.c",
      "new_id": "71597474047cab1473228407a51ac9abc0e919f3",
      "new_mode": 33188,
      "new_path": "ui/input-legacy.c"
    },
    {
      "type": "modify",
      "old_id": "b035f86d37f2cd237c75e6587982c65ee9ec4092",
      "old_mode": 33188,
      "old_path": "ui/input.c",
      "new_id": "ed88cda6d6692fdfcf2d8e6c88531e3e2d111d02",
      "new_mode": 33188,
      "new_path": "ui/input.c"
    },
    {
      "type": "modify",
      "old_id": "13a59f500e839016a940f792e3424c50d3582612",
      "old_mode": 33188,
      "old_path": "ui/vnc-auth-sasl.c",
      "new_id": "56e45e3473799bb2d4b92a911d0843cf52160f6c",
      "new_mode": 33188,
      "new_path": "ui/vnc-auth-sasl.c"
    },
    {
      "type": "modify",
      "old_id": "9494a19ecf833170ecf8eca68a59a0c8a1a078fa",
      "old_mode": 33188,
      "old_path": "ui/vnc.c",
      "new_id": "6d39ddd3f949fd132976b42c6f7a5c5ceec52992",
      "new_mode": 33188,
      "new_path": "ui/vnc.c"
    },
    {
      "type": "modify",
      "old_id": "fd37ac209bfc62cb360e762a5a59e36230e69d7b",
      "old_mode": 33188,
      "old_path": "util/qemu-sockets.c",
      "new_id": "540649a7affcda3a33b03f0041d6f60d84a2ec3c",
      "new_mode": 33188,
      "new_path": "util/qemu-sockets.c"
    }
  ]
}
