History | View | Annotate | Download (29 kB)
memory: make memory_global_sync_dirty_bitmap take an AddressSpace
Since this is a MemoryListener operation, it only makes senseon an AddressSpace granularity.
Suggested-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
audio: look for the ISA and PCI buses
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Message-id: 1366303444-24620-8-git-send-email-pbonzini@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
audio: remove the need for audio card CONFIG_* symbols
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Message-id: 1366303444-24620-3-git-send-email-pbonzini@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
audio: remove HAS_AUDIO
Several targets can have wavcapture/-soundhw support via PCI cards.HAS_AUDIO is a useless limitation, remove it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Message-id: 1366303444-24620-4-git-send-email-pbonzini@redhat.com...
include: avoid useless includes of exec/ headers
Headers in include/exec/ are for the deepest innards of QEMU,they should almost never be included directly.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
acpi: move declarations from pc.h to acpi.h
Functions defined in acpi/ should be declared inacpi.h
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw: move headers to include/
Many of these should be cleaned up with proper qdev-/QOM-ification.Right now there are many catch-all headers in include/hw/ARCH dependingon cpu.h, and this makes it necessary to compile these files per-target.However, fixing this does not belong in these patches....
strip some whitespace
Signed-off-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1363821803-3380-2-git-send-email-lersek@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
acpi_table_add(): accept QemuOpts and parse it with OptsVisitor
As one consequence, strtok() -- which modifies its argument -- is replacedwith g_strsplit().
Signed-off-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
like acpi_table_install(), acpi_table_add() should propagate Errors
Signed-off-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1363821803-3380-8-git-send-email-lersek@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
migration: do not sent zero pages in bulk stage
during bulk stage of ram migration if a page is azero page do not send it at all.the memory at the destination reads as zero anyway.
even if there is an madvise with QEMU_MADV_DONTNEEDat the target upon receipt of a zero page I have observed...
migration: do not search dirty pages in bulk stage
avoid searching for dirty pages just increment thepage offset. all pages are dirty anyway.
Signed-off-by: Peter Lieven <pl@kamp.de>Reviewed-by: Eric Blake <eblake@redhat.com>Reviewed-by: Orit Wasserman <owasserm@redhat.com>...
migration: use XBZRLE only after bulk stage
at the beginning of migration all pages are marked dirty andin the first round a bulk migration of all pages is performed.
currently all these pages are copied to the page cache regardlessof whether they are frequently updated or not. this doesn't make sense...
Use qemu_put_buffer_async for guest memory pages
This will remove an unneeded copy of guest memory pages.For the page header and device state we still copy the data to thestatic buffer the other option is to allocate the memory on demandwhich is more expensive....
migration: search for zero instead of dup pages
virtually all dup pages are zero pages. removethe special is_dup_page() function and use theoptimized buffer_find_nonzero_offset() functioninstead.
here buffer_find_nonzero_offset() is used directlyto avoid the unnecssary additional checks in...
migration: add an indicator for bulk state of ram migration
the first round of ram transfer is special since all pagesare dirty and thus all memory pages are transferred tothe target. this patch adds a boolean variable to trackthis stage.
Signed-off-by: Peter Lieven <pl@kamp.de>...
move vector definitions to qemu-common.h
vector optimizations will now be used at various placesnot just in is_dup_page() in arch_init.c
Signed-off-by: Peter Lieven <pl@kamp.de>Signed-off-by: Juan Quintela <quintela@redhat.com>
Add top level changes for moxie
Signed-off-by: Anthony Green <green@moxielogic.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
page_cache: dup memory on insert
The page cache frees all data on finish, on resize andif there is collision on insert. So it should be the cachesresponsibility to dup the data that is stored in the cache.
Signed-off-by: Peter Lieven <pl@kamp.de>Signed-off-by: Orit Wasserman <owasserm@redhat.com>...
migration: run pending/iterate callbacks out of big lock
This makes it possible to do blocking writes directly to the socket,with no buffer in the middle. For RAM, only the migration_bitmap_sync()call needs the iothread lock. For block migration, it is needed by...
migration: run setup callbacks out of big lock
Only the migration_bitmap_sync() call needs the iothread lock.
Reviewed-by: Orit Wasserman <owasserm@redhat.com>Reviewed-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
migration: calculate expected_downtime
We removed the calculation in commit e4ed1541ac9413eac494a03532e34beaf8a7d1c5
Now we add it back. We need to create dirty_bytes_rate because wecan't include cpu-all.h from migration.c, and there is no other way to...
Allow XBZRLE decoding without enabling the capability
Before this fix we couldn't load a guest fromXBZRLE compressed file.
For example:The user activated the XBZRLE capabilityThe user run migrate -d "exec:gzip -c > vm.gz" The user won't be able to load vm.gz and get an error....
Unlock ramlist lock also in error case
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Reviewed-by: Eric Blake <eblake@redhat.com>
Protect migration_bitmap_sync() with the ramlist lock
ram: Use memory_region_test_and_clear_dirty
This avoids having to do two walks over the dirty bitmap, once readingthe dirty bits, and anthoer cleaning them.
Signed-off-by: Juan Quintela <quintela@redhat.com>
ram: optimize migration bitmap walking
Instead of testing each page individually, we search what is the nextdirty page with a bitmap operation. We have to reorganize the code tomove from a "for" loop, to a while(dirty) loop.
ram: account the amount of transferred ram better
ram: refactor ram_save_block() return value
It could only return 0 if we only found dirty xbzrle pages that hadn'tchanged (i.e. they were written with the same content). We don't careabout that case, it is the same than nothing dirty.
So now the return of the function is how much have it written, nothing...
ram: rename last_block to last_seen_block
ram: Add last_sent_block
This is the last block from where we have sent data.
Signed-off-by: Orit Wasserman <owasserm@redhat.com>Signed-off-by: Juan Quintela <quintela@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
exec: sort the memory from biggest to smallest
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.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
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.
migration: fix migration_bitmap leak
Cc: qemu-stable@nongnu.orgSigned-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Juan Quintela <quintela@redhat.com>
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/
exec: move include files to include/exec/
net: do not include net.h everywhere
janitor: do not rely on indirect inclusions of or from qemu-char.h
Various header files rely on qemu-char.h including qemu-config.h ormain-loop.h, but they really do not need qemu-char.h at all (particularlyinteresting is the case of the block layer!). Clean this up, and also...
Merge commit '1dd3a74d2ee2d873cde0b390b536e45420b3fe05' into HEAD
pci: update all users to look in pci/
update all users so we can remove the makefile hack.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Fix off-by-1 error in RAM migration code
The code for migrating (or savevm-ing) memory pages starts off by creatinga dirty bitmap and filling it with 1s. Except, actually, because bitaddresses are 0-based it fills every bit except bit 0 with 1s and puts an...
migration: Fix madvise breakage if host and guest have different page sizes
madvise(DONTNEED) will throw away the contents of the whole page at thegiven address, even if the given length is less than the page size. Onecan argue about whether that's the correct behaviour, but that's what it's...
fix migration sync
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
migration: rename expected_time to expected_downtime
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Orit Wasserman <owasserm@redhat.com>
migration: print expected downtime in info migrate
savevm: Factorize ram globals reset in its own function
ram: introduce migration_bitmap_set_dirty()
It just marks a region of memory as dirty.
ram: Introduce migration_bitmap_test_and_reset_dirty()
It just test if the dirty bit is set, and clears it.
ram: introduce migration_bitmap_sync()
Helper that we use each time that we need to syncronize the migrationbitmap with the other dirty bitmaps.
ram: create trace event for migration sync bitmap
Separate migration bitmap
This patch creates a migration bitmap, which is periodically kept insync with the qemu bitmap. A separate copy of the dirty bitmap for themigration limits the amount of concurrent access to the qemu bitmapfrom iothread and migration thread (which requires taking the big...
migration: Add dirty_pages_rate to query migrate output
It indicates how many pages were dirtied during the last second.
Eliminate cpus-x86_64.conf file
This file is not needed anymore, as QEMU won't ship any config-basedcpudefs 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>...
arch_init.c: Improve '-soundhw help' for non-HAS_AUDIO_CHOICE archs
For architectures which don't set HAS_AUDIO_CHOICE, improve the'-soundhw help' message so that it doesn't simply print an emptylist, implying no sound support at all.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
arch_init.c: add missing '%' symbols before PRIu64 in debug printfs
'%' symbols were missing in front of PRIu64 macros in DPRINTF messages inarch_init.c, this caused compilation warnings when compiled with DEBUG_ARCH_INIT defined.
Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com>...
qapi: add 'query-target' command to return target arch
Add a 'query-target' QAPI command to allow management applicationsto determine what target architecture a QEMU binary is emulatingwithout having to parse the binary name or -help output
$ qmp-shell -p /tmp/qemu...
Merge remote-tracking branch 'quintela/migration-next-20120808' into staging
unicore32-softmmu: Add unicore32-softmmu build support
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...
Add XBZRLE to ram_save_block and ram_save_live
In the outgoing migration check to see if the page is cached andchanged, then send compressed page by using save_xbrle_page function.In the incoming migration check to see if RAM_SAVE_FLAG_XBZRLE is setand decompress the page (by using load_xbrle function)....
Add migrate_set_cache_size command
Change XBZRLE cache size in bytes (the size should be a power of 2, it will berounded 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...
Add migration accounting for normal and duplicate pages
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 XBZRLE statistics
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>...
Restart optimization on stage3 update version
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>
Support 'help' as a synonym for '?' in command line options
For command line options which permit '?' meaning 'please list thepermitted values', add support for 'help' as a synonym, by abstractingthe check out into a helper function.
This change means that in some cases where we were being lazy in...
Merge commit 'quintela/migration-next-v5' into staging
target-or32: Add target stubs and QOM cpu
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>
Change ram_save_block to return -1 if there are no more changes
It will return 0 if the page is unmodifed.
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
savevm: Live migration handlers register the struct directly
Notice that the live migration users never unregister, so no problemabout freeing the ops structure.
savevm: Refactor cancel operation in its own operation
Intead of abusing stage with value -1.
savevm: split save_live_setup from save_live_state
This patch splits stage 1 to its own function for both save_liveusers, ram and block. It is just a copy of the function, removing theparts of the other stages. Optimizations would came later.
savevm: split save_live into stage2 and stage3
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.
ram: save_live_setup() don't need to sent pages
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 itworks with current ram_load().
ram: save_live_complete() only do one loop
We were doing the same loop that stage2, and a new one for stage3. Weonly need the one for stage3.
ram: iterate phase
We only need to synchronize the bitmap when the number of dirty pages is low.Not every time that we call the function.
ram: save_live_setup() we don't need to synchronize the dirty bitmap.
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....
Maintain the number of dirty pages
Calculate the number of dirty pages takes a lot on hosts with lotsof memory. Just maintain how many pages are dirty.
Exit loop if we have been there too long
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 surethat we spent less than 50ms (half of buffered_file timer), if we...
Only calculate expected_time for stage 2
ram_save_remaining() is an expensive operation when there is a lot of memory.So we only call the function when we need it.
Add migration_end function
Add debugging infrastructure
Add save_block_hdr 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>
Add missing check for host_from_stream_offset return value for RAM_SAVE_FLAG_PAGE
arch_init: Fix AltiVec build on Darwin/ppc
Commit f29a56147b66845914d0a645bf9b4c5bb9a6af57 (implement-no-user-config command-line option (v3)) introduced uses of boolin arch_init.c. Shortly before that usage is support code forAltiVec (conditional to ALTIVEC)....
implement -no-user-config command-line option (v3)
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>...
move CPU definitions to /usr/share/qemu/cpus-x86_64.conf (v2)
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>
move list of default config files to an array
More files will be added to the list, with additional attributes, later.
move code to read default config files to a separate function (v2)
Function added to arch_init.c because it depends on arch-specificsettings.
Changes v1 -> v2: - Move qemu_read_default_config_file() prototype to qemu-config.h
eliminate arch_config_name variable
Not needed anymore, as the code that uses the variable is already insidearch_init.c.
pcspk: initialize PC speaker if compiled in
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>...
Purge migration of (almost) everything to do with monitors
The Monitor object is passed back and forth within the migration/savevmcode so that it can print errors and progress to the user.
However, that approach assumes a HMP monitor, being completely invalid...
pcspk: Convert to qdev
Convert the PC speaker device to a qdev ISA model. Move the publicinterface 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 size
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>
memory: change dirty setting APIs to take a size
Instead of each target knowing or guessing the guest page size,just pass the desired size of dirtied memory area.