summary refs log tree commit diff stats
path: root/include (follow)
Commit message (Collapse)AuthorAgeFilesLines
* qemu-option: move standard option definitions out of qemu-config.cPaolo Bonzini2013-01-122-5/+8
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* pixman: fix warningGerd Hoffmann2013-01-121-0/+7
| | | | | | | Cc: afaerber@suse.de Cc: agraf@suse.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* bswap: Rewrite cpu_to_<endian><type>u with {ld,st}<type>_<endian>_pRichard Henderson2013-01-121-94/+53
| | | | | | | | | We've now optimized the ld/st versions; reuse that for the "legacy" versions. Always use inlines so that we get the type checking that we expect. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* bswap: Rewrite all ld<type>_<endian>_p functionsRichard Henderson2013-01-121-270/+30
| | | | | | | | | | Use the new host endian unaligned access functions instead of open coding byte-by-byte references. Remove assembly special cases for i386 and ppc -- we've now exposed the operation to the compiler sufficiently for these to be optimized automatically. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* bswap: Add host endian unaligned access functionsRichard Henderson2013-01-121-1/+50
| | | | | Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* bswap: Tidy base definitions of bswapNRichard Henderson2013-01-121-42/+30
| | | | | | | | | | | Move the bswap_N -> bswapN wrappers inside CONFIG_BYTESWAP_H. Change the ultimate fallback defintions from macros to inline functions. The proper types recieved by the function arguments means we can remove unnecessary casts, making the code more readable. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* fdt: Use bswapN instead of bswap_NRichard Henderson2013-01-121-8/+8
| | | | | | | | | | | | Fixes the libfdt enabled build for hosts that have <machine/bswap.h>. The code at the beginning of qemu/bswap.h is attempting to standardize on bswapN. In the case of CONFIG_MACHINE_BSWAP_H, this is all we get. In the case of CONFIG_BYTESWAP_H, we get bswap_N from the system header and then wrap these with inline functions to get bswapN. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Make all static TypeInfos constAndreas Färber2013-01-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | Since 39bffca2030950ef6efe57c2fac8327a45ae1015 (qdev: register all types natively through QEMU Object Model), TypeInfo as used in the common, non-iterative pattern is no longer amended with information and should therefore be const. Fix the documented QOM examples: sed -i 's/static TypeInfo/static const TypeInfo/g' include/qom/object.h Since frequently the wrong examples are being copied by contributors of new devices, fix all types in the tree: sed -i 's/^static TypeInfo/static const TypeInfo/g' */*.c sed -i 's/^static TypeInfo/static const TypeInfo/g' */*/*.c This also avoids to piggy-back these changes onto real functional changes or other refactorings. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu-common.h: Make qemu_init_vcpu() stub static inlineAndreas Färber2013-01-081-1/+3
| | | | | | | | | | | | | Turn the *-user macro into a no-op inline function to avoid unused-variable warnings and band-aiding #ifdef'ery. This allows to drop an #ifdef for alpha and avoids more for unicore32 and other upcoming trivial realizefn implementations. Suggested-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
* cpu: Change parent type to DeviceEduardo Habkost2013-01-081-3/+3
| | | | | | | | | | | This finally makes the CPU class a subclass of the Device class, allowing us to start using DeviceState properties on CPU subclasses. It has no_user=1, as creating CPUs using -device doesn't work yet. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* softfloat: Implement uint64_to_float128Richard Henderson2013-01-051-0/+3
| | | | | | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* iov: add qemu_iovec_concat_iov()Stefan Hajnoczi2013-01-021-0/+3
| | | | | | | | | | | | | The qemu_iovec_concat() function copies a subset of a QEMUIOVector. The new qemu_iovec_concat_iov() function does the same for a iov/cnt pair. It is easy to define qemu_iovec_concat() in terms of qemu_iovec_concat_iov(). The existing code is mostly unchanged, except for the assertion src->size >= soffset, which cannot be efficiently checked upfront on a iov/cnt pair. Instead we assert upon hitting the end of src with an unsatisfied soffset. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* iov: add iov_discard_front/back() to remove dataStefan Hajnoczi2013-01-021-0/+13
| | | | | | | | The iov_discard_front/back() functions remove data from the front or back of the vector. This is useful when peeling off header/footer structs. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* raw-posix: add raw_get_aio_fd() for virtio-blk-data-planeStefan Hajnoczi2013-01-021-0/+9
| | | | | | | | | | | The raw_get_aio_fd() function allows virtio-blk-data-plane to get the file descriptor of a raw image file with Linux AIO enabled. This interface is really a layering violation that can be resolved once the block layer is able to run outside the global mutex - at that point virtio-blk-data-plane will switch from custom Linux AIO code to using the block layer. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* Disable semaphores fallback code for OpenBSDBrad Smith2012-12-281-1/+1
| | | | | | | | Disable the semaphores fallback code for OpenBSD as modern OpenBSD releases now have sem_timedwait(). Signed-off-by: Brad Smith <brad@comstyle.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Merge branch 'master' of git://git.qemu.org/qemu into qom-cpuAndreas Färber2012-12-23134-7/+18283
|\ | | | | | | | | | | Adapt header include paths. Signed-off-by: Andreas Färber <afaerber@suse.de>
| * migration: merge QEMUFileBuffered into MigrationStateJuan Quintela2012-12-201-0/+8
| | | | | | | | | | | | | | | | | | Avoid splitting the state of outgoing migration, more or less arbitrarily, between two data structures. QEMUFileBuffered anyway is used only during migration. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
| * memory: introduce memory_region_test_and_clear_dirtyJuan Quintela2012-12-201-0/+16
| | | | | | | | | | | | | | This function avoids having to do two calls, one to test the dirty bit, and other to reset it. Signed-off-by: Juan Quintela <quintela@redhat.com>
| * migration: Inline qemu_fopen_ops_buffered into migrate_fd_connectJuan Quintela2012-12-201-2/+0
| | | | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com>
| * migration: move migration_fd_put_ready()Juan Quintela2012-12-201-1/+0
| | | | | | | | | | | | Put it near its use and un-export it. Signed-off-by: Juan Quintela <quintela@redhat.com>
| * migration: move buffered_file.c code into migration.cJuan Quintela2012-12-201-0/+1
| | | | | | | | | | | | | | This only moves the code (also from buffered_file.h to migration.h). Fix whitespace until checkpatch is happy. Signed-off-by: Juan Quintela <quintela@redhat.com>
| * savevm: New save live migration method: pendingJuan Quintela2012-12-203-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code just now does (simplified for clarity) if (qemu_savevm_state_iterate(s->file) == 1) { vm_stop_force_state(RUN_STATE_FINISH_MIGRATE); qemu_savevm_state_complete(s->file); } Problem here is that qemu_savevm_state_iterate() returns 1 when it knows that remaining memory to sent takes less than max downtime. But this means that we could end spending 2x max_downtime, one downtime in qemu_savevm_iterate, and the other in qemu_savevm_state_complete. Changed code to: pending_size = qemu_savevm_state_pending(s->file, max_size); DPRINTF("pending size %lu max %lu\n", pending_size, max_size); if (pending_size >= max_size) { ret = qemu_savevm_state_iterate(s->file); } else { vm_stop_force_state(RUN_STATE_FINISH_MIGRATE); qemu_savevm_state_complete(s->file); } So what we do is: at current network speed, we calculate the maximum number of bytes we can sent: max_size. Then we ask every save_live section how much they have pending. If they are less than max_size, we move to complete phase, otherwise we do an iterate one. This makes things much simpler, because now individual sections don't have to caluclate the bandwidth (it was implossible to do right from there). Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
| * migration: remove unfreeze logicJuan Quintela2012-12-201-1/+0
| | | | | | | | | | | | | | | | Now that we have a thread, and blocking writes, we don't need it. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
| * migration: make writes blockingJuan Quintela2012-12-201-5/+0
| | | | | | | | | | | | | | | | Move all the writes to the migration_thread, and make writings blocking. Notice that are still using the iothread for everything that we do. Signed-off-by: Juan Quintela <quintela@redhat.com>
| * migration: move migration thread init code to migrate_fd_put_readyJuan Quintela2012-12-201-0/+1
| | | | | | | | | | | | | | This way everything related with migration is run on the migration thread and no locking is needed. Signed-off-by: Juan Quintela <quintela@redhat.com>
| * migration: make qemu_fopen_ops_buffered() return voidJuan Quintela2012-12-201-0/+1
| | | | | | | | | | | | | | | | | | We want the file assignment to happen before the thread is created to avoid locking, so we just do it before creating the thread. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
| * protect the ramlist with a separate mutexUmesh Deshpande2012-12-201-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | Add the new mutex that protects shared state between ram_save_live and the iothread. If the iothread mutex has to be taken together with the ramlist mutex, the iothread shall always be _outside_. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Umesh Deshpande <udeshpan@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
| * add a version number to ram_listUmesh Deshpande2012-12-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | This will be used to detect if last_block might have become invalid across different calls to ram_save_live. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Umesh Deshpande <udeshpan@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
| * exec: change RAM list to a TAILQPaolo Bonzini2012-12-201-2/+2
| | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
| * exec: change ramlist from MRU order to a 1-item cachePaolo Bonzini2012-12-201-0/+1
| | | | | | | | | | | | | | | | | | Most of the time, only 2 items will be active (from/to for a string operation, or code/data). But TCG guests likely won't have gigabytes of memory, so this actually goes down to 1 item. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
| * Merge remote-tracking branch 'bonzini/header-dirs' into stagingAnthony Liguori2012-12-19134-7/+18246
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bonzini/header-dirs: (45 commits) janitor: move remaining public headers to include/ hw: move executable format header files to hw/ fpu: move public header file to include/fpu softmmu: move remaining include files to include/ subdirectories softmmu: move include files to include/sysemu/ misc: move include files to include/qemu/ qom: move include files to include/qom/ migration: move include files to include/migration/ monitor: move include files to include/monitor/ exec: move include files to include/exec/ block: move include files to include/block/ qapi: move include files to include/qobject/ janitor: add guards to headers qapi: make struct Visitor opaque qapi: remove qapi/qapi-types-core.h qapi: move inclusions of qemu-common.h from headers to .c files ui: move files to ui/ and include/ui/ qemu-ga: move qemu-ga files to qga/ net: reorganize headers net: move net.c to net/ ... Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| | * janitor: move remaining public headers to include/Paolo Bonzini2012-12-194-0/+1767
| | | | | | | | | | | | | | | | | | | | | Headers in the root directory are now used only from within that directory. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| | * fpu: move public header file to include/fpuPaolo Bonzini2012-12-192-1/+639
| | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| | * softmmu: move remaining include files to include/ subdirectoriesPaolo Bonzini2012-12-192-0/+274
| | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| | * softmmu: move include files to include/sysemu/Paolo Bonzini2012-12-1916-1/+1343
| | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| | * misc: move include files to include/qemu/Paolo Bonzini2012-12-1960-38/+4359
| | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| | * qom: move include files to include/qom/Paolo Bonzini2012-12-195-4/+4
| | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| | * migration: move include files to include/migration/Paolo Bonzini2012-12-196-1/+1035
| | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| | * monitor: move include files to include/monitor/Paolo Bonzini2012-12-195-4/+160
| | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| | * exec: move include files to include/exec/Paolo Bonzini2012-12-1923-0/+4065
| | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| | * block: move include files to include/block/Paolo Bonzini2012-12-199-0/+1743
| | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| | * qapi: move include files to include/qobject/Paolo Bonzini2012-12-1927-5/+1208
| | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| | * ui: move files to ui/ and include/ui/Paolo Bonzini2012-12-195-0/+790
| | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| | * net: reorganize headersPaolo Bonzini2012-12-195-0/+376
| | | | | | | | | | | | | | | | | | | | | | | | | | | Move public headers to include/net, and leave private headers in net/. Put the virtio headers in include/net/tap.h, removing the multiple copies that existed. Leave include/net/tap.h as the interface for NICs, and net/tap_int.h as the interface for OS-specific parts of the tap backend. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| | * build: kill libdis, move disassemblers to disas/Paolo Bonzini2012-12-192-0/+526
| |/ | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* | cpu: Move kvm_run into CPUStateAndreas Färber2012-12-191-0/+2
| | | | | | | | | | | | Pass CPUState / {X86,S390}CPU to helper functions. Signed-off-by: Andreas Färber <afaerber@suse.de>
* | cpu: Move kvm_state field into CPUStateAndreas Färber2012-12-191-0/+3
| | | | | | | | | | | | Adapt some functions to take CPUState / {PowerPC,S390}CPU argument. Signed-off-by: Andreas Färber <afaerber@suse.de>
* | kvm: Pass CPUState to kvm_arch_*Andreas Färber2012-12-191-0/+1
| | | | | | | | | | | | | | Move kvm_vcpu_dirty field into CPUState to simplify things and change its type to bool while at it. Signed-off-by: Andreas Färber <afaerber@suse.de>
* | cpu: Move kvm_fd into CPUStateAndreas Färber2012-12-191-0/+5
|/ | | | Signed-off-by: Andreas Färber <afaerber@suse.de>
* stream: fix ratelimit_set_speedDietmar Maurer2012-11-301-1/+1
| | | | | | | | The formula to compute slice_quota was wrong since commit 6ef228fc. Signed-off-by: Dietmar Maurer <dietmar@proxmox.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>