OSDN Git Service
Stefan Hajnoczi [Wed, 14 Nov 2012 14:30:09 +0000 (15:30 +0100)]
dataplane: add Linux AIO request queue
The IOQueue has a pool of iocb structs and a function to add new
read/write requests. Multiple requests can be added before calling the
submit function to actually tell the host kernel to begin I/O. This
allows callers to batch requests and submit them in one go.
The actual I/O is performed using Linux AIO.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Stefan Hajnoczi [Wed, 14 Nov 2012 14:23:00 +0000 (15:23 +0100)]
dataplane: add event loop
Outside the safety of the global mutex we need to poll on file
descriptors. I found epoll(2) is a convenient way to do that, although
other options could replace this module in the future (such as an
AioContext-based loop or glib's GMainLoop).
One important feature of this small event loop implementation is that
the loop can be terminated in a thread-safe way. This allows QEMU to
stop the data plane thread cleanly.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Stefan Hajnoczi [Wed, 14 Nov 2012 14:15:50 +0000 (15:15 +0100)]
dataplane: add virtqueue vring code
The virtio-blk-data-plane cannot access memory using the usual QEMU
functions since it executes outside the global mutex and the memory APIs
are this time are not thread-safe.
This patch introduces a virtqueue module based on the kernel's vhost
vring code. The trick is that we map guest memory ahead of time and
access it cheaply outside the global mutex.
Once the hardware emulation code can execute outside the global mutex it
will be possible to drop this code.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Stefan Hajnoczi [Tue, 20 Nov 2012 09:30:08 +0000 (10:30 +0100)]
dataplane: add host memory mapping code
The data plane thread needs to map guest physical addresses to host
pointers. Normally this is done with cpu_physical_memory_map() but the
function assumes the global mutex is held. The data plane thread does
not touch the global mutex and therefore needs a thread-safe memory
mapping mechanism.
Hostmem registers a MemoryListener similar to how vhost collects and
pushes memory region information into the kernel. There is a
fine-grained lock on the regions list which is held during lookup and
when installing a new regions list.
When the physical memory map changes the MemoryListener callbacks are
invoked. They build up a new list of memory regions which is finally
installed when the list has been completed.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Stefan Hajnoczi [Wed, 14 Nov 2012 14:04:15 +0000 (15:04 +0100)]
configure: add CONFIG_VIRTIO_BLK_DATA_PLANE
The virtio-blk-data-plane feature only works with Linux AIO. Therefore
add a ./configure option and necessary checks to implement this
dependency.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Stefan Hajnoczi [Wed, 14 Nov 2012 10:43:23 +0000 (11:43 +0100)]
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 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>
Stefan Weil [Sat, 24 Nov 2012 22:03:13 +0000 (23:03 +0100)]
pflash_cfi01: Suppress warning when Linux probes for AMD flash
There are several ARM and MIPS boards which are manufactured with
either Intel (pflash_cfi01.c) or AMD (pflash_cfi02.c) flash memory.
The Linux kernel supports both and first probes for AMD flash which
resulted in one or two warnings from the Intel flash emulation:
pflash_write: Unimplemented flash cmd sequence (offset
0000000000000000, wcycle 0x0 cmd 0x0 value 0xf000f0)
pflash_write: Unimplemented flash cmd sequence (offset
0000000000000000, wcycle 0x0 cmd 0x0 value 0xf0)
These warnings confuse users, so suppress them.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
陳韋任 (Wei-Ren Chen) [Mon, 10 Dec 2012 16:15:55 +0000 (00:15 +0800)]
target-mips: Use EXCP_SC rather than a magic number
From the discussion on the ML [1], the exception limit defined by
magic number 0x100 is actually EXCP_SC defined in cpu.h. Replace the
magic number with EXCP_SC. Remove "#if 1 .. #endif" as well.
[1] http://lists.gnu.org/archive/html/qemu-devel/2012-11/msg03080.html
Signed-off-by: Chen Wei-Ren <chenwj@iis.sinica.edu.tw>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Jovanovic, Petar [Tue, 11 Dec 2012 15:06:35 +0000 (15:06 +0000)]
target-mips: Make repl_ph to sign extend to target-long
The immediate value is 9bits, should sign-extend to 16bits. The return value to
register should sign-extend to target_long, as Richard says, removing an
unnecessary cast works fun.
Signed-off-by: Dongxue Zhang <elta.era@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Dongxue Zhang [Tue, 11 Dec 2012 14:28:28 +0000 (22:28 +0800)]
Fix my email address
Fix my email address, last time it's wrong.
Signed-off-by: Dongxue Zhang <elta.era@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Stefan Weil [Sat, 22 Dec 2012 12:38:19 +0000 (13:38 +0100)]
target-mips: Remove semicolon from macro definition
Macro RESTORE_FLUSH_MODE is similar to RESTORE_ROUNDING_MODE
but included a semicolon.
The code which uses that macro also includes a semicolon,
so the result was an empty statement.
Remove the superfluous semicolon from the macro definition.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Petar Jovanovic [Mon, 10 Dec 2012 15:28:17 +0000 (16:28 +0100)]
target-mips: Fix for helpers for EXTR_* instructions
The change removes some unnecessary and incorrect code for EXTR_S.H.
Further, it corrects the mask for shift value in the EXTR_ instructions. It also
extends the existing tests so they trigger the issues corrected with the change.
Signed-off-by: Petar Jovanovic <petarj@mips.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Petar Jovanovic [Thu, 6 Dec 2012 19:30:35 +0000 (20:30 +0100)]
target-mips: Fix incorrect reads and writes to DSPControl register
Upper 4 bits of ccond (bits 31..28 ) of DSPControl register are not used in
the MIPS32 architecture. They are used in the MIPS64 architecture. For MIPS32
these bits must be written as zero, and return zero on read.
The change fixes writes (WRDSP) and reads (RDDSP) to the register. It also fixes
the tests that use these instructions, and makes them smaller and simpler.
Signed-off-by: Petar Jovanovic <petarj@mips.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Brad Smith [Fri, 28 Dec 2012 06:00:26 +0000 (01:00 -0500)]
Fix semaphores fallback code
As reported in bug
1087114 the semaphores fallback code is broken which
results in QEMU crashing and making QEMU unusable.
This patch is from Paolo.
This needs to be back ported to the 1.3 stable tree as well.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 28 Dec 2012 22:19:35 +0000 (14:19 -0800)]
tcg-hppa: Fix typo in brcond2
Reported-by: Stuart Brady <sdb@zubnet.me.uk>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 28 Dec 2012 22:17:02 +0000 (14:17 -0800)]
tcg-i386: Perform cmov detection at runtime for 32-bit.
Existing compile-time detection is spotty at best. Convert
it all to runtime detection instead.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 7 Dec 2012 21:07:17 +0000 (15:07 -0600)]
tcg: Add TCGV_IS_UNUSED_*
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Brad Smith [Fri, 28 Dec 2012 06:38:11 +0000 (01:38 -0500)]
Disable semaphores fallback code for OpenBSD
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>
Alon Levy [Sun, 23 Dec 2012 21:25:09 +0000 (23:25 +0200)]
usb/redirect.c: unbreak compilation due to include/char/char.h
Broken since:
commit
927d4878b0ff319ed87fed9363f314613b0a5ed9
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: Mon Dec 17 18:20:05 2012 +0100
softmmu: move remaining include files to include/ subdirectories
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Blue Swirl [Fri, 28 Dec 2012 16:08:23 +0000 (16:08 +0000)]
Merge branch 'qom-cpu' of git://repo.or.cz/qemu/afaerber
* 'qom-cpu' of git://repo.or.cz/qemu/afaerber:
MAINTAINERS: Include X86CPU in CPU maintenance area
cpu: Move kvm_run into CPUState
cpu: Move kvm_state field into CPUState
ppc_booke: Pass PowerPCCPU to ppc_booke_timers_init()
ppc4xx_devs: Return PowerPCCPU from ppc4xx_init()
ppc_booke: Pass PowerPCCPU to {decr,fit,wdt} timer callbacks
ppc: Pass PowerPCCPU to [h]decr timer callbacks
ppc: Pass PowerPCCPU to [h]decr callbacks
ppc: Pass PowerPCCPU to ppc_set_irq()
kvm: Pass CPUState to kvm_vcpu_ioctl()
kvm: Pass CPUState to kvm_arch_*
cpu: Move kvm_fd into CPUState
qdev-properties.c: Separate core from the code used only by qemu-system-*
qdev: Coding style fixes
cpu: Introduce CPUListState struct
target-alpha: Add support for -cpu ?
target-alpha: Turn CPU definitions into subclasses
target-alpha: Avoid leaking the alarm timer over reset
alpha: Pass AlphaCPU array to Typhoon
target-alpha: Let cpu_alpha_init() return AlphaCPU
Gleb Natapov [Wed, 19 Dec 2012 15:46:15 +0000 (17:46 +0200)]
MAINTAINERS: Take over kvm maintenance
Replace Avi with myself as kvm maintainer.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Robert Schiele [Tue, 4 Dec 2012 15:58:08 +0000 (16:58 +0100)]
configure: allow disabling pixman if not needed
When we build neither any system emulation targets nor the tools there
is actually no need for pixman library. In that case do not enforce
presence of that library on the system.
Reviewed-by: Andreas F=E4rber <afaerber@suse.de>
Signed-off-by: Robert Schiele <rschiele@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Alex Horn [Wed, 5 Dec 2012 12:34:06 +0000 (12:34 +0000)]
tmp105: Create API for TMP105 temperature sensor.
* Define enum for TMP105 registers
* Move tmp105_set() from I2C to TMP105 header
* Document units and range of temperature as preconditions
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Alex Horn <alex.horn@cs.ox.ac.uk>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Lluís Vilanova [Fri, 14 Dec 2012 19:13:09 +0000 (20:13 +0100)]
build: Use separate makefile for "trace/"
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
--
Changes in v2:
* Do not depend on "qemu-timer-common.o".
* Use "$(obj)" in rules to refer to the build sub-directory.
* Remove dependencies against "$(GENERATED_HEADERS)".
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Jan Kiszka [Fri, 23 Nov 2012 11:12:01 +0000 (12:12 +0100)]
win32: Switch thread abstraction to us TLS variable internally
We already depend on working __thread support for coroutines, so this
complication here is no longer needed.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Eduardo Habkost [Thu, 20 Dec 2012 18:43:48 +0000 (16:43 -0200)]
target-i386: CPUID: return highest basic leaf if eax > cpuid_xlevel
This fixes a subtle bug. A bug that probably won't cause trouble for any
existing OS, but a bug anyway:
Intel SDM Volume 2, CPUID Instruction states:
> Two types of information are returned: basic and extended function
> information. If a value entered for CPUID.EAX is higher than the maximum
> input value for basic or extended function for that processor then the
> data for the highest basic information leaf is returned. For example,
> using the Intel Core i7 processor, the following is true:
>
> CPUID.EAX = 05H (* Returns MONITOR/MWAIT leaf. *)
> CPUID.EAX = 0AH (* Returns Architectural Performance Monitoring leaf. *)
> CPUID.EAX = 0BH (* Returns Extended Topology Enumeration leaf. *)
> CPUID.EAX = 0CH (* INVALID: Returns the same information as CPUID.EAX = 0BH. *)
> CPUID.EAX = 80000008H (* Returns linear/physical address size data. *)
> CPUID.EAX = 8000000AH (* INVALID: Returns same information as CPUID.EAX = 0BH. *)
AMD's CPUID Specification, on the other hand, is less specific:
> The CPUID instruction supports two sets or ranges of functions,
> standard and extended.
>
> • The smallest function number of the standard function range is
> Fn0000_0000. The largest function num- ber of the standard function
> range, for a particular implementation, is returned in CPUID
> Fn0000_0000_EAX.
>
> • The smallest function number of the extended function range is
> Fn8000_0000. The largest function num- ber of the extended function
> range, for a particular implementation, is returned in CPUID
> Fn8000_0000_EAX.
>
> Functions that are neither standard nor extended are undefined and
> should not be relied upon.
QEMU's behavior matched Intel's specification before, but this was
changed by commit
b3baa152aaef1905876670590275c2dd0bbb088c. This patch
restores the behavior documented by Intel when cpuid_xlevel2 is 0.
The existing behavior when cpuid_xlevel2 is set (falling back to
level=cpuid_xlevel) is being kept, as I couldn't find any public
documentation on the CPUID 0xC0000000 function range on Centaur CPUs.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Lei Li [Fri, 21 Dec 2012 04:26:38 +0000 (12:26 +0800)]
qemu-char: Inherit ptys and improve output from -serial pty
Changes since V1:
- Avoid crashing since qemu_opts_id() may return null on some
systems according to Markus's suggestion.
When controlling a qemu instance from another program, it's
hard to know which serial port or monitor device is redirected
to which pty. With more than one device using "pty" a lot of
guesswork is involved.
$ ./x86_64-softmmu/qemu-system-x86_64 -serial pty -serial pty -monitor pty
char device redirected to /dev/pts/5
char device redirected to /dev/pts/6
char device redirected to /dev/pts/7
Although we can find out what everything else is connected to
by the "info chardev" with "-monitor stdio" in the command line,
It'd be very useful to be able to have qemu inherit pseudo-tty
file descriptors so they could just be specified on the command
line like:
$ ./x86_64-softmmu/qemu-system-x86_64 -serial pty -serial pty -monitor pty
char device compat_monitor0 redirected to /dev/pts/5
char device serial0 redirected to /dev/pts/6
char device serial1 redirected to /dev/pts/7
link: https://bugs.launchpad.net/qemu/+bug/938552
Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Andreas Färber [Sat, 22 Dec 2012 23:39:34 +0000 (00:39 +0100)]
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>
Max Filippov [Wed, 19 Dec 2012 20:04:09 +0000 (00:04 +0400)]
target-xtensa: fix search_pc for the last TB opcode
Zero out tcg_ctx.gen_opc_instr_start for instructions representing the
last guest opcode in the TB.
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Liming Wang [Fri, 21 Dec 2012 08:56:58 +0000 (16:56 +0800)]
net: add missing include file
To fix building error:
CC net/vde.o
net/vde.c: In function ‘vde_cleanup’:
net/vde.c:65:5: error: implicit declaration of function ‘qemu_set_fd_handler’ [-Werror=implicit-function-declaration]
net/vde.c:65:5: error: nested extern declaration of ‘qemu_set_fd_handler’ [-Werror=nested-externs]
cc1: all warnings being treated as errors
Signed-off-by: Liming Wang <walimisdev@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
陳韋任 (Wei-Ren Chen) [Thu, 20 Dec 2012 01:39:16 +0000 (09:39 +0800)]
translate-all.c: Use tb1->phys_hash_next directly in tb_remove
When tb_remove was first commited at
fd6ce8f6, there were three different
calls pass different names to offsetof. In current codebase, the other two
calls are replaced with tb_page_remove. There is no need to have a general
tb_remove. Omit passing the third parameter and using tb1->phys_hash_next
directly.
Signed-off-by: Chen Wei-Ren <chenwj@iis.sinica.edu.tw>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Stefan Weil [Thu, 20 Dec 2012 22:09:53 +0000 (23:09 +0100)]
net: Add missing include statement (fix compiler warnings for MinGW)
These and some more compiler warnings were caused by a recent commit:
net/tap-win32.c:724: warning: no previous prototype for ‘tap_has_ufo’
net/tap-win32.c:729: warning: no previous prototype for ‘tap_has_vnet_hdr’
...
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Paolo Bonzini [Thu, 20 Dec 2012 11:29:20 +0000 (12:29 +0100)]
xen: add missing include
xen-all needs to access CharDeviceState's filename field, so
it needs to include char/char.h.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Paolo Bonzini [Thu, 20 Dec 2012 11:29:19 +0000 (12:29 +0100)]
build: fix includes for VNC
vnc-tls.h is included by vnc.h, and it includes gnutls/gnutls.h.
Hence, GnuTLS header files are needed by all files that include
vnc.h, most notably qmp.c. Move these flags to QEMU_CFLAGS for
simplicity.
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Anthony Liguori [Fri, 21 Dec 2012 13:53:48 +0000 (07:53 -0600)]
Merge remote-tracking branch 'quintela/thread-
20121220.next' into staging
* quintela/thread-
20121220.next: (79 commits)
migration: merge QEMUFileBuffered into MigrationState
migration: fix qemu_get_fd for BufferedFile
ram: refactor ram_save_block() return value
ram: account the amount of transferred ram better
ram: optimize migration bitmap walking
ram: Use memory_region_test_and_clear_dirty
memory: introduce memory_region_test_and_clear_dirty
ram: Add last_sent_block
ram: rename last_block to last_seen_block
migration: move migration notifier
migration: Inline qemu_fopen_ops_buffered into migrate_fd_connect
migration: move migration_fd_put_ready()
migration: add XFER_LIMIT_RATIO
migration: move buffered_file.c code into migration.c
savevm: New save live migration method: pending
buffered_file: unfold buffered_append in buffered_put_buffer
buffered_file: don't flush on put buffer
buffered_file: Unfold the trick to restart generating migration data
migration: just lock migrate_fd_put_ready
migration: remove unfreeze logic
...
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Juan Quintela [Wed, 19 Dec 2012 08:55:50 +0000 (09:55 +0100)]
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 during
migration.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Paolo Bonzini [Wed, 7 Nov 2012 23:42:50 +0000 (00:42 +0100)]
migration: fix qemu_get_fd for BufferedFile
Not really used, but nice to have it correct. :)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Juan Quintela [Mon, 10 Dec 2012 12:27:50 +0000 (13:27 +0100)]
ram: refactor ram_save_block() return value
It could only return 0 if we only found dirty xbzrle pages that hadn't
changed (i.e. they were written with the same content). We don't care
about that case, it is the same than nothing dirty.
So now the return of the function is how much have it written, nothing
else. Adjust callers.
And we also made ram_save_iterate() return the number of transferred
bytes, not the number of transferred pages.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Juan Quintela [Thu, 18 Oct 2012 11:56:35 +0000 (13:56 +0200)]
ram: account the amount of transferred ram better
Signed-off-by: Juan Quintela <quintela@redhat.com>
Juan Quintela [Wed, 17 Oct 2012 22:00:59 +0000 (00:00 +0200)]
ram: optimize migration bitmap walking
Instead of testing each page individually, we search what is the next
dirty page with a bitmap operation. We have to reorganize the code to
move from a "for" loop, to a while(dirty) loop.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Juan Quintela [Wed, 17 Oct 2012 18:27:15 +0000 (20:27 +0200)]
ram: Use memory_region_test_and_clear_dirty
This avoids having to do two walks over the dirty bitmap, once reading
the dirty bits, and anthoer cleaning them.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Juan Quintela [Wed, 17 Oct 2012 18:24:28 +0000 (20:24 +0200)]
memory: introduce memory_region_test_and_clear_dirty
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>
Juan Quintela [Wed, 17 Oct 2012 18:10:55 +0000 (20:10 +0200)]
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>
Juan Quintela [Wed, 17 Oct 2012 18:08:04 +0000 (20:08 +0200)]
ram: rename last_block to last_seen_block
Signed-off-by: Juan Quintela <quintela@redhat.com>
Juan Quintela [Wed, 3 Oct 2012 18:04:41 +0000 (20:04 +0200)]
migration: move migration notifier
At this point, it is waranteed that state is ACTIVE. Old position
didn't assured hat.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Juan Quintela [Wed, 3 Oct 2012 16:23:03 +0000 (18:23 +0200)]
migration: Inline qemu_fopen_ops_buffered into migrate_fd_connect
Signed-off-by: Juan Quintela <quintela@redhat.com>
Juan Quintela [Wed, 3 Oct 2012 15:23:59 +0000 (17:23 +0200)]
migration: move migration_fd_put_ready()
Put it near its use and un-export it.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Juan Quintela [Wed, 19 Dec 2012 09:40:48 +0000 (10:40 +0100)]
migration: add XFER_LIMIT_RATIO
The "magic" divisions by 10 are there because of the value of BUFFER_DELAY.
Introduce a constant to explain them better.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Juan Quintela [Wed, 3 Oct 2012 12:18:33 +0000 (14:18 +0200)]
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.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Juan Quintela [Fri, 21 Sep 2012 09:18:18 +0000 (11:18 +0200)]
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
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>
Juan Quintela [Tue, 24 Jul 2012 12:24:08 +0000 (14:24 +0200)]
buffered_file: unfold buffered_append in buffered_put_buffer
It was the only user, and now buffered_put_buffer just do the append
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Juan Quintela [Tue, 24 Jul 2012 12:00:13 +0000 (14:00 +0200)]
buffered_file: don't flush on put buffer
We call buffered_put_buffer with iothread held, and buffered_flush() does
synchronous writes. We only want to do the synchronous writes outside.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Juan Quintela [Tue, 24 Jul 2012 11:22:18 +0000 (13:22 +0200)]
buffered_file: Unfold the trick to restart generating migration data
This was needed before due to the way that the callbacks worked.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Juan Quintela [Mon, 23 Jul 2012 04:31:30 +0000 (06:31 +0200)]
migration: just lock migrate_fd_put_ready
Signed-off-by: Juan Quintela <quintela@redhat.com>
Juan Quintela [Mon, 23 Jul 2012 04:24:03 +0000 (06:24 +0200)]
migration: remove unfreeze logic
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>
Juan Quintela [Mon, 23 Jul 2012 04:15:02 +0000 (06:15 +0200)]
migration: make writes blocking
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>
Juan Quintela [Mon, 23 Jul 2012 03:45:29 +0000 (05:45 +0200)]
migration: move migration thread init code to migrate_fd_put_ready
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>
Juan Quintela [Mon, 23 Jul 2012 00:13:23 +0000 (02:13 +0200)]
migration: make qemu_fopen_ops_buffered() return void
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>
Juan Quintela [Sun, 22 Jul 2012 23:56:50 +0000 (01:56 +0200)]
buffered_file: Move from using a timer to use a thread
We still protect everything except the wait with the iothread lock.
But we moved from a timer to a thread. Steps one by one.
We also need to detect when we have finished with a variable "complete".
Signed-off-by: Juan Quintela <quintela@redhat.com>
Umesh Deshpande [Wed, 17 Aug 2011 07:01:33 +0000 (00:01 -0700)]
protect the ramlist with a separate mutex
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>
Umesh Deshpande [Thu, 18 Aug 2011 18:41:17 +0000 (11:41 -0700)]
add a version number to ram_list
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>
Paolo Bonzini [Wed, 14 Nov 2012 15:00:51 +0000 (16:00 +0100)]
exec: sort the memory from biggest to smallest
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Paolo Bonzini [Wed, 14 Nov 2012 14:54:48 +0000 (15:54 +0100)]
exec: change RAM list to a TAILQ
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Paolo Bonzini [Wed, 14 Nov 2012 14:45:02 +0000 (15:45 +0100)]
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, so
this actually goes down to 1 item.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Juan Quintela [Wed, 3 Oct 2012 12:08:05 +0000 (14:08 +0200)]
migration-fd: remove duplicate include
Signed-off-by: Juan Quintela <quintela@redhat.com>
Juan Quintela [Wed, 3 Oct 2012 12:07:31 +0000 (14:07 +0200)]
migration: include qemu-file.h
They don't use/know anything about buffered-file.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Paolo Bonzini [Sat, 10 Nov 2012 17:58:40 +0000 (18:58 +0100)]
migration: remove double call to migrate_fd_close
The call in buffered_close is enough, because buffered_close is called
already by migrate_fd_cleanup.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Paolo Bonzini [Tue, 20 Nov 2012 11:48:19 +0000 (12:48 +0100)]
buffered_file: do not send more than s->bytes_xfer bytes per tick
Sending more was possible if the buffer was large.
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Paolo Bonzini [Wed, 12 Dec 2012 11:54:43 +0000 (12:54 +0100)]
migration: fix migration_bitmap leak
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Anthony Liguori [Wed, 19 Dec 2012 23:15:39 +0000 (17:15 -0600)]
Merge remote-tracking branch 'bonzini/header-dirs' into staging
* 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>
Andreas Färber [Sun, 9 Dec 2012 19:15:31 +0000 (20:15 +0100)]
MAINTAINERS: Include X86CPU in CPU maintenance area
Document that the x86 CPU refactorings are going through the qom-cpu
tree. This does not contradict the established practice that patches
adding KVM features to the x86 CPU go through the KVM maintainers,
it merely takes it out of target-i386 TCG's Odd Fixes status.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Marcello Tosatti <mtosatti@redhat.com>
Andreas Färber [Sat, 1 Dec 2012 05:18:14 +0000 (06:18 +0100)]
cpu: Move kvm_run into CPUState
Pass CPUState / {X86,S390}CPU to helper functions.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Andreas Färber [Sat, 1 Dec 2012 04:35:08 +0000 (05:35 +0100)]
cpu: Move kvm_state field into CPUState
Adapt some functions to take CPUState / {PowerPC,S390}CPU argument.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Andreas Färber [Sat, 1 Dec 2012 03:43:18 +0000 (04:43 +0100)]
ppc_booke: Pass PowerPCCPU to ppc_booke_timers_init()
Cleans up after passing PowerPCCPU to timer callbacks.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Andreas Färber [Sat, 1 Dec 2012 03:47:33 +0000 (04:47 +0100)]
ppc4xx_devs: Return PowerPCCPU from ppc4xx_init()
Prepares for passing PowerPCCPU to ppc_booke_timers_init().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Andreas Färber [Sat, 1 Dec 2012 03:35:15 +0000 (04:35 +0100)]
ppc_booke: Pass PowerPCCPU to {decr,fit,wdt} timer callbacks
Cleans up after passing PowerPCCPU to booke_update_irq().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Andreas Färber [Sat, 1 Dec 2012 03:26:55 +0000 (04:26 +0100)]
ppc: Pass PowerPCCPU to [h]decr timer callbacks
Cleans up after passing PowerPCCPU to [h]decr exception callbacks.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Andreas Färber [Sat, 1 Dec 2012 03:18:02 +0000 (04:18 +0100)]
ppc: Pass PowerPCCPU to [h]decr callbacks
Cleans up after passing PowerPCCPU to ppc_set_irq().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Andreas Färber [Sat, 1 Dec 2012 02:55:58 +0000 (03:55 +0100)]
ppc: Pass PowerPCCPU to ppc_set_irq()
Adapt static caller functions.
This cleans up after passing PowerPCCPU to kvmppc_set_interrupt().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Andreas Färber [Wed, 31 Oct 2012 05:06:49 +0000 (06:06 +0100)]
kvm: Pass CPUState to kvm_vcpu_ioctl()
Adapt helper functions to pass X86CPU / PowerPCCPU / S390CPU.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Andreas Färber [Wed, 31 Oct 2012 05:57:49 +0000 (06:57 +0100)]
kvm: Pass CPUState to kvm_arch_*
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>
Andreas Färber [Wed, 31 Oct 2012 04:29:00 +0000 (05:29 +0100)]
cpu: Move kvm_fd into CPUState
Signed-off-by: Andreas Färber <afaerber@suse.de>
Eduardo Habkost [Wed, 5 Dec 2012 16:49:11 +0000 (14:49 -0200)]
qdev-properties.c: Separate core from the code used only by qemu-system-*
This separates the qdev properties code in two parts:
- qdev-properties.c, that contains most of the qdev properties code;
- qdev-properties-system.c for code specific for qemu-system-*,
containing:
- Property types: drive, chr, netdev, vlan, that depend on code that
won't be included on *-user
- qemu_add_globals(), that depends on qemu-config.o.
This change should help on two things:
- Allowing DeviceState to be used by *-user without pulling
dependencies that are specific for qemu-system-*;
- Writing qdev unit tests without pulling too many dependencies.
The copyright/license of qdev-properties.c isn't explicitly stated at
the file, so add a simple copyright/license header pointing to the
commit ID of the original file.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Eduardo Habkost [Wed, 5 Dec 2012 16:49:10 +0000 (14:49 -0200)]
qdev: Coding style fixes
Add missing braces and break lines larger than 80 chars.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Andreas Färber [Sun, 16 Dec 2012 01:17:02 +0000 (02:17 +0100)]
cpu: Introduce CPUListState struct
This generalizes {ARM,M68k,Alpha}CPUListState to avoid declaring it for
each target. Place it in cpu-common.h to avoid circular dependencies.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Paolo Bonzini [Wed, 24 Oct 2012 11:09:17 +0000 (13:09 +0200)]
janitor: move remaining public headers to include/
Headers in the root directory are now used only from within that
directory.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Fri, 14 Sep 2012 16:19:15 +0000 (18:19 +0200)]
hw: move executable format header files to hw/
Or delete a.out.h which is unused.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Wed, 24 Oct 2012 11:12:00 +0000 (13:12 +0200)]
fpu: move public header file to include/fpu
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Mon, 17 Dec 2012 17:20:05 +0000 (18:20 +0100)]
softmmu: move remaining include files to include/ subdirectories
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Mon, 17 Dec 2012 17:20:04 +0000 (18:20 +0100)]
softmmu: move include files to include/sysemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Mon, 17 Dec 2012 17:20:00 +0000 (18:20 +0100)]
misc: move include files to include/qemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Mon, 17 Dec 2012 17:19:50 +0000 (18:19 +0100)]
qom: move include files to include/qom/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Mon, 17 Dec 2012 17:19:50 +0000 (18:19 +0100)]
migration: move include files to include/migration/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Mon, 17 Dec 2012 17:19:49 +0000 (18:19 +0100)]
monitor: move include files to include/monitor/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Mon, 17 Dec 2012 17:19:49 +0000 (18:19 +0100)]
exec: move include files to include/exec/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Mon, 17 Dec 2012 17:19:44 +0000 (18:19 +0100)]
block: move include files to include/block/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Mon, 17 Dec 2012 17:19:43 +0000 (18:19 +0100)]
qapi: move include files to include/qobject/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Thu, 6 Dec 2012 11:15:58 +0000 (12:15 +0100)]
janitor: add guards to headers
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Thu, 6 Dec 2012 10:28:04 +0000 (11:28 +0100)]
qapi: make struct Visitor opaque
Move its definition from qapi-visit-core.h to qapi-visit-impl.h.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Thu, 6 Dec 2012 10:51:59 +0000 (11:51 +0100)]
qapi: remove qapi/qapi-types-core.h
The file is only including error.h and qerror.h. Prefer explicit
inclusion of whatever files are needed.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>