scsi: add tracepoint for scsi_req_cancel
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scsi-disk: removable hard disks support load/eject
Support for the LOEJ bit of the START/STOP UNIT command right now islimited to CD-ROMs. This is wrong, since removable hard disks (in thereal world: SD card readers) also support it in pretty much the same way....
scsi-disk: Fail medium writes with proper sense for readonly LUNs
Add sense code for DATA_PROTECT/WRITE_PROTECTED and return this errorfor any WRITE*/WRITE_VERIFY* calls if the device is readonly=on,i.e. write-protected
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>...
scsi-disk: fix changeable values for MODE_PAGE_R_W_ERROR
The changeable values were not all-zeros for this mode page, fix it.
scsi-disk: parse MODE SELECT commands and parameters
This adds the bulk of the parsing code for MODE SELECT, includingbreaking out changes to different mode pages, and checking that onlychangeable values are modified.
In order to report errors correctly two passes are made through the...
scsi-disk: support toggling the write cache
Finally, this uses the "plumbing" in the previous patch toadd support for toggling the WCE bit of the caching mode page.
scsi-disk: rd/wr/vr-protect !=0 is an error
The QEMU SCSI emulation does not support protection information,so any READ/WRITE/VERIFY commands that has the protect bits set tonon-zero should fail with ILLEGAL_REQUEST/INVALID_FIELD_IN_CDB
From SCSI SBC :...
scsi-disk: improve the lba-out-of-range tests for read/write/verify
Improve the tests for the LBA to cover more cases.
For the 16 byte opcodes, the lba is a uint64, so we need to check is tomake sure that we do not wrap. For example if an opcode would specify...
scsi-disk: let the user customize vendor and product name
This patch adds two new properties vendor and product to SCSI disks.These options let the user customize the inquiry data returned by thedisk.
Signed-off-by: Yan Vugenfirer <yan@ravellosystems.com>...
scsi-disk: make discard asynchronous
By making discard asynchronous, we can reuse all the error handlingcode that is used for other commands.
scsi-disk: move all non-DMA commands to scsi_disk_emulate_command
We want to use separate SCSIReqOps for emulated commands needing anallocated buffer vs. those that are zerocopy when the HBA supportsS/G lists. Ensure that all of the former are in scsi_disk_emulate_command....
scsi-disk: split scsi-disk reqops
Only checks for present medium were still done in scsi_send_commandfor emulated commands. So move those to scsi_disk_emulate_commandand return different SCSIReqOps depending on the kind of command.
Checks for present medium can be done unconditionally for the...
scsi-disk: separate read_data/write_data implementation for emulate_reqops
The previous patch only separated the send_command callback.Use different implementations also for read_data and write_data.The latter is still unreachable, so it aborts for now....
scsi-disk: support emulated TO_DEV requests
This adds the implementation of write_data for the emulatedcommand case. The first time through it asks for more data,the second time it finishes the processing of the command.
MODE SELECT and MODE SELECT can now be re-enabled, but they...
scsi-disk: adjust offsets in MODE SENSE by 2
This will make offsets the same when implementing MODE SELECT. This isbecause MODE SELECT has to deal with both 2-byte and 4-byte headers.Unfortunately, this means that the offsets are now off by two compared...
lsi: use qdev_reset_all
By first resetting the devices, lsi_soft_reset will find the queuealready cleared so there is no need to do that forcibly (which may alsoleak SCSIRequests, and/or worse due to dangling references to thelsi_request in the hba_private field)....
lsi: introduce lsi_request_free
Split the common bits of lsi_request_cancelled and lsi_command_completeout to a new function.
lsi: avoid redundant tests of s->current != NULL
Simplify the code by checking against req->hba_private directly,and asserting that it is non-NULL before a command is completedor canceled.
scsi-block: remove properties that are not relevant for passthrough
scsi-block is a passthrough device and does not allow customizationof vendor, product, removable, DPOFUA, block size or any other piece ofinformation. Thus, drop DEFINE_SCSI_DISK_PROPERTIES() from the...
cutils: add strpadcpy()
Signed-off-by: Yan Vugenfirer <yan@ravellosystems.com>Signed-off-by: Dmitry Fleytman <dmitry.fleytman@ravellosystems.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
megasas: Replace trace_megasas_dcmd_dump_frame()
trace_megasas_dcmd_dump_frame() takes 9 arguments, which israther much. Plus the trace infrastructure doesn't supportit. As we can get the information via other means it's pointlessto have it in the driver, so rather use some proper trace...
megasas: fix misuse of scsi_req_abort
scsi_req_abort is for terminating a command with a non-zero status.The ABORT task management function is invoked by scsi_req_cancel.In fact, ABORTED_COMMAND is a sense key, not a SAM status code.
Merge remote-tracking branch 'stefanha/tracing' into staging
Merge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into staging
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Merge remote-tracking branch 'stefanha/net' into staging
qapi schema: remove trailing whitespace
Signed-off-by: Laszlo Ersek <lersek@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
qapi schema: add Netdev types
NetdevTapOptions::sndbuf and NetdevDumpOptions::len use the new "size" type.
v1->v2:- NetLegacy::name is optional- NetLegacyNicOptions::vectors is of type uint32- NetdevVdeOptions::port and ::mode are of type uint16- NetLegacy::vlan has type int32...
hw, net: "net_client_type" -> "NetClientOptionsKind" (qapi-generated)
NET_CLIENT_TYPE_ -> NET_CLIENT_OPTIONS_KIND_
convert net_client_init() to OptsVisitor
The net_client_init() prototype is kept intact.
Based on "is_netdev", the QemuOpts-rooted QemuOpt-list is parsed as aNetdev or a NetLegacy. The original meat of net_client_init() is moved toand simplified in net_client_init1():...
convert net_init_nic() to NetClientOptions
v1->v2:- NetLegacyNicOptions::vectors is of type uint32
convert net_init_dump() to NetClientOptions
v1->v2:- NetdevDumpOptions::len is of type 'size', whose C type was changed to uint64_t. Adapt the printf() format specifier macro.
convert net_init_slirp() to NetClientOptions
convert net_init_socket() to NetClientOptions
I "reverse engineered" the following permissions between the -socketsub-options:
fd listen connect mcast udp | localaddr fd x . . . . | . listen . x . . . | ....
convert net_init_vde() to NetClientOptions
v1->v2:- NetdevVdeOptions::port and ::mode are of type uint16. Remove superfluous range checks.
convert net_init_tap() to NetClientOptions
convert net_init_bridge() to NetClientOptions
remove unused QemuOpts parameter from net init functions
v1->v2:- unchanged
v2->v3:- keep "qemu-option.h" included in "net/slirp.h"
MAINTAINERS: Replace net maintainer Mark McLoughlin with Stefan Hajnoczi
The net subsystem has lacked an active maintainer since 2009. I havebuilt and tested a net-next tree to get the ball rolling again.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
qapi: fix error propagation
Don't overwrite / leak previously set errors.Make traversal cope with missing mandatory sub-structs.Don't try to end a container that could not be started.
v2->v3:- instead of examining, assert that we never overwrite errors with...
qapi: add test case for deallocating traversal of incomplete structure
v3:- new patch
qapi: generate C types for fixed-width integers
(Long line folded using parens:<http://www.python.org/dev/peps/pep-0008/#maximum-line-length>.)
qapi: introduce "size" type
v1->v2:- fall back to uint64 rather than int
expose QemuOpt and QemuOpts struct definitions to interested parties
The only clients should be the existent "qemu-option.c", and the upcoming"qapi/opts-visitor.c".
qapi: introduce OptsVisitor
This visitor supports parsing
-option [type=]discriminator[,optarg1=val1][,optarg2=val2][,...]
style QemuOpts objects into "native" C structures. After defining the typetree in the qapi schema (see below), a root type traversal with this...
powerpc pci: fixed packing of ranges[]
By default mingw-gcc is trying to pack structures the way topreserve binary compatibility with MS Visual C what leads toincorrect and unexpected padding in the PCI bus ranges property ofthe sPAPR PHB.
The patch replaces attribute((packed)) with more strict QEMU_PACKED...
Recognize PCID feature
This patch makes Qemu recognize the PCID feature specified from configuration or command line options.
Signed-off-by: Junjie Mao <junjie.mao@intel.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Use macro QEMU_PACKED for new packed structures
Since commit 541dc0d47f10973c241e9955afc2aefc96adec51,some new packed structures were added without using QEMU_PACKED.
QEMU_PACKED is needed for compilations with MinGW.For other platforms nothing changes....
cpus.c: Make all_cpu_threads_idle() static
Commit 946fb27c1 moved all the uses of all_cpu_threads_idle()into cpus.c. This means we can mark the function 'static'(again), if we shuffle it a bit earlier in the source file.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
qdev: Fix Open Firmware comment
Commit 0d936928ef87ca1bb7b41b5b89c400c699a7691c removed code,but left the related comment at a location where it no longerbelongs to.
The patch moves the comment to the correct callback and improves the text.
Signed-off-by: Stefan Weil <sw@weilnetz.de>...
Fix some more Qemus in documentation and help text
Hopefully they will be eliminated one day.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
exynos4210: add Exynos4210 i2c implementation
Create 9 exynos4210 i2c interfaces.
Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com>Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/exynos4210_rtc.c: remove unnecessary code
Signed-off-by: Oleg Ogurtsov <o.ogurtsov@samsung.com>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/exynos4210_rtc.c: Fix calculating for value of year
hw/arm_boot.c: Consistently use ram_size from arm_boot_info struct
Clean up the mix of getting the RAM size from the global ram_sizeand from the ram_size field in the arm_boot_info structure, sothat we always use the structure field.
hw/arm_boot.c: Check for RAM sizes exceeding ATAGS capacity
The legacy ATAGS format for passing information to the kernel onlyallows RAM sizes which fit in 32 bits; enforce this restrictionrather than silently doing something weird.
device_tree: Add support for reading device tree properties
Add support for reading device tree properties (both genericand single-cell ones) to QEMU's convenience wrapper layer.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
hw/arm_boot.c: Support DTBs which use 64 bit addresses
Support the case where the device tree blob specifies that#address-cells and #size-cells are greater than 1. (Thisis needed for device trees which can handle 64 bit physicaladdresses and thus total RAM sizes over 4GB.)...
hw/vexpress.c: Allow >4GB of RAM for Cortex-A15 daughterboard
Now that we have LPAE support and can handle passing 64 bitRAM sizes to Linux via the device tree, we can lift therestriction in the Versatile Express A15 daughterboard modelon not having more than 2GB of RAM. Allow up to 30GB, which...
hw/pl011.c: Avoid crash on read when no chr backend present
Add a missing guard that meant we would segfault if the guest readUARTDR on a PL011 serial device which had no chr backend connected.(This didn't happen for Linux guests because Linux reads the flags...
hw/arm_boot.c: Make ram_size a uint64_t
Make the RAM size in arm_boot_info a uint64_t so it can expressthe larger RAM sizes that may be seen in LPAE systems.
Revert "audio: Make PC speaker audio card available by default"
This reverts commit 504972922da9b562f15e13544d3efca84b46b8fd which broke thebuild for ARM.
I don't think this change is necessary. If I'm wrong, please recommit thischangeset with an appropriate fix for ARM....
audio: Make PC speaker audio card available by default
[ The following text is in the "ISO-8859-1" character set. ] [ Your display is set for the "KOI8-R" character set. ] [ Some special characters may be displayed incorrectly. ]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
Simpletrace v2: Support multiple arguments, strings.
Existing simpletrace backend allows to trace at max 6 args and does notsupport strings. This newer tracelog format gets rid of fixed size recordsand therefore allows to trace variable number of args including strings....
Update simpletrace.py for new log format
Support new tracelog format for multiple arguments and strings.
Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
monitor: remove unused do_info_trace
Going forward with simpletrace v2 variable size trace records, we cannothave a generic function to print trace event info and therefore thisinterface becomes invalid.
As per Stefan Hajnoczi:
"This command is only available from the human monitor. It's not very...
trace: added ability to comment out events in the list
It is convenient for debug to be able to switch on/off some events easily.The only possibility now is to remove event name from the file completelyand type it again when we want it back.
The patch adds '#' symbol handling as a comment specifier....
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
Merge remote-tracking branch 'qmp/queue/qmp' into staging
Merge remote-tracking branch 'kraxel/bios.2' into staging
Merge remote-tracking branch 'kraxel/usb.57' into staging
build: fix build breakage due to bad merge
34bb443ee74df3780d86044dbf6492eb798c5807 broke the build but in a subtle way.The patch on the ML was actually based on the 1.1.1 stable branch(accidentally). When I merged it from the ML, the fuzzing got resolved in a...
build: add make dist target (v2)
Let's stop screwing up releases by having a script do the work that Anthony'sfat fingers can't seem to get right.
Cc: Michael Roth <mdroth@linux.vnet.ibm.com>Reviewed-by: Eric Blake <eblake@redhat.com>Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com>...
qemu-options.hx: Improve -{read|write}config options description
This is the patch to improve description for -{read|write}configfunctions.
Signed-off-by: Michal Novotny <minovotn@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-options.hx: Improve -nodefaults description
This patch improves the description of -nodefaults QEMU command lineoption by adding more information what is being disabled using thiscommand.
qemu-options.hx: Fix set_password and expire_password description
The description for set_password and expire_password commands isincomplete. This patch fixes the man page that is being generatedto match the real behaviour of these functions.
Signed-off-by: Michal Novotny <minovotn@redhat.com>...
doc: Fix indefinite article an -> a before nouns that begin with 'h'
Although the rule also allows 'an' for historical reasons,'a' is more common because 'h' is pronounced.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Stefan Weil <sw@weilnetz.de>...
constify value pointer for qdev_prop_set_string
qdev_prop_set_string uses object_property_set_str, which takesa const char * for the value. Lets propagate the constnessinto qdev_prop_set_string.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>...
hd-geometry: Compute BIOS CHS translation in one place
Currently, it is split between hd_geometry_guess() andpc_cmos_init_late(). Confusing. info qtree shows the result of theformer. Also confusing.
Fold the part done in pc_cmos_init_late() into hd_geometry_guess()....
blockdev: Drop redundant CHS validation for if=ide
Leave it to ide_init_drive().
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Relax IDE CHS limits from 16383,16,63 to 65535,16,255
New limits straight from ATA4 6.2 Register delivered data transfercommand sector addressing.
I figure the old sector limit 63 was blindly copied from the BIOSint 13 limit. Doesn't apply to the hardware. No idea where the old...
hw/block-common: Move BlockConf & friends from block.h
This stuff doesn't belong to block layer, and was put there onlybecause a better home didn't exist then. Now it does.
hw/block-common: Factor out fall back to legacy -drive serial=...
blockdev: Don't limit DriveInfo serial to 20 characters
All current users (IDE, SCSI and virtio-blk) happen to share this 20characters limit. Still, it should be left to device models. Theyalready enforce their limits. They have to, as the DriveInfo limit...
hw/block-common: Factor out fall back to legacy -drive cyls=...
qemu-io: Fix memory leaks
Almost all callers of create_iovec() forgot to destroy the qiov when therequest has completed.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
coroutine-ucontext: Help valgrind understand coroutines
valgrind tends to get confused and report false positives when youswitch stacks and don't tell it about it.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
qemu-iotests: Valgrind support
check -valgrind wraps all qemu-io calls with valgrind. This makes it abit easier to debug problems that occur somewhere deep in a test case.
fdc: fix relative seek
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
fdc-test: introduce test_relative_seek
fdc-test: Clean up a bit
Readability of the test code has suffered as the test case evolved. Thisshould improve it a bit again.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qtest: Cover qdev properties for disk geometry
qdev: Collect private helpers in one place
Just code motion, with one long line wrapped to keep checkpatch.plhappy.
qdev: New property type chs-translation
ide: qdev property for BIOS CHS translation
This isn't quite orthodox. CHS translation is firmware configuration,communicated via the RTC's CMOS RAM, not a property of the disk. Butit's best to treat it just like geometry anyway.
Maintain backward compatibility exactly like for geometry: fall back...
qtest: Cover qdev property for BIOS CHS translation
block: Geometry and translation hints are now useless, purge them
There are two producers of these hints: drive_init() on behalf of-drive, and hd_geometry_guess().
The only consumer of the hint is hd_geometry_guess().
The callers of hd_geometry_guess() call it only when drive_init()...
ide pc: Put hard disk info into CMOS only for hard disks
In particular, don't set disk type and geometry when a CD-ROM on buside.0 has media during CMOS initialization.
qtest: Test we don't put hard disk info into CMOS for a CD-ROM