aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2010-10-03rc4030: Fix compilation error in debug codeStefan Weil1-1/+4
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>
2010-10-03mipsnet: Fix compiler warning in debug codeStefan Weil1-1/+1
size_t needs a different format specifier, so fix this. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-03block/vvfat: Fix compiler warning in debug codeStefan Weil1-1/+0
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> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-03virtio-9p: Use GCC_FMT_ATTR and fix a format warningStefan Weil1-4/+6
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’ Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-03blockdev: Use GCC_FMT_ATTR (format checking)Stefan Weil1-8/+7
Additional changes: * Removed 'extern' from drive_add (avoids too long line). * Removed 'extern' from other functions (makes declarations consistent with others in same header file). Cc: Blue Swirl <blauwirbel@gmail.com> Cc: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-03Use GCC_FMT_ATTR (format checking)Stefan Weil14-16/+25
Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-03Replace most gcc format attributes by macro GCC_FMT_ATTR (format checking)Stefan Weil10-21/+12
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)) because QEMU always uses standard format strings (even with mingw32). The patch replaces format attribute printf / __printf__ by macro GCC_FMT_ATTR which uses gnu_printf if supported. It also removes an #ifdef __GNUC__ (not needed any longer). Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-03slirp: Silence warning on HaikuAndreas Färber1-1/+3
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>
2010-10-03tap: Add stub for HaikuAndreas Färber2-0/+62
Adapted from AIX code. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-03nbd: Haiku has _IO() in its BSD compatibility layerAndreas Färber1-1/+1
Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-03Haiku doesn't have libmAndreas Färber1-0/+2
Math functions are integrated into Haiku's libroot. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-03configure: Don't rely on special pthreads libraryAndreas Färber1-7/+11
Haiku has pthreads integrated into its libroot.so library. No linker arguments are needed for it, so don't fail if -lpthread and similar don't link. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-03configure: Add basic support for HaikuAndreas Färber1-1/+12
For compatibility with BeOS, Haiku's error codes are negative whereas recent POSIX versions require them to be positive. As spotted by François, some parts of QEMU code rely on this, so use a mapper library to convert them to positive ones. Cc: François Revol <revol@free.fr> Cc: Ingo Weinhold <ingo_weinhold@gmx.de> Haiku has network functions in libnetwork.so. It doesn't ship libutil.so. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-02trace: avoid unnecessary recompilation if nothing changedBlue Swirl1-5/+9
Add logic to detect changes in generated files. If the old and 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. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-02Makefile: fix config-devices.mak generationBlue Swirl1-3/+5
The logic of detecting changes in default-configs/*.mak is flawed as can be demonstrated by 'touch default-configs/*.mak' followed by make. This results in a message claiming that user made changes to the */config-devices.mak files. Fix by separating the detection of changes made by the user and changes in the default-configs. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-02sysbus: fix address truncationBlue Swirl2-3/+5
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>
2010-10-02target-cris: Use %td for ptrdiff_t arguments in debug messageStefan Weil1-1/+1
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> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-10-02target-microblaze: Use %td for ptrdiff_t arguments in debug messageStefan Weil1-1/+1
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> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-10-02virtex: Add bracesEdgar E. Iglesias1-1/+2
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-09-30powerpc: Add a virtex5 ml507 refdesign boardEdgar E. Iglesias6-0/+296
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2010-09-30powerpc: Add a ppc-440x5 Xilinx modelEdgar E. Iglesias1-2/+4
Add a powerpc 440x5 with the model ID on the Xilinx virtex5. Connect the 440x5 to the 40x interrupt logic. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2010-09-29tap: Remove double include of util.hAndreas Färber1-4/+0
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> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-29pulse-audio: fix bug on updating rposWu Fengguang1-1/+1
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() qpa_run_out() qpa_thread_out loop N doing pa_simple_write() qpa_thread_out loop N critical section 2 qpa_thread_out loop N+1 critical section 1 qpa_run_out() qpa_thread_out loop N+1 doing pa_simple_write() In the above scheme, "qpa_thread_out loop N+1 critical section 1" will get the same rpos as the one used by "qpa_thread_out loop N critical section 1". So it will be reading dead samples from the old rpos. The rpos can only be updated back to qpa_thread_out when there is a qpa_run_out() run between two qpa_thread_out loops. normal sequence: qpa_thread_out: hw->rpos (X0) => local rpos => pa->rpos (X1) qpa_run_out: pa->rpos (X1) => hw->rpos (X1) qpa_thread_out: hw->rpos (X1) => local rpos => pa->rpos (X2) buggy sequence: qpa_thread_out: hw->rpos (X0) => local rpos => pa->rpos (X1) qpa_thread_out: hw->rpos (X0) => local rpos => pa->rpos (X1') Obviously qpa_run_out() shall be called at least once between any two qpa_thread_out loops (after pa->rpos is set), in order for the new qpa_thread_out loop to see the updated rpos. Setting pa->live to 0 does the trick. The next loop will have to wait for one qpa_run_out() invocation in order to get a non-zero pa->live and proceed. Signed-off-by: malc <av1474@comtv.ru> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
2010-09-28audio: Fix memory size for resampling buffer in DAC casemalc1-4/+0
Signed-off-by: malc <av1474@comtv.ru>
2010-09-26mingw: add version information to the executablesBlue Swirl4-3/+48
Add QEMU version information to the executables, based on earlier work by C. W. Betts and Robert Riebisch. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-26Avoid exit in trap as it breaks with some shellsLoïc Minier1-1/+3
Don't call exit in the trap handler as it causes the return code to be zero with some buggy shells (dash and pdksh at least) and is useless here anyway. Signed-off-by: Loïc Minier <loic.minier@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-25Introduce qemu_madvise()Andreas Färber8-20/+100
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(). MinGW implements neither. Check for madvise() and posix_madvise() in configure and supply qemu_madvise() as wrapper. Prefer madvise() over posix_madvise() due to flag availability. Convert all callers to use qemu_madvise() and QEMU_MADV_*. Note that on Solaris the warning is fixed by moving the madvise() prototype, not by qemu_madvise() itself. It helps with porting though, and it simplifies most call sites. v7 -> v8: * Some versions of MinGW have no sys/mman.h header. Reported by Blue Swirl. v6 -> v7: * Adopt madvise() rather than posix_madvise() semantics for returning errors. * Use EINVAL in place of ENOTSUP. v5 -> v6: * Replace two leftover instances of POSIX_MADV_NORMAL with QEMU_MADV_INVALID. Spotted by Blue Swirl. v4 -> v5: * Introduce QEMU_MADV_INVALID, suggested by Alexander Graf. Note that this relies on -1 not being a valid advice value. v3 -> v4: * Eliminate #ifdefs at qemu_advise() call sites. Requested by Blue Swirl. This will currently break the check in kvm-all.c by calling madvise() with a supported flag, which will not fail. Ideas/patches welcome. v2 -> v3: * Reuse the *_MADV_* defines for QEMU_MADV_*. Suggested by Alexander Graf. * Add configure check for madvise(), too. Add defines to Makefile, not QEMU_CFLAGS. Convert all callers, untested. Suggested by Blue Swirl. * Keep Solaris' madvise() prototype around. Pointed out by Alexander Graf. * Display configure check results. v1 -> v2: * Don't rely on posix_madvise() availability, add qemu_madvise(). Suggested by Blue Swirl. Signed-off-by: Andreas Färber <afaerber@opensolaris.org> Cc: Blue Swirl <blauwirbel@gmail.com> Cc: Alexander Graf <agraf@suse.de> Cc: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-24powerpc: Make the decr interrupt type overridableEdgar E. Iglesias3-5/+17
Make it possible for boards to override the kind of interrupt to be signaled when the decr timer hits. The 405's signal PIT interrupts while the 440's signal DECR. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-09-24powerpc: Improve emulation of the BookE MMUEdgar E. Iglesias2-8/+33
Improve the emulation of the BookE MMU to be able to boot linux on virtex5 boards. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-09-24fmopl: workaround for -Wempty-bodymalc1-2/+4
Signed-off-by: malc <av1474@comtv.ru>
2010-09-22Move macros GCC_ATTR and GCC_FMT_ATTR to common header fileStefan Weil2-8/+16
By moving the definition of GCC_ATTR and GCC_FMT_ATTR from audio_int.h to qemu-common.h these macros are now generally available for further patches which add the gcc format attribute. Newer gcc versions support format gnu_printf which is better suited for use in QEMU than format printf (QEMU always uses standard format strings (even with mingw32)). V2: Use correct operator '==' (instead of '=') Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-22Fix OpenBSD buildBlue Swirl1-0/+1
Add #include <sys/types.h>, needed by #include <sys/socket.h>. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-22block-verify: fix 32-bit buildAnthony Liguori1-1/+1
Reported-by: Peter Lemenkov <lemenkov@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-09-22Fix compilation error (missing include statement)Stefan Weil1-0/+1
./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 Cc: Christoph Hellwig <hch@lst.de> Cc: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-09-21Merge remote branch 'kwolf/for-anthony' into stagingAnthony Liguori23-123/+721
2010-09-21mips_malta: Fix format stringsStefan Weil1-2/+2
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>
2010-09-21mips_fulong2e: Fix format stringsStefan Weil1-3/+3
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> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-21trace: Fix user emulator dependency on trace objectsAndreas Färber1-2/+2
On a clean build, after generating trace.h, make would recurse into *-*-user without a clue how to build ../trace.o (added to $(obj-y) in Makefile.target) since its generation rule is in the main Makefile. The softmmus are seemingly unaffected because the $(TOOLS), which each have a dependency on $(trace-obj-y), are built first for the build-all target. Add a dependency on $(trace-obj-y) for %-user, as done for the qemu-* tools. Let's be paranoid and do the same for %-softmmu while at it, just in case someone messes with $(TOOLS) or calls the Makefile target directly. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Acked-by: Stefan Weil <weil@mail.berlios.de> Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Cc: Prerna Saxena <prerna@linux.vnet.ibm.com> Cc: Blue Swirl <blauwirbel@gmail.com> Cc: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-21blkverify: Add block driver for verifying I/OStefan Hajnoczi3-1/+452
The blkverify block driver makes investigating image format data corruption much easier. A raw image initialized with the same contents as the test image (e.g. qcow2 file) must be provided. The raw image mirrors read/write operations and is used to verify that data read from the test image is correct. See docs/blkverify.txt for more information. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-09-21scsi_bus: fix length and xfer_mode for RESERVE and RELEASE commandsBernhard Kohl1-1/+2
For the RESERVE and RELEASE commands the length must be zero and xfer_mode must be SCSI_XFER_NONE. Signed-off-by: Bernhard Kohl <bernhard.kohl@nsn.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-09-21scsi-generic: add missing reset handlerBernhard Kohl1-2/+19
Ensure that pending requests of a SCSI generic device are purged on system 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> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-09-21qcow2: Avoid bounce buffers for AIO write requestsKevin Wolf1-23/+18
qcow2 used to use bounce buffers for any AIO requests. This does not only imply unnecessary copying, but also unbounded allocations which should be avoided. This patch removes bounce buffers from the normal AIO write path. Encrypted images continue to use a bounce buffer, however with constant size. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-09-21qcow2: Avoid bounce buffers for AIO read requestsKevin Wolf3-30/+68
qcow2 used to use bounce buffers for any AIO requests. This does not only imply unnecessary copying, but also unbounded allocations which should be avoided. This patch removes bounce buffers from the normal AIO read path, and constrains them to a constant size for encrypted images. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-09-21cutils: qemu_iovec_copy and qemu_iovec_memsetKevin Wolf2-9/+44
This adds two functions that work on QEMUIOVectors and will be used by the next qcow2 patches. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-09-21ide: propagate the required alignmentChristoph Hellwig1-1/+3
IDE is a bit ugly in this respect. For one it doesn't really keep track of a sector size - most of the protocol is in units of 512 bytes, and we assume 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 with a CDROM or not, so increase the alignment for the io_buffer unconditionally. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-09-21scsi-disk: propagate the required alignmentChristoph Hellwig1-0/+1
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-09-21virtio-blk: propagate the required alignmentChristoph Hellwig1-0/+1
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-09-21qcow2: Get rid of additional sync on COWKevin Wolf1-2/+8
We always have a sync for the refcount update when a new cluster is allocated. If we move this past the COW, we can save an additional sync. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-09-21qcow2: Move sync out of qcow2_alloc_clustersKevin Wolf3-2/+7
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-09-21qcow2: Move sync out of update_refcountKevin Wolf1-2/+11
Note that the flush is omitted intentionally in qcow2_free_clusters. If anything, we can leak clusters here if we lose the writes. Signed-off-by: Kevin Wolf <kwolf@redhat.com>