summaryrefslogtreecommitdiff
path: root/include/sysemu
AgeCommit message (Collapse)AuthorFilesLines
2013-03-23Add sample moxie systemAnthony Green1-0/+1
Signed-off-by: Anthony Green <green@moxielogic.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-03-15blockdev: Keep a copy of DriveInfo.serialKevin Wolf1-1/+1
Pointing to a QemuOpts element is surprising and can lead to subtle use-after-free errors when the QemuOpts is freed after all options are parsed. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-03-11migration: use qemu_file_set_error to pass error codes back to qemu_savevm_statePaolo Bonzini1-3/+3
Reviewed-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-02-23Replace all setjmp()/longjmp() with sigsetjmp()/siglongjmp()Peter Maydell1-0/+8
The setjmp() function doesn't specify whether signal masks are saved and restored; on Linux they are not, but on BSD (including MacOSX) they are. We want to have consistent behaviour across platforms, so we should always use "don't save/restore signal mask" (this is also generally going to be faster). This also works around a bug in MacOSX where the signal-restoration on longjmp() affects the signal mask for a completely different thread, not just the mask for the thread which did the longjmp. The most visible effect of this was that ctrl-C was ignored on MacOSX because the CPU thread did a longjmp which resulted in its signal mask being applied to every thread, so that all threads had SIGINT and SIGTERM blocked. The POSIX-sanctioned portable way to do a jump without affecting signal masks is to siglongjmp() to a sigjmp_buf which was created by calling sigsetjmp() with a zero savemask parameter, so change all uses of setjmp()/longjmp() accordingly. [Technically POSIX allows sigsetjmp(buf, 0) to save the signal mask; however the following siglongjmp() must not restore the signal mask, so the pair can be effectively considered as "sigjmp/longjmp which don't touch the mask".] For Windows we provide a trivial sigsetjmp/siglongjmp in terms of setjmp/longjmp -- this is OK because no user will ever pass a non-zero savemask. The setjmp() uses in tests/tcg/test-i386.c and tests/tcg/linux-test.c are left untouched because these are self-contained singlethreaded test programs intended to be run under QEMU's Linux emulation, so they have neither the portability nor the multithreading issues to deal with. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Tested-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-02-21ui: add basic GTK gui (v5)Anthony Liguori1-0/+1
This is minimalistic and just contains the basic widget infrastructure. The GUI consists of a menu and a GtkNotebook. To start with, the notebook has its tabs hidden which provides a UI that looks very similar to SDL with the exception of the menu bar. The menu bar allows a user to toggle the visibility of the tabs. Cairo is used for rendering. I used gtk-vnc as a reference. gtk-vnc solves the same basic problems as QEMU since it was originally written as a remote display for QEMU. So for the most part, the approach to rendering and keyboard handling should be pretty solid for GTK. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1361367806-4599-4-git-send-email-aliguori@us.ibm.com
2013-02-21Remove forward declaration of non-existant variableHervé Poussineau1-1/+0
This variable has been removed 5 years ago in 970ac5a3082428dca91171f270dcd95d6f4b2636. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-16cpus.c: Drop unnecessary set_cpu_log()Peter Maydell1-1/+0
The set_cpu_log() function in cpus.c is a fairly simple wrapper which is only called from one location. Just inline the code into vl.c, since there is no need to indirect it via cpus.c and the handling of the error case is more appropriate to vl.c. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-02-16qemu-log: Unify {cpu_set,set_cpu}_log_filename as qemu_set_log_filenamePeter Maydell1-1/+0
The qemu_log() functionality is no longer specific to TCG CPU debug logs. Rename cpu_set_log_filename() to qemu_set_log_filename() and drop the pointless wrapper set_cpu_log_filename(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-02-02util: Fix compilation of envlist.c for MinGWStefan Weil1-0/+2
MinGW has no strtok_r, so we need a declaration in sysemu/os-win32.h. We must also fix the include statements in util/envlist.c to include that file. We currently don't need an implementation of strtok_r because the code is compiled but not linked for MinGW. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-02-01accel: change {xen, kvm, tcg, qtest}_allowed from int to boolliguang2-2/+2
Signed-off-by: liguang <lig.fnst@cn.fujitsu.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-28kvm: Pass CPUState to kvm_on_sigbus_vcpu()Andreas Färber1-1/+1
Since commit 20d695a9254c1b086a456d3b79a3c311236643ba (kvm: Pass CPUState to kvm_arch_*) CPUArchState is no longer needed. Allows to change qemu_kvm_eat_signals() argument as well. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Gleb Natapov <gleb@redhat.com>
2013-01-27cpus.h: Make constant smp_cores/smp_threads available on *-userEduardo Habkost1-0/+7
The code that calculates the APIC ID will use smp_cores/smp_threads, so just define them as 1 on *-user to avoid #ifdefs in the code. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-01-27kvm: Create kvm_arch_vcpu_id() functionEduardo Habkost1-0/+3
This will allow each architecture to define how the VCPU ID is set on the KVM_CREATE_VCPU ioctl call. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-01-27kvm: Add fake KVM_FEATURE_CLOCKSOURCE_STABLE_BIT for builds without KVMEduardo Habkost1-0/+1
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-01-26fw_cfg: Splash image loader can overrun a stack variable, fixMarkus Armbruster1-1/+1
read_splashfile() passes the address of an int variable as size_t * parameter to g_file_get_contents(), with a cast to gag the compiler. No problem on machines where sizeof(size_t) == sizeof(int). Happens to work on my x86_64 box (64 bit little endian): the least significant 32 bits of the file size end up in the right place (caller's variable file_size), and the most significant 32 bits clobber a place that gets assigned to before its next use (caller's variable file_type). I'd expect it to break on a 64 bit big-endian box. Fix up the variable types and drop the problematic cast. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-21Merge remote-tracking branch 'quintela/thread.next' into stagingAnthony Liguori1-1/+1
# By Juan Quintela (7) and Paolo Bonzini (6) # Via Juan Quintela * quintela/thread.next: migration: remove argument to qemu_savevm_state_cancel migration: Only go to the iterate stage if there is anything to send migration: unfold rest of migrate_fd_put_ready() into thread migration: move exit condition to migration thread migration: Add buffered_flush error handling migration: move beginning stage to the migration thread qemu-file: Only set last_error if it is not already set migration: fix off-by-one in buffered_rate_limit migration: remove double call to migrate_fd_close migration: make function static use XFER_LIMIT_RATIO consistently Protect migration_bitmap_sync() with the ramlist lock Unlock ramlist lock also in error case
2013-01-19vl: Use size_t for sizes in get_boot_devices_list()Markus Armbruster1-1/+1
Code mixes uint32_t, int and size_t. Very unlikely to go wrong in practice, but clean it up anyway. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-17migration: remove argument to qemu_savevm_state_cancelJuan Quintela1-1/+1
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2013-01-17HMP: add QDict to info callback handlerWenchao Xia1-2/+2
This patch change all info call back function to take additional QDict * parameter, which allow those command take parameter. Now it is set to NULL at default case. Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2013-01-15kvm: Add fake KVM constants to avoid #ifdefs on KVM-specific codeEduardo Habkost1-0/+14
Any KVM-specific code that use these constants must check if kvm_enabled() is true before using them. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-01-15kvm: Pass CPUState to kvm_init_vcpu()Andreas Färber1-2/+3
CPUArchState is no longer needed, and it thereby no longer depends on NEED_CPU_H. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-01-12qemu-option: move standard option definitions out of qemu-config.cPaolo Bonzini1-0/+8
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-23Merge branch 'master' of git://git.qemu.org/qemu into qom-cpuAndreas Färber15-0/+1343
Adapt header include paths. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-20savevm: New save live migration method: pendingJuan Quintela1-0/+1
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>
2012-12-19softmmu: move include files to include/sysemu/Paolo Bonzini15-0/+1342
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>