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.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
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>
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....
spice: simple display
With that patch applied you'll actually see the guests screen in thespice client. This does not bring qxl and full spice support though.This is basically the qxl vga mode made more generic, so it playstogether with any qemu-emulated gfx card. You can display stdvga or...
spice: add tablet support
Add support for the spice tablet interface. The tablet interface willbe registered (and then used by the spice client) as soon as a absolutepointing device is available and used by the guest, i.e. you'll have toconfigure your guest with '-usbdevice tablet'.
add spice into the configure file
spice: core bits
Add -spice command line switch. Has support setting passwd and port fornow. With this patch applied the spice client can successfully connectto qemu. You can't do anything useful yet though.
spice: add keyboard
Open keyboard channel. Now you can type into the spice client and thekeyboard events are sent to your guest. You'll need some other displaylike vnc to actually see the guest responding to them though.
spice: add mouse
Open mouse channel. Now you can move the guests mouse pointer.No tablet / absolute positioning (yet) though.
Use display types for local display only.
This patch drops DT_VNC. The display types are only used to selectselect the local display (i.e. curses, sdl, coca, ...). Remotedisplays (for now only vnc, spice will follow) can be enabledindependently.
Use machine_init() to register virtfs config options.
add pflib: PixelFormat conversion library.
configure: add logging
Write compile commands and messages to config.log.Useful for debugging configure.
blkverify: Add block driver for verifying I/O
The blkverify block driver makes investigating image format datacorruption much easier. A raw image initialized with the same contentsas the test image (e.g. qcow2 file) must be provided. The raw imagemirrors read/write operations and is used to verify that data read from...
qcow2: Avoid bounce buffers for AIO write requests
qcow2 used to use bounce buffers for any AIO requests. This does not only implyunnecessary copying, but also unbounded allocations which should be avoided.
This patch removes bounce buffers from the normal AIO write path. Encrypted...
scsi-generic: add missing reset handler
Ensure that pending requests of a SCSI generic device are purged onsystem reset. This also avoids calling a NULL function in lsi53c895a.The lsi code was recently changed to call the .qdev.reset function.
Signed-off-by: Bernhard Kohl <bernhard.kohl@nsn.com>...
scsi_bus: fix length and xfer_mode for RESERVE and RELEASE commands
For the RESERVE and RELEASE commands the length must be zeroand xfer_mode must be SCSI_XFER_NONE.
Signed-off-by: Bernhard Kohl <bernhard.kohl@nsn.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
vvfat: Use cache=unsafe
The qcow file used for write support in vvfat is a temporary file,so we can use cache=unsafe there. Without this, write support is justtoo slow to be of any use.
Signed-off-by: Kevin Wolf <mail@kevin-wolf.de>
use qemu_blockalign consistently
Use qemu_blockalign for all allocations in the block layer. This allowsincreasing the required alignment, which is need to support O_DIRECT ondevices with large block sizes.
Signed-off-by: Christoph Hellwig <hch@lst.de>...
raw-posix: handle > 512 byte alignment correctly
Replace the hardcoded handling of 512 byte alignment with bs->buffer_alignmentto handle larger sector size devices correctly.
Note that we can not rely on it to be initialize in bdrv_open, so dealwith the worst case there....
Improve qemu-nbd performance by 4400 %
This patch allows to reduce the boot time from an NBD server from 225 seconds to5 seconds (time between the "boot cd:0" and the kernel init) for thefollowing command lines:
./qemu-nbd -t ../ISO/debian-500-powerpc-netinst.iso...
nbd: correctly manage default port
block/nbd.c: use default port number when none is specifiedqemu-nbd.c: use IANA-assigned port number: 10809
Signed-off-by: Laurent Vivier <laurent@vivier.eu>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qcow2: Move sync out of write_refcount_block_entries
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qcow2: Move sync out of update_refcount
Note that the flush is omitted intentionally in qcow2_free_clusters. Ifanything, we can leak clusters here if we lose the writes.
qcow2: Move sync out of qcow2_alloc_clusters
qcow2: Get rid of additional sync on COW
We always have a sync for the refcount update when a new cluster isallocated. If we move this past the COW, we can save an additional sync.
virtio-blk: propagate the required alignment
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
scsi-disk: propagate the required alignment
ide: propagate the required alignment
IDE is a bit ugly in this respect. For one it doesn't really keep trackof a sector size - most of the protocol is in units of 512 bytes, and weassume 2048 bytes for CDROMs which is correct most of the time.
Second IDE allocates an I/O buffer long before we know if we're dealing...
cutils: qemu_iovec_copy and qemu_iovec_memset
This adds two functions that work on QEMUIOVectors and will be used by the nextqcow2 patches.
qcow2: Avoid bounce buffers for AIO read requests
This patch removes bounce buffers from the normal AIO read path, and constrains...