- Dec 17, 2015
-
-
Jean-Christophe Dubois authored
With this CCM, i.MX25 timer is accurate with "real world time". Signed-off-by:
Jean-Christophe Dubois <jcd@tribudubois.net> Message-id: 2c0cf90be767bfc8520661eca891ab22c61f18fe.1449528242.git.jcd@tribudubois.net Reviewed-by Peter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Jean-Christophe Dubois authored
The IMX_CCM class is now the base abstract class that is used by EPIT and GPT timer implementation. IMX31_CCM class is the concrete class implementing CCM for i.MX31 SOC. For now the i.MX25 continues to use the i.MX31 CCM implementation. An i.MX25 specific CCM will be introduced in a later patch. We also rework initialization to stop using deprecated sysbus device init. Signed-off-by:
Jean-Christophe Dubois <jcd@tribudubois.net> Reviewed-by:
Peter Crosthwaite <crosthwaite.peter@gmail.com> Message-id: fd3c7f87b50f5ebc99ec91f01413db35017f116d.1449528242.git.jcd@tribudubois.net Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Jean-Christophe Dubois authored
This is to prepare for CCM code refactoring. This is just a bit of function and enum values renaming. We also remove some useless intermediate variables. Signed-off-by:
Jean-Christophe Dubois <jcd@tribudubois.net> Reviewed-by:
Peter Crosthwaite <crosthwaite.peter@gmail.com> Message-id: 53c4d9b9611988a5f56f178f285e04490747925e.1449528242.git.jcd@tribudubois.net Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Jean-Christophe Dubois authored
Linux on i.MX31/KZM is expecting the CCM to use the CKIH ref clock instead of the CKIL plus the FPM multiplier. We change the CCMR reg reset value to match linux expected config. This allows the CCM to provide a 39MHz clk (as expected by linux) instead of the actual 50MHz. With this change the "sleep 60" command on linux is time accurate with "real world time". Signed-off-by:
Jean-Christophe Dubois <jcd@tribudubois.net> Reviewed-by:
Peter Crosthwaite <crosthwaite.peter@gmail.com> Message-id: 6dc5bc4e0a450b20cecdb2991112e7281b653345.1449528242.git.jcd@tribudubois.net Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Alex Bennée authored
The aim of these tests is to combine with an appropriate kernel image (with symbol-file vmlinux) and check it behaves as it should. Given a kernel it checks: - single step - software breakpoint - hardware breakpoint - access, read and write watchpoints On success it returns 0 to the calling process. I've not plumbed this into the "make check" logic though as we need a solution for providing non-host binaries to the tests. However the test is structured to work with pretty much any Linux kernel image as it uses the basic kernel_init code which is common across architectures. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Message-id: 1449599553-24713-7-git-send-email-alex.bennee@linaro.org Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Alex Bennée authored
If we can't find details for the debug exception in our debug state then we can assume the exception is due to debugging inside the guest. To inject the exception into the guest state we re-use the TCG exception code (do_interrupt). However while guest debugging is in effect we currently can't handle the guest using single step as we will keep trapping to back to userspace. GDB makes heavy use of single-step behind the scenes which effectively means the guest's ability to debug itself is disabled while it is being debugged. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Message-id: 1449599553-24713-6-git-send-email-alex.bennee@linaro.org [PMM: Fixed a few typos in comments and commit message] Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Alex Bennée authored
This adds basic support for HW assisted debug. The ioctl interface to KVM allows us to pass an implementation defined number of break and watch point registers. When KVM_GUESTDBG_USE_HW is specified these debug registers will be installed in place on the world switch into the guest. The hardware is actually capable of more advanced matching but it is unclear if this expressiveness is available via the gdbstub protocol. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Message-id: 1449599553-24713-5-git-send-email-alex.bennee@linaro.org Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Alex Bennée authored
This adds support for single-step. There isn't much to do on the QEMU side as after we set-up the request for single step via the debug ioctl it is all handled within the kernel. The actual setting of the KVM_GUESTDBG_SINGLESTEP flag is already in the common code. If the kernel doesn't support guest debug the ioctl will simply error. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Message-id: 1449599553-24713-4-git-send-email-alex.bennee@linaro.org Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Alex Bennée authored
These don't involve messing around with debug registers, just setting the breakpoint instruction in memory. GDB will not use this mechanism if it can't access the memory to write the breakpoint. All the kernel has to do is ensure the hypervisor traps the breakpoint exceptions and returns to userspace. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Message-id: 1449599553-24713-3-git-send-email-alex.bennee@linaro.org [PMM: Fixed typo in comment] Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Alex Bennée authored
As we haven't always had guest debug support we need to probe for it. Additionally we don't do this in the start-up capability code so we don't fall over on old kernels. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Message-id: 1449599553-24713-2-git-send-email-alex.bennee@linaro.org Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Shannon Zhao authored
Add a gpio-keys node. This is used for Poweroff for the systems which use DT not ACPI. Signed-off-by:
Shannon Zhao <zhaoshenglong@huawei.com> Signed-off-by:
Shannon Zhao <shannon.zhao@linaro.org> Tested-by:
Wei Huang <wei@redhat.com> Message-id: 1449804086-3464-11-git-send-email-zhaoshenglong@huawei.com [PMM: use "standard-headers/linux/input.h" rather than <linux/input.h>] Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Shannon Zhao authored
Currently mach-virt model doesn't support powerdown request. Guest VM doesn't react to system_powerdown from monitor console (or QMP) because there is no communication mechanism for such requests. This patch registers GPIO Pin 3 with powerdown notification. So guest VM can receive notification when such powerdown request is triggered. Signed-off-by:
Wei Huang <wei@redhat.com> Signed-off-by:
Shannon Zhao <zhaoshenglong@huawei.com> Signed-off-by:
Shannon Zhao <shannon.zhao@linaro.org> Reviewed-by:
Wei Huang <wei@redhat.com> Tested-by:
Wei Huang <wei@redhat.com> Message-id: 1449804086-3464-10-git-send-email-zhaoshenglong@huawei.com Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Shannon Zhao authored
Here GPIO pin 3 is used for Power Button, add _E03 in ACPI DSDT table. Signed-off-by:
Shannon Zhao <zhaoshenglong@huawei.com> Signed-off-by:
Shannon Zhao <shannon.zhao@linaro.org> Tested-by:
Wei Huang <wei@redhat.com> Message-id: 1449804086-3464-9-git-send-email-zhaoshenglong@huawei.com Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Shannon Zhao authored
Signed-off-by:
Shannon Zhao <zhaoshenglong@huawei.com> Signed-off-by:
Shannon Zhao <shannon.zhao@linaro.org> Tested-by:
Wei Huang <wei@redhat.com> Reviewed-by:
Igor Mammedov <imammedo@redhat.com> Message-id: 1449804086-3464-8-git-send-email-zhaoshenglong@huawei.com Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Shannon Zhao authored
Signed-off-by:
Shannon Zhao <zhaoshenglong@huawei.com> Signed-off-by:
Shannon Zhao <shannon.zhao@linaro.org> Tested-by:
Wei Huang <wei@redhat.com> Reviewed-by:
Igor Mammedov <imammedo@redhat.com> Message-id: 1449804086-3464-7-git-send-email-zhaoshenglong@huawei.com Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Shannon Zhao authored
Add power button device in ACPI DSDT table. Signed-off-by:
Shannon Zhao <zhaoshenglong@huawei.com> Signed-off-by:
Shannon Zhao <shannon.zhao@linaro.org> Reviewed-by:
Wei Huang <wei@redhat.com> Tested-by:
Wei Huang <wei@redhat.com> Reviewed-by:
Igor Mammedov <imammedo@redhat.com> Message-id: 1449804086-3464-6-git-send-email-zhaoshenglong@huawei.com Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Shannon Zhao authored
Add GPIO controller in ACPI DSDT table. It can be used for gpio event. Signed-off-by:
Shannon Zhao <zhaoshenglong@huawei.com> Signed-off-by:
Shannon Zhao <shannon.zhao@linaro.org> Tested-by:
Wei Huang <wei@redhat.com> Message-id: 1449804086-3464-5-git-send-email-zhaoshenglong@huawei.com Reviewed-by:
Igor Mammedov <imammedo@redhat.com> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Shannon Zhao authored
ACPI 5.0 supports GPIO-signaled ACPI Events. This can be used for powerdown, hotplug evnets. Add a GPIO controller in machine virt, to support powerdown, maybe can be used for cpu hotplug. And here we use pl061. Signed-off-by:
Shannon Zhao <zhaoshenglong@huawei.com> Signed-off-by:
Shannon Zhao <shannon.zhao@linaro.org> Reviewed-by:
Wei Huang <wei@redhat.com> Tested-by:
Wei Huang <wei@redhat.com> Message-id: 1449804086-3464-4-git-send-email-zhaoshenglong@huawei.com Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Igor Mammedov authored
ASL Interrupt() macro translates to Extended Interrupt Descriptor which supports variable number of IRQs. It will be used for conversion of ASL code for pc/q35 machines that use it for returning several IRQs in _PSR object. Signed-off-by:
Igor Mammedov <imammedo@redhat.com> Reviewed-by:
Shannon Zhao <shannon.zhao@linaro.org> Signed-off-by:
Shannon Zhao <shannon.zhao@linaro.org> Message-id: 1449804086-3464-3-git-send-email-zhaoshenglong@huawei.com Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Xiao Guangrong authored
Add serialized method support so that explicit Mutex can be avoided Signed-off-by:
Xiao Guangrong <guangrong.xiao@linux.intel.com> Signed-off-by:
Igor Mammedov <imammedo@redhat.com> Reviewed-by:
Shannon Zhao <shannon.zhao@linaro.org> Signed-off-by:
Shannon Zhao <shannon.zhao@linaro.org> Message-id: 1449804086-3464-2-git-send-email-zhaoshenglong@huawei.com Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Sergey Fedorov authored
The AArch32 translation completion code for singlestep enabled/active case was a way more confusing and too repetitive then it needs to be. Probably that was the cause for a bug to be introduced into it at some point. The bug was that SWI/HVC/SMC exception would be generated in condition-failed instruction code path whereas it shouldn't. This patch rewrites the code in a way similar to the non-singlestep case. In the condition-passed/unconditional instruction code path we need to: - Write the condexec bits back to the CPU state - Advance the singlestep state machine and generate a corresponding exception in case of SWI/HVC/SMC - Write the PC back to the CPU state if it hasn't already been written and generate an appropriate singlestep exception otherwise In the condition-failed instruction code path we need to: - Set a TCG label to jump to it if the condition is failed - Write the condexec bits back to the CPU state - Write the PC back to the CPU state since it hasn't been written in this case - Generate an appropriate singlestep exception Signed-off-by:
Sergey Fedorov <serge.fdrv@gmail.com> Message-id: 1448474560-22475-1-git-send-email-serge.fdrv@gmail.com Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Andrew Baumann authored
Qemu does not generally perform alignment checks. However, the ARM ARM requires implementation of alignment exceptions for a number of cases including LDREX, and Windows-on-ARM relies on this. This change adds plumbing to enable alignment checks on loads using MO_ALIGN, a do_unaligned_access hook to raise the exception (data abort), and uses the new aligned loads in LDREX (for all but single-byte loads). Signed-off-by:
Andrew Baumann <Andrew.Baumann@microsoft.com> Message-id: 1449167808-5656-1-git-send-email-Andrew.Baumann@microsoft.com [PMM: set WnR bits in syndrome and FSR as appropriate] Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Paolo Bonzini authored
This is a first baby step towards removing widespread inclusion of cpu.h and compiling more devices once (so that arm, aarch64 and in the future target-multi can share the object files). Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> [PMM: changed __FUNCTION__ to __func__ since we're touching these lines of code anyway] Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Paolo Bonzini authored
Behaviour of emulated devices should not depend on the endianness of the CPU, so avoid using the endian-dependent load and store functions in the PXA2xx and OMAP display devices. These devices are little endian when they do DMA access. (Since ARM softmmu is always compiled as little endian, this means that the endian-dependent load and store functions are always little endian, so this commit makes no functionally visible change.) Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> [PMM: rewrote commit message] Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Jean-Christophe Dubois authored
The i.MX6 GPIO device supports 2 interrupts instead of one. * 1 for the lower 16 GPIOs. * 1 for the upper 16 GPIOs. i.MX31 and i.MX25 only support 1 interrupt for the 32 GPIOs. So we add a property to turn the behavior on when required. Signed-off-by:
Jean-Christophe Dubois <jcd@tribudubois.net> Reviewed-by:
Peter Crosthwaite <crosthwaite.peter@gmail.com> Message-id: 1447497668-1603-1-git-send-email-jcd@tribudubois.net Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Peter Maydell authored
fw_cfg: doc updates, various optimizations. # gpg: Signature made Thu 17 Dec 2015 08:59:32 GMT using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-fw-cfg-20151217-1: fw_cfg: replace ioport data read with generic method fw_cfg: add generic non-DMA read method fw_cfg: avoid calculating invalid current entry pointer fw_cfg: remove offset argument from callback prototype fw_cfg: amend callback behavior spec to once per select fw_cfg: move internal function call docs to header file Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Peter Maydell authored
QAPI patches for 2015-12-17 # gpg: Signature made Thu 17 Dec 2015 07:33:41 GMT using RSA key ID EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" * remotes/armbru/tags/pull-qapi-2015-12-17: (40 commits) qapi: Detect base class loops qapi: Move duplicate collision checks to schema check() qapi: Enforce (or whitelist) case conventions on qapi members qapi: Track enum values by QAPISchemaMember, not string qapi: Prepare new QAPISchemaMember base class qapi: Shorter visits of optional fields qapi: Simplify visits of optional fields qapi: Fix alternates that accept 'number' but not 'int' qapi: Inline _make_implicit_tag() qapi-types: Drop unnedeed ._fwdefn qapi: Simplify visiting of alternate types qapi: Convert QType into QAPI built-in enum type qobject: Rename qtype_code to QType qobject: Simplify QObject qapi: Change munging of CamelCase enum values qapi: Add alias for ErrorClass cpu: Convert CpuInfo into flat union qapi: Remove obsolete tests for MAX collision qapi: Don't let implicit enum MAX member collide qapi: Tighten the regex on valid names ... Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Peter Maydell authored
coreaudio: use new-in-OSX-10.6 APIs, cleanups. # gpg: Signature made Tue 15 Dec 2015 10:15:24 GMT using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-audio-20151215-1: audio/coreaudio.c: Avoid deprecated AudioDeviceAdd/RemoveIOProc APIs audio/coreaudio.c: Use new-in-OSX-10.6 APIs when available audio/coreaudio.c: Factor out uses of AudioDeviceGet/SetProperty audio/coreaudio.c: Use new-in-OSX-10.6 API for getting default voice audio/coreaudio.c: Factor out use of AudioHardwareGetProperty Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Peter Maydell authored
usb: ehci idt fix, event support for mtp # gpg: Signature made Tue 15 Dec 2015 09:54:22 GMT using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-usb-20151215-1: ehci: make idt processing more robust usb-mtp: add support for basic mtp events usb-mtp: Add support for inotify based file monitoring usb-mtp: free objects on a mtp reset usb-mtp: use a list for keeping track of children Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Peter Maydell authored
Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Eric Blake authored
It should be fairly obvious that qapi base classes need to form an acyclic graph, since QMP cannot specify the same key more than once, while base classes are included as flat members alongside other members added by the child. But the old check_member_clash() parser function was not prepared to check for this, and entered an infinite recursion (at least until Python gives up, complaining about nesting too deep). Now that check_member_clash() has been recently removed, attempts at self-inheritance trigger an assertion failure introduced by commit ac88219a. The obvious fix is to turn the assertion into a conditional. This patch includes both the tests (base-cycle-direct and base-cycle-indirect) and the fix, since the .err file output for the unfixed case is not useful (particularly when it was warning about unbounded recursion, as that limit may be platform-specific). We don't need to worry about cycles in flat unions (neither the base type nor the type of a variant can be a union) nor in alternates (alternate branches cannot themselves be an alternate). But if we later allow a union type as a variant, we will still be okay, as QAPISchemaObjectTypeVariants.check() triggers the same QAPISchemaObjectType.check() that will detect any loops. Likewise, we need not worry about the case of diamond inheritance where the same class is used for a flat union base class and one of its variants; either both uses will introduce a collision in trying to insert the same member name twice, or the shared type is empty and changes nothing. Signed-off-by:
Eric Blake <eblake@redhat.com> Message-Id: <1449033659-25497-16-git-send-email-eblake@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Eric Blake authored
With the recent commit 'qapi: Detect collisions in C member names', we have two different locations for detecting clashes - one at parse time, and another at QAPISchema*.check() time. Remove all of the ad hoc parser checks, and delete associated code (for example, the global check_member_clash() method is no longer needed). Testing this showed that the test union-bad-branch wasn't adding much: union-clash-branches also exposes the error message when branches collide, and we've recently fixed things to avoid an implicit collision with max. Likewise, the error for enum-clash-member changes to report our new detection of upper case in a value name, unless we modify the test to use all lower case. The wording of several error messages has changed, but the change is generally an improvement rather than a regression. No change to generated code. Signed-off-by:
Eric Blake <eblake@redhat.com> Message-Id: <1449033659-25497-15-git-send-email-eblake@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Eric Blake authored
We document that members of enums and objects should be 'lower-case', although we were not enforcing it. We have to whitelist a few pre-existing entities that violate the norms. Add three new tests to expose the new error message, each of which first uses the whitelisted name 'UuidInfo' to prove the whitelist works, then triggers the failure (this is the same pattern used in the existing returns-whitelist.json test). Note that by adding this check, we have effectively forbidden an entity with a case-insensitive clash of member names, for any entity that is not on the whitelist (although there is still the possibility to clash via '-' vs. '_'). Not done here: a future patch should also add naming convention support and whitelist exceptions for command, event, and type names. The additions to QAPISchemaMember.check_clash() check whether info['name'] is in the whitelist (the top-most entity name at the point 'info' tracks), rather than self.owner (the type, possibly implicit, that directly owns the member), because it is easier to maintain the whitelist by the names actually in the user's .json file, rather than worrying about the names of implicit types. Signed-off-by:
Eric Blake <eblake@redhat.com> Message-Id: <1449033659-25497-14-git-send-email-eblake@redhat.com> [Simplified a bit as per discussion with Eric] Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Eric Blake authored
Rather than using just an array of strings, make enum.values be an array of the new QAPISchemaMember type, and add a helper member_names() method to get back at the original list of names. Likewise, creating an enum requires wrapping strings, via a new QAPISchema._make_enum_members() method. The benefit of wrapping enum members in a QAPISchemaMember Python object is that we now share the existing code for C name clash detection (although the code is not yet active until a later commit removes the earlier ad hoc parser checks). In a related change, the QAPISchemaMember._pretty_owner() method needs to learn about one more implicit type name: the generated enum associated with a simple union. In the interest of keeping the changes of this patch local to one file, the visitor interface still passes just a list of names rather than the full list of QAPISchemaMember instances. We may want to revisit this in the future, if the consistency with visit_object_type() is worth it. Signed-off-by:
Eric Blake <eblake@redhat.com> Message-Id: <1449033659-25497-12-git-send-email-eblake@redhat.com> [Eric's simplifying followup squashed in] Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Eric Blake authored
We want to share some clash detection code between enum values and object type members. To assist with that, split off part of QAPISchemaObjectTypeMember into a new base class QAPISchemaMember that tracks name, owner, and common clash detection code; while the former keeps the additional fields for type and optional flag. Signed-off-by:
Eric Blake <eblake@redhat.com> Message-Id: <1449033659-25497-11-git-send-email-eblake@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Eric Blake authored
For less code, reflect the determined boolean value of an optional visit back to the caller instead of making the caller read the boolean after the fact. The resulting generated code has the following diff: |- visit_optional(v, &has_fdset_id, "fdset-id"); |- if (has_fdset_id) { |+ if (visit_optional(v, &has_fdset_id, "fdset-id")) { | visit_type_int(v, &fdset_id, "fdset-id", &err); | if (err) { | goto out; | } | } Signed-off-by:
Eric Blake <eblake@redhat.com> Message-Id: <1449033659-25497-10-git-send-email-eblake@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Eric Blake authored
None of the visitor callbacks would set an error when testing if an optional field was present; make this part of the interface contract by eliminating the errp argument. The resulting generated code has a nice diff: |- visit_optional(v, &has_fdset_id, "fdset-id", &err); |- if (err) { |- goto out; |- } |+ visit_optional(v, &has_fdset_id, "fdset-id"); | if (has_fdset_id) { | visit_type_int(v, &fdset_id, "fdset-id", &err); | if (err) { | goto out; | } | } Signed-off-by:
Eric Blake <eblake@redhat.com> Message-Id: <1449033659-25497-9-git-send-email-eblake@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Eric Blake authored
The QMP input visitor allows integral values to be assigned by promotion to a QTYPE_QFLOAT. However, when parsing an alternate, we did not take this into account, such that an alternate that accepts 'number' and some other type, but not 'int', would reject integral values. With this patch, we now have the following desirable table: alternate has case selected for 'int' 'number' QTYPE_QINT QTYPE_QFLOAT no no error error no yes 'number' 'number' yes no 'int' error yes yes 'int' 'number' While it is unlikely that we will ever use 'number' in an alternate other than in the testsuite, it never hurts to be more precise in what we allow. Signed-off-by:
Eric Blake <eblake@redhat.com> Message-Id: <1449033659-25497-8-git-send-email-eblake@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Eric Blake authored
Now that alternates no longer use an implicit tag, we can inline _make_implicit_tag() into its one caller, _def_union_type(). No change to generated code. Suggested-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Eric Blake <eblake@redhat.com> Message-Id: <1449033659-25497-7-git-send-email-eblake@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Eric Blake authored
Previously, the generated code in qapi-types.c initialized all enum lookup tables first, prior to any other definitions. But there are no topological sorting requirements that mandate this layout, so we can drop the QAPISchemaGenTypeVisitor._fwdefn field and just generate all definitions in visitation order. The generated code shows some churn due to reordering, but it is still fairly straightforward to follow (all the deletions occur in one hunk, and all the deleted lines are re-inserted in the same order later in the same files, just spread across multiple insertion points). Suggested-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Eric Blake <eblake@redhat.com> Message-Id: <1449033659-25497-6-git-send-email-eblake@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-