summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-01-13memory: s/mask/clear/ cpu_physical_memory_mask_dirty_rangeJuan Quintela2-4/+4
Now all functions use the same wording that bitops/bitmap operations Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: cpu_physical_memory_get_dirty() is used as returning a boolJuan Quintela1-7/+8
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: make cpu_physical_memory_get_dirty() the main functionJuan Quintela1-17/+19
And make cpu_physical_memory_get_dirty_flag() to use it. It used to be the other way around. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: unfold cpu_physical_memory_set_dirty_flag()Juan Quintela1-3/+6
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: unfold cpu_physical_memory_set_dirty() in its only userJuan Quintela1-8/+3
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: unfold cpu_physical_memory_clear_dirty_flag() in its only userJuan Quintela1-8/+2
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: split dirty bitmap into threeJuan Quintela4-15/+16
After all the previous patches, spliting the bitmap gets direct. Note: For some reason, I have to move DIRTY_MEMORY_* definitions to the beginning of memory.h to make compilation work. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13bitmap: Add bitmap_zero_extend operationJuan Quintela1-0/+9
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: cpu_physical_memory_clear_dirty_flag() result is never usedJuan Quintela1-2/+2
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: only resize dirty bitmap when memory size increasesJuan Quintela1-3/+9
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: make sure that client is always inside rangeJuan Quintela1-0/+4
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: use bit 2 for migrationJuan Quintela1-1/+2
For historical reasons it was bit 3. Once there, create a constant to know the number of clients. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: cpu_physical_memory_mask_dirty_range() always clears a single flagJuan Quintela5-42/+34
Document it Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: cpu_physical_memory_set_dirty_range() always dirty all flagsJuan Quintela3-11/+4
So remove the flag argument and do it directly. After this change, there is nothing else using cpu_physical_memory_set_dirty_flags() so remove it. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: set single dirty flags when possibleJuan Quintela2-4/+7
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: all users of cpu_physical_memory_get_dirty used only one flagJuan Quintela1-7/+2
So cpu_physical_memory_get_dirty_flags is not needed anymore Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: make cpu_physical_memory_is_dirty return boolJuan Quintela2-7/+8
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13exec: create function to get a single dirty bitJuan Quintela2-1/+7
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: create function to set a single dirty bitJuan Quintela2-1/+7
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2014-01-13exec: use accessor function to know if memory is dirtyJuan Quintela1-1/+1
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2014-01-13memory: cpu_physical_memory_set_dirty_range() return voidJuan Quintela1-1/+1
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2014-01-13memory: cpu_physical_memory_set_dirty_flags() result is never usedJuan Quintela1-2/+2
So return void. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2014-01-13bitmap: use long as indexJuan Quintela3-75/+76
Move index and size fields from int to long. We need that for migration. long is 64 bits on sane architectures, and 32bits should be enough on all the 32bits architectures. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13tests: Some unit tests for vmstate.cEduardo Habkost3-0/+362
* Basic load/save tests * Tests for loading older versions * Tests for .field_exists() handling Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2014-01-13savevm: Small comment about why timer QEMUFile/VMState code is in savevm.cEduardo Habkost1-2/+6
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2014-01-13qemu-file: Move QEMUFile code to qemu-file.cEduardo Habkost3-820/+827
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2014-01-13vmstate: Move VMState code to vmstate.cEduardo Habkost3-645/+651
This will allow unit tests to be written for VMState code without pulling dependencies from the savevm code. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2014-01-13savevm.c: Coding style fixEduardo Habkost1-1/+2
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2014-01-13savevm.c: Coding style fixesEduardo Habkost1-31/+44
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2014-01-13savevm: Convert all tabs to spacesEduardo Habkost1-9/+9
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2014-01-13migration: Move QEMU_VM_* defines to migration/migration.hEduardo Habkost2-11/+11
The VMState code will be moved to vmstate.c and it uses some of the QEMU_VM_* constants, so move it to a header. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2014-01-13qemu-file: Make a few functions non-staticEduardo Habkost2-4/+8
The QEMUFile code will be moved to qemu-file.c. This will require making the following functions non-static because they are used by the savevm.c code: * qemu_peek_byte() * qemu_peek_buffer() * qemu_file_skip() * qemu_file_set_error() Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2014-01-13migration: Fix rate limitMatthew Garrett1-1/+1
The migration thread appears to want to allow writeout to occur at full speed rather than being rate limited during completion of state saving, but sets the limit to INT_MAX when xfer_limit is INT64_MAX. This causes problems if there's more than 2GB of state left to save at this point. It probably ought to just be INT64_MAX instead. Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2014-01-13introduce MIG_STATE_CANCELLING stateZhanghaoyu (A)1-10/+16
Introduce MIG_STATE_CANCELLING state to avoid starting a new migration task while the previous one still exist. Signed-off-by: Zeng Junliang <zengjunliang@huawei.com> Signed-off-by: Zhang Haoyu <haoyu.zhang@huawei.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2014-01-13avoid a bogus COMPLETED->CANCELLED transitionZhanghaoyu (A)1-1/+8
Avoid a bogus COMPLETED->CANCELLED transition. There is a period of time from the timing of setting COMPLETED state to that of migration thread exits, so during which it's problematic in COMPLETED->CANCELLED transition. Signed-off-by: Zeng Junliang <zengjunliang@huawei.com> Signed-off-by: Zhang Haoyu <haoyu.zhang@huawei.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2014-01-12Merge remote-tracking branch 'pmaydell/tags/pull-cocoa-20140112' into stagingAnthony Liguori2-37/+64
cocoa queue: * pass command key to guest when VM has mousegrab * add .qcow2 to extension list for image load dialog * fix bugs in code for starting QEMU via image load dialog * fix resize/redraw interaction * draw window black if guest hasn't sent anything to screen * minor style/typo fixes * add myself as cocoa co-maintainer # gpg: Signature made Sun 12 Jan 2014 02:45:52 PM PST using RSA key ID 14360CDE # gpg: Can't check signature: public key not found * pmaydell/tags/pull-cocoa-20140112: MAINTAINERS: add myself as cocoa UI co-maintainer ui/cocoa: Remove stray tabs ui/cocoa: Draw black rectangle if we have no data yet ui/cocoa: Redraw at correct size when switching surface ui/cocoa: Fix code for starting QEMU via image file load dialog ui/cocoa: Add ".qcow2" to extension list for image load dialog ui/cocoa: Send warning message to stderr, not stdout ui/cocoa: Correct typos in comments and variable names ui/cocoa: Pass command key through to guest when VM has mousegrab Message-id: 1389567158-31066-1-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2014-01-12Merge remote-tracking branch 'pmaydell/tags/pull-target-arm-20140112' into ↵Anthony Liguori1-1/+1
staging target-arm queue: * build fix for bigendian hosts # gpg: Signature made Sun 12 Jan 2014 01:38:22 PM PST using RSA key ID 14360CDE # gpg: Can't check signature: public key not found * pmaydell/tags/pull-target-arm-20140112: arm: fix compile on bigendian host Message-id: 1389562970-30944-1-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2014-01-12MAINTAINERS: add myself as cocoa UI co-maintainerPeter Maydell1-0/+1
Add myself to the maintainers list for the cocoa UI; status remains "Odd Fixes". Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Andreas Färber <andreas.faerber@web.de> Message-id: 1387207075-10280-1-git-send-email-peter.maydell@linaro.org
2014-01-12ui/cocoa: Remove stray tabsPeter Maydell1-3/+3
The ui/cocoa.m file has just three lines with hardcoded tabs; fix them. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Stefan Weil <sw@weilnetz.de> Message-id: 1387886052-27067-1-git-send-email-peter.maydell@linaro.org
2014-01-12ui/cocoa: Draw black rectangle if we have no data yetPeter Maydell1-1/+6
If our redraw method is called before we have any data from the guest, then draw a black rectangle rather than leaving the window empty. This mostly only matters when the guest machine has no framebuffer device, but it is more in line with the behaviour of other QEMU UIs. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1387853507-26298-3-git-send-email-peter.maydell@linaro.org
2014-01-12ui/cocoa: Redraw at correct size when switching surfacePeter Maydell1-7/+17
If the surface switch involved a resize, we were doing the redraw at the old size rather than the new, because the update of screen.width and screen.height was being done after the setFrame method calls which triggered a redraw. Normally this isn't very noticeable because typically after the guest triggers the window resize it also draws something to it, which will in turn cause us to redraw. However, the combination of a guest which never draws to the display and a command line setting of a screen size larger than the default can reveal odd effects. Move most of the handling of resizes to the top of the method, and guard it with a check that the surface size actually changed, to avoid unnecessary operations (including some user visible ones like "recenter the window on the screen") if the surface is the same size as the old one. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1387853507-26298-2-git-send-email-peter.maydell@linaro.org
2014-01-12ui/cocoa: Fix code for starting QEMU via image file load dialogPeter Maydell1-6/+6
Fix a number of bugs in the code for starting QEMU via the image file load dialog: * use the actual argv[0] rather than "qemu": this avoids failures to find BIOS image files caused by not looking in the correct directory relative to the executable path * allocate a large enough argv array to NULL terminate it * use g_strdup(X) rather than g_strdup_printf("%s", X) or g_strdup_printf(X) * disable the printing of the simulated command line argument (which is presumably intended for debug only) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1386543546-31919-6-git-send-email-peter.maydell@linaro.org
2014-01-12ui/cocoa: Add ".qcow2" to extension list for image load dialogPeter Maydell1-1/+1
Add ".qcow2" to the list of file extensions which are accepted by the initial disk image load dialog which is displayed if the user runs QEMU without any command line arguments. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1386543546-31919-5-git-send-email-peter.maydell@linaro.org
2014-01-12ui/cocoa: Send warning message to stderr, not stdoutPeter Maydell1-1/+1
Bring a warning message into line with the others in this file by sending it to stderr, not stdout. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1386543546-31919-4-git-send-email-peter.maydell@linaro.org
2014-01-12ui/cocoa: Correct typos in comments and variable namesPeter Maydell1-14/+14
Fix various non-user-visible typos in comments and variable names. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Stefan Weil <sw@weilnetz.de> Message-id: 1386543546-31919-3-git-send-email-peter.maydell@linaro.org
2014-01-12ui/cocoa: Pass command key through to guest when VM has mousegrabPeter Maydell1-7/+18
The guest might want to be able to use the command key for its won purposes (as command if it is MacOS X, or for the Windows key if it is a PC guest, for instance). In line with other UI frontends, pass it through if the guest has mousegrab, and only use it for UI menu accelerators if not grabbed. Thanks to John Arbuckle for reporting this problem, helping us work through what the best solution would be and providing a patch which was the initial inspiration for this one. Reported-by: John Arbuckle <programmingkidx@gmail.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1386543546-31919-2-git-send-email-peter.maydell@linaro.org
2014-01-12arm: fix compile on bigendian hostAlexey Kardashevskiy1-1/+1
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-01-10Merge remote-tracking branch 'bonzini/scsi-next' into stagingAnthony Liguori2-1/+30
* bonzini/scsi-next: scsi-disk: add UNMAP limits to block limits VPD page block/iscsi: use a bh to schedule co reentrance Message-id: 1387720926-11421-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2014-01-10Merge remote-tracking branch 'stefanha/block' into stagingAnthony Liguori24-541/+535
* stefanha/block: commit: Remove unused check qemu-iotests: Update test cases for commit active commit: Support commit active layer block: Add commit_active_start() mirror: Move base to MirrorBlockJob mirror: Don't close target qemu-iotests: drop duplicate virtio-blk initialization failure vmdk: Allow vmdk_create to work with protocol vmdk: Check VMFS extent line field number docs: updated qemu-img man page and qemu-doc to reflect VHDX support. block: vhdx - improve error message, and .bdrv_check implementation block/iscsi: Fix compilation for libiscsi 1.4.0 (API change) qapi-schema: fix QEMU 1.8 references dataplane: replace hostmem with memory_region_find dataplane: change vring API to use VirtQueueElement vring: factor common code for error exits vring: create a common function to parse descriptors sheepdog: fix dynamic grow for running qcow2 format Message-id: 1387554416-5837-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2014-01-10Merge remote-tracking branch 'mst/tags/for_anthony' into stagingAnthony Liguori18-140/+359
acpi,pci,pc,fedora,virtio fixes and enhancements This includes some Preparatory patches for cpu hotplug for q25 and memory hotplug by Igor, tests and memory mapping change by Laszlo and pci reset cleanup by Paolo. There are also some fixes for fedora and virtio: included here since they are test blockers for me. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Mon 23 Dec 2013 08:07:18 AM PST using RSA key ID D28D5469 # gpg: Can't check signature: public key not found * mst/tags/for_anthony: target-arm: fix build with gcc 4.8.2 virtio: add back call to virtio_bus_device_unplugged piix: fix 32bit pci hole qdev: switch reset to post-order qdev: allow both pre- and post-order vists in qdev walking functions pci: clean up resetting of IRQs pci: do not export pci_bus_reset ACPI/DSDT-CPU: cleanup bogus comment ACPI: Q35 DSDT: fix CPU hotplug GPE0.2 handler acpi: ich9: allow guest to clear SCI rised by GPE acpi: factor out common pm_update_sci() into acpi core acpi: piix4: remove not needed GPE0 mask i440fx-test: verify firmware under 4G and 1M, both -bios and -pflash i440fx-test: generate temporary firmware blob i440fx-test: give each GTest case its own qtest i440fx-test: qtest_start() should be paired with qtest_end() hw/i386/pc_sysfw: support two flash drives pc_piix: document gigabyte_align piix: gigabyte alignment for ram Message-id: 1387815007-1272-1-git-send-email-mst@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>