cpu: Change parent type to Device
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>...
softfloat: Implement uint64_to_float128
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()
The qemu_iovec_concat() function copies a subset of a QEMUIOVector. Thenew qemu_iovec_concat_iov() function does the same for a iov/cnt pair.
It is easy to define qemu_iovec_concat() in terms ofqemu_iovec_concat_iov(). The existing code is mostly unchanged, except...
iov: add iov_discard_front/back() to remove data
The iov_discard_front/back() functions remove data from the front orback of the vector. This is useful when peeling off header/footerstructs.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
raw-posix: add raw_get_aio_fd() for virtio-blk-data-plane
The raw_get_aio_fd() function allows virtio-blk-data-plane to get thefile descriptor of a raw image file with Linux AIO enabled. Thisinterface is really a layering violation that can be resolved once the...
Disable semaphores fallback code for OpenBSD
Disable the semaphores fallback code for OpenBSD as modern OpenBSDreleases 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-cpu
Adapt header include paths.
Signed-off-by: Andreas Färber <afaerber@suse.de>
migration: merge QEMUFileBuffered into MigrationState
Avoid splitting the state of outgoing migration, more or less arbitrarily,between two data structures. QEMUFileBuffered anyway is used only duringmigration.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
migration: move migration_fd_put_ready()
Put it near its use and un-export it.
Signed-off-by: Juan Quintela <quintela@redhat.com>
migration: Inline qemu_fopen_ops_buffered into migrate_fd_connect
memory: introduce memory_region_test_and_clear_dirty
This function avoids having to do two calls, one to test the dirty bit, andother to reset it.
migration: move buffered_file.c code into migration.c
This only moves the code (also from buffered_file.h to migration.h).Fix whitespace until checkpatch is happy.
migration: make qemu_fopen_ops_buffered() return void
We want the file assignment to happen before the thread is created toavoid locking, so we just do it before creating the thread.
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
migration: move migration thread init code to migrate_fd_put_ready
This way everything related with migration is run on the migrationthread and no locking is needed.
migration: make writes blocking
Move all the writes to the migration_thread, and make writingsblocking. Notice that are still using the iothread for everythingthat we do.
migration: remove unfreeze logic
Now that we have a thread, and blocking writes, we don't need it.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
savevm: New save live migration method: pending
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...
exec: change RAM list to a TAILQ
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Juan Quintela <quintela@redhat.com>
add a version number to ram_list
This will be used to detect if last_block might have become invalidacross 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>...
protect the ramlist with a separate mutex
Add the new mutex that protects shared state between ram_save_liveand the iothread. If the iothread mutex has to be taken togetherwith the ramlist mutex, the iothread shall always be outside.
exec: change ramlist from MRU order to a 1-item cache
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, sothis actually goes down to 1 item.
Merge remote-tracking branch 'bonzini/header-dirs' into staging
cpu: Move kvm_state field into CPUState
Adapt some functions to take CPUState / {PowerPC,S390}CPU argument.
cpu: Move kvm_run into CPUState
Pass CPUState / {X86,S390}CPU to helper functions.
cpu: Move kvm_fd into CPUState
kvm: Pass CPUState to kvm_arch_*
Move kvm_vcpu_dirty field into CPUState to simplify things and changeits type to bool while at it.
softmmu: move remaining include files to include/ subdirectories
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
fpu: move public header file to include/fpu
janitor: move remaining public headers to include/
Headers in the root directory are now used only from within thatdirectory.
softmmu: move include files to include/sysemu/
misc: move include files to include/qemu/
monitor: move include files to include/monitor/
migration: move include files to include/migration/
qom: move include files to include/qom/
qapi: move include files to include/qobject/
block: move include files to include/block/
exec: move include files to include/exec/
ui: move files to ui/ and include/ui/
net: reorganize headers
Move public headers to include/net, and leave private headers in net/.Put the virtio headers in include/net/tap.h, removing the multiple copiesthat existed. Leave include/net/tap.h as the interface for NICs, andnet/tap_int.h as the interface for OS-specific parts of the tap backend....
build: kill libdis, move disassemblers to disas/
stream: fix ratelimit_set_speed
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>
virtio-rng: fix typos, comments
Fix typos, whitespace and update comments to match currentimplementation.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qom: make object_finalize static
It is not used anymore, and there is no need to make it public.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: move bus removal to object_unparent
Add an ObjectClass method that is done at object_unparent time. Itshould remove any backlinks to the object in the composition tree,so that object_delete will be able to drop the last reference andfree the object....
qom: make object_delete usable for statically-allocated objects
Store in the object the freeing function that will be used at deletiontime. This makes it possible to use object_delete on statically-allocated(embedded) objects. Dually, it makes it possible to use object_unparent...
rng-random: add an RNG backend that uses /dev/random (v3)
The filename can be overridden but it expects a non-blocking source of entropy.A typical invocation would be:
qemu -object rng-random,id=rng0 -device virtio-rng-pci,rng=rng0
This can also be used with /dev/urandom by using the command line:...
object: add object_property_add_bool (v2)
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>---v1 -> v2 - Fix whitespace (Andreas Faerber)
rng: add RndBackend abstract object class
This is the backend used by devices that need to request entropy.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
cpus: Pass CPUState to run_on_cpu()
CPUArchState is no longer needed.
Move the declaration to include/qemu/cpu.h and add documentation.
cpu: Move thread_id to CPUState
cpus: Pass CPUState to [qemu_]cpu_has_work()
For target-mips also change the return type to bool.
Make include paths for cpu-qom.h consistent for alpha and unicore32.
Signed-off-by: Andreas Färber <afaerber@suse.de>[AF: Updated new target-openrisc function accordingly]...
cpus: Pass CPUState to qemu_cpu_kick()
CPUArchState is no longer needed there.
cpu: Move queued_work_{first,last} to CPUState
cpu: Move created field to CPUState
Change its type to bool.
cpu: Move stop field to CPUState
cpu: Move stopped field to CPUState
cpus: Pass CPUState to cpu_is_stopped()
Also change the return type to bool.
cpu: Move halt_cond to CPUState
cpus: Pass CPUState to qemu_cpu_is_self()
Change return type to bool, move to include/qemu/cpu.h andadd documentation.
Signed-off-by: Andreas Färber <afaerber@suse.de>Reviewed-by: Igor Mammedov <imammedo@redhat.com>[AF: Updated new caller qemu_in_vcpu_thread()]
Merge remote-tracking branch 'quintela/migration-next-20120808' into staging
qom: Reimplement Interfaces
The current implementation of Interfaces is poorly designed. Each interfacethat an object implements ends up being an object that's tracked by theimplementing object. There's all sorts of gymnastics to deal with castingbetween these objects....
Add cache handling functions
Add MRU page cache mechanism.The page are accessed by their address.
Signed-off-by: Benoit Hudzia <benoit.hudzia@sap.com>Signed-off-by: Petter Svard <petters@cs.umu.se>Signed-off-by: Aidan Shribman <aidan.shribman@sap.com>...
cpu: Move thread_kicked to CPUState
Change field type to bool.
cpu: Move CPU_COMMON_THREAD into CPUState
CPU_COMMON_THREAD was only used for Windows, adding an hThread fieldto CPU_COMMON.
Move the field into QOM CPUState and change its type to HANDLE,which it is assigned from. This requires Windows headers, pulled in...
cpu: Move thread field into CPUState
Merge remote-tracking branch 'afaerber-or/qom-next-2' into staging
qdev: Remove qdev_prop_exists()
Can be replaced everywhere with object_property_find().
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
qom: Push error reporting to object_property_find()
Avoids duplicated error_set().
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>[AF: Also drop error_set() in object_property_del().]Signed-off-by: Andreas Färber <afaerber@suse.de>
qom: Add class_base_init
The class_base_init TypeInfo callback was present in one of the earlyQOM versions but removed (on my request...) before committing. Wewill need it soon, add it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
qom: Make Object a type
Right now the base Object class has a special NULL type. Change this sothat we will be able to add class_init and class_base_init callbacks.To do this, remove some special casing of ObjectClass that is not reallynecessary.
qom: Drop type_register_static_alias() macro
It's unused.
qom: Add object_class_get_parent()
This simple bit of functionality was missing and we'll need it soon,so add it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>[AF: Document possible NULL return value]...
qom: Add object_child_foreach()
A utility function that will be used to implement hierarchical realization.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>[AF: Drop unrelated whitespace change, add Returns: in documentation]...
stream: move rate limiting to a separate header file
Make the code reusable.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qom: Documentation addition for object_class_by_name()
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>[AF: Document the possible NULL return value]Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Update documentation and comment
State struct CPU had been renamed to CPUState, former CPUState toCPUArchState.
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qom: Refine container_get() to allow using a custom root
Specify the root to search from as argument. This avoids hardcoding"/machine" in some places and makes it more flexible.
Signed-off-by: Andreas Färber <afaerber@suse.de>Cc: Paolo Bonzini <pbonzini@redhat.com>...
qom: add container_get
This is QOM "mkdir -p". It is useful when referring tocontainer objects such as "/machine".
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qom: Introduce CPU class
Reintroduce CPUState as QOM object: It's abstract and derived directlyfrom TYPE_OBJECT for compatibility with the user emulators.The identifier CPUState avoids conflicts between CPU and the struct.
Introduce $(qom-twice-y) to build it separately for system and for user...
qom: Introduce object_class_get_list()
This function allows to obtain a singly-linked list of classes, whichcan be sorted by the caller.
Signed-off-by: Andreas Färber <afaerber@suse.de>Cc: Anthony Liguori <anthony@codemonkey.ws>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Spelling fixes in comments (it's -> its)
Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Stefan Weil <sw@weilnetz.de>...
qom: Fix spelling in documentation
This fixes a new spelling issue which was detected by codespell.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
qom: Document ways to retrieve child object added by object_property_add_child()
object_property_add_child() creates a property whose values as a string isthe child object's canonical path.
Acked-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Alexander Barabash <alexander_barabash@mentor.com>...
qom: add generic string parsing/printing
Add generic property accessors that take a string and parse itappropriately for the property type. All the magic here is doneby the new string-based visitors.
qom: Fix typo in Object's documentation
Fixes a warning from gtk-doc.
qom: Fix identifiers in documentation
Fixes gtk-doc warnings.
qom: Unify type registration
Replace device_init() with generalized type_init().
While at it, unify naming convention: type_init([$prefix_]register_types)Also, type_init() is a function, so add preceding blank line wherenecessary and don't put a semicolon after the closing brace....
qom: add object_resolve_path_type
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qom: add property get/set wrappers for links
These can set a link to any object, as long as it is included inthe composition tree.
qom: add QObject-based property get/set wrappers
Move the creation of QmpInputVisitor and QmpOutputVisitor from qmp.cto qom/object.c, since it's the only practical way to access objectproperties.
Keep this isolated such that it's easy to remove. At some point, we need...
qom: add property get/set wrappers for C types
Add wrappers that let you get/set properties using normal C data types.
Reviewed-by: Anthony Liguori <anthony@aliguori@us.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qom: more documentation on subclassing
qom: clean up cast macros
qom: move properties from qdev to object
This is mostly code movement although not entirely. This makes properties partof the Object base class which means that we can now start using Object in ameaningful way outside of qdev.
qdev: register all types natively through QEMU Object Model
This was done in a mostly automated fashion. I did it in three steps and thenrebased it into a single step which avoids repeatedly touching every file inthe tree.
The first step was a sed-based addition of the parent type to the subclass...
qom: allow object_class_foreach to take additional parameters to refine search
qom: add the base Object class (v2)
This class provides the main building block for QEMU Object Model and isextensively documented in the header file. It is largely inspired by GObject.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>---v1 -> v2...