summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-11-01ia64-dis.c: Undefine ABS to avoid clash with glibPeter Maydell1-0/+3
Undefine ABS to avoid a clash with the macro that glib.h helpfully defines for us (and a resulting build failure on ia64 hosts). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01Fix segfault on migration completionLuiz Capitulino1-1/+1
A simple migration reproduces it: 1. Start the source VM with: # qemu [...] -S 2. Start the destination VM with: # qemu <source VM cmd-line> -incoming tcp:0:4444 3. In the source VM: (qemu) migrate -d tcp:0:4444 4. The source VM will segfault as soon as migration completes (might not happen in the first try) What is happening here is that qemu_file_put_notify() can end up closing 's->file' (in which case it's also set to NULL). The call stack is rather complex, but Eduardo helped tracking it to: select loop -> migrate_fd_put_notify() -> qemu_file_put_notify() -> buffered_put_buffer() -> migrate_fd_put_ready() -> migrate_fd_completed() -> migrate_fd_cleanup(). To be honest, it's not completely clear to me in which cases 's->file' is not closed (on error maybe)? But I doubt this fix will make anything worse. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01Add qapi related generated files to .gitignoreDavid Gibson1-0/+4
.gitignore already lists the qapi-generated subdirectory which includes a number of files generated during build. However, there are some additional files generated by the qapi build which go in the top level directory. This patch adds them to .gitignore, removing the irritating noise from diffs and the like. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01qemu-barrier: Fix build failure on PowerPC Mac OS XEric Sunshine1-1/+1
qemu-barrier.h tests if macro __powerpc__ is defined, however, the preprocessor on PowerPC Mac OS X defines only __POWERPC__, not __powerpc__. Resolve by testing instead for qemu-provided _ARCH_PPC. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01fw_cfg: Use g_file_get_contents instead of multiple fread() callsPavel Borzenkov1-64/+38
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01Simplify cpu_exec_all to tcg_exec_allJan Kiszka2-10/+5
After the removal of the non-threaded mode cpu_exec_all is now only used by TCG. Refactor it accordingly, also dropping its unused return value. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01Make cpu_single_env thread-localPaolo Bonzini2-2/+4
Make cpu_single_env thread-local. This fixes a regression in handling of multi-threaded programs in linux-user mode (bug 823902). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> [Peter Maydell: rename tls_cpu_single_env to cpu_single_env] Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01darwin-user/main.c: Drop unused cpu_single_env definitionPaolo Bonzini1-2/+0
Drop the cpu_single_env definition as it is unused. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01qemu-tls.h: Add abstraction layer for TLS variablesPeter Maydell1-0/+52
Add an abstraction layer for defining and using thread-local variables. For the moment this is implemented only for Linux, which means they can only be used in restricted circumstances. The abstraction layer allows us to add POSIX and Win32 support later. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01Error check find_ram_offsetAlex Williamson1-2/+9
Spotted via code review, we initialize offset to 0 to avoid a compiler warning, but in the unlikely case that offset is never set to something else, we should abort instead of return a value that will almost certainly cause problems. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01Support running QEMU on ValgrindStefan Weil1-3/+19
Valgrind is a tool which can automatically detect many kinds of bugs. Running QEMU on Valgrind with x86_64 hosts was not possible because Valgrind aborts when memalign is called with an alignment larger than 1 MiB. QEMU normally uses 2 MiB on Linux x86_64. Now the alignment is reduced to the page size when QEMU is running on Valgrind. v2: Instead of using the macro RUNNING_ON_VALGRIND from valgrind.h, the patch now uses a hack from libvirt which tests for the pre-loaded vgpreload_*.so shared libraries. This avoids the need for valgrind.h. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01MAINTAINERS: Add PReP maintainerAndreas Färber1-3/+3
Officially take on maintainership for PReP and upgrade to Odd Fixes. Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Andreas Färber <andreas.faerber@web.de> Cc: Alexander Graf <agraf@suse.de> Cc: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-10-31Merge remote-tracking branch 'riku/linux-user-for-upstream' into stagingAnthony Liguori9-175/+193
2011-10-31Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori33-649/+1978
Conflicts: block/vmdk.c
2011-10-31Merge remote-tracking branch 'aneesh/for-upstream-7' into stagingAnthony Liguori21-161/+973
2011-10-31Merge remote-tracking branch 'qmp/queue/qmp' into stagingAnthony Liguori27-1054/+1611
Conflicts: ui/spice-core.c
2011-10-31Merge remote-tracking branch 'qemu-kvm-tmp/uq/master' into stagingAnthony Liguori8-2/+784
2011-10-31Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori9-35/+37
2011-10-31Merge remote-tracking branch 'alon/pull-libcacard-assert' into stagingAnthony Liguori3-4/+10
2011-10-31Merge remote-tracking branch 'spice/spice.v45' into stagingAnthony Liguori9-54/+132
2011-10-31hw/9pfs: Replace rwlocks with RCU variants of interfaces.Harsh Prateek Bora1-16/+13
Use QLIST_INSERT_HEAD_RCU and rcu_read_lock/unlock instead of rwlocks. Use v9fs_synth_mutex as a write-only mutex to handle concurrent writers. Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-31qemu-queue: Introduce QLIST_INSERT_HEAD_RCU and dummy RCU wrappers.Harsh Prateek Bora2-0/+16
SynthFS needs a QLIST_INSERT_HEAD_RCU to make sure list instructions are not re-ordered and therefore avoiding a crash. There may be parallel readers which should be allowed for lock-free access and this variant allows us to get rid of rwlocks used by readers. SynthFS is a special case where we dont really need full RCU capabilities as it doesnt allow list entry deletion but concurrent readers/writers and instruction re-ordering should not result in a crash. Also, once the real rcu is available, dummy rcu macro definitions will go away and the code will still work as expected. This patchwork is based on inputs from Paolo Bonzini. Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-31hw/9pfs: Add synthetic file system support using 9pAneesh Kumar K.V8-0/+660
This patch create a synthetic file system with mount tag v_synth when -virtfs_synth command line option is specified in qemu. The synthetic file system can be mounted in guest using 9p using the below command line mount -t 9p -oversion=9p2000.L,trans=virtio v_synth <mountpint> Synthetic file system enabled different qemu subsystem to register callbacks for read and write events from guest. The subsystem can create directories and files in the synthetic file system as show in ex below qemu_v9fs_synth_mkdir(NULL, 0777, "test2", &node); qemu_v9fs_synth_add_file(node, 0777, "testfile", my_test_read, NULL, NULL); Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-31hw/9pfs: Abstract open state of fid to V9fsFidOpenStateAneesh Kumar K.V8-141/+179
To implement synthetic file system in Qemu we may not really require file descriptor and Dir *. Make generic code use V9fsFidOpenState instead. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-31hw/9pfs: Read-only support for 9p exportM. Mohan Kumar6-6/+78
A new fsdev parameter "readonly" is introduced to control accessing 9p export. "readonly" can be used to specify the access type. By default "rw" access is given to 9p export. Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-31qemu: Add opt_set_bool functionalityM. Mohan Kumar2-5/+37
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-31configure: Update configure so that open_by_handle_at check returns correct ↵Aneesh Kumar K.V1-1/+1
value According to David Gibson for some compiler/libc combinations, open_by_handle_at test in configure isn't quite right: because the file_handle pointer is never dereferenced, gcc doesn't complain even if it is undefined. Change the test as suggested by him. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-31hw/9pfs: Fix error handling in local_mknodAneesh Kumar K.V1-8/+5
Update local_chown to remove unnecessary if loop Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-31hw/vexpress.c, hw/realview.c: Add PL041 to VExpress, Realview boardsPeter Maydell2-2/+13
Instantiate the PL041 audio on the Versatile Express and Realview board models. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-10-31Add AACI audio playback support to the ARM Versatile/PB platformMathieu Sonet7-0/+1240
This driver emulates the ARM AACI interface (PL041) connected to a LM4549 codec. It enables audio playback for the Versatile/PB platform. Limitations: - Supports only a playback on one channel (Versatile/Vexpress) - Supports only one TX FIFO in compact-mode or non-compact mode. - Supports playback of 12, 16, 18 and 20 bits samples. - Record is not supported. - The PL041 is hardwired to a LM4549 codec. Versatile/PB test build: linux-2.6.38.5 buildroot-2010.11 alsa-lib-1.0.22 alsa-utils-1.0.22 mpg123-0.66 Qemu host: Ubuntu 10.04 in Vmware/OS X Playback tested successfully with speaker-test/aplay/mpg123. Signed-off-by: Mathieu Sonet <contact@elasticsheep.com> [Peter Maydell: fixed typo in code clearing SL1RXBUSY/SL2RXBUSY bits, as spotted by Andrzej Zaborowski] Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-10-30MAINTAINERS: update wiki URL and machine names for target-xtensaMax Filippov1-3/+8
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-10-30tcg: Optimize some forms of deposit.Richard Henderson1-14/+51
If the deposit replaces the entire word, optimize to a move. If we're inserting to the top of the word, avoid the mask of arg2 as we'll be shifting out all of the garbage and shifting in zeros. If the host is 32-bit, reduce a 64-bit deposit to a 32-bit deposit when possible. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-10-30hw/9pfs: Make VirtFS tracing work correctlyAneesh Kumar K.V3-114/+112
this patch fix multiple issues with VirtFS tracing. a) Add tracepoint to the correct code path. We handle error in complete_pdu b) Fix indentation in python script c) Fix variable naming issue in python script Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-10-30exec-all: Fix void pointer arithmeticStefan Weil1-2/+1
Adding an offset to a void pointer works with gcc but is not allowed by the current C standards. With -pedantic, gcc complains: exec-all.h:344: error: pointer of type ‘void *’ used in arithmetic Fix this, and also replace (unsigned long) by (uintptr_t) in the same statement. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-10-30Add linux-headers/asm to .gitignoreDavid Gibson1-0/+1
linux-headers/asm is a symlink generated during configure. It should not, therefore be committed to git, nor show up in git diffs and the like. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-10-28scsi-disk: add scsi-block for device passthroughPaolo Bonzini1-0/+118
scsi-block is a new device that supports device passthrough of Linux block devices (i.e. /dev/sda, not /dev/sg0). It uses SG_IO for commands other than I/O commands, and regular AIO read/writes for I/O commands. Besides being simpler to configure (no mapping required to scsi-generic device names), this removes the need for a large bounce buffer and, in the future, will get scatter/gather support for free from scsi-disk. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-10-28scsi: push request restart to SCSIDevicePaolo Bonzini3-69/+68
The request restart mechanism is generic and could be reused for scsi-generic. In the meanwhile, pushing it to SCSIDevice avoids that scsi_dma_restart_bh looks at SCSIGenericReqs when working on a scsi-block device. The code is the same that is already in hw/scsi-disk.c, with the type flags replaced by req->cmd.mode and a more generic way to requeue SCSI_XFER_NONE commands. I also added a missing call to qemu_del_vm_change_state_handler. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-10-28scsi-generic: bump SCSIRequest reference count until aio completion runsPaolo Bonzini1-0/+18
Same as before, but for scsi-generic. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-10-28scsi-disk: bump SCSIRequest reference count until aio completion runsPaolo Bonzini1-3/+45
In some cases a request may be canceled before the completion callback runs. Keep a reference to the request between starting an AIO operation and the corresponding scsi_req_cancel or scsi_*_complete. When a request has to be retried, the request can be dropped because scsi_dma_restart_bh only looks at requests that are enqueued. As such, they always have at least a reference. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-10-28scsi: do not call transfer_data after canceling a requestPaolo Bonzini3-4/+21
Otherwise, if cancellation is "faked" by the AIO layer and goes through qemu_aio_flush, the whole request is completed synchronously during scsi_req_cancel. Using the enqueued flag would work here, but not in the next patches, so I'm introducing a new io_canceled flag. That's because scsi_req_data is a synchronous callback and the enqueued flag might be reset by the time it returns. scsi-disk cannot unref the request until after calling scsi_req_data. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-10-28scsi: pass cdb to alloc_reqPaolo Bonzini4-5/+5
This will let scsi-block choose between passthrough and emulation. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-10-28scsi: export scsi_generic_reqopsPaolo Bonzini2-1/+4
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-10-28scsi: make reqops constPaolo Bonzini4-11/+10
Also delete a stale occurrence of SCSIReqOps inside SCSIDeviceInfo. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-10-28scsi: move max_lba to SCSIDevicePaolo Bonzini3-8/+10
The field is only in scsi-disk for now. Moving it up to SCSIDevice makes it easier to reuse the scsi-generic reqops elsewhere. At the same time, make scsi-generic get max_lba from snooped READ CAPACITY commands as well. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-10-28scsi-disk: small clean up to INQUIRYPaolo Bonzini1-25/+21
Set s->removable, s->qdev.blocksize and s->qdev.type in the callers of scsi_initfn. With this in place, s->qdev.type is allowed, and we can just reuse it as the first byte in VPD data (just like we do in standard INQUIRY data). Also set s->removable is set consistently and we can use it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-10-28scsi-disk: remove cluster_sizePaolo Bonzini1-19/+16
This field is redundant, and having it makes it more complicated to share reqops between the upcoming scsi-block and scsi-generic. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-10-28scsi-disk: do not duplicate BlockDriverState memberPaolo Bonzini1-47/+45
Same as for scsi-generic, avoid duplication even if it causes longer lines. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-10-28scsi-generic: snoop READ CAPACITY commands to get block sizePaolo Bonzini1-41/+25
Instead of "guessing" the block size when there is no medium in the drive, wait for the guest to send a READ CAPACITY command and snoop it from there. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-10-28scsi-generic: look at host statusPaolo Bonzini1-4/+16
Pass down the host status so that failing transport can be detected by the guest. Similar treatment of host status could be done in virtio-blk, too. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-10-28scsi-generic: check ioctl statuses when SG_IO succeedsPaolo Bonzini1-4/+4
A succeeding ioctl does not imply that the SCSI command succeeded. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>