summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit 'd08d6f04d6eeedce5090ff66d0676162d7d8d788' into upstream-mergeAvi Kivity2009-12-071-9/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'd08d6f04d6eeedce5090ff66d0676162d7d8d788': (23 commits) monitor: use qemu_gettimeofday(), not gettimeofday() win32: fix variable use before initialization monitor: rename EVENT_* to QEVENT_* to avoid conflict on mingw32 Sparc64: fix compilation with DEBUG_MMU ide: implement stub for audio control/volume read ide: Use some already defined page macros instead of constants eepro100: Improve debug messages Remove rule for config-devices.h eepro100: Allocate a larger buffer for regname() multiboot: Use signed type for negative error numbers posix-aio-compat: Fix error check qemu-img: Fix memory leak Fix compile error when LSI_DEBUG is defined Fix build for mingw32 on windows ($$ expansion) Fix build for mingw32 on windows ($@ in macro) e1000: Fix warning from code review multiboot: Fix module loading and setting of mmap. Make -kernel for linux work with bochsbios Fix recently introduced bugs in -usbdevice host Fix description of size parameter in qemu-img's help text ... Conflicts: monitor.c Signed-off-by: Avi Kivity <avi@redhat.com>
| * posix-aio-compat: Fix error checkKevin Wolf2009-12-031-9/+9
| | | | | | | | | | | | | | | | Checking for nbytes < 0 is pointless as long as it's a size_t. If we want to use negative numbers for error codes, we should use signed types. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * Don't leak file descriptorsKevin Wolf2009-12-031-1/+1
| | | | | | | | | | | | | | | | 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>
* | Merge commit '1e5b9d2fccb205ed8fc84fb38945b8fb3d225640' into upstream-mergeMarcelo Tosatti2009-11-061-6/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '1e5b9d2fccb205ed8fc84fb38945b8fb3d225640': Remove aio_ctx from paio_* interface Add *CFLAGS to LINK in rules.mak serial: Add missing bit serial: Support additional serial speed values usb: print attached status in info qtree usb-host: use qdev for -usbdevice + rework. usb-storage: use qdev for -usbdevice usb: make attach optional. usb-serial and braille: use qdev for -usbdevice usb-hid: use qdev for -usbdevice usb core: use qdev for -usbdevice use rom loader for pc bios. Conflicts: posix-aio-compat.c Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * Remove aio_ctx from paio_* interfaceKevin Wolf2009-10-301-6/+5
| | | | | | | | | | | | | | | | | | | | The context parameter in paio_submit isn't used anyway, so there is no reason why block drivers should need to remember it. This also avoids passing a Linux AIO context to paio_submit (which doesn't do any harm as long as the parameter is unused, but it is highly confusing). Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Merge commit '38c75be3139a117b02350dbda9d48d47aa57fa3d' into upstream-mergeMark McLoughlin2009-10-281-0/+12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '38c75be3139a117b02350dbda9d48d47aa57fa3d': net: make tap_receive() re-use tap_receive_iov() code net: import linux tap ioctl definitions net: remove unused includes of if_tun.h and if_tap.h Revert "qcow2: Bring synchronous read/write back to life" linux-aio: Honour AsyncContext posix-aio-compat: Honour AsyncContext block: Use new AsyncContext for bdrv_read/write emulation Introduce contexts for asynchronous callbacks Split out bottom halves Conflicts: net.c Signed-off-by: Mark McLoughlin <markmc@redhat.com>
| * posix-aio-compat: Honour AsyncContextKevin Wolf2009-10-271-0/+12
| | | | | | | | | | | | | | Don't call callbacks that don't belong to the active AsyncContext. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Merge commit '8febfa26846e75d38848255028dfe2d06e5ba941' into upstream-mergeMark McLoughlin2009-10-281-1/+2
|\| | | | | | | | | | | | | | | | | | | * commit '8febfa26846e75d38848255028dfe2d06e5ba941': Add qemu_aio_process_queue() Conflicts: posix-aio-compat.c Signed-off-by: Mark McLoughlin <markmc@redhat.com>
| * Add qemu_aio_process_queue()Kevin Wolf2009-10-271-1/+2
| | | | | | | | | | | | | | | | | | We'll leave some AIO completions unhandled when we can't call the callback. qemu_aio_process_queue() is used later to run any callbacks that are left and can be run then. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Merge commit '59c7b155aa6e1cbfe8a92e2322ea59ab31965c10' into upstream-mergeMark McLoughlin2009-10-281-27/+38
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '59c7b155aa6e1cbfe8a92e2322ea59ab31965c10': (81 commits) posix-aio-compat: Split out posix_aio_process_queue monitor: Convert do_closefd() to QObject monitor: Convert do_getfd() to QObject monitor: Convert do_eject() to QObject monitor: Convert do_pci_device_hot_remove() to QObject monitor: Convert do_migrate_cancel() to QObject monitor: Convert do_migrate_set_speed() to QObject monitor: Convert do_migrate() to QObject monitor: Convert do_physical_memory_save() to QObject monitor: Convert do_memory_save() to QObject lsi_scsi: port to vmstate vmstate: Add VMSTATE_BUFFER_UNSAFE vmware_vga: port to vmstate vmware_vga: the support to change dinamically depth is not there vmware_vga: scratch is really an array of uint32_t vmware_vga: remove !EMBED_STDVGA code vmware_vga: qemu_malloc() returns void * vmware_vga: Remove uselss casts from void * vmware_vga: Pass pci_vmsga_state_t arg no VGACommonState vga: remove unused vga_common_save/load ... Conflicts: posix-aio-compat.c Signed-off-by: Mark McLoughlin <markmc@redhat.com>
| * posix-aio-compat: Split out posix_aio_process_queueKevin Wolf2009-10-271-16/+27
| | | | | | | | | | | | | | | | We need to process the request queue and run callbacks separately from reading out the queue in a later patch, so split it out. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Merge commit 'ee3993069ff55fa6f1c64daf1e09963e340db8e4' into upstream-mergeMarcelo Tosatti2009-09-291-5/+9
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'ee3993069ff55fa6f1c64daf1e09963e340db8e4': posix-aio-compat: avoid signal race when spawning a thread target-i386: kill a tmp register target-i386: use subfi instead of sub with a non-freed constant eepro100: Fix format strings in debug messages eepro100: Replace sprintf by snprintf eepro100: Remove unused code eepro100: Enhanced logging and comments fix -daemonize with kvm Set SDL icon_title when using `-name XXX` for proper gnome-panel window list integration qemu-option: rename bool -> boolean ARM back-end: Use sxt[bh] instructions for ext{8, 6}s Fix and improve qint_from_int64_test monitor: Fix do_wav_capture() argument type Conflicts: vl.c Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * posix-aio-compat: avoid signal race when spawning a threadmalc2009-09-271-5/+9
| | | | | | | | Signed-off-by: malc <av1474@comtv.ru>
* | Merge commit '72cf2d4f0e181d0d3a3122e04129c58a95da713e' into upstream-mergeMarcelo Tosatti2009-09-141-11/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '72cf2d4f0e181d0d3a3122e04129c58a95da713e': Fix sys-queue.h conflict for good Try to fix BSD breakage by 806b60248218bd5f74a8b070f5a99a864e8e51c6 Include sys-queue.h early to override system queue definitions on BSD Unbreak BSD: use qemu_fdatasync instead of fdatasync Use proper format conversion specifier when printing size_t value audio: remove lsbindex/popcount in favour of host-utils's ctz32 alsa: poll mode handling oss: poll mode handling audio: poll mode infrastructure gus: Do not manually free the state, qdev does it for us oss: Unbreak mmaping the ability to mmap oss fd on Linux Conflicts: exec.c kvm.h sysemu.h vl.c Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * Fix sys-queue.h conflict for goodBlue Swirl2009-09-121-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Our file sys-queue.h is a copy of the BSD file, but there are some additions and it's not entirely compatible. Because of that, there have been conflicts with system headers on BSD systems. Some hacks have been introduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896, f40d753718c72693c5f520f0d9899f6e50395e94, 96555a96d724016e13190b28cffa3bc929ac60dc and 3990d09adf4463eca200ad964cc55643c33feb50 but the fixes were fragile. Solution: Avoid the conflict entirely by renaming the functions and the file. Revert the previous hacks. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
| * Unbreak BSD: use qemu_fdatasync instead of fdatasyncBlue Swirl2009-09-121-1/+1
| | | | | | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Merge commit '1a621c8dc9e4dcc9d385bdd2c24c5b5dbfd0ebe4' into upstream-mergeMarcelo Tosatti2009-09-141-2/+17
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '1a621c8dc9e4dcc9d385bdd2c24c5b5dbfd0ebe4': (51 commits) ram: remove support for loading v1 move mux focus field from CharDriverState to MuxDriver monitor: fix muxing qdev: add parser for chardev properties Allow -serial chardev:<name> convert udp chardev to QemuOpts. convert mux chardev to QemuOpts. convert vc chardev to QemuOpts. convert tty + parport chardevs to QemuOpts. convert windows console chardev to QemuOpts. convert braille chardev to QemuOpts. convert msmouse chardev to QemuOpts. convert stdio chardev to QemuOpts. convert pty chardev to QemuOpts. convert unix+tcp chardevs to QemuOpts. sockets: add inet_listen_opts sockets: add inet_connect_opts sockets: add unix_*_opts for windows. sockets: add unix_listen_opts sockets: add unix_connect_opts ... Conflicts: vl.c Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * block: add aio_flush operationChristoph Hellwig2009-09-111-2/+17
| | | | | | | | | | | | | | | | | | | | | | Instead stalling the VCPU while serving a cache flush try to do it asynchronously. Use our good old helper thread pool to issue an asynchronous fdatasync for raw-posix. Note that while Linux AIO implements a fdatasync operation it is not useful for us because it isn't actually implement in asynchronous fashion. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Merge commit '9ef91a677110ec200d7b2904fc4bcae5a77329ad' into upstream-mergeAvi Kivity2009-08-301-73/+249
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '9ef91a677110ec200d7b2904fc4bcae5a77329ad': raw-posix: refactor AIO support virtio-console: rename dvq to ovq pci ids: remove redundant defines multiboot.raw is a generated file Port ACPI to VMState Conflicts: block/raw-posix.c Signed-off-by: Avi Kivity <avi@redhat.com>
| * raw-posix: refactor AIO supportChristoph Hellwig2009-08-271-73/+252
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the raw-posix.c code contains a lot of knowledge about the asynchronous I/O scheme that is mostly implemented in posix-aio-compat.c. All this code does not really belong here and is getting a bit in the way of implementing native AIO on Linux. So instead move all the guts of the AIO implementation into posix-aio-compat.c (which might need a better name, btw). There's now a very small interface between the AIO providers and raw-posix.c: - an init routine is called from raw_open_common to return an AIO context for this drive. An AIO implementation may either re-use one context for all drives, or use a different one for each as the Linux native AIO support will do. - an submit routine is called from the aio_reav/writev methods to submit an AIO request There are no indirect calls involved in this interface as we need to decide which one to call manually. We will only call the Linux AIO native init function if we were requested to by vl.c, and we will only call the native submit function if we are asked to and the request is properly aligned. That's also the reason why the alignment check actually does the inverse move and now goes into raw-posix.c. The old posix-aio-compat.h headers is removed now that most of it's content is private to posix-aio-compat.c, and instead we add a new block/raw-posix-aio.h headers is created containing only the tiny interface between raw-posix.c and the AIO implementation. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* rename HAVE_PREADV to CONFIG_PREADVJuan Quintela2009-07-271-2/+2
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* fix asynchronous ioctlsChristoph Hellwig2009-05-081-1/+10
| | | | | | | | posix_aio_read expect aio requests to return the number of bytes requests to be successfull, so we need to fake this up for ioctls. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* native preadv/pwritev support (Christoph Hellwig)aliguori2009-04-071-2/+83
| | | | | | | | | | | | | | | | This ties up the preadv/pwritev syscalls to qemu if they are declared in unistd.h. This is the case currently on at least NetBSD and OpenBSD and will hopefully soon be the case on Linux. Thanks to Blue Swirl and Gerd Hoffmann for the configure autodetection of preadv/pwritev. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7021 c046a42c-6fe2-441c-8c8c-71466251a162
* push down vector linearization to posix-aio-compat.c (Christoph Hellwig)aliguori2009-04-071-26/+92
| | | | | | | | | | | | | | | | | Make all AIO requests vectored and defer linearization until the actual I/O thread. This prepares for using native preadv/pwritev. Also enables asynchronous direct I/O by handling that case in the I/O thread. Qcow and qcow2 propably want to be adopted to directly deal with multi-segment requests, but that can be implemented later. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7020 c046a42c-6fe2-441c-8c8c-71466251a162
* new scsi-generic abstraction, use SG_IO (Christoph Hellwig)aliguori2009-03-281-34/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Okay, I started looking into how to handle scsi-generic I/O in the new world order. I think the best is to use the SG_IO ioctl instead of the read/write interface as that allows us to support scsi passthrough on disk/cdrom devices, too. See Hannes patch on the kvm list from August for an example. Now that we always do ioctls we don't need another abstraction than bdrv_ioctl for the synchronous requests for now, and for asynchronous requests I've added a aio_ioctl abstraction keeping it simple. Long-term we might want to move the ops to a higher-level abstraction and let the low-level code fill out the request header, but I'm lazy enough to leave that to the people trying to support scsi-passthrough on a non-Linux OS. Tested lightly by issuing various sg_ commands from sg3-utils in a guest to a host CDROM device. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6895 c046a42c-6fe2-441c-8c8c-71466251a162
* Properly handle pthread_cond_timedwait timing outmalc2009-02-211-1/+1
| | | | | | | | pthread_cond_timedwait is allowed to both consume the signal and return with the value indicating the timeout, hence predicate should always be (re)checked before taking an action git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6634 c046a42c-6fe2-441c-8c8c-71466251a162
* Cosmeticsmalc2009-02-211-11/+13
| | | | | | | Avoid repeated creation/initalization/destruction of attr and calls to getpid git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6633 c046a42c-6fe2-441c-8c8c-71466251a162
* Avoid thundering herd problemmalc2009-02-211-4/+4
| | | | | | | | | | | | | | | | | | Broadcast was used so that the I/O threads would wakeup, reset their ts values and all but one go to sleep, in other words an optimization to prevent threads from exiting in presence of continuing I/O activity. Spurious wakeups make the looping around cond_timedwait with ever reinitialized ts potentially unsafe and as such ts in no longer reinitilized inside the loop, hence switch to signal is warranted and this benefits of this particlaur optimization are lost. (It's worth noting that timed variants of pthread calls use realtime clock by default, and therefore can hang "forever" should the host time be changed. Unfortunatelly not all host systems QEMU runs on support CLOCK_MONOTONIC and/or pthread_condattr_setclock with this value) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6632 c046a42c-6fe2-441c-8c8c-71466251a162
* Avoid infinite loop around timed condition variablemalc2009-02-211-6/+7
| | | | | | This can happen due to spurious wakeups git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6631 c046a42c-6fe2-441c-8c8c-71466251a162
* Error checkingmalc2009-02-211-24/+72
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6630 c046a42c-6fe2-441c-8c8c-71466251a162
* Rename sigev_signo to avoid FreeBSD problems (Juergen Lock)blueswir12009-01-241-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6414 c046a42c-6fe2-441c-8c8c-71466251a162
* Use kill instead of sigqueue: re-enables AIO on OpenBSDblueswir12009-01-171-3/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6360 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix race in POSIX AIO emulation (Jan Kiszka)aliguori2009-01-131-7/+2
| | | | | | | | | | | | | | | | | | | | | | When we cancel an AIO request that is already being processed by aio_thread, qemu_paio_cancel should return QEMU_PAIO_NOTCANCELED as long as aio_thread isn't done with this request. But as the latter currently updates aiocb->ret after every block of the request, we may report QEMU_PAIO_ALLDONE too early. Futhermore, in case some zero-length request should have been queued, aiocb->ret is never set to != -EINPROGRESS and callers like raw_aio_cancel could get stuck in an endless loop. Fix those issues by updating aiocb->ret _after_ the request has been fully processed. This also simplifies the locking. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6278 c046a42c-6fe2-441c-8c8c-71466251a162
* Remove unnecessary trailing newlinesblueswir12008-12-131-1/+0
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6000 c046a42c-6fe2-441c-8c8c-71466251a162
* Replace posix-aio with custom thread poolaliguori2008-12-121-0/+202
glibc implements posix-aio as a thread pool and imposes a number of limitations. 1) it limits one request per-file descriptor. we hack around this by dup()'ing file descriptors which is hideously ugly 2) it's impossible to add new interfaces and we need a vectored read/write operation to properly support a zero-copy API. What has been suggested to me by glibc folks, is to implement whatever new interfaces we want and then it can eventually be proposed for standardization. This requires that we implement our own posix-aio implementation though. This patch implements posix-aio using pthreads. It immediately eliminates the need for fd pooling. It performs at least as well as the current posix-aio code (in some circumstances, even better). Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5996 c046a42c-6fe2-441c-8c8c-71466251a162