mips: avoid write only variables
Compiling with GCC 4.6.0 20100925 produced a lot of warnings like:/src/qemu/target-mips/translate.c: In function 'gen_ld':/src/qemu/target-mips/translate.c:1039:17: error: variable 'opn' set but not used [-Werror=unused-but-set-variable]...
ppc: avoid write only variables
Compiling with GCC 4.6.0 20100925 produced warnings:/src/qemu/target-ppc/op_helper.c: In function 'helper_icbi':/src/qemu/target-ppc/op_helper.c:351:14: error: variable 'tmp' set but not used [-Werror=unused-but-set-variable]...
i386: avoid a write only variable
Compiling with GCC 4.6.0 20100925 produced warnings:/src/qemu/target-i386/op_helper.c: In function 'switch_tss':/src/qemu/target-i386/op_helper.c:283:53: error: variable 'new_trap' set but not used [-Werror=unused-but-set-variable]...
vnc: avoid write only variables
Compiling with GCC 4.6.0 20100925 produced warnings:/src/qemu/ui/vnc.c: In function 'vnc_client_cache_auth':/src/qemu/ui/vnc.c:217:12: error: variable 'qdict' set but not used [-Werror=unused-but-set-variable]/src/qemu/ui/vnc.c: In function 'vnc_display_open':...
cris: avoid a write only variable
Compiling with GCC 4.6.0 20100925 produced a warning:In file included from /src/qemu/target-cris/translate.c:3154:0:/src/qemu/target-cris/translate_v10.c: In function 'dec10_prep_move_m':/src/qemu/target-cris/translate_v10.c:111:22: error: variable 'rd' set but not used [-Werror=unused-but-set-variable]...
Delete write only variables
Compiling with GCC 4.6.0 20100925 produced warnings like:/src/qemu/net/tap-win32.c: In function 'tap_win32_open':/src/qemu/net/tap-win32.c:582:12: error: variable 'hThread' set but not used [-Werror=unused-but-set-variable]...
block: avoid a write only variable
Compiling with GCC 4.6.0 20100925 produced a warning:/src/qemu/block/qcow2-refcount.c: In function 'update_refcount':/src/qemu/block/qcow2-refcount.c:552:13: error: variable 'dummy' set but not used [-Werror=unused-but-set-variable]...
cirrus: avoid write only variables
Compiling with GCC 4.6.0 20100925 produced a lot of warnings like:In file included from /src/qemu/hw/cirrus_vga_rop.h:174:0, from /src/qemu/hw/cirrus_vga.c:284:/src/qemu/hw/cirrus_vga_rop2.h: In function 'cirrus_patternfill_0_8':...
eepro100: initialize a variable in all cases
Compiling with GCC 4.6.0 20100925 produced warnings:/src/qemu/hw/eepro100.c: In function 'eepro100_read4':/src/qemu/hw/eepro100.c:1351:14: error: 'val' may be used uninitialized in this function [-Werror=uninitialized]...
lsi53c895a: avoid a write only variable
Compiling with GCC 4.6.0 20100925 produced a warning:/src/qemu/hw/lsi53c895a.c: In function 'lsi_do_msgout':/src/qemu/hw/lsi53c895a.c:848:9: error: variable 'len' set but not used [-Werror=unused-but-set-variable]...
ppc: remove video.x
Only Mac-on-Linux stuff used video.x, OpenBIOS does not need it.
Remove video.x MoL hacks.
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Merge remote branch 'mst/for_anthony' into staging
trace: remove timestamp files when cleaning up
'make clean' did not remove trace.[ch]-timestamp files,only trace.[ch]. But 'make' did not know how to make trace.[ch]files if the timestamp files were present.
Fix by removing the timestamp files along with trace.[ch]....
configure: Send error message from spice check to /dev/null
pkg-config is not always available (e.g. on win32 hosts),but we don't want to see the 'command not found' error message.
Redirect stdout and stderr to /dev/null.
v2:
win32: Set unbuffered stdout
Win32 does not support line-buffering, but it allowsunbuffered output.
Unbuffered output is a good approximation. For typical outputstatements which usually end with '\n', it's even identical.
Buffered output is unusable for program traces because of...
.gitignore: Ignore *-timestamp
Timestamp files were recently added to reduce make churn on source filesthat use tracing. The timestamp files should never be committed andshould not be visible in git status.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
acpi: Fix an infinite loop in acpi_table_add
Commit d729bb9a7700e364b1c5f9893d61f07a9e002bce has a typo, causing aninfinite loop in acpi_table_add.
Signed-off-by: Vincent Minet <vincent@vincent-minet.net>Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>...
configure: Remove unneeded defines from checks
_GNU_SOURCE is already defined in QEMU_CFLAGS whichis passed to gcc in shell function compile_prog.
Removing the definition from several checks avoids compiler warnings(which are now written to config.log)....
configure: include stddef.h for NULL
This fixes an observed failure to detect madvise() on Linux.
To avoid similar issues, all other tests that use NULL but don't alreadyhave stddef.h (or another header that is defined to provide NULL,such as stdio.h, unistd.h, or time.h) are also fixed....
trace: Trace bdrv_aio_{readv,writev}
Observing block layer aio readv/writev operations is useful fordebugging image formats or understanding guest disk I/O patterns.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
trace: Use TP_PROTO() and TP_ARGS() for LTTng UST
The LTTng UserSpace Tracer formerly used TPPROTO and TPARGS insteadof TP_PROTO() and TP_ARGS() like the kernel uses. This has been changedso QEMU needs to follow.
I am not aware of a graceful way of making the transition but since no...
trace: Don't strip lines containing '#' arbitrarily
Although comment lines must be skipped, the '#' character can occur invalid format strings. Be more careful when checking for comments.Leave comments at the end of the line where they will not interfere with...
trace: Use portable format strings
It is not portable to use "%ld" for int64_t because int64_t may havetype long on 64-bit platforms and long long on 32-bit platforms. Usethe standard library PRId64 macros to keep format strings portable.
cris: Consider the TLB valid bit on writes to the TLB
When updating the guest TLB we only need to flush previousmappings from the entry written if the entry was valid.
Also fixes a compiler warning reported by Blue Swirl.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
virtio: invoke set_status callback on reset
As status is set to 0 on reset, invoke the relevant callback. This makesfor a cleaner code in devices as they don't need to duplicate the codein their reset routine, as well as excercises this path a little more....
virtio-net: unify vhost-net start/stop
Move all of vhost-net start/stop logic to a single routine,and call it from everywhere.
Additionally, start/stop vhost-net on link up/down:we should not transmit anything if user asked us toput the link down.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
eepro100: Add support for multiple individual addresses (multiple IA)
I reviewed the latest sources of Linux, FreeBSD and NetBSD.They all reset the multiple IA bit (multi_ia in BSD) to zero,but I did not find code which sets this bit to one(like it is done by some routers)....
virtio: change set guest notifier to per-device
When using irqfd with vhost-net to inject interrupts,a single evenfd might inject multiple interrupts.Implementing this is much easier with a singleper-device callback to set guest notifiers.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
vhost: error code
fix up errors returned to include errno, not just -1
net: delay freeing peer host device
With -netdev, virtio devices present offloadfeatures to guest, depending on the backend used.Thus, removing host netdev peer while guest isactive leads to guest-visible inconsistency and/or crashes.
As a solution, while guest (NIC) peer device exists,...
Merge remote branch 'spice/submit.6' into staging
Conflicts: configure
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote branch 'qmp/for-anthony' into staging
Fix spelling in comments
multifuction -> multifunctionsuccessfull -> successful.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
linux-user: Fix typo m86k -> m68k
Replace m86k_sim_stat by m68k_sim_stat.
Cc: Riku Voipio <riku.voipio@iki.fi>Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Add new user mode option -ignore-environment
An empty environment is sometimes useful in user mode.The new option provides it for linux-user and bsd-user(darwin-user still has no environment related options).
The patch also adds the documentation for other...
docs: Improve documentation
Fix some inconsistencies (tabs and punctuation)and try to improve grammar and spelling.
Cc: Juan Quintela <quintela@redhat.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>
ppc: Minor 40x MMU fixes
Signed-off-by: John Clark <clarkjc@runbox.com>Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
console: Avoid dereferencing NULL active_console
The console_select() function does not check that active_console isnon-NULL before dereferencing it. When invoked with qemu -nodefaults itis possible to hit this case.
This patch checks that active_console is non-NULL before stashing away...
exec: Fix compilation error for debug code
is_softmmu was removed with commitd4c430a80f000d722bb70287af4d4c184a8d7006,so remove it now from debug code, too.
Fix also the format specifier for paddrin the same line of code.
Cc: Blue Swirl <blauwirbel@gmail.com>...
rc4030: Fix compilation error in debug code
min was unknown here, so avoid it.
Cc: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
mipsnet: Fix compiler warning in debug code
size_t needs a different format specifier, so fix this.
block/vvfat: Fix compiler warning in debug code
Fix this compiler warning:./block/vvfat.c:2285: error: comparison of unsigned expression >= 0 is always true
Cc: Blue Swirl <blauwirbel@gmail.com>Cc: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
virtio-9p: Use GCC_FMT_ATTR and fix a format warning
With the new gcc format warnings, gcc detected this:
/qemu/hw/virtio-9p.c:1040: error: format ‘%u’ expects type ‘unsigned int’, but argument 4 has type ‘__nlink_t’
blockdev: Use GCC_FMT_ATTR (format checking)
Additional changes:
Use GCC_FMT_ATTR (format checking)
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Replace most gcc format attributes by macro GCC_FMT_ATTR (format checking)
Since version 4.4.x, gcc supports additional format attributes. attribute ((format (gnu_printf, 1, 2)))should be used instead of attribute ((format (printf, 1, 2))...
slirp: Silence warning on Haiku
Haiku has O_BINARY in fcntl.h.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>Cc: Jan Kiszka <jan.kiszka@web.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
tap: Add stub for Haiku
Adapted from AIX code.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
nbd: Haiku has _IO() in its BSD compatibility layer
Haiku doesn't have libm
Math functions are integrated into Haiku's libroot.
configure: Don't rely on special pthreads library
Haiku has pthreads integrated into its libroot.so library. No linker argumentsare needed for it, so don't fail if -lpthread and similar don't link.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>...
configure: Add basic support for Haiku
For compatibility with BeOS, Haiku's error codes are negative whereas recentPOSIX versions require them to be positive. As spotted by François, someparts of QEMU code rely on this, so use a mapper library to convert them...
trace: avoid unnecessary recompilation if nothing changed
Add logic to detect changes in generated files. If the oldand new files are identical, don't touch the generated file.This avoids a lot of churn since many files depend on trace.h.
Based on suggestion by Paolo Bonzini....
Makefile: fix config-devices.mak generation
The logic of detecting changes in default-configs/*.mak isflawed as can be demonstrated by 'touch default-configs/*.mak'followed by make. This results in a message claiming that usermade changes to the */config-devices.mak files....
sysbus: fix address truncation
Fix address truncation in sysbus by using a wider type.
Reported-by: Artyom Tarasenko <atar4qemu@googlemail.com>Tested-by: Andreas Färber <andreas.faerber@web.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
target-microblaze: Use %td for ptrdiff_t arguments in debug message
According to ISO/IEC 9899:1999 7.19.6.1,the correct length modifier for ptrdiff_t is 't', not 'z'.
Cc: Blue Swirl <blauwirbel@gmail.com>Cc: Markus Armbruster <armbru@redhat.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
target-cris: Use %td for ptrdiff_t arguments in debug message
virtex: Add braces
Monitor: Rename monitor_handler_is_async()
Let's follow the convention introduced by the previous commit andcall it handler_is_async().
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Monitor: Directly call QObject handlers
This avoids handle_user_command() calling monitor_call_handler(),which is currently shared with QMP.
QMP: Introduce qmp_call_cmd()
Calls a QObject handler and emits the QMP response, also dropsmonitor_call_handler() which is now unused.
Monitor: Rename the qemu-monitor.hx file
Let's be consistent and call it hmp-commands.hx, so that we haveqmp-commands.hx for QMP and hmp-commands.hx for HMP.
Please, note that this commit doesn't touch qemu-monitor.texi. Alltexi files have the qemu- prefix and I don't think it's worth...
QMP/README: Update QMP homepage address
disable guest-provided stats on "info balloon" command
The addition of memory stats reporting to the virtio balloon causesthe 'info balloon' command to become asynchronous. This is a regressionbecause in some cases it can hang the user monitor.
This is an alternative to Adam Litke's patch. Adam's patch disabled the...
Monitor: Introduce search_dispatch_table()
It's a generic version of monitor_find_command() which searchesthe dispatch table passed as an argument.
Future commits will introduce new dispatch tables, so we needcommon code to search them.
QMP: handle_qmp_command(): Move 'cmd' sanity check
Next commit will change how query commands are handled in away that the 'cmd' sanity check is also going to be neededfor query commands handling.
Let's move it out of the else body then.
QMP: Don't use do_info()
Since its inception, QMP has been using HMP's do_info() functionto run query commands.
This was a bad choice, as it made do_info() more complex andcontributed to couple QMP and HMP.
This commit fixes that by doing the following changes:...
Monitor: Drop QMP bits from do_info()
As of last commit, QMP doesn't use do_info() anymore. Simplify it.
Monitor: Drop is_async_return()
If I understood it correcty, the is_async_return() logic was onlyused to prevent QMP from issuing duplicated success responsesfor asynchronous handlers.
However, QMP doesn't use do_info() anymore so this is dead logicand (hopefully) can be safely dropped....
Monitor: Convert do_info() back to HMP
This is a HMP specific handler, it makes no sense to have itunder QMP.
Monitor: Introduce the qmp-commands.hx file
This file contains a copy of the following information from theqemu-monitor.hx file:
o QObject handlers entries o QMP documentation (all SQMP/EQMP sections)
Right now it's only used to generate the QMP docs in QMP/, but...
QMP: Introduce qmp_find_cmd()
Next commit needs this new function: it will introduce thethe QMP's command dispatch table and qmp_find_cmd() will beused to search on it.
QMP: Introduce command dispatch table
Also update QMP functions to use it. The table is generatedfrom the qmp-commands.hx file.
From now on, QMP and HMP have different command dispatchtables.
QMP: Introduce query commands dispatch table
The new table is a copy of HMP's table, containing only QObjecthandlers.
In the near future HMP will be making QMP calls and then we willbe able to drop QObject handlers from HMP's table.
From now on, QMP and HMP have different query command dispatch...
QMP: Simplify do_info_commands()
We now iterate over QMP's dispatch tables, no need to check forQMP-only handlers anymore.
QMP: Small cleanup in handle_qmp_command()
QMP has its own dispatch tables, we can now drop the followingchecks:
o 'info' command: this command doesn't exist in QMP's dispatch table, the right thing will happen when it's issued by a client (ie. command not found error)...
Monitor: Drop QMP info from the qemu-monitor.hx file
QMP has its own dispatch table and documentation file(qmp-commands.hx), we can now drop the following QMP specific infofrom qemu-monitor.hx:
o SQMP/EQMP sections o The qmp_capabilities command...
Monitor: Drop monitor_cmd_user_only()
This function was only needed when QMP and HMP were sharing dispatchtables, this is no longer true so just drop it.
Monitor: Rename monitor_handler_ported()
That name makes no sense anymore, as dispatch tables have been split,a better name is handler_is_qobject(), which really communicatesthe handler's type.
Add support for JSON pretty printing
The monitor does not pretty-print JSON output, so that everythingwill be on a single line reply. When JSON docs get large this isquite unpleasant to read. For the future command line capabilitiesquery ability, huge JSON docs will be available. This needs the...
Add option to turn on JSON pretty printing in monitor
Expaned '-mon' arg to allow a 'pretty=on' flag. This makes themonitor pretty print its replies to easy human debugging / reading
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
powerpc: Add a virtex5 ml507 refdesign board
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>Signed-off-by: Alexander Graf <agraf@suse.de>
powerpc: Add a ppc-440x5 Xilinx model
Add a powerpc 440x5 with the model ID on the Xilinx virtex5.Connect the 440x5 to the 40x interrupt logic.
tap: Remove double include of util.h
If neither of FreeBSD, FreeBSD_kernel and DragonFly is defined,util.h is included from tap-bsd.c.Don't include it again if OpenBSD is defined.
Cc: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Andreas Färber <andreas.faerber@web.de>...
pulse-audio: fix bug on updating rpos
Fix a rpos coordination bug between qpa_run_out() and qpa_thread_out(),which shows up as playback noises.
qpa_run_out() qpa_thread_out loop N critical section 1 qpa_run_out() qpa_thread_out loop N doing pa_simple_write()...
audio: Fix memory size for resampling buffer in DAC case
Signed-off-by: malc <av1474@comtv.ru>
mingw: add version information to the executables
Add QEMU version information to the executables, based on earlierwork by C. W. Betts and Robert Riebisch.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Avoid exit in trap as it breaks with some shells
Don't call exit in the trap handler as it causes the return code to bezero with some buggy shells (dash and pdksh at least) and is uselesshere anyway.
Signed-off-by: Loïc Minier <loic.minier@linaro.org>...
Introduce qemu_madvise()
vl.c has a Sun-specific hack to supply a prototype for madvise(),but the call site has apparently moved to arch_init.c.
Haiku doesn't implement madvise() in favor of posix_madvise().OpenBSD and Solaris 10 don't implement posix_madvise() but madvise()....
powerpc: Make the decr interrupt type overridable
Make it possible for boards to override the kind of interruptto be signaled when the decr timer hits. The 405's signal PITinterrupts while the 440's signal DECR.
powerpc: Improve emulation of the BookE MMU
Improve the emulation of the BookE MMU to be able to boot linuxon virtex5 boards.
fmopl: workaround for -Wempty-body
Move macros GCC_ATTR and GCC_FMT_ATTR to common header file
By moving the definition of GCC_ATTR and GCC_FMT_ATTRfrom audio_int.h to qemu-common.h these macros arenow generally available for further patches which addthe gcc format attribute.
Newer gcc versions support format gnu_printf which is...
Fix OpenBSD build
Add #include <sys/types.h>, needed by #include <sys/socket.h>.
block-verify: fix 32-bit build
Reported-by: Peter Lemenkov <lemenkov@gmail.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix compilation error (missing include statement)
./hw/sd.c: In function ‘sd_init’:./hw/sd.c:443: error: implicit declaration of function ‘qemu_blockalign’./hw/sd.c:443: error: nested extern declaration of ‘qemu_blockalign’./hw/sd.c:443: error: assignment makes pointer from integer without a cast...
Merge remote branch 'kwolf/for-anthony' into staging
mips_malta: Fix format strings
Fix two compiler warnings (when format attribute is applied).
Cc: Aurelien Jarno <aurelien@aurel32.net>Cc: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
mips_fulong2e: Fix format strings
Fix two compiler warnings (when format attribute is applied)and one error (missing %) in format strings.
Cc: Aurelien Jarno <aurelien@aurel32.net>Cc: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
trace: Fix user emulator dependency on trace objects
On a clean build, after generating trace.h, make would recurse into *-*-userwithout a clue how to build ../trace.o (added to $(obj-y) in Makefile.target)since its generation rule is in the main Makefile....