allow qemu_iovec_from_buffer() to specify offset from which to start copying
Similar to qemu_iovec_memset(QEMUIOVector *qiov, size_t offset, int c, size_t bytes);the new prototype is: qemu_iovec_from_buf(QEMUIOVector *qiov, size_t offset,...
consolidate qemu_iovec_copy() and qemu_iovec_concat() and make them consistent
qemu_iovec_concat() is currently a wrapper forqemu_iovec_copy(), use the former (with extra"0" arg) in a few places where it is used.
Change skip argument of qemu_iovec_copy() from...
change qemu_iovec_to_buf() to match other to,from_buf functions
It now allows specifying offset within qiov to start from andamount of bytes to copy. Actual implementation is just a callto iov_to_buf().
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
rename qemu_sendv to iov_send, change proto and move declarations to iov.h
Rename arguments and use size_t for sizes instead of int,from int qemu_sendv(int sockfd, struct iovec *iov, int len, int iov_offset)to ssize_t iov_send(int sockfd, struct iovec *iov,...
export iov_send_recv() and use it in iov_send() and iov_recv()
Rename do_sendv_recvv() to iov_send_recv(), change its last arg(do_send) from int to bool, export it in iov.h, and made the twocallers of it (iov_send() and iov_recv()) to be trivial #defines...
consolidate qemu_iovec_memset{,_skip}() into single function and use existing iov_memset()
This patch combines two functions into one, and replacesthe implementation with already existing iov_memset() fromiov.c.
The new prototype of qemu_iovec_memset():...
rewrite iov_* functions
This changes implementations of all iov_*functions, completing the previous step.
All iov_* functions now ensure that this offsetargument is within the iovec (using assertion),but lets to specify `bytes' value larger thanactual length of the iovec - in this case they...
change iov_* function prototypes to be more appropriate
Reorder arguments to be more natural, readable andconsistent with other iov_* functions, and changeargument names, from: iov_from_buf(iov, iov_cnt, buf, iov_off, size)to iov_from_buf(iov, iov_cnt, offset, buf, bytes)...
virtio-serial-bus: use correct lengths in control_out() message
Original code has one thing to process (cur_len), requests toconvert from iovec to buf another thing (len which is actually max_len),and processes something else (copied). Whole thing is very difficult...
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>
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.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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.
omap: Use cpu_arm_init() to store ARMCPU in omap_mpu_state_s
Fix tab indentations of comments, add braces, use cpu_reset().
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Peter Maydell <peter.maydell@linaro.org>
armv7m: Use cpu_arm_init() to obtain ARMCPU
Needed for armv7m_reset().
armv7m: Pass ARMCPU to armv7m_reset()
arm_boot: Pass ARMCPU to do_cpu_reset()
target-lm32: Let cpu_lm32_init() return LM32CPU
Make the include paths for cpu-qom.h consistent to allow using LM32CPUin cpu.h.
Turn cpu_init macro into a static inline function returning CPULM32Statefor backwards compatibility.
lm32_boards: Use cpu_lm32_init() to obtain LM32CPU
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Michael Walle <michael@walle.cc>
lm32_boards: Store LM32CPU in ResetInfo
milkymist: Use cpu_lm32_init() to obtain LM32CPU
milkymist: Store LM32 in ResetInfo
target-xtensa: Let cpu_xtensa_init() return XtensaCPU
Make the include paths for cpu-qom.h consistent to allow using XtensaCPUin cpu.h.
Turn cpu_init macro into a static inline function returningCPUXtensaState for backwards compatibility.
xtensa_sim: Use cpu_xtensa_init() to obtain XtensaCPU
Needed for sim_reset().
xtensa_sim: Pass XtensaCPU to sim_reset()
xtensa_lx60: Use cpu_xtensa_init() to obtain XtensaCPU
target-arm: Use cpu_reset() in cpu_arm_init()
Commit 3c30dd5a68e9fee6af67cfd0d14ed7520820f36a (target-arm: Move resethandling to arm_cpu_reset) QOM'ified CPU reset. Complete it by replacingcpu_state_reset() with cpu_reset().
pxa2xx: Use cpu_arm_init() and store ARMCPU
Also use cpu_reset() in place of cpu_state_reset().
qemu-config: introduce qemu_find_opts_err()
This is like qemu_find_opts(), except that it takes an Error argument.
This new function allows for a incremental conversion of code usingqemu_find_opts().
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>...
net: purge the monitor object from all init functions
The only backend that really uses it is the socket one, which callsmonitor_get_fd(). But it can use 'cur_mon' instead.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Reviewed-By: Laszlo Ersek <lersek@redhat.com>
net: net_client_init(): use error_set()
Callers are changed to use qerror_report_err() to keep their QErrorsemantics.
qapi: convert netdev_add
This is not a full QAPI conversion, but an intermediate step.
In essence, do_netdev_add() is split into three functions:
1. netdev_add(): performs the actual work. This function is fully converted to Error (thus, it's "qapi-friendly")...
qapi: convert netdev_del
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Reviewed-By: Laszlo Ersek <lersek@redhat.com>
Add 'query-events' command to QMP to query async events
Sometimes it is neccessary for an application to determinewhether a particular QMP event is available, so they candecide whether to use compatibility code instead. Thisintroduces a new 'query-events' command to QMP to do just...
qemu-option: opt_set(): use error_set()
The functions qemu_opt_set() and opts_do_parse() both call opt_set(),but their callers expect QError semantics. Thus, both functions callqerro_report_err() to keep the expected semantics.
qemu-option: introduce qemu_opt_set_err()
This is like qemu_opt_set(), except that it takes an Error argument.
This new function allows for a incremental conversion of code usingqemu_opt_set().
qemu-option: qemu_opts_from_qdict(): use error_set()
do_device_add() and do_netdev_add() call qerror_report_err() to maintaintheir QError semantics.
qerror: introduce QERR_INVALID_OPTION_GROUP
qemu-config: find_list(): use error_set()
Note that qemu_find_opts() and qemu_config_parse() need to callerror_report() to maintain their semantics on error.