aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* win32: Add missing function ffsStefan Weil2010-06-271-0/+7
| | | | | | | | | | | | | | | | | | mingw32 does not include function ffs. Commit c6d29ad6e24533cc3762e1d654275607e1d03058 added a declaration for ffs, but an implementation was missing. For compilations with optimization, the compiler creates inline code, so the implementation is not always needed. Without optimization, linking fails without this patch. v2: Use __builtin_ffs as suggested by Richard Henderson Cc: Richard Henderson <rth@twiddle.net> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* documentation: qemu_write_full don't work with non-blocking fd'sJuan Quintela2010-03-091-0/+5
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix qemu_eventfd compile when !CONFIG_EVENTFDAvi Kivity2010-02-231-1/+1
| | | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* use eventfd for iothreadPaolo Bonzini2010-02-171-0/+32
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
* fix placement of config-host.h inclusionPaolo Bonzini2010-02-101-3/+4
| | | | | | | The #ifdef CONFIG_SOLARIS below was useless without this patch. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Tell users about out-of-memory errorsStefan Weil2010-01-261-1/+9
| | | | | | | | | | | | | | | | | | | | | Aborting without an error message when memory is short is not helpful, so print the reason for the abort. Try qemu -m 1000000 or qemu -m 2000 (win32) to force an out-of-memory error. v2: * Fix error message for win32. * Fix error message for posix_memalign. Thanks to malc for the hints. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Introduce qemu_write_full()Kirill A. Shutemov2010-01-261-0/+27
| | | | | | | | A variant of write(2) which handles partial write. Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* osdep.c: Fix accept4 fallbackKevin Wolf2010-01-131-1/+1
| | | | | | | | | | Commit 3a03bfa5 added a fallback in case the Linux kernel running qemu is older than the kernel of the build system. Unfortunately, v1 was committed instead of v2, so the code has a bug that was revealed in the review (checking for the wrong error code). Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* fix pidfile option to work in WIN32Juha Riihimäki2009-12-181-11/+2
| | | | | | | | | | | | | | Explicit read/write locking pidfile under WIN32 is bit extreme nobody get the chance to read the pidfile. Convert to a write-only lock. Also, creating pidfile was disabled along with daemonize under WIN32. Enable it, but do not enable daemon support which doesn't exist under WIN32 atm. From: Juha Riihimäki <juha.riihimaki@nokia.com> Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com> Signed-off-by: Riku Voipio <riku.voipio@nokia.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* osdep: Fix runtime failure on older Linux kernelsAndre Przywara2009-12-181-6/+12
| | | | | | | | | | | | | If QEMU finds newer kernel header files on compilation time, it will use advertised features like pipe2 or SOCK_CLOEXEC by just doing a compile test. If later the executables are executed on an older kernel (<2.6.27, like Xen Dom0 2.6.18), then QEMU will fail on opening sockets and creating pipes and returns the rather unspecific "qemu_init_main_loop failed". This patch fixes this by checking the return values of these calls for EINVAL and ENOSYS and falling back to the older versions automatically. Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Don't leak file descriptorsKevin Wolf2009-12-031-1/+103
| | | | | | | | We're leaking file descriptors to child processes. Set FD_CLOEXEC on file descriptors that don't need to be passed to children to stop this misbehaviour. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add #defines needed by OpenSolaris, fix breakage by the #definesBlue Swirl2009-09-121-2/+2
| | | | | | | | We need to define _XOPEN_SOURCE and __EXTENSIONS__ macros in order to get CMSG_ and TIOCWIN macros defined. But then _POSIX_C_SOURCE gets defined, which is (incorrectly) used as an indicator for existence of posix_memalign() in osdep.c. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Only build osdep onceAnthony Liguori2009-08-241-3/+0
| | | | | | We no longer need hackery to work around kqemu Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Unbreak large mem support by removing kqemuAnthony Liguori2009-08-241-121/+0
| | | | | | | | | | | | | | | | | | | | | | kqemu introduces a number of restrictions on the i386 target. The worst is that it prevents large memory from working in the default build. Furthermore, kqemu is fundamentally flawed in a number of ways. It relies on the TSC as a time source which will not be reliable on a multiple processor system in userspace. Since most modern processors are multicore, this severely limits the utility of kqemu. kvm is a viable alternative for people looking to accelerate qemu and has the benefit of being supported by the upstream Linux kernel. If someone can implement work arounds to remove the restrictions introduced by kqemu, I'm happy to avoid and/or revert this patch. N.B. kqemu will still function in the 0.11 series but this patch removes it from the 0.12 series. Paul, please Ack or Nack this patch. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* rename HOST_BSD to CONFIG_BSDJuan Quintela2009-07-271-3/+3
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* change HOST_SOLARIS to CONFIG_SOLARIS{_VERSION}Juan Quintela2009-07-271-3/+3
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add out of memory and zero size argument checks to be consistent withmalc2009-07-081-5/+25
| | | | the qemu_malloc routines
* Add tool_osdep.cPaul Brook2009-05-131-0/+3
| | | | | | | | | | osdep.c is built in both as a toplevel target independant object, and as a per-target object because of kqemu dependencies. Under some circumstances make picks up the wrong one. Build the former as tool-osdep to avoid this conflict. Signed-off-by: Paul Brook <paul@codesourcery.com>
* kqemu: merge CONFIG_KQEMU and USE_KQEMUblueswir12009-04-191-3/+3
| | | | | | | | | | Basically a recursive ":%s/USE_KQEMU/CONFIG_KQEMU/g". Signed-off-by: Paul Bolle <pebolle@tiscali.nl> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7189 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix windows build and clean up use of <windows.h>aliguori2009-03-081-1/+0
| | | | | | | | | | | | | We want to globally define WIN_LEAN_AND_MEAN and WINVER to particular values so let's do it in OS_CFLAGS. Then, we can pepper in windows.h includes where using #includes that require it. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6783 c046a42c-6fe2-441c-8c8c-71466251a162
* Rename _BSD to HOST_BSD so that it's more obvious that it's defined by configureblueswir12009-03-081-3/+3
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6775 c046a42c-6fe2-441c-8c8c-71466251a162
* Support for DragonFly BSD (Hasso Tepper)blueswir12009-03-071-2/+2
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6746 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix BSD breakage from r6736blueswir12009-03-071-0/+3
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6742 c046a42c-6fe2-441c-8c8c-71466251a162
* Sparse fixes: NULL use, header order, ANSI prototypes, staticblueswir12009-03-071-3/+2
| | | | | | | | | | | | | Fix Sparse warnings: * use NULL instead of plain 0 * rearrange header include order to avoid redefining types accidentally * ANSIfy SLIRP * avoid "restrict" keyword * add static git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6736 c046a42c-6fe2-441c-8c8c-71466251a162
* Remove redundant #ifdef _BSDblueswir12008-12-111-4/+0
| | | | | | | | | | since _BSD if already handled in osdep.c:qemu_memalign(), we don't need to check it in the calling function again. getpagesize() is available in BSD. Signed-off-by: Andre Przywara <andre.przywara@amd.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5983 c046a42c-6fe2-441c-8c8c-71466251a162
* Use MAP_ANON also for FreeBSD (Juergen Lock)blueswir12008-11-221-2/+5
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5778 c046a42c-6fe2-441c-8c8c-71466251a162
* Use qemu_memalign instead of memalign in qemu_vmallocmalc2008-11-181-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5730 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix -linux-user build by reverting r5701aliguori2008-11-111-14/+1
| | | | | | | | | | | | | Unfortunately, -linux-user doesn't use osdep as it replaces some of those functions with specific ones. The code #ifdef code in exec.c needs to remain in place so instead of introducing a qemu_getpagesize() let's just use getpagesize() in the non-Windows implementation of qemu_vmalloc. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5703 c046a42c-6fe2-441c-8c8c-71466251a162
* Allocate guest memory on host page boundaries (Hollis Blanchard)aliguori2008-11-111-1/+1
| | | | | | | | Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5702 c046a42c-6fe2-441c-8c8c-71466251a162
* Define OS-dependent qemu_getpagesize() (Hollis Blanchard)aliguori2008-11-111-0/+13
| | | | | | | | Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5701 c046a42c-6fe2-441c-8c8c-71466251a162
* Use common objects for qemu-img and qemu-nbdaliguori2008-09-151-0/+27
| | | | | | | | | | | | | | | | | | | | | | | Right now, we sprinkle #if defined(QEMU_IMG) && defined(QEMU_NBD) all over the code. It's ugly and causes us to have to build multiple object files for linking against qemu and the tools. This patch introduces a new file, qemu-tool.c which contains enough for qemu-img, qemu-nbd, and QEMU to all share the same objects. This also required getting qemu-nbd to be a bit more Windows friendly. I also changed the Windows block-raw to use normal IO instead of overlapping IO since we don't actually do AIO yet on Windows. I changed the various #if 0's to #if WIN32_AIO to make it easier for someone to eventually fix AIO on Windows. After this patch, there are no longer any #ifdef's related to qemu-img and qemu-nbd. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5226 c046a42c-6fe2-441c-8c8c-71466251a162
* Preliminary OpenBSD host support (based on OpenBSD patches by Todd T. Fries)blueswir12008-08-151-2/+15
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5012 c046a42c-6fe2-441c-8c8c-71466251a162
* Use correct types to enable > 2G support, based on a patch fromaurel322008-04-271-1/+0
| | | | | | | Anthony Liguori. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4265 c046a42c-6fe2-441c-8c8c-71466251a162
* Revert "Use correct types to enable > 2G support" (r4238), it isaurel322008-04-221-0/+1
| | | | | | | not yet ready. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4240 c046a42c-6fe2-441c-8c8c-71466251a162
* Use correct types to enable > 2G support, based on a patch fromaurel322008-04-221-1/+0
| | | | | | | Anthony Liguori. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4238 c046a42c-6fe2-441c-8c8c-71466251a162
* Use "mount -o remount" instead of "umount" and "mount /dev/shm",aurel322008-04-201-2/+1
| | | | | | | which results in emptying this virtual file system. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4228 c046a42c-6fe2-441c-8c8c-71466251a162
* Remove osdep.c/qemu-img code duplicationaurel322008-04-111-35/+0
| | | | | | | (Kevin Wolf) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4191 c046a42c-6fe2-441c-8c8c-71466251a162
* Add "cache" parameter to "-drive" (Laurent Vivier).balrog2007-12-241-0/+20
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3848 c046a42c-6fe2-441c-8c8c-71466251a162
* Use WIN32_LEAN_AND_MEAN, by Stefan Weil.ths2007-12-171-0/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3832 c046a42c-6fe2-441c-8c8c-71466251a162
* Add statics and missing #includes for prototypes.pbrook2007-11-181-2/+2
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3683 c046a42c-6fe2-441c-8c8c-71466251a162
* Break up vl.h.pbrook2007-11-171-4/+2
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
* find -type f | xargs sed -i 's/[\t ]$//g' # on most filesths2007-09-161-13/+13
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162
* Windows build fixes.pbrook2007-06-071-0/+24
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2959 c046a42c-6fe2-441c-8c8c-71466251a162
* qemu_create_pidfile implementation for Win32, based on a patch byths2007-03-251-0/+48
| | | | | | | Carlos O'Donell. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2540 c046a42c-6fe2-441c-8c8c-71466251a162
* Kqemu support for Solaris, by Ben Taylor.ths2007-01-171-0/+13
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2329 c046a42c-6fe2-441c-8c8c-71466251a162
* fd leak fix (Igor Kovalenko)bellard2006-08-171-8/+4
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2118 c046a42c-6fe2-441c-8c8c-71466251a162
* removed unused codebellard2006-08-031-238/+0
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2080 c046a42c-6fe2-441c-8c8c-71466251a162
* removed unused codebellard2006-08-011-195/+0
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2072 c046a42c-6fe2-441c-8c8c-71466251a162
* Only use /dev/shm hack when kqemu is enabled.pbrook2006-05-221-4/+18
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1930 c046a42c-6fe2-441c-8c8c-71466251a162
* informative message about low memory on /dev/shmbellard2005-04-231-0/+27
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1388 c046a42c-6fe2-441c-8c8c-71466251a162