qapi: Add Visitor interfaces for uint*_t and int*_t
This adds visitor interfaces for fixed-width integers types.Implementing these in visitors is optional, otherwise we fall back tovisit_type_int() (int64_t) with some additional bounds checking to avoid...
qapi: Unit tests for visitor-based serialization
Currently we test our visitors individually, and seperately for inputvs. output. This is useful for validating internal representationsagainst the native C types and vice-versa, and other visitor-specific...
qapi: String visitor, use %f representation for floats
Currently string-output-visitor formats floats as %g, which is nice inthat trailing 0's are automatically truncated, but otherwise this causessome issues:
- it uses 6 significant figures instead of 6 decimal places, which...
qapi: Add String visitor coverage to serialization unit tests
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
qdev: Use int32_t container for devfn property
Valid range for devfn is -1 to 255 (-1 for automatic assignment). We donot currently validate this due to devfn being stored as a uint32_t.This can lead to segfaults and other strange behavior.
We could technically just cast it to int32_t to implement the checking,...
Merge remote-tracking branch 'bonzini/nested-makefiles-3' into staging
target-microblaze: fix swx build breakage
The lazy initialisation of r_check was throwing an error on --enable-debug.Removed the lazy initialisation of r_check and swx_addr.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
build: do not create directories at configure time
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
build: compile oslib-obj-y once
There is no difference in oslib-obj-y between user-mode and systemtargets. There used to be when user-mode could optionally becompiled with PIE.
configure: ensure directory exists when creating symlink
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
build: move device tree to per-target Makefile.objs
build: libcacard Makefile cleanups
Build vscclient from toplevel Makefile, limit usage of vpath.
build: limit usage of vpath
All paths are now explicitly given, and the object tree mimicsthe source tree, so there is no need to apply special vpaths.
build: convert libhw to nested Makefile.objs
After this patch, the libhw* directories will have a hierarchythat mimics the source tree. This is useful because we do havea couple of files there that are in the top source directory.
build: move per-target hw/ objects to nested Makefile.objs
This completes the move to nested Makefiles for virtio and a fewother files that were not part of obj-TARGET-y, but still werecompiled separately for each target.
build: move qga/ objects to nested Makefile.objs
build: move target-independent hw/ objects to nested Makefile.objs
This patch starts converting the hw/ directory. Some files in hw/are compiled once, some twice (32-/64-bit), some once per target.Each category is moved in a separate patch.
After this patch, the files that are compiled once will show the...
build: move slirp/ objects to nested Makefile.objs
build: move qapi/ objects to nested Makefile.objs
build: move ui/ objects to nested Makefile.objs
build: move audio/ objects to nested Makefile.objs
build: move block/ objects to nested Makefile.objs
build: move net/ objects to nested Makefile.objs
build: move fsdev/ objects to nested Makefile.objs
build: move rules for nesting to Makefile.objs
At this point we will start adding nesting behavior to other filesthan Makefile.target. Because Makefile.objs is included byMakefile.target, it is simpler to move the processing ofsubdirectories there.
To enable this, only add per-target files to obj-y. Use a separate...
build: adapt qom/Makefile and move it to Makefile.objs
qom/ already used a separate makefile. Convert it to use relativepaths, and make it declare both common-obj-y and user-obj-y. Thisway, the upper makefiles do not need to know that some QOM filesare compiled twice....
build: move other target-*/ objects to nested Makefile.objs
dump: remove dumping stuff from cpu-all.h
This simplifies things, because they will only be included for softmmutargets and because the stubs are taken out-of-line in separate files,which in the future could even be compiled only once.
dump: change cpu_get_note_size to return ssize_t
So that it can use the same prototype in both cases.
dump: do not compile dump.o for user-mode emulation
It is not needed, because the monitor is not included.
Cc: Wen Congyang <wency@cn.fujitsu.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
build: move libobj-y variable to nested Makefile.objs
build: move obj-TARGET-y variables to nested Makefile.objs
Also drop duplicate occurrence of device-hotplug.o.
build: move *-user/ objects to nested Makefile.objs
build: add rules for nesting
This adds the 'magic' rules that take care of subdirectories.The subdirectory makefiles in the source tree are not complete; theyonly define some variables (listed in nested-vars) according to theconfiguration.
The magic rules descend into subdirectory makefiles and gather the...
build: do not sprinkle around GENERATED_HEADERS dependencies
Keeping GENERATED_HEADERS dependencies up-to-date everywhere is complex.We can simply make the Makefile depend on them, and they will be builtbefore all other targets.
build: remove trace-nested-y
Merge remote-tracking branch 'qmp/queue/qmp' into staging
Merge remote-tracking branch 'afaerber-or/qom-cpu-3' into staging
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
kvm: Fix build for non-CAP_IRQ_ROUTING targets
A type definition and a KVMState field initialization escaped therequired wrapping with KVM_CAP_IRQ_ROUTING. Also, we need to provide adummy kvm_irqchip_release_virq as virtio-pci references (but does notuse) it....
Revert "Revert "rtl8139: do the network/host communication only in normal operating mode""
This reverts commit 9c92bf7f6c3f675e60b8ba8a5287bb88ea1eac36.
Per Jason's request.
cpu-exec: Use cpu_reset() in cpu_exec() for TARGET_PPC
CPUState will be needed for all targets in the future, so place it intothe main variable declaration block.
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Alexander Graf <agraf@suse.de>
target-sparc: Let cpu_sparc_init() return SPARCCPU
Make include paths for cpu-qom.h consistent, so that SPARCCPU can beused in cpu.h.
Turn cpu_init macro into a static inline function returningCPUSPARCState for backwards compatibility.
Signed-off-by: Andreas Färber <afaerber@suse.de>...
sun4m: Use cpu_sparc_init() to obtain SPARCCPU
Needed for {main,secondary}_cpu_reset().
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Blue Swirl <blauwirbel@gmail.com>
sun4m: Pass SPARCCPU to {main,secondary}_cpu_reset()
We can now use cpu_reset() in place of cpu_state_reset().
sun4u: Use cpu_sparc_init() to obtain SPARCCPU
This prepares using it in sun4uv_init().
sun4u: Let cpu_devinit() return SPARCCPU
Needed for main_cpu_reset().
sun4u: Store SPARCCPU in ResetData
We can now use cpu_reset() in place of cpu_state_reset() inmain_cpu_reset().
leon3: Use cpu_sparc_init() to obtain SPARCCPU
leon3: Store SPARCCPU in ResetData
Allows us to use cpu_reset() in place of cpu_state_reset() inmain_cpu_reset().
bsd-user: Use cpu_reset() in after cpu_init()
Eliminates cpu_state_reset() usage.
linux-user: Use cpu_reset() after cpu_init() / cpu_copy()
Signed-off-by: Andreas Färber <afaerber@suse.de>
Kill off cpu_state_reset()
In commit 1bba0dc932e8826a7d030df3767daf0bc339f9a2 cpu_reset()was renamed to cpu_state_reset(), to allow introducing a new cpu_reset()that would operate on QOM objects.
All callers have been updated except for one in target-mips, so drop all...
spapr: Use cpu_ppc_init() to obtain PowerPCCPU
Needed for spapr_cpu_reset().
spapr: Pass PowerPCCPU to spapr_cpu_reset()
Allows us to use cpu_reset() in place of cpu_state_reset().
ppc440_bamboo: Use cpu_ppc_init() to obtain PowerPCCPU
ppc440_bamboo: Pass PowerPCCPU to main_cpu_reset()
ppc4xx_devs: Use cpu_ppc_init() to obtain PowerPCCPU
Needed for ppc4xx_reset().
ppc4xx_devs: Pass PowerPCCPU to ppc4xx_reset()
ppc_newworld: Use cpu_ppc_init() to obtain PowerPCCPU
Needed for ppc_core99_reset().
ppc_newworld: Pass PowerPCCPU to ppc_core99_reset()
ppc_oldworld: Use cpu_ppc_init() to obtain PowerPCCPU
Needed for ppc_heathrow_reset().
ppc_oldworld: Pass PowerPCCPU to ppc_heathrow_reset()
ppc_prep: Use cpu_ppc_init() to obtain PowerPCCPU
Needed for ppc_prep_reset().
ppc_prep: Pass PowerPCCPU to ppc_prep_reset()
virtex_ml507: Use cpu_ppc_init() to obtain PowerPCCPU
Needed to change ppc440_init_xilinx() return type.
virtex_ml507: Let ppc440_init_xilinx() return PowerPCCPU
virtex_ml507: Pass PowerPCCPU to main_cpu_reset()
Allows us to call cpu_reset() in place of cpu_state_reset().
r2d: Use cpu_sh4_init() to obtain SuperHCPU
r2d: Store SuperHCPU in ResetData
target-mips: Use cpu_reset() in cpu_mips_init()
Commit 0f71a7095db6bc055bc5bb520d85ea650cca8a33 (target-mips: QOM'ifyCPU) hooked up cpu_state_reset() to CPUClass::reset(). Dropping theintroduction of subclasses for 1.1, due to mips_def_t the reset code...
target-mips: Use cpu_reset() in do_interrupt()
target-mips: Let cpu_mips_init() return MIPSCPU
Turn cpu_init macro into a static inline function returning CPUMIPSStatefor backwards compatibility.
mips_fulong2e: Use cpu_mips_cpu() to obtain MIPSCPU
mips_fulong2e: Pass MIPSCPU to main_cpu_reset()
mips_jazz: Use cpu_mips_init() to obtain MIPSCPU
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Hervé Poussineau <hpoussin@reactos.org>
mips_jazz: Pass MIPSCPU to main_cpu_reset()
mips_malta: Use cpu_mips_init() to obtain MIPSCPU
mips_malta: Pass MIPSCPU to main_cpu_reset()
mips_mipssim: Use cpu_mips_init() to obtain MIPSCPU
mips_mipssim: Store MIPSCPU in ResetData
mips_r4k: Use cpu_mips_init() to obtain MIPSCPU
mips_r4k: Store MIPSCPU in ResetData
target-ppc: Let cpu_ppc_init() return PowerPCCPU
Adapt e500 mpc8544ds machine accordingly.
Turn cpu_init() into a static inline function returning CPUPPCState forbackwards compatibility.
ppce500_mpc8544ds: Pass PowerPCCPU to mpc8544ds_cpu_reset[_sec]
xtensa_lx60: Pass XtensaCPU to lx60_reset()
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Max Filippov <jcmvbkbc@gmail.com>
target-cris: Reindent cpu_cris_init()
Judging by TCG variable initialization it used 8-char tabs; use 4 spacesinstead. Also remove trailing whitespace.
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
target-cris: Let cpu_cris_init() return CRISCPU
Turn cpu_init macro into a static inline function returning CPUCRISStatefor backwards compatibility.
axis_dev88: Use cpu_cris_init() to obtain CRISCPU
Needed for cris_load_image().
cris-boot: Pass CRISCPU to cris_load_image()
cris-boot: Pass CRISCPU to main_cpu_reset().
target-microblaze: Let cpu_mb_init() return MicroBlazeCPU
Since qemu_init_vcpu() is no-op for CONFIG_USER_ONLY drop the envvariable that is now unused there.
Turn cpu_init macro into a static inline function returning CPUMBStatefor backwards compatibility....
petalogix_ml605: Use cpu_mb_init() to obtain MicroBlazeCPU
Needed for microblaze_load_kernel().
petalogix_s3adsp1800_mmu: Use cpu_mb_init() to obtain MicroBlazeCPU
microblaze_boot: Pass MicroBlazeCPU to microblaze_load_kernel()
Also pass it through to its reset callbacks, while at it.
target-i386: Pass X86CPU to do_cpu_{init,sipi}()
Allows to use cpu_reset() in place of cpu_state_reset().
Signed-off-by: Andreas Färber <afaerber@suse.de>Reviewed-by: Igor Mammedov <imammedo@redhat.com>
target-i386: Let cpu_x86_init() return X86CPU
Turn cpu_init macro into a static inline function returning CPUX86Statefor backwards compatibility.
pc: Use cpu_x86_init() to obtain X86CPU
Needed for pc_cpu_reset().
Also change return type to X86CPU.
pc: Pass X86CPU to pc_cpu_reset()
target-sh4: Let cpu_sh4_init() return SuperHCPU
Turn cpu_init macro into a static inline function returningCPUSH4State for backwards compatibility.