fw_cfg: Use g_file_get_contents instead of multiple fread() calls
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>
qemu-barrier: Fix build failure on PowerPC Mac OS X
qemu-barrier.h tests if macro powerpc is defined, however, thepreprocessor on PowerPC Mac OS X defines only POWERPC, notpowerpc. Resolve by testing instead for qemu-provided _ARCH_PPC.
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>...
Error check find_ram_offset
Spotted via code review, we initialize offset to 0 to avoid acompiler warning, but in the unlikely case that offset isnever set to something else, we should abort instead of returna value that will almost certainly cause problems....
qemu-tls.h: Add abstraction layer for TLS variables
Add an abstraction layer for defining and using thread-localvariables. 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...
darwin-user/main.c: Drop unused cpu_single_env definition
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>
Make cpu_single_env thread-local
Make cpu_single_env thread-local. This fixes a regressionin 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]...
Simplify cpu_exec_all to tcg_exec_all
After the removal of the non-threaded mode cpu_exec_all is now only usedby 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>
MAINTAINERS: Add PReP maintainer
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>...
Support running QEMU on Valgrind
Valgrind is a tool which can automatically detect many kinds of bugs.
Running QEMU on Valgrind with x86_64 hosts was not possible becauseValgrind aborts when memalign is called with an alignment larger than1 MiB. QEMU normally uses 2 MiB on Linux x86_64....
Merge remote-tracking branch 'riku/linux-user-for-upstream' into staging
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Conflicts: block/vmdk.c
Merge remote-tracking branch 'aneesh/for-upstream-7' into staging
Merge remote-tracking branch 'qmp/queue/qmp' into staging
Conflicts: ui/spice-core.c
Merge remote-tracking branch 'qemu-kvm-tmp/uq/master' into staging
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Merge remote-tracking branch 'alon/pull-libcacard-assert' into staging
Merge remote-tracking branch 'spice/spice.v45' into staging
hw/9pfs: Add synthetic file system support using 9p
This patch create a synthetic file system with mount tagv_synth when -virtfs_synth command line option is specifiedin qemu. The synthetic file system can be mounted in guestusing 9p using the below command line...
qemu-queue: Introduce QLIST_INSERT_HEAD_RCU and dummy RCU wrappers.
SynthFS needs a QLIST_INSERT_HEAD_RCU to make sure list instructions are notre-ordered and therefore avoiding a crash. There may be parallel readers whichshould be allowed for lock-free access and this variant allows us to get rid...
hw/9pfs: Replace rwlocks with RCU variants of interfaces.
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>...
hw/9pfs: Read-only support for 9p export
A new fsdev parameter "readonly" is introduced to control accessing 9p export."readonly" can be used to specify the access type. By default "rw" accessis given to 9p export.
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>...
hw/9pfs: Abstract open state of fid to V9fsFidOpenState
To implement synthetic file system in Qemu we may not reallyrequire file descriptor and Dir *. Make generic code useV9fsFidOpenState instead.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
qemu: Add opt_set_bool functionality
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
hw/9pfs: Fix error handling in local_mknod
Update local_chown to remove unnecessary if loop
configure: Update configure so that open_by_handle_at check returns correct value
According to David Gibson for some compiler/libc combinations, open_by_handle_attest in configure isn't quite right: because the file_handle pointer is neverdereferenced, gcc doesn't complain even if it is undefined. Change the test...
hw/vexpress.c, hw/realview.c: Add PL041 to VExpress, Realview boards
Instantiate the PL041 audio on the Versatile Express andRealview board models.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
Add AACI audio playback support to the ARM Versatile/PB platform
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)...
MAINTAINERS: update wiki URL and machine names for target-xtensa
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
tcg: Optimize some forms of deposit.
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 arg2as 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...
hw/9pfs: Make VirtFS tracing work correctly
this patch fix multiple issues with VirtFS tracing.a) Add tracepoint to the correct code path. We handle error in complete_pdub) Fix indentation in python scriptc) Fix variable naming issue in python script...
exec-all: Fix void pointer arithmetic
Adding an offset to a void pointer works with gcc but is not allowedby 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...
Add linux-headers/asm to .gitignore
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>...
scsi-disk: do not duplicate BlockDriverState member
Same as for scsi-generic, avoid duplication even if it causes longerlines.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
scsi-disk: remove cluster_size
This field is redundant, and having it makes it more complicatedto share reqops between the upcoming scsi-block and scsi-generic.
scsi-disk: small clean up to INQUIRY
Set s->removable, s->qdev.blocksize and s->qdev.type in the callersof scsi_initfn.
With this in place, s->qdev.type is allowed, and we can just reuse itas the first byte in VPD data (just like we do in standard INQUIRY data)....
scsi: move max_lba to SCSIDevice
The field is only in scsi-disk for now. Moving it up to SCSIDevice makesit easier to reuse the scsi-generic reqops elsewhere.
At the same time, make scsi-generic get max_lba from snooped READ CAPACITYcommands as well....
scsi: make reqops const
Also delete a stale occurrence of SCSIReqOps inside SCSIDeviceInfo.
scsi: export scsi_generic_reqops
scsi: pass cdb to alloc_req
This will let scsi-block choose between passthrough and emulation.
scsi: do not call transfer_data after canceling a request
Otherwise, if cancellation is "faked" by the AIO layer and goesthrough qemu_aio_flush, the whole request is completed synchronouslyduring scsi_req_cancel.
Using the enqueued flag would work here, but not in the next patches,...
scsi-disk: bump SCSIRequest reference count until aio completion runs
In some cases a request may be canceled before the completion callbackruns. Keep a reference to the request between starting an AIO operationand the corresponding scsi_req_cancel or scsi_*_complete....
scsi-generic: bump SCSIRequest reference count until aio completion runs
Same as before, but for scsi-generic.
scsi: push request restart to SCSIDevice
The request restart mechanism is generic and could be reused forscsi-generic. In the meanwhile, pushing it to SCSIDevice avoidsthat scsi_dma_restart_bh looks at SCSIGenericReqs when working ona scsi-block device....
scsi-disk: add scsi-block for device passthrough
scsi-block is a new device that supports device passthrough of Linuxblock devices (i.e. /dev/sda, not /dev/sg0). It uses SG_IO for commandsother than I/O commands, and regular AIO read/writes for I/O commands....
scsi-disk: report media changed via GET EVENT STATUS NOTIFICATION
This adds support for media change notification via the GET EVENT STATUSNOTIFICATION command, used by Linux versions 2.6.38 and newer.
scsi: move tcq/ndev to SCSIBusOps (now SCSIBusInfo)
qdev: switch children device list to QTAILQ
SCSI buses will need to read the children list first-to-last. Thisrequires using a QTAILQ, because hell breaks loose if you just tryinserting at the tail (thus reversing the order of all existingvisits from last-to-first to first-to-tail)....
scsi: remove devs array from SCSIBus
Change the devs array into a linked list, and add a scsi_device_findfunction to navigate the children list instead. This lets the SCSIbus use more complex addressing, and HBAs can talk to the correct devicewhen there are multiple LUNs per target....
scsi: implement REPORT LUNS for arbitrary LUNs
scsi: allow arbitrary LUNs
This only requires changes in two places: in SCSIBus, we need to lookfor a free LUN if somebody creates a device with a pre-existing scsi-idbut the default LUN (-1, meaning "search for a free spot"); in vSCSI,we need to actually parse the LUN according to the SCSI spec....
scsi: add channel to addressing
This also requires little more than adding the new argument toscsi_device_find, and the qdev property. All devices by defaultend up on channel 0.
scsi-disk: fail READ CAPACITY if LBA != 0 but PMI == 0
Tested by the Windows Logo Kit SCSI Compliance test. From SBC-3, paragraph5.25: "The LOGICAL BLOCK ADDRESS field shall be set to zero if the PMIbit is set to zero. If the PMI bit is set to zero and the LOGICAL BLOCK...
scsi-disk: fix retrying a flush
Flush does not go anymore through scsi_disk_emulate_command.
scsi-generic: drop SCSIGenericState
It is not needed, because s->bs is already stored in SCSIDevice, andcan be reached from the conf.bs member.
scsi-generic: remove scsi_req_fixup
This is not needed anymore, since asynchronous ioctls were introducedby commit 221f715 (new scsi-generic abstraction, use SG_IO, 2009-03-28).
scsi-generic: check ioctl statuses when SG_IO succeeds
A succeeding ioctl does not imply that the SCSI command succeeded.
scsi-generic: look at host status
Pass down the host status so that failing transport can be detectedby the guest. Similar treatment of host status could be done invirtio-blk, too.
scsi-generic: snoop READ CAPACITY commands to get block size
Instead of "guessing" the block size when there is no medium in thedrive, wait for the guest to send a READ CAPACITY command and snoopit from there.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
block: reinitialize across bdrv_close()/bdrv_open()
Several BlockDriverState fields are not being reinitialized acrossbdrv_close()/bdrv_open(). Make sure they are reset to their defaultvalues.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
Documentation: Add syntax for using sheepdog devices
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
scsi: pass correct sense code for ENOMEDIUM
atapi/scsi: unify definitions for MMC
The definitions in ide/internal.h are duplicates, since ATAPI commandsactually come from SCSI. Use the ones in scsi-defs.h and move themissing ones there. Two exceptions:
- MODE_PAGE_WRITE_PARMS conflicts with the "flexible disk geometry"...
atapi: move GESN definitions to scsi-defs.h
As a complement to the previous patch, move definitions for GET EVENTSTATUS NOTIFICATION from the two functions to scsi-defs.h.
The NCR_* constants are just bit values corresponding to the ENC_*values, with no offsets even, so keep just one copy....
atapi: cleanup/fix mode sense results
The first two bytes (after the 8-byte ATAPI header) are the mode pagenumber and the number of bytes after the length field itself. Makethis clear in the code.
The AUDIO_CTL page was filled with wrong values. It is not anymore in...
scsi: notify the device when unit attention is reported
Reporting media change events via unit attention sense codes requiresa small state machine: first report "NO MEDIUM", then report "MEDIUM MAYHAVE CHANGED". Unfortunately there is no good hooking point for the...
scsi-disk: report media changed via unit attention sense codes
Building on the previous patch, this one adds a media change callbackto scsi-disk.
scsi-disk: fix coding style issues (braces)
scsi-disk: add stubs for more MMC commands
This patch adds a few stub implementations for MMC commands toscsi-disk, to be filled in later in the series. It also adds toscsi-defs.h constants for commands implemented by ide/atapi.c,when missing.
scsi-disk: store valid mode pages in a table
A small refactoring of the MODE SENSE implementation in scsi-disk.
atapi/scsi-disk: make mode page values coherent between the two
This patch adds to scsi-disk the missing mode page 0x01 for both diskand CD-ROM drives, and mode page 0x0e for CD drives only.
A few offsets were wrong in atapi.c. Also change the 2Ah mode page to...
scsi-disk: support DVD profile in GET CONFIGURATION
scsi-disk: support READ DVD STRUCTURE
Documentation: Add iSCSI section
Add new section for device URL syntax for special files and describe the iSCSIURL with examples
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Teach block/vdi about "discarded" (no longer allocated) blocks
An entry in the VDI block map will hold an offset to the actual block ifthe block is allocated, or one of two specially-interpreted values ifnot allocated. Using VirtualBox terminology, value VDI_IMAGE_BLOCK_FREE...
qcow2: fix some errors and typo in qcow2.txt
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: Remove dead code
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: Fix bdrv_open use after free
tmp_filename was used outside the block it was defined in, i.e. after it wentout of scope. Move its declaration to the top level.
qcow: Fix bdrv_write_compressed error handling
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
ide: Fix off-by-one error in array index check
vmdk: Fix use of uninitialised value
In error cases, cid is never set.
vmdk: Improve error handling
Return the right error values in some more places.
vmdk: Fix possible segfaults
Data we read from the disk isn't necessarily null terminated and may notcontain the string we're looking for. The code needs to be a bit more carefulhere.
Documentation: Describe NBD URL syntax
This patch adds a short description of how to specify a NBD deviceto QEMU.Syntax for both TCP and Unix Domain Sockets are provided as wellas examples.
block: fix qcow2_co_flush deadlock
If qcow2_cache_flush failed, s->lock will not be unlock.
Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-io: delete bs instead of leaking it
Using bdrv_close() is not enough to free a BlockDriverState. Since weexplicitly create it with bdrv_new(), use bdrv_delete() to close anddelete it.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: set bs->read_only before .bdrv_open()
Several block drivers set bs->read_only in .bdrv_open() butblock.c:bdrv_open_common() clobbers its value. Additionally, QED usesbdrv_is_read_only() in .bdrv_open() to decide whether to performconsistency checks....
iSCSI block driver
This provides built-in support for iSCSI to QEMU.
This has the advantage that the iSCSI devices need not be made visible to the host, which is useful if you have very many virtual machines and very many iscsi devices.It also has the benefit that non-root users of QEMU can access iSCSI devices across the network without requiring root privilege on the host....
Merge branch 'rth/vis2' of git://repo.or.cz/qemu/rth
block: iostatus: Drop BDRV_IOS_INVAL
A future commit will convert bdrv_info() to the QAPI and it won'tprovide IOS_INVAL.
Luckily all we have to do is to add a new 'iostatus_enabled'member to BlockDriverState and use it instead.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
block: Rename the BlockIOStatus enum values
The biggest change is to rename its prefix from BDRV_IOS toBLOCK_DEVICE_IO_STATUS.
Next commit will convert the query-block command to the QAPIand that's how the enumeration is going to be generated.
qapi: Convert query-block
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qapi: Convert query-blockstats
qerror: Add a user string for QERR_FEATURE_DISABLED
Missing from commit 821601ea5b.
qapi: Convert query-vnc
There are three important remarks in relation to the non-qapi command:
1. This commit also fixes the behavior of the 'query-vnc' and 'info vnc' commands to return an error when qemu is built without VNC support (ie. --disable-vnc). The non-qapi command would return the OK...
qapi: Convert query-spice
qapi: Convert query-balloon
Please, note that some of the code supporting memory statistics isstill around (eg. virtio_balloon_receive_stats() and reset_stats()).
Also, the qmp_query_balloon() function is synchronous and thus doesn'tmake any use of the (not fully working) monitor's asynchronous command...
qapi: Convert query-pci
This also fixes a bug with the old version: QMP would invert device idand vendor id. This would look ok on HMP because it was printing"device:vendor" instead of "vendor:device".
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
QMP: Drop the query commands dispatch table
Because QMP development originated in the monitor, it hasinherited the monitor's distinction between query- andnon-query commands.
However, previous commits unified both commands and thedistinction is gone. This commit drops the query commands...
Monitor: do_info(): Drop QMP command handling code
Previous commits converted all existing QMP commands to the QAPI,now each info command does its own QMP call.
Let's then drop all QMP command handling code from do_info().
Drop qemu-objects.h from modules that don't require it
Previous commits dropped most qobjects usage from qemu modules(now they are a low level interface used by the QAPI). However,some modules still include the qemu-objects.h header file.
This commit drops qemu-objects.h from some of those modules...