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
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.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....
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: Fix segfault on write to read-only disk
vvfat tries to set the readonly flag in its open function, but nowadaysthis is overwritted with the readonly=... command line option. Check inbdrv_write if the vvfat was opened read-only and return an error in this...
vvfat: Fix double free for opening the image rw
Allocation and deallocation of bs->opaque is not in the control of ablock driver. Therefore it should not set bs->opaque to a data structureused by another bs, or closing the image will lead to a double free....
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...
Merge remote branch 'mst/for_anthony' into staging
e1000: Pad short frames to minimum size (60 bytes)
The OpenIndiana (Solaris) e1000g driver drops frames that are too longor too short. It expects to receive frames of at least the Ethernetminimum size. ARP requests in particular are small and will be dropped...
mingw: use ASLR, no-SEH and DEP if available
If the linker supports the flags --dynamicbase, --no-seh,or --nxcompat, use them.
Tested on Windows Vista: Process Explorer reports that ASLR and DEPare in use. No effect seen on Wine or Windows XP.
cris: Fix watchdog resets
cris: Fix TLB exec bit protection
Use gcc warning flag -Wnested-externs
If the compiler supports the warning flag -Wnested-externs, use it.
Avoid the only warning by moving the declaration of xml_builtin to amore proper place.
Use gcc warning flag -Wempty-body
If the compiler supports the warning flag -Wempty-body, use it.
Adjust the code to avoid the warnings.
Use a few more gcc warning flags
If the compiler supports the following warning flags, use them:
-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers-Wmissing-include-dirs
Currently, these flags don't produce any warnings.
pxa2xx: remove useless checks
Remove checks which were made useless by r5849,8da3ff180974732fc4272cb4433fef85c1822961.
This also avoids a warning with GCC flag -Wtype-limits.
blkdebug: fix enum comparison
The signedness of enum types depend on the compiler implementation.Therefore the check for negative values may or may not be meaningful.
Fix by explicitly casting to a signed integer.
Since the values are also checked earlier against event_names...
PPC: Suppress gcc warnings with -Wtype-limits
The hack added by c5b76b381081680633e2e0a91216507430409fb2 was notenough to avoid warnings with gcc flag -Wtype-limits. Add a new macroto fix both problems.
MIPS: fix yield handling
The parameter for yield should be handled as a signed integerfor the comparisons to have any effect.
This also avoids a gcc warning with -Wtype-limits.
pxa2xx: fix SSSR TFN logic
Fix SSSR TFN logic: TX FIFO is never filled, so it is always inunderrun condition if SSP is enabled.
Use gcc warning flag -Wtype-limits
If the compiler supports the warning flag -Wtype-limits, use it.
Check for errors during BIOS or kernel load
Because of the use of unsigned types, possible errors duringBIOS or kernel load were ignored.
Fix by using a signed type.
This also avoids some warnings with GCC flag -Wtype-limits.
linux-user: fix socklen_t comparisons
On many systems, socklen_t is defined as unsigned. This means thatchecks for negative values are not meaningful.
This also avoids some warnings with GCC flag -Wtype-limits....
linux-user: fix types in a comparison
-1ul is unsigned long, which does not necessarily match abi_ulongtype.
Fix by using abi_long instead.
linux-user: improve flatload error checking
Because of the use of unsigned type, possible errors duringload were ignored.
Introduce range.h
Extract range functions from pci.h. These will be used by later patchesby non-PCI devices. Adjust current users.
Use range_covers_byte
Use range_covers_byte() instead of comparisons.
This avoids some warnings with GCC flag -Wtype-limits.
Accept packets with TTL=1
Packets with TTL=1 may be directed to local network (DHCP/DNS servers for example), so don't discard themThis is required by old versions of NetBSD which send DHCP DISCOVER packets with TTL=1
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>...
Make ARP replies at least 64 bytes long
IEEE 802.3 standard requires Ethernet frames to be at least 64 bytes long.If it is not the case, they will be considered as runt frames, and may be ignored by netcard and/or OS
cris: Avoid spurios hw_abort on recursive bus faults
PPC: Redesign interrupt trigger path
According to the Book3S spec, the interrupt context starts with an MSRvalue that is rather simple. If we leave out the HV case, it's almostalways 0.
To reflect this, let's redesign the way that MSR value gets calculated....
PPC: Enable hint bits for lwarx/ldarx
The lwarx and ldarx instructions have a bit to give some hint to theCPU which is safe to ignore. We currently refuse to accept any instructionwith that bit set, as it used to be declared MBZ.
Let's remove the reserved bit and make the instruction work as expected....
serial: Update parameters after load
This is the patch to update serial port parameters after guest isalready loaded.
Signed-off-by: Michal Novotny <minovotn@redhat.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
vhost: fix infinite loop on error path
file.index is unsigned, hence 'while (--file.index >= 0)'will loop > forever. Change to while (file.index-- > 0).
Reported-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Remove wrong semicolon in macro definition
Macros normally should not end with a semicolon,otherwise their usage results in two statementswhere only one statement was expected.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
serial: Wrap debug prints around a DPRINTF macro
ESP: fix ESP DMA access when DMA is not enabled
Sending ESP a command caused it to trigger DMA immediatelyeven if DMA was not enabled at the DMA controller.
Add a signal from DMA controller to ESP to tell ESP about changes inDMA enable bit. Also use the correct function for setting up GPIO outputs....
powerpc: Avoid TLB related log spamming
Invalid TLB entries are normal and should not spam the log.
trace: fix a regex portability problem
The /bin/sh in Milax has problems with the regex:Error: invalid trace backendPlease choose a supported trace backend.
Fix it by escaping ')' like the regexes with '('.
trace: fix a typo
There is no qemu_valloc() but qemu_vmalloc().
HACKING: add rules for printf-like functions
Add rules for printf-like functions, based on libvirt HACKING.
HACKING: add string management rules
Add string management rules, somewhat like libvirt HACKING.
HACKING: add memory management rules
Add memory management rules, somewhat like libvirt HACKING.
HACKING: add C type rules
Add C type rules, adapted from libvirt HACKING. Also includea description of special QEMU scalar types.
Move typedef rule from CODING_STYLE rule 3 to HACKING rule 6where it belongs.
HACKING: add preprocessor rules
Add a new file, HACKING, in order to collect recurringissues with submitted patches.
Start with preprocessor rules, adapted from libvirt HACKING.
vmware_vga: Replace the few tab-indents with spaces (clean-up).
Use 4 spaces instead of 2, too.
vmware_vga: Add checks to deal with non-atomic fifo writes.
Janne Huttunen noticed that the FIFO end pointer is updated by theguest after writing each word to the FIFO, at least the X.org driverwhich is open does this. This means that there's no way for the...
hw/omap: Fix default setup for OMAP UART devices
Character devices created by qemu_chr_open don'tallow duplicate device names, so naming allUART devices "null" no longer works.
Running "qemu-system-arm -M n800" (and some other machines)results in this error message:...
trace: Trace qemu_malloc() and qemu_vmalloc()
It is often useful to instrument memory management functions in order tofind leaks or performance problems. This patch adds trace events forthe memory allocation primitives.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
trace: Trace virtio-blk, multiwrite, and paio_submit
This patch adds trace events that make it possible to observevirtio-blk.
trace: Trace virtqueue operations
This patch adds trace events for virtqueue operations includingadding/removing buffers, notifying the guest, and receiving a notifyfrom the guest.
trace: Trace port IO
Signed-off-by: Prerna Saxena
trace: Trace entry point of balloon request handler
trace: Add user documentation