summaryrefslogtreecommitdiff
path: root/util
AgeCommit message (Collapse)AuthorFilesLines
2016-01-27oslib-win32: always get java path from registryJinhyung Jo2-115/+84
Regardless of the architecture of the emulator(32bit or 64bit), always gets the java execution path from Windows registry. This commit would be helpful to reduce the java execution failure. Change-Id: I890bfa67ffdde36bbbd28678e196d7a50bce65a8 Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
2015-09-14emulator: Fixed a bug Java path not found on Windows 64jinhyung.jo1-11/+9
The get_java_path function aways returns the first item of the JRE(or JDK) registry. The RegEnumKeyEx function's 4th argument type is [In, Out], But previous implementations have used without resetting it. So fix it and improved the 'while' statement. Change-Id: Ief77879c1b6be8f02fbc36e5c7d118152984e371 Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com> (cherry picked from commit 812b3ccac697ae0d026bb7ea911b95aaa7f04921)
2015-09-14emulator: Modified code about java path in WOW64jinhyung.jo1-35/+74
Use more registry keys and the environment variable in oder to find more precise 'Java Home'. Removed redundant code. Change-Id: I9ef2d3e87cd47cb31ee0c4389269cca2708fcc4d Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com> (cherry picked from commit 6ba1131714016b47c49e79f361c66cd25d148bc0)
2014-12-24util/qemu-sockets.c: Avoid unused variable warningsPeter Maydell1-2/+1
The 'on' variable is never used, and 'off' is only used if IPV6_V6ONLY is defined; delete 'on' and move 'off' to the point where it is used. This avoids warnings from clang 3.4. Change-Id: Ia886bd9b95c0b019d5808834cf704bc97a3cd312 Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-10-16Merge branch 'tizen' into tizen_2.3SeokYeon Hwang2-1/+25
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com> Conflicts: hw/virtio/virtio-pci.c hw/virtio/virtio-pci.h package/build.macos-64 package/build.ubuntu-32 package/build.ubuntu-64 package/build.windows-32 package/changelog package/pkginfo.manifest tizen/src/Makefile.tizen tizen/src/Makefile.tizen.i386 tizen/src/debug_ch.c tizen/src/debug_ch.h tizen/src/display/maru_sdl.c tizen/src/display/maru_sdl_processing.c tizen/src/display/maru_shm.c tizen/src/display/maru_shm.h tizen/src/ecs/Makefile.tizen tizen/src/ecs/ecs.c tizen/src/ecs/ecs_eventcast.h tizen/src/ecs/ecs_msg.c tizen/src/ecs/ecs_tethering.c tizen/src/emul_state.c tizen/src/emul_state.h tizen/src/emulator.c tizen/src/eventcast/common.h tizen/src/eventcast/msg/eventcast.proto tizen/src/hw/maru_pm.c tizen/src/hw/pci/maru_brillcodec.c tizen/src/hw/virtio/maru_virtio_jack.h tizen/src/hw/virtio/maru_virtio_nfc.c tizen/src/hw/virtio/maru_virtio_sensor.h tizen/src/sdb.c tizen/src/sdb.h tizen/src/skin/client/skins/mobile-320x480-3btn/default.dbi tizen/src/skin/client/skins/mobile-480x800-3btn/default.dbi tizen/src/skin/client/skins/mobile-720x1280-3btn/default.dbi tizen/src/skin/client/skins/mobile-general-3btn/default.dbi tizen/src/skin/client/skins/wearable-general-1btn/default.dbi tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java tizen/src/skin/maruskin_operation.c tizen/src/skin/maruskin_server.c tizen/src/tethering/Makefile.tizen tizen/src/tethering/app_tethering.h tizen/src/tethering/common.h tizen/src/tethering/genmsg/tethering.pb-c.c tizen/src/tethering/genmsg/tethering.pb-c.h tizen/src/tethering/touch.h tizen/src/util/osutil-linux.c tizen/src/util/osutil-win32.c tizen/src/util/osutil.h
2014-07-09emulator: clean-up some headers and sourcesSeokYeon Hwang1-1/+1
Rename "maru_common.h" to "emulator_common.h". Remove unnecessary headers. Remove "guest_debug.h". Change-Id: I98b4fcf5c3205e4a537685a168f761a749dbd34b Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
2014-07-08emulator: fix bad usage of "strerror()"SeokYeon Hwang1-1/+1
Change-Id: Ic9cd037a0f39f98a0102394cb30731ea11a199da Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
2014-06-17emulator: fix legacy arguments compatibility issueSeokYeon Hwang2-4/+12
Fix legacy arguments compatibility issue. Fix memory break related with RAM preallocation. Change-Id: Ia43f1367a8910f9bf52383ac703123c9998c2f06 Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
2014-06-16emulator: modify RAM preallocation logicSeokYeon Hwang2-0/+16
Change-Id: Idfe6eb74f35fa13c9518dedb18adec3b9ed1de20 Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
2014-04-21Merge branch 'upstream_qemu_2.0' into tizenSeokYeon Hwang22-110/+1493
Initial merge Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com> Conflicts: .gitignore Makefile.target block/raw-win32.c configure cpu-exec.c cpus.c hw/9pfs/virtio-9p-device.c hw/i386/pc_piix.c include/exec/cpu-defs.h include/qemu-common.h include/sysemu/sysemu.h include/ui/console.h tcg/i386/tcg-target.c tcg/tcg.h ui/console.c ui/input.c util/oslib-posix.c vl.c Change-Id: I52df9052942eea8d541bde75fd936e58a9f2f8ff
2014-03-28Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell2-3/+20
acpi,pc,build bug fixes Here are some bugfixes for 2.0. A bugfix for acpi for pci bridges, and a build fix for old systems without pthread_setname_np: both fix regressions so we definitely want to include them. HPET fix is not for a regression but looks very safe, fixes a nasty bug and has been on list for a while. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Fri 28 Mar 2014 12:00:12 GMT using RSA key ID D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" * remotes/mst/tags/for_upstream: acpi: fix ACPI generation for pci bridges Don't enable a HPET timer if HPET is disabled Detect pthread_setname_np at configure time Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-03-27Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-2014-03-27' ↵Peter Maydell1-1/+1
into staging trivial patches for 2014-03-27 # gpg: Signature made Thu 27 Mar 2014 15:23:53 GMT using RSA key ID 74F0C838 # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>" # gpg: aka "Michael Tokarev <mjt@corpit.ru>" # gpg: aka "Michael Tokarev <mjt@debian.org>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D 4324 457C E0A0 8044 65C5 # Subkey fingerprint: E190 8639 3B10 B51B AC2C 8B73 5253 C5AD 74F0 C838 * remotes/mjt/tags/trivial-patches-2014-03-27: (23 commits) linux-user: remove duplicate statement hw/timer/grlib_gptimer: remove unnecessary assignment hw/pci-host/apb.c: Avoid shifting left into sign bit hw/intc/xilinx_intc: Avoid shifting left into sign bit hw/intc/slavio_intctl: Avoid shifting left into sign bit tests/libqos/pci-pc: Avoid shifting left into sign bit hw/ppc: Avoid shifting left into sign bit hw/intc/openpic: Avoid shifting left into sign bit hw/usb/hcd-ohci.c: Avoid shifting left into sign bit target-mips: Avoid shifting left into sign bit hw/i386/acpi_build.c: Avoid shifting left into sign bit hw/pci/pci_host.c: Avoid shifting left into sign bit hw/intc/apic.c: Use uint32_t for mask word in foreach_apic target-i386: Avoid shifting left into sign bit CODING_STYLE: Section about mixed declarations doc: update default PowerPC framebuffer settings doc: update sun4m documentation fix return check for KVM_GET_DIRTY_LOG ioctl target-i386: Add missing 'static' and 'const' attributes util: Add 'static' attribute to function implementation ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-03-27Detect pthread_setname_np at configure timeDr. David Alan Gilbert2-3/+20
Warn if no way of setting thread name is available. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-03-27util: Add 'static' attribute to function implementationStefan Weil1-1/+1
The static code analyzer smatch complains because of a missing 'static' attribute: util/module.c:166:6: warning: symbol 'module_load' was not declared. Should it be static? 'static' is used in the forward declaration, but not in the implementation. Add it there, too. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-03-27util: add qemu_ether_ntoaAlexey Kardashevskiy1-0/+14
This adds a helper to format ethernet MAC address. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
2014-03-25osdep: initialize glib threads in all QEMU toolsStefan Hajnoczi1-0/+18
glib versions prior to 2.31.0 require an explicit g_thread_init() call to enable multi-threading. Failure to initialize threading causes glib to take single-threaded code paths without synchronization. For example, the g_slice allocator will crash due to race conditions. Fix this for all QEMU tool programs (qemu-nbd, qemu-io, qemu-img) by moving the g_thread_init() call from vl.c:main() into a new osdep.c:thread_init() constructor function. thread_init() has __attribute__((constructor)) and is automatically invoked by the runtime during startup. We can now drop the "simple" trace backend's g_thread_init() call since thread_init() already called it. Note that we must keep coroutine-gthread.c's g_thread_init() call which is located in a constructor function. There is no guarantee for constructor function ordering so thread_init() may only be called later. Reported-by: Mario de Chenno <mario.dechenno@unina2.it> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-03-17debug utility : dump backtrace whenever exit called or signal catchedGeunhae LEE1-1/+8
- tested on both Linux and Windows - stack trace is printed out in emulator.log by class of err - it only print stack trace for thread which either calls exit or catchs signals Change-Id: I45258234af329889226badb8e8455d355ded4de6 Signed-off-by: Geunhae LEE <geunhae.lee@samsung.com>
2014-03-13Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into ↵Peter Maydell2-0/+79
staging Block pull request # gpg: Signature made Thu 13 Mar 2014 13:50:49 GMT using RSA key ID 81AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/block-pull-request: (24 commits) block/raw-win32: bdrv_parse_filename() for hdev block/raw-posix: Strip protocol prefix on creation block/raw-posix: bdrv_parse_filename() for cdrom block/raw-posix: bdrv_parse_filename() for floppy block/raw-posix: bdrv_parse_filename() for hdev qemu-io: Fix warnings from static code analysis block: Unlink temporary file qcow2: Don't write with BDRV_O_INCOMING qcow2: Keep option in qcow2_invalidate_cache() qmp: add query-iothreads command iothread: stash thread ID away dataplane: replace internal thread with IOThread iothread: add "iothread" qdev property type qdev: make get_pointer() handle temporary strings iothread: add I/O thread object aio: add aio_context_acquire() and aio_context_release() rfifolock: add recursive FIFO lock object: add object_get_canonical_path_component() block: Rewrite the snapshot authorization mechanism for block filters. iotests: Test corruption during COW request ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-03-13oslib-posix: Fix build on FreeBSDAndreas Färber1-0/+4
Commit 10f5bff622cad71645e22c027b77ac31e51008ef (util: Split out exec_dir from os_find_datadir) moved code from os-posix.c to util/oslib-posix.c but forgot to move a FreeBSD #include alongside, needed for CTL_KERN among others. Cc: Fam Zheng <famz@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <andreas.faerber@web.de> Message-id: 1394717279-23406-1-git-send-email-andreas.faerber@web.de Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-03-13rfifolock: add recursive FIFO lockStefan Hajnoczi2-0/+79
QemuMutex does not guarantee fairness and cannot be acquired recursively: Fairness means each locker gets a turn and the scheduler cannot cause starvation. Recursive locking is useful for composition, it allows a sequence of locking operations to be invoked atomically by acquiring the lock around them. This patch adds RFifoLock, a recursive lock that guarantees FIFO order. Its first user is added in the next patch. RFifoLock has one additional feature: it can be initialized with an optional contention callback. The callback is invoked whenever a thread must wait for the lock. For example, it can be used to poke the current owner so that they release the lock soon. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-03-11qemu-thread-posix: Fix build against older glibc versionJan Kiszka1-1/+1
pthread_setname_np was introduced with 2.12. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-03-09Add a 'name' parameter to qemu_thread_createDr. David Alan Gilbert3-4/+10
If enabled, set the thread name at creation (on GNU systems with pthread_set_np) Fix up all the callers with a thread name Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2014-03-09Add 'debug-threads' suboption to --nameDr. David Alan Gilbert2-0/+15
Add flag storage to qemu-thread-* to store the namethreads flag Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2014-03-05target-ppc: Add ISA2.06 divde[o] InstructionsTom Musta1-0/+37
This patch adds the Divide Doubleword Extended instructions. The implementation builds on the unsigned helper provided in the previous patch. Signed-off-by: Tom Musta <tommusta@gmail.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Alexander Graf <agraf@suse.de>
2014-03-05target-ppc: Add ISA2.06 divdeu[o] InstructionsTom Musta1-0/+38
This patch adds the Divide Doubleword Extended Unsigned instructions. This instruction requires dividing a 128-bit value by a 64 bit value. Since 128 bit integer division is not supported in TCG, a helper is used. An architecture independent 128-bit division routine is added to host-utils. Signed-off-by: Tom Musta <tommusta@gmail.com> Reviewed-by: Richard Henderson <rth@twiddle.net> [agraf: use ||] Signed-off-by: Alexander Graf <agraf@suse.de>
2014-03-03util/iov: Use qemu/sockets.h instead of conditional codeStefan Weil1-8/+1
Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-02-28modules: Fix building with --enable-modulesFam Zheng1-1/+1
Compiling util/modules.c with modules enabled fails now. Fix it by including qemu-common.h before #ifdef testing in module.c. Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1393453893-12125-1-git-send-email-famz@redhat.com Reviewed-by: Hu Tao <hutao@cn.fujitsu.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-02-25modules: do not include gmodule-2.0 in static buildsPaolo Bonzini1-0/+2
gmodule-2.0's pkg-config files include -Wl,--export-dynamic, which breaks static builds. It is a glib bug, but we need to support --static builds for the linux-user targets, and in the end all that is needed to fix this is: * outlaw --enable-modules --static, which makes little sense anyway * only include gmodule-2.0's cflags and ldflags if --enable-modules is specified on the command line. Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1393346215-5636-1-git-send-email-pbonzini@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-02-25Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into stagingPeter Maydell3-0/+161
Block patches # gpg: Signature made Fri 21 Feb 2014 21:42:24 GMT using RSA key ID C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" * remotes/kevin/tags/for-upstream: (54 commits) iotests: Mixed quorum child device specifications quorum: Simplify quorum_open() quorum: Add unit test. quorum: Add quorum_open() and quorum_close(). quorum: Implement recursive .bdrv_recurse_is_first_non_filter in quorum. quorum: Add quorum_co_flush(). quorum: Add quorum_invalidate_cache(). quorum: Add quorum_getlength(). quorum: Add quorum mechanism. quorum: Add quorum_aio_readv. blkverify: Extract qemu_iovec_clone() and qemu_iovec_compare() from blkverify. quorum: Add quorum_aio_writev and its dependencies. quorum: Create BDRVQuorumState and BlkDriver and do init. quorum: Create quorum.c, add QuorumChildRequest and QuorumAIOCB. check-qdict: Test termination of qdict_array_split() check-qdict: Adjust test for qdict_array_split() qdict: Extract non-QDicts in qdict_array_split() qemu-config: Sections must consist of keys qemu-iotests: Check qemu-img command line parsing qemu-img: Allow -o help with incomplete argument list ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-02-24Merge remote-tracking branch 'remotes/bonzini/configure' into stagingPeter Maydell3-2/+227
* remotes/bonzini/configure: build: softmmu targets do not have a "main.o" file configure: Disable libtool if -fPIE does not work with it (bug #1257099) block: convert block drivers linked with libs to modules Makefile: introduce common-obj-m and block-obj-m for DSO Makefile: install modules with "make install" module: implement module loading rules.mak: introduce DSO rules darwin: do not use -mdynamic-no-pic block: use per-object cflags and libs rules.mak: allow per object cflags and libs rules.mak: fix $(obj) to a real relative path util: Split out exec_dir from os_find_datadir Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-02-21blkverify: Extract qemu_iovec_clone() and qemu_iovec_compare() from blkverify.Benoît Canet1-0/+106
qemu_iovec_compare() will be used to compare IOs vectors in quorum blkverify mode. The patch extracts these functions in order to factorize the code. Signed-off-by: Benoit Canet <benoit@irqsave.net> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-02-21qemu-config: Sections must consist of keysMax Reitz1-0/+6
In config_parse_qdict_section(), the QList returned by qdict_array_split() is assumed to only contain QDicts. Currently, this is true but it may (and will) change in the future. Therefore, check whether the assumption actually holds. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-02-21qemu-option: has_help_option() and is_valid_option_list()Kevin Wolf1-0/+49
has_help_option() checks if any help option ('help' or '?') occurs anywhere in an option string, so that things like 'cluster_size=4k,help' are recognised. is_valid_option_list() ensures that the option list doesn't have options with leading commas or trailing unescaped commas. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2014-02-20module: implement module loadingFam Zheng1-2/+143
This patch adds loading, stamp checking and initialization of modules. The init function of dynamic module is no longer directly called as __attribute__((constructor)) in static linked version, it is called only after passed the checking of presense of stamp symbol: qemu_stamp_$RELEASEHASH where $RELEASEHASH is generated by hashing version strings and content of configure script. With this, modules built from a different tree/version/configure will not be loaded. The module loading code requires gmodule-2.0. Modules are searched under - CONFIG_MODDIR - executable folder (to allow running qemu-{img,io} in the build directory) - ../ of executable folder (to allow running system emulator in the build directory) Modules are linked under their subdir respectively, then copied to top level of build directory for above convinience, e.g.: $(BUILD_DIR)/block/curl.so -> $(BUILD_DIR)/block-curl.so Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-02-20util: Split out exec_dir from os_find_datadirFam Zheng2-0/+84
With this change, main() calls qemu_init_exec_dir and uses argv[0] to init exec_dir. The saved value can be retrieved with qemu_get_exec_dir later. It will be reused by module loading. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-02-17Use error_is_set() only when necessaryMarkus Armbruster2-19/+19
error_is_set(&var) is the same as var != NULL, but it takes whole-program analysis to figure that out. Unnecessarily hard for optimizers, static checkers, and human readers. Dumb it down to obvious. Gets rid of several dozen Coverity false positives. Note that the obvious form is already used in many places. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-02-08util/fifo8: clear fifo head upon resetBeniamino Galvani1-0/+1
To improve the predictability of fifo8_pop_buf(), the fifo head is set to the start of data buffer upon a reset so that the first call to the function will be able to retrieve all data in the fifo. Signed-off-by: Beniamino Galvani <b.galvani@gmail.com> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-02-08util/fifo8: implement push/pop of multiple bytesBeniamino Galvani1-0/+46
The patch adds functions fifo8_push_all() and fifo8_pop_buf() which can be used respectively to push the content of a memory buffer to the fifo and to pop multiple bytes obtaining a pointer to the fifo backing buffer. In addition, it implements fifo8_num_free() and fifo8_num_used() which allow to check if a multi-byte operation can be performed. Signed-off-by: Beniamino Galvani <b.galvani@gmail.com> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-02-01osdep: drop unused #include "trace.h"Stefan Hajnoczi1-1/+0
osdep.c does not use trace_*() so we can just drop the include. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-01-24qemu_memalign: Allow small alignmentsKevin Wolf1-0/+5
The functions used by qemu_memalign() require an alignment that is at least sizeof(void*). Adjust it if it is too small. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Benoît Canet <benoit@irqsave.net>
2014-01-24qemu-progress: Fix progress printing on SIGUSR1Kevin Wolf1-0/+10
Since commit a7aae221 ('Switch SIG_IPI to SIGUSR1'), SIGUSR1 is blocked during startup, breaking the progress report in tools. This patch reenables the signal when initialising a progress report. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net>
2014-01-24qemu-progress: Drop unused includeKevin Wolf1-1/+0
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net>
2014-01-22qemu-option: Add qemu_config_parse_qdict()Max Reitz1-0/+100
This function basically parses command-line options given as a QDict replacing a config file. For instance, the QDict {"section.opt1": 42, "section.opt2": 23} corresponds to the config file: [section] opt1 = 42 opt2 = 23 It is possible to specify multiple sections and also multiple sections of the same type. On the command line, this looks like the following: inject-error.0.event=reftable_load,\ inject-error.1.event=l2_load,\ set-state.event=l1_update This would correspond to the following config file: [inject-error "inject-error.0"] event = reftable_load [inject-error "inject-error.1"] event = l2_load [set-state] event = l1_update Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-22osdep: add qemu_set_tty_echo()Stefan Hajnoczi2-0/+37
Using stdin with readline.c requires disabling echo and line buffering. Add a portable wrapper to set the terminal attributes under Linux and Windows. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-22readline: move readline to a generic locationStefan Hajnoczi2-0/+496
Now that the monitor and readline are decoupled, readline.h no longer belongs in include/monitor/. Put the header into include/qemu/. Move the source file into util/ so it can be linked as part of libqemuutil.a. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-17Revert "error: Don't use error_report() for assertion msgs."Peter Crosthwaite1-4/+4
This reverts commit d32934c84c72f57e78d430c22974677b7bcabe5d. The original implementation before this patch makes abortive error messages much more friendly. The underlying bug that required this change is now fixed. Revert. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2014-01-15error: Don't use error_report() for assertion msgs.Peter Crosthwaite1-4/+4
Use fprintf(stderr instead. This removes dependency of libqemuutil.a on the monitor. We can further justify this change, in that this code path should only trigger under a fatal error condition. fprintf-stderr is probably the appropriate medium as under a fatal error conidition the monitor itself may be down and out for the count. So assertion failure messages should go lowest common denominator - straight to stderr. Fixes the build as reported by Kevin Wolf. Issue debugged and change suggested by Luiz Capitulino. Issue introduced by 5d24ee70bcbcf578614193526bcd5ed30a8eb16c. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2014-01-14Merge remote branch 'luiz/queue/qmp' into qmpqEdgar E. Iglesias4-20/+31
* luiz/queue/qmp: migration: qmp_migrate(): keep working after syntax error qerror: Remove assert_no_error() qemu-option: Remove qemu_opts_create_nofail target-i386: Remove assert_no_error usage hw: Remove assert_no_error usages qdev: Delete dead code error: Add error_abort monitor: add object-add (QMP) and object_add (HMP) command monitor: add object-del (QMP) and object_del (HMP) command qom: catch errors in object_property_add_child qom: fix leak for objects created with -object rng: initialize file descriptor to -1 qemu-monitor: HMP cpu-add wrapper vl: add missing transition debug->finish_migrate Message-Id: 1389045795-18706-1-git-send-email-lcapitulino@redhat.com Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2014-01-13bitmap: use long as indexJuan Quintela1-30/+30
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-06qemu-option: Remove qemu_opts_create_nofailPeter Crosthwaite3-19/+10
This is a boiler-plate _nofail variant of qemu_opts_create. Remove and use error_abort in call sites. null/0 arguments needs to be added for the id and fail_if_exists fields in affected callsites due to argument inconsistency between the normal and no_fail variants. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>