summaryrefslogtreecommitdiffstats
path: root/arch_init.c
Commit message (Collapse)AuthorAgeFilesLines
* migration: Add dirty_pages_rate to query migrate outputJuan Quintela2012-10-171-0/+18
| | | | | | It indicates how many pages were dirtied during the last second. Signed-off-by: Juan Quintela <quintela@redhat.com>
* Separate migration bitmapJuan Quintela2012-10-171-20/+43
| | | | | | | | | | | | | | | | This patch creates a migration bitmap, which is periodically kept in sync with the qemu bitmap. A separate copy of the dirty bitmap for the migration limits the amount of concurrent access to the qemu bitmap from iothread and migration thread (which requires taking the big lock). We use the qemu bitmap type. We have to "undo" the dirty_pages counting optimization on the general dirty bitmap and do the counting optimization with the migration local bitmap. Signed-off-by: Umesh Deshpande <udeshpan@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
* ram: create trace event for migration sync bitmapJuan Quintela2012-10-171-0/+6
| | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
* ram: introduce migration_bitmap_sync()Juan Quintela2012-10-171-2/+8
| | | | | | | | | Helper that we use each time that we need to syncronize the migration bitmap with the other dirty bitmaps. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
* ram: Introduce migration_bitmap_test_and_reset_dirty()Juan Quintela2012-10-171-5/+14
| | | | | | | | | It just test if the dirty bit is set, and clears it. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* ram: introduce migration_bitmap_set_dirty()Juan Quintela2012-10-171-7/+13
| | | | | | | | | It just marks a region of memory as dirty. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* savevm: Factorize ram globals reset in its own functionJuan Quintela2012-10-171-3/+9
| | | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* migration: print expected downtime in info migrateJuan Quintela2012-10-171-0/+2
| | | | Signed-off-by: Juan Quintela <quintela@redhat.com>
* migration: rename expected_time to expected_downtimeJuan Quintela2012-10-171-10/+10
| | | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* fix migration syncJuan Quintela2012-10-171-0/+1
| | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
* Eliminate cpus-x86_64.conf fileEduardo Habkost2012-09-211-1/+0
| | | | | | | | | This file is not needed anymore, as QEMU won't ship any config-based cpudefs out of the box, relying only on the builtin CPU models. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* arch_init.c: Improve '-soundhw help' for non-HAS_AUDIO_CHOICE archsPeter Maydell2012-09-191-0/+5
| | | | | | | | | For architectures which don't set HAS_AUDIO_CHOICE, improve the '-soundhw help' message so that it doesn't simply print an empty list, implying no sound support at all. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: malc <av1474@comtv.ru>
* arch_init.c: add missing '%' symbols before PRIu64 in debug printfsIgor Mitsyanko2012-09-141-4/+4
| | | | | | | | '%' symbols were missing in front of PRIu64 macros in DPRINTF() messages in arch_init.c, this caused compilation warnings when compiled with DEBUG_ARCH_INIT defined. Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
* qapi: add 'query-target' command to return target archDaniel P. Berrange2012-08-221-0/+11
| | | | | | | | | | | | | Add a 'query-target' QAPI command to allow management applications to determine what target architecture a QEMU binary is emulating without having to parse the binary name or -help output $ qmp-shell -p /tmp/qemu (QEMU) query-target { u'return': { u'arch': u'x86_64' }} Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote-tracking branch 'quintela/migration-next-20120808' into stagingAnthony Liguori2012-08-131-5/+241
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * quintela/migration-next-20120808: Restart optimization on stage3 update version Add XBZRLE statistics Add migration accounting for normal and duplicate pages Change total_time to total-time in MigrationStats Add migrate_set_cache_size command Add XBZRLE to ram_save_block and ram_save_live Add xbzrle_encode_buffer and xbzrle_decode_buffer functions Add uleb encoding/decoding functions Add cache handling functions Add XBZRLE documentation Add migrate-set-capabilities Add migration capabilities
| * Restart optimization on stage3 update versionJuan Quintela2012-08-081-9/+15
| | | | | | | | | | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
| * Add XBZRLE statisticsOrit Wasserman2012-08-081-0/+28
| | | | | | | | | | | | | | | | | | | | | | 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> Signed-off-by: Orit Wasserman <owasserm@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
| * Add migration accounting for normal and duplicate pagesOrit Wasserman2012-08-081-0/+38
| | | | | | | | | | | | | | | | | | | | | | 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> Signed-off-by: Orit Wasserman <owasserm@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
| * Add migrate_set_cache_size commandOrit Wasserman2012-08-081-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change XBZRLE cache size in bytes (the size should be a power of 2, it will be rounded down to the nearest power of 2). If XBZRLE cache size is too small there will be many cache miss. New query-migrate-cache-size QMP command and 'info migrate_cache_size' HMP command to query cache value. 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> Signed-off-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
| * Add XBZRLE to ram_save_block and ram_save_liveOrit Wasserman2012-08-081-2/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the outgoing migration check to see if the page is cached and changed, then send compressed page by using save_xbrle_page function. In the incoming migration check to see if RAM_SAVE_FLAG_XBZRLE is set and decompress the page (by using load_xbrle function). 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> Signed-off-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
* | unicore32-softmmu: Add unicore32-softmmu build supportGuan Xuetao2012-08-111-0/+2
|/ | | | | | | | | | | This patch adds unicore32-softmmu build support, include configure, makefile, arch_init, and all missing functions needed by softmmu. Although all missing functions are empty, unicore32-softmmu could be build successfully. By 20120804: change QEMU_ARCH_UNICORE32 to 0x4000 Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Support 'help' as a synonym for '?' in command line optionsPeter Maydell2012-08-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | For command line options which permit '?' meaning 'please list the permitted values', add support for 'help' as a synonym, by abstracting the check out into a helper function. This change means that in some cases where we were being lazy in our string parsing, "?junk" will now be rejected as an invalid option rather than being (undocumentedly) treated the same way as "?". Update the documentation to use 'help' rather than '?', since '?' is a shell metacharacter and thus prone to fail confusingly if there is a single character filename in the current working directory and the '?' has not been escaped. It's therefore better to steer users towards 'help', though '?' is retained for backwards compatibility. We do not, however, update the output of the system emulator's -help (or any documentation autogenerated from the qemu-options.hx which is the source of the -help text) because libvirt parses our -help output and will break. At a later date when QEMU provides a better interface so libvirt can avoid having to do this, we can update the -help text too. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge commit 'quintela/migration-next-v5' into stagingAnthony Liguori2012-07-301-50/+87
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '6c779f22a93cc6e4565b940ef616e3efc5b50ba5': Change ram_save_block to return -1 if there are no more changes ram: save_live_setup() we don't need to synchronize the dirty bitmap. ram: iterate phase ram: save_live_complete() only do one loop ram: save_live_setup() don't need to sent pages savevm: split save_live into stage2 and stage3 savevm: split save_live_setup from save_live_state savevm: introduce is_active method savevm: Refactor cancel operation in its own operation savevm: remove SaveLiveStateHandler savevm: remove SaveSetParamsHandler savevm: Live migration handlers register the struct directly savevm: Use a struct to pass all handlers
| * Change ram_save_block to return -1 if there are no more changesOrit Wasserman2012-07-231-6/+20
| | | | | | | | | | | | It will return 0 if the page is unmodifed. Signed-off-by: Orit Wasserman <owasserm@redhat.com>
| * ram: save_live_setup() we don't need to synchronize the dirty bitmap.Juan Quintela2012-07-201-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | 1st: we were synchonizing the dirty bitmap before calling memory_global_dirty_log_start(). 2nd: We are marking all pages as dirty anywhere, no reason to go through all the bitmap to "mark" dirty same pages twice. So, call removed. Signed-off-by: Juan Quintela <quintela@redhat.com>
| * ram: iterate phaseJuan Quintela2012-07-201-3/+7
| | | | | | | | | | | | | | We only need to synchronize the bitmap when the number of dirty pages is low. Not every time that we call the function. Signed-off-by: Juan Quintela <quintela@redhat.com>
| * ram: save_live_complete() only do one loopJuan Quintela2012-07-201-32/+0
| | | | | | | | | | | | | | We were doing the same loop that stage2, and a new one for stage3. We only need the one for stage3. Signed-off-by: Juan Quintela <quintela@redhat.com>
| * ram: save_live_setup() don't need to sent pagesJuan Quintela2012-07-201-34/+0
| | | | | | | | | | | | | | | | We should send pages on interate phase, not in setup one. This was a "bug". Just removing the loop does what we want. Tested that it works with current ram_load(). Signed-off-by: Juan Quintela <quintela@redhat.com>
| * savevm: split save_live into stage2 and stage3Juan Quintela2012-07-201-17/+55
| | | | | | | | | | | | | | | | We split it into 2 functions, foo_live_iterate, and foo_live_complete. At this point, we only remove the bits that are for the other stage, functionally this is equivalent to previous code. Signed-off-by: Juan Quintela <quintela@redhat.com>
| * savevm: split save_live_setup from save_live_stateJuan Quintela2012-07-201-22/+65
| | | | | | | | | | | | | | | | This patch splits stage 1 to its own function for both save_live users, ram and block. It is just a copy of the function, removing the parts of the other stages. Optimizations would came later. Signed-off-by: Juan Quintela <quintela@redhat.com>
| * savevm: Refactor cancel operation in its own operationJuan Quintela2012-07-201-5/+6
| | | | | | | | | | | | Intead of abusing stage with value -1. Signed-off-by: Juan Quintela <quintela@redhat.com>
| * savevm: Live migration handlers register the struct directlyJuan Quintela2012-07-201-2/+7
| | | | | | | | | | | | | | Notice that the live migration users never unregister, so no problem about freeing the ops structure. Signed-off-by: Juan Quintela <quintela@redhat.com>
* | target-or32: Add target stubs and QOM cpuJia Liu2012-07-271-0/+2
|/ | | | | | | Add OpenRISC target stubs, QOM cpu and basic machine. Signed-off-by: Jia Liu <proljc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Maintain the number of dirty pagesJuan Quintela2012-06-291-14/+1
| | | | | | | Calculate the number of dirty pages takes a lot on hosts with lots of memory. Just maintain how many pages are dirty. Signed-off-by: Juan Quintela <quintela@redhat.com>
* Exit loop if we have been there too longJuan Quintela2012-06-291-0/+18
| | | | | | | | | | Checking each 64 pages is a random magic number as good as any other. We don't want to test too many times, but on the other hand, qemu_get_clock_ns() is not so expensive either. We want to be sure that we spent less than 50ms (half of buffered_file timer), if we spent more than 100ms, all the accounting got wrong. Signed-off-by: Juan Quintela <quintela@redhat.com>
* Only calculate expected_time for stage 2Juan Quintela2012-06-291-5/+8
| | | | | | | ram_save_remaining() is an expensive operation when there is a lot of memory. So we only call the function when we need it. Signed-off-by: Juan Quintela <quintela@redhat.com>
* Add migration_end functionOrit Wasserman2012-06-291-1/+6
| | | | Signed-off-by: Orit Wasserman <owasserm@redhat.com>
* Add debugging infrastructureOrit Wasserman2012-06-291-6/+27
| | | | Signed-off-by: Orit Wasserman <owasserm@redhat.com>
* Add save_block_hdr functionOrit Wasserman2012-06-291-12/+14
| | | | | | | 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> Signed-off-by: Orit Wasserman <owasserm@redhat.com>
* Add missing check for host_from_stream_offset return value for ↵Orit Wasserman2012-06-291-0/+3
| | | | | | RAM_SAVE_FLAG_PAGE Signed-off-by: Orit Wasserman <owasserm@redhat.com>
* arch_init: Fix AltiVec build on Darwin/ppcAndreas Färber2012-05-291-0/+4
| | | | | | | | | | | | | | | | Commit f29a56147b66845914d0a645bf9b4c5bb9a6af57 (implement -no-user-config command-line option (v3)) introduced uses of bool in arch_init.c. Shortly before that usage is support code for AltiVec (conditional to __ALTIVEC__). GCC's altivec.h may in a !__APPLE_ALTIVEC__ code path redefine bool, leading to type mismatches. altivec.h recommends to #undef for C++ compatibility, but doing so in C leads to bool remaining undefined. Fix by redefining bool to _Bool as mandated for stdbool.h by POSIX. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
* move CPU definitions to /usr/share/qemu/cpus-x86_64.conf (v2)Eduardo Habkost2012-05-101-0/+1
| | | | | | | | Changes v1 -> v2: - userconfig variable is now bool, not int Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* implement -no-user-config command-line option (v3)Eduardo Habkost2012-05-101-3/+8
| | | | | | | | | | | | Changes v2 -> v3: - Rebase against latest qemu.git Changes v1 -> v2: - Change 'userconfig' field/variables to bool instead of int - Coding style change Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* move list of default config files to an arrayEduardo Habkost2012-05-101-9/+16
| | | | | | | More files will be added to the list, with additional attributes, later. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* eliminate arch_config_name variableEduardo Habkost2012-05-101-2/+1
| | | | | | | | Not needed anymore, as the code that uses the variable is already inside arch_init.c. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* move code to read default config files to a separate function (v2)Eduardo Habkost2012-05-101-0/+18
| | | | | | | | | | | Function added to arch_init.c because it depends on arch-specific settings. Changes v1 -> v2: - Move qemu_read_default_config_file() prototype to qemu-config.h Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pcspk: initialize PC speaker if compiled inHervé Poussineau2012-04-151-1/+1
| | | | | | | | | | PC speaker has been moved to target-independant code in 71093711589dafcb920dc3bc9bb811eaf8b14101, so do not depend of target to include it or not. Cc: malc <av1474@comtv.ru> Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Herv? Poussineau <hpoussin@reactos.org> Signed-off-by: malc <av1474@comtv.ru>
* Purge migration of (almost) everything to do with monitorsLuiz Capitulino2012-03-151-1/+1
| | | | | | | | | | | | | | | | | The Monitor object is passed back and forth within the migration/savevm code so that it can print errors and progress to the user. However, that approach assumes a HMP monitor, being completely invalid in QMP. This commit drops almost every single usage of the Monitor object, all monitor_printf() calls have been converted into DPRINTF() ones. There are a few remaining Monitor objects, those are going to be dropped by the next commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* pcspk: Convert to qdevJan Kiszka2012-02-171-0/+1
| | | | | | | | | Convert the PC speaker device to a qdev ISA model. Move the public interface to a dedicated header file at this chance. CC: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* memory: change dirty getting API to take a sizeBlue Swirl2012-02-041-3/+4
| | | | | | | Instead of each device knowing or guessing the guest page size, just pass the desired size of dirtied memory area. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
OpenPOWER on IntegriCloud