{"push_id":825059593,"size":21,"distinct_size":21,"ref":"refs/heads/master","head":"c49d3411faae8ffaab8f7e5db47405a008411c10","before":"5451316ed07b758a187dedf21047bed8f843f7f1","commits":[{"sha":"9b89b6a2872f1473ef82acdcb64c901982e0ef88","author":{"email":"5d00b6b660f20fb41305186c34c40973ec5cb35b@redhat.com","name":"Markus Armbruster"},"message":"docs: Move files from docs/qmp/ to docs/\n\nGiving QMP its own subdirectory in docs/ is hardly worthwhile when we\nhave just four files, and one of them isn't even in the subdirectory.\nMove the files from docs/qmp/ to docs/, renaming docs/qmp/README to\ndocs/qmp-intro.\n\nUpdate MAINTAINERS.  The new pattern also captures the fourth file\ndocs/writing-qmp-commands.txt.\n\nSigned-off-by: Markus Armbruster <armbru@redhat.com>\nMessage-Id: <1443111117-29831-2-git-send-email-armbru@redhat.com>\nReviewed-by: Eric Blake <eblake@redhat.com>\nReviewed-by: Luiz Capitulino <lcapitulino@redhat.com>","distinct":true,"url":"https://api.github.com/repos/qemu/qemu/commits/9b89b6a2872f1473ef82acdcb64c901982e0ef88"},{"sha":"7735d2b50477b171446b38efd2d8866d3c966162","author":{"email":"5d00b6b660f20fb41305186c34c40973ec5cb35b@redhat.com","name":"Markus Armbruster"},"message":"MAINTAINERS: Specify QObject include and test files\n\nSigned-off-by: Markus Armbruster <armbru@redhat.com>\nMessage-Id: <1443111117-29831-3-git-send-email-armbru@redhat.com>\nReviewed-by: Eric Blake <eblake@redhat.com>\nReviewed-by: Luiz Capitulino <lcapitulino@redhat.com>","distinct":true,"url":"https://api.github.com/repos/qemu/qemu/commits/7735d2b50477b171446b38efd2d8866d3c966162"},{"sha":"ac4abb9aeb734f36eb90b149b9eed0cc8fdb2872","author":{"email":"5d00b6b660f20fb41305186c34c40973ec5cb35b@redhat.com","name":"Markus Armbruster"},"message":"MAINTAINERS: Specify QAPI include and test files\n\nSigned-off-by: Markus Armbruster <armbru@redhat.com>\nMessage-Id: <1443111117-29831-4-git-send-email-armbru@redhat.com>\nReviewed-by: Eric Blake <eblake@redhat.com>\nReviewed-by: Luiz Capitulino <lcapitulino@redhat.com>","distinct":true,"url":"https://api.github.com/repos/qemu/qemu/commits/ac4abb9aeb734f36eb90b149b9eed0cc8fdb2872"},{"sha":"1ffe818a395cb883746f3baf8d9a0b6988375e8b","author":{"email":"a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com","name":"Eric Blake"},"message":"qapi: Sort qapi-schema tests\n\nRecent changes to qapi have provided quite a bit of churn in\nthe makefile, because we are inconsistent on what order test\nnames appear in, and on whether to re-wrap the list of tests or\njust add arbitrary line lengths.  Writing the list in a sorted\nfashion, one test per line, will make future patches easier\nto see what tests are being added or removed by a patch.\n\nAlthough it is tempting to use $(wildcard qapi-schema/*.json)\nfor a more compact listing, such an approach would risk picking\nup leftover garbage .json files in the directory; so keeping\nthe list explicit is safer for ensuring reproducible tarballs\nand test results.\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\nMessage-Id: <1443565276-4535-2-git-send-email-eblake@redhat.com>\nSigned-off-by: Markus Armbruster <armbru@redhat.com>","distinct":true,"url":"https://api.github.com/repos/qemu/qemu/commits/1ffe818a395cb883746f3baf8d9a0b6988375e8b"},{"sha":"7408fb67c0f9403f6e40aecf97cf798fc14e2cd8","author":{"email":"a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com","name":"Eric Blake"},"message":"qapi: Improve 'include' error message\n\nUse of '\"...%s\" % include' to print non-strings can lead to\nugly messages, such as this (if the .json change is applied\nwithout the qapi.py change):\n Expected a file name (string), got: OrderedDict()\n\nBetter is to just omit the actual non-string value in the\nmessage.\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\nMessage-Id: <1443565276-4535-3-git-send-email-eblake@redhat.com>\nSigned-off-by: Markus Armbruster <armbru@redhat.com>","distinct":true,"url":"https://api.github.com/repos/qemu/qemu/commits/7408fb67c0f9403f6e40aecf97cf798fc14e2cd8"},{"sha":"59b00542659c8947f9d4e8c28d2d528ab3ab61a5","author":{"email":"a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com","name":"Eric Blake"},"message":"qapi: Invoke exception superclass initializer\n\npylint recommends that every exception class should explicitly\ninvoke the superclass __init__, even though things seem to work\nfine without it.\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\nMessage-Id: <1443565276-4535-4-git-send-email-eblake@redhat.com>\nSigned-off-by: Markus Armbruster <armbru@redhat.com>","distinct":true,"url":"https://api.github.com/repos/qemu/qemu/commits/59b00542659c8947f9d4e8c28d2d528ab3ab61a5"},{"sha":"437db2549be383e52acad6cd4bf2862e98fdfc93","author":{"email":"a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com","name":"Eric Blake"},"message":"qapi: Clean up qapi.py per pep8\n\nSilence pep8, and make pylint a bit happier.  Just style cleanups,\nplus killing a useless comment in camel_to_upper(); no semantic\nchanges.\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\nMessage-Id: <1443565276-4535-5-git-send-email-eblake@redhat.com>\nSigned-off-by: Markus Armbruster <armbru@redhat.com>","distinct":true,"url":"https://api.github.com/repos/qemu/qemu/commits/437db2549be383e52acad6cd4bf2862e98fdfc93"},{"sha":"d220fbcd1db2097de5ff3037e85317fcb5433e4e","author":{"email":"a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com","name":"Eric Blake"},"message":"qapi: Test for various name collisions\n\nExpose some weaknesses in the generator: we don't always forbid\nthe generation of structs that contain multiple members that map\nto the same C or QMP name.  This has already been marked FIXME in\nqapi.py in commit d90675f, but having more tests will make sure\nfuture patches produce desired behavior; and updating existing\npatches to better document things doesn't hurt, either.  Some of\nthese collisions are already caught in the old-style parser\nchecks, but ultimately we want all collisions to be caught in the\nnew-style QAPISchema*.check() methods.\n\nThis patch focuses on C struct members, and does not consider\ncollisions between commands and events (affecting C function\nnames), or even collisions between generated C type names with\nuser type names (for things like automatic FOOList struct\nrepresenting array types or FOOKind for an implicit enum).\n\nThere are two types of struct collisions we want to catch:\n 1) Collision between two keys in a JSON object. qapi.py prevents\n    that within a single struct (see test duplicate-key), but it is\n    possible to have collisions between a type's members and its\n    base type's members (existing tests struct-base-clash,\n    struct-base-clash-deep), and its flat union variant members\n    (renamed test flat-union-clash-member).\n 2) Collision between two members of the C struct that is generated\n    for a given QAPI type:\n    a) Multiple QAPI names map to the same C name (new test\n       args-name-clash)\n    b) A QAPI name maps to a C name that is used for another purpose\n       (new tests flat-union-clash-branch, struct-base-clash-base,\n       union-clash-data). We already fixed some such cases in commit\n       0f61af3e and 1e6c1616, but more remain.\n    c) Two C names generated for other purposes clash\n       (updated test alternate-clash, new test union-clash-branches,\n       union-clash-type, flat-union-clash-type)\n\nUltimately, if we need to have a flat union where a tag value\nclashes with a base member name, we could change the generator to\nname the union (using 'foo.u.value' rather than 'foo.value') or\notherwise munge the C name corresponding to tag values.  But\nunless such a need arises, it will probably be easier to just\nforbid these collisions.\n\nSome of these negative tests will be deleted later, and positive\ntests added to qapi-schema-test.json in their place, when the\ngenerator code is reworked to avoid particular code generation\ncollisions in class 2).\n\n[Note that viewing this patch with git rename detection enabled\nmay see some confusion due to renaming some tests while adding\nothers, but where the content is similar enough that git picks\nthe wrong pre- and post-patch files to associate]\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\nMessage-Id: <1443565276-4535-6-git-send-email-eblake@redhat.com>\n[Improve commit message and comments a bit, drop an unrelated test]\nSigned-off-by: Markus Armbruster <armbru@redhat.com>","distinct":true,"url":"https://api.github.com/repos/qemu/qemu/commits/d220fbcd1db2097de5ff3037e85317fcb5433e4e"},{"sha":"7b2a5c2f9a52c4a08630fa741052f03fe5d3cc8a","author":{"email":"a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com","name":"Eric Blake"},"message":"qapi: Avoid assertion failure on union 'type' collision\n\nThe previous commit added two tests that triggered an assertion\nfailure. It's fairly straightforward to avoid the failure by\njust outright forbidding the collision between a union's tag\nvalues and its discriminator name (including the implicit name\n'kind' supplied for simple unions [*]).  Ultimately, we'd like\nto move the collision detection into QAPISchema*.check(), but\nfor now it is easier just to enhance the existing checks.\n\n[*] Of course, down the road, we have plans to rename the simple\nunion tag name to 'type' to match the QMP wire name, but the\nidea of the collision will still be present even then.\n\nTechnically, we could avoid the collision by naming the C union\nmembers representing each enum value as '_case_value' rather\nthan 'value'; but until we have an actual qapi client (and not\njust our testsuite) that has a legitimate reason to match a\ncase label to the name of a QMP key and needs the name munging\nto satisfy the compiler, it's easier to just reject the qapi\nas invalid.\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\nMessage-Id: <1443565276-4535-7-git-send-email-eblake@redhat.com>\n[Polished a few comments]\nSigned-off-by: Markus Armbruster <armbru@redhat.com>","distinct":true,"url":"https://api.github.com/repos/qemu/qemu/commits/7b2a5c2f9a52c4a08630fa741052f03fe5d3cc8a"},{"sha":"8d25dd101f759425456b8005b3180062689d71e7","author":{"email":"a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com","name":"Eric Blake"},"message":"qapi: Add tests for empty unions\n\nThe documentation claims that alternates are useful for\nallowing two or more types, although nothing enforces this.\nMeanwhile, it is silent on whether empty unions are allowed.\nIn practice, the generated code will compile, in part because\nwe have a 'void *data' branch; but attempting to visit such a\ntype will cause an abort().  While there's no technical reason\nthat a degenerate union could not be made to work, it's harder\nto justify the time spent in chasing known (the current\nabort() during visit) and unknown corner cases, than it would\nbe to just outlaw them.  A future patch will probably take the\napproach of forbidding them; in the meantime, we can at least\nadd testsuite coverage to make it obvious where things stand.\n\nIn addition to adding tests to expose the problems, we also\nneed to adjust existing tests that are meant to test something\nelse, but which could fail for the wrong reason if we reject\ndegenerate alternates/unions.\n\nNote that empty structs are explicitly supported (for example,\nright now they are the only way to specify that one branch of a\nflat union adds no additional members), and empty enums are\ncovered by the testsuite as working (even if they do not seem\nto have much use).\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\nMessage-Id: <1443565276-4535-8-git-send-email-eblake@redhat.com>\nSigned-off-by: Markus Armbruster <armbru@redhat.com>","distinct":true,"url":"https://api.github.com/repos/qemu/qemu/commits/8d25dd101f759425456b8005b3180062689d71e7"},{"sha":"9c51b4412959c5331a8a931d848c4b755b5bb36a","author":{"email":"a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com","name":"Eric Blake"},"message":"qapi: Test use of 'number' within alternates\n\nAdd some testsuite exposure for use of a 'number' as part of\nan alternate.  The current state of the tree has a few bugs\nexposed by this: our input parser depends on the ordering of\nhow the qapi schema declared the alternate, and the parser\ndoes not accept integers for a 'number' in an alternate even\nthough it does for numbers outside of an alternate.\n\nMixing 'int' and 'number' in the same alternate is unusual,\nsince both are supplied by json-numbers, but there does not\nseem to be a technical reason to forbid it given that our\njson lexer distinguishes between json-numbers that can be\nrepresented as an int vs. those that cannot.\n\nImprove the existing test_visitor_in_alternate() to match the\nstyle of the new test_visitor_in_alternate_number(), and to\nensure full coverage of all possible qtype parsing.\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\nMessage-Id: <1443565276-4535-9-git-send-email-eblake@redhat.com>\n[Eric's follow-up fixes squashed in]\nSigned-off-by: Markus Armbruster <armbru@redhat.com>","distinct":true,"url":"https://api.github.com/repos/qemu/qemu/commits/9c51b4412959c5331a8a931d848c4b755b5bb36a"},{"sha":"376863ef4895ae709aadb6f26365a5973310ef09","author":{"email":"a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com","name":"Eric Blake"},"message":"qapi: Reuse code for flat union base validation\n\nRather than open-code the check for a valid base type, we\nshould reuse the common functionality. This allows for\nconsistent error messages, and also makes it easier for a\nlater patch to turn on support for inline anonymous base\nstructures.\n\nTest flat-union-inline is updated to test only one feature\n(anonymous branch dictionaries), which can be implemented\nindependently (test flat-union-bad-base already covers the\nidea of an anonymous base dictionary).\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\nMessage-Id: <1443565276-4535-10-git-send-email-eblake@redhat.com>\nSigned-off-by: Markus Armbruster <armbru@redhat.com>","distinct":true,"url":"https://api.github.com/repos/qemu/qemu/commits/376863ef4895ae709aadb6f26365a5973310ef09"},{"sha":"2a0f50e8d973b01eda4c63bac4a5c79ea0f584ef","author":{"email":"a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com","name":"Eric Blake"},"message":"qapi: Consistent generated code: prefer error 'err'\n\nWe had some pointless differences in the generated code for visit,\ncommand marshalling, and events; unifying them makes it easier for\nfuture patches to consolidate to common helper functions.\nThis is one patch of a series to clean up these differences.\n\nThis patch consistently names the local error variable 'err' rather\nthan 'local_err'.\n\nNo change in semantics to the generated code.\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\nMessage-Id: <1443565276-4535-11-git-send-email-eblake@redhat.com>\nSigned-off-by: Markus Armbruster <armbru@redhat.com>","distinct":true,"url":"https://api.github.com/repos/qemu/qemu/commits/2a0f50e8d973b01eda4c63bac4a5c79ea0f584ef"},{"sha":"f8b7f1a8eafa9f565ebecfe409e8741d38cd786b","author":{"email":"a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com","name":"Eric Blake"},"message":"qapi: Consistent generated code: prefer visitor 'v'\n\nWe had some pointless differences in the generated code for visit,\ncommand marshalling, and events; unifying them makes it easier for\nfuture patches to consolidate to common helper functions.\nThis is one patch of a series to clean up these differences.\n\nThis patch names the local visitor variable 'v' rather than 'm'.\nRelated objects, such as 'QapiDeallocVisitor', are also named by\ntheir initials instead of an unrelated leading m.\n\nNo change in semantics to the generated code.\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\nMessage-Id: <1443565276-4535-12-git-send-email-eblake@redhat.com>\nSigned-off-by: Markus Armbruster <armbru@redhat.com>","distinct":true,"url":"https://api.github.com/repos/qemu/qemu/commits/f8b7f1a8eafa9f565ebecfe409e8741d38cd786b"},{"sha":"f782399cb4fa3fc4182cb046817f65a6db92ab07","author":{"email":"a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com","name":"Eric Blake"},"message":"qapi: Consistent generated code: prefer common labels\n\nWe had some pointless differences in the generated code for visit,\ncommand marshalling, and events; unifying them makes it easier for\nfuture patches to consolidate to common helper functions.\nThis is one patch of a series to clean up these differences.\n\nThis patch names the goto labels 'out' (not 'clean') and 'out_obj'\n(not 'out_end').  Additionally, the generator was inconsistent on\nwhether labels had a leading space [our HACKING is silent; while\nemacs 'gnu' style adds the space to avoid littering column 1].\nFor minimal churn, prefer no leading space; this also matches\nthe style that is more prevalent in current qemu.git.\n\nNo change in semantics to the generated code.\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\nMessage-Id: <1443565276-4535-13-git-send-email-eblake@redhat.com>\nSigned-off-by: Markus Armbruster <armbru@redhat.com>","distinct":true,"url":"https://api.github.com/repos/qemu/qemu/commits/f782399cb4fa3fc4182cb046817f65a6db92ab07"},{"sha":"e36c714e6aad7c9266132350833e2f263f6d8874","author":{"email":"a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com","name":"Eric Blake"},"message":"qapi: Consistent generated code: prefer common indentation\n\nWe had some pointless differences in the generated code for visit,\ncommand marshalling, and events; unifying them makes it easier for\nfuture patches to consolidate to common helper functions.\nThis is one patch of a series to clean up these differences.\n\nThis patch adjusts gen_visit_union() to use the same indentation\nas other functions, namely, by jumping early to the error label\nif the object was not set rather than placing the rest of the\nbody inside an if for when it is set.\n\nNo change in semantics to the generated code.\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\nMessage-Id: <1443565276-4535-14-git-send-email-eblake@redhat.com>\nSigned-off-by: Markus Armbruster <armbru@redhat.com>","distinct":true,"url":"https://api.github.com/repos/qemu/qemu/commits/e36c714e6aad7c9266132350833e2f263f6d8874"},{"sha":"05372f708a8cb3556e4d67458de79417dadf241f","author":{"email":"a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com","name":"Eric Blake"},"message":"qapi: Consistent generated code: minimize push_indent() usage\n\nWe had some pointless differences in the generated code for visit,\ncommand marshalling, and events; unifying them makes it easier for\nfuture patches to consolidate to common helper functions.\nThis is one patch of a series to clean up these differences.\n\nThis patch reduces the number of push_indent()/pop_indent() pairs\nso that generated code is typically already at its natural output\nindentation in the python files.  It is easier to reason about\ngenerated code if the reader does not have to track how much\nspacing will be inserted alongside the code, and moreso when all\nof the generators use the same patterns (qapi-type and qapi-event\nwere already using in-place indentation).\n\nArguably, the resulting python may be a bit harder to read with C\ncode at the same indentation as python; on the other hand, not\nhaving to think about push_indent() is a win, and most decent\neditors provide syntax highlighting that makes it easier to\nvisually distinguish python code from string literals that will\nbecome C code.\n\nThere is no change to the generated output.\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\nMessage-Id: <1443565276-4535-15-git-send-email-eblake@redhat.com>\nSigned-off-by: Markus Armbruster <armbru@redhat.com>","distinct":true,"url":"https://api.github.com/repos/qemu/qemu/commits/05372f708a8cb3556e4d67458de79417dadf241f"},{"sha":"1f35334489a43800df4d20cd91362a87cee39a29","author":{"email":"a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com","name":"Eric Blake"},"message":"qapi: Share gen_err_check()\n\nqapi-commands has a nice helper gen_err_check(), but did not\nuse it everywhere. In fact, using it in more places makes it\neasier to reduce the lines of code used for generating error\nchecks.  This in turn will make it easier for later patches\nto consolidate another common pattern among the generators.\n\nThe generated code has fewer blank lines in qapi-event.c functions,\nbut has no semantic difference.\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\nMessage-Id: <1443565276-4535-16-git-send-email-eblake@redhat.com>\n[Drop another blank line for symmetry]\nSigned-off-by: Markus Armbruster <armbru@redhat.com>","distinct":true,"url":"https://api.github.com/repos/qemu/qemu/commits/1f35334489a43800df4d20cd91362a87cee39a29"},{"sha":"82ca8e469666b169ccf818a0e36136aee97d7db0","author":{"email":"a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com","name":"Eric Blake"},"message":"qapi: Share gen_visit_fields()\n\nConsolidate the code between visit, command marshalling, and\nevent generation that iterates over the members of a struct.\nIt reduces code duplication in the generator, so that a future\npatch can reduce the size of generated code while touching only\none instead of three locations.\n\nThere are no changes to the generated marshal code.\n\nThe visitor code becomes slightly more verbose, but remains\nsemantically equivalent, and is actually easier to read as\nit follows a more common idiom:\n\n|     visit_optional(v, &(*obj)->has_device, \"device\", &err);\n|-    if (!err && (*obj)->has_device) {\n|-        visit_type_str(v, &(*obj)->device, \"device\", &err);\n|-    }\n|     if (err) {\n|         goto out;\n|     }\n|+    if ((*obj)->has_device) {\n|+        visit_type_str(v, &(*obj)->device, \"device\", &err);\n|+        if (err) {\n|+            goto out;\n|+        }\n|+    }\n\nThe event code becomes slightly more verbose, but this is\narguably a bug fix: although the visitors are not well\ndocumented, use of an optional member should not be attempted\nunless guarded by a prior call to visit_optional().  Works only\nbecause the output qmp visitor has a no-op visit_optional():\n\n|+    visit_optional(v, &has_offset, \"offset\", &err);\n|+    if (err) {\n|+        goto out;\n|+    }\n|     if (has_offset) {\n|         visit_type_int(v, &offset, \"offset\", &err);\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\nMessage-Id: <1443565276-4535-17-git-send-email-eblake@redhat.com>\nSigned-off-by: Markus Armbruster <armbru@redhat.com>","distinct":true,"url":"https://api.github.com/repos/qemu/qemu/commits/82ca8e469666b169ccf818a0e36136aee97d7db0"},{"sha":"18bdbc3ac8b477e160d56aa6ecd6942495ce44d0","author":{"email":"a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com","name":"Eric Blake"},"message":"qapi: Simplify gen_visit_fields() error handling\n\nSince we have consolidated all generated code to use 'err' as\nthe name of the local variable for error detection, we can\nsimplify the decision on whether to skip error detection (useful\nfor deallocation paths) to be a boolean.\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\nMessage-Id: <1443565276-4535-18-git-send-email-eblake@redhat.com>\n[Change to gen_visit_fields() simplified]\nSigned-off-by: Markus Armbruster <armbru@redhat.com>","distinct":true,"url":"https://api.github.com/repos/qemu/qemu/commits/18bdbc3ac8b477e160d56aa6ecd6942495ce44d0"}]}