summary refs log tree commit diff stats
path: root/hw (follow)
Commit message (Collapse)AuthorAgeFilesLines
* scsi-generic: remove scsi_req_fixupPaolo Bonzini2011-10-281-15/+0
| | | | | | | | This is not needed anymore, since asynchronous ioctls were introduced by commit 221f715 (new scsi-generic abstraction, use SG_IO, 2009-03-28). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* scsi-generic: drop SCSIGenericStatePaolo Bonzini2011-10-281-50/+40
| | | | | | | | It is not needed, because s->bs is already stored in SCSIDevice, and can be reached from the conf.bs member. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* scsi-disk: fix retrying a flushPaolo Bonzini2011-10-281-6/+3
| | | | | | | Flush does not go anymore through scsi_disk_emulate_command. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* scsi-disk: fail READ CAPACITY if LBA != 0 but PMI == 0Paolo Bonzini2011-10-281-0/+6
| | | | | | | | | | | | Tested by the Windows Logo Kit SCSI Compliance test. From SBC-3, paragraph 5.25: "The LOGICAL BLOCK ADDRESS field shall be set to zero if the PMI bit is set to zero. If the PMI bit is set to zero and the LOGICAL BLOCK ADDRESS field is not set to zero, then the device server shall terminate the command with CHECK CONDITION status with the sense key set to ILLEGAL REQUEST and the additional sense code set to INVALID FIELD IN CDB". Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* scsi: add channel to addressingPaolo Bonzini2011-10-285-21/+25
| | | | | | | | | This also requires little more than adding the new argument to scsi_device_find, and the qdev property. All devices by default end up on channel 0. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* scsi: allow arbitrary LUNsPaolo Bonzini2011-10-286-24/+75
| | | | | | | | | | | | | This only requires changes in two places: in SCSIBus, we need to look for a free LUN if somebody creates a device with a pre-existing scsi-id but the default LUN (-1, meaning "search for a free spot"); in vSCSI, we need to actually parse the LUN according to the SCSI spec. For vSCSI, max_target/max_lun are set according to the logical unit addressing format in SAM. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* scsi: implement REPORT LUNS for arbitrary LUNsPaolo Bonzini2011-10-281-10/+39
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* scsi: remove devs array from SCSIBusPaolo Bonzini2011-10-286-52/+50
| | | | | | | | | | | | | Change the devs array into a linked list, and add a scsi_device_find function to navigate the children list instead. This lets the SCSI bus use more complex addressing, and HBAs can talk to the correct device when there are multiple LUNs per target. scsi_device_find may return another LUN on the same target if none is found that matches exactly. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qdev: switch children device list to QTAILQPaolo Bonzini2011-10-288-28/+28
| | | | | | | | | | SCSI buses will need to read the children list first-to-last. This requires using a QTAILQ, because hell breaks loose if you just try inserting at the tail (thus reversing the order of all existing visits from last-to-first to first-to-tail). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* scsi: move tcq/ndev to SCSIBusOps (now SCSIBusInfo)Paolo Bonzini2011-10-287-32/+39
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* scsi-disk: report media changed via GET EVENT STATUS NOTIFICATIONPaolo Bonzini2011-10-281-4/+53
| | | | | | | | This adds support for media change notification via the GET EVENT STATUS NOTIFICATION command, used by Linux versions 2.6.38 and newer. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* scsi-disk: support READ DVD STRUCTUREPaolo Bonzini2011-10-281-1/+101
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* scsi-disk: support DVD profile in GET CONFIGURATIONPaolo Bonzini2011-10-281-8/+42
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* atapi/scsi-disk: make mode page values coherent between the twoPaolo Bonzini2011-10-282-16/+31
| | | | | | | | | | | | This patch adds to scsi-disk the missing mode page 0x01 for both disk and 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 expose DVD media read capabilities in the IDE cdrom. This lets you run dvd+rw-mediainfo on the virtual DVD drives. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* scsi-disk: store valid mode pages in a tablePaolo Bonzini2011-10-281-12/+13
| | | | | | | A small refactoring of the MODE SENSE implementation in scsi-disk. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* scsi-disk: add stubs for more MMC commandsPaolo Bonzini2011-10-282-5/+65
| | | | | | | | | | This patch adds a few stub implementations for MMC commands to scsi-disk, to be filled in later in the series. It also adds to scsi-defs.h constants for commands implemented by ide/atapi.c, when missing. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* scsi-disk: fix coding style issues (braces)Paolo Bonzini2011-10-281-25/+46
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* scsi-disk: report media changed via unit attention sense codesPaolo Bonzini2011-10-283-1/+35
| | | | | | | | Building on the previous patch, this one adds a media change callback to scsi-disk. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* scsi: notify the device when unit attention is reportedPaolo Bonzini2011-10-282-5/+29
| | | | | | | | | | | Reporting media change events via unit attention sense codes requires a small state machine: first report "NO MEDIUM", then report "MEDIUM MAY HAVE CHANGED". Unfortunately there is no good hooking point for the device to notice that its pending unit attention condition has been reported. This patch reworks the generic machinery to add one. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* atapi: cleanup/fix mode sense resultsPaolo Bonzini2011-10-281-4/+6
| | | | | | | | | | | | The first two bytes (after the 8-byte ATAPI header) are the mode page number and the number of bytes after the length field itself. Make this clear in the code. The AUDIO_CTL page was filled with wrong values. It is not anymore in MMC, but at least keep the values sane. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* atapi: move GESN definitions to scsi-defs.hPaolo Bonzini2011-10-282-37/+27
| | | | | | | | | | | As a complement to the previous patch, move definitions for GET EVENT STATUS 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. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* atapi/scsi: unify definitions for MMCPaolo Bonzini2011-10-287-104/+101
| | | | | | | | | | | | | | The definitions in ide/internal.h are duplicates, since ATAPI commands actually come from SCSI. Use the ones in scsi-defs.h and move the missing ones there. Two exceptions: - MODE_PAGE_WRITE_PARMS conflicts with the "flexible disk geometry" page in scsi-disk.c. It is unused, so pick the latter. - GPCMD_* is left in ide/internal.h, at least for now. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* scsi: pass correct sense code for ENOMEDIUMPaolo Bonzini2011-10-281-0/+3
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* ide: Fix off-by-one error in array index checkKevin Wolf2011-10-281-1/+1
| | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
* Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori2011-10-266-19/+42
|\
| * pc: Fix floppy drives with if=noneKevin Wolf2011-10-215-16/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit 63ffb564 broke floppy devices specified on the command line like -drive file=...,if=none,id=floppy -global isa-fdc.driveA=floppy because it relies on drive_get() which works only with -fda/-drive if=floppy. This patch resembles what we're already doing for IDE, i.e. remember the floppy device that was created and use that to extract the BlockDriverStates where needed. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
| * fdc: Fix floppy port I/OKevin Wolf2011-10-211-0/+2
| | | | | | | | | | | | | | | | | | The floppy device was broken by commit 212ec7ba (fdc: Convert to isa_register_portio_list). While the old interface provided the port number relative to the floppy drive's io_base, the new one provides the real port number, so we need to apply a bitmask now to get the register number. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * xen_disk: Always set feature-barrier = 1Kevin Wolf2011-10-211-3/+2
| | | | | | | | | | | | | | | | The synchronous .bdrv_flush callback doesn't exist any more and a device really shouldn't poke into the block layer internals anyway. All drivers are supposed to have a correctly working bdrv_flush, so let's just hard-code this. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | hda: do not mix output and input stream states, RHBZ #740493Marc-André Lureau2011-10-253-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | Windows 7 may use the same stream number for input and output. Current code will confuse streams. Changes since v1: - keep running_compat[] for migration version 1 - add running_real[] for migration version 2 Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
* | hda: do not mix output and input streams, RHBZ #740493Marc-André Lureau2011-10-251-4/+5
| | | | | | | | | | | | | | | | | | | | | | Windows 7 may use the same stream number for input and output. That will result in lot of garbage on playback. The hardcoded value of 4 needs to be in sync with GCAP streams description and IN/OUT registers. Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
* | Merge remote-tracking branch 'bonzini/split-main-loop-for-anthony' into stagingAnthony Liguori2011-10-242-6/+0
|\ \
| * | remove unused functionPaolo Bonzini2011-10-212-6/+0
| | | | | | | | | | | | | | | Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* | | m48t59: fix write accessBlue Swirl2011-10-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix incorrect order of arguments, letting writes to NVRAM succeed. It looks like guests never write to the device, only read from it, since the bug originates back to 819385c58b319d9f80d676cefaed0610118f03ac. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | | m48t59: drop obsolete address base arithmeticBlue Swirl2011-10-231-2/+0
| | | | | | | | | | | | | | | | | | | | | Remove now incorrect address base arithmetic, missed by 9936d6e42392f1440505dfa9df065eabd251cadf. Fixes Sparc64 boot. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | | pci_bridge: fix typoBlue Swirl2011-10-231-1/+1
| |/ |/| | | | | | | Reviewed-by: Avi Kivity <avi@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | hw/arm_gic.c: Fix save/load of irq_target arrayDmitry Koshelev2011-10-211-8/+8
| | | | | | | | | | | | | | | | | | irq_target array saving/loading is in the wrong loop. Version bump. Signed-off-by: Dmitry Koshelev <karaghiozis@gmail.com> Acked-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
* | hw/omap2: Wire up the IRQ for the 2430's fifth GPIO modulePeter Maydell2011-10-211-0/+5
|/ | | | | | | | | The OMAP2430 version of the omap-gpio device has five GPIO modules, not four like the other OMAP2 versions; wire up the fifth module's IRQ line correctly. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
* Merge remote-tracking branch 'quintela/migration-pull' into stagingAnthony Liguori2011-10-202-14/+18
|\
| * migration: rename qemu_file_has_error to qemu_file_get_errorJuan Quintela2011-10-201-1/+1
| | | | | | | | | | | | | | Now the function returned errno, so it is better the new name. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
| * migration: change has_error to contain errno valuesJuan Quintela2011-10-201-1/+1
| | | | | | | | | | | | We normally already have an errno value. When not, abuse EIO. Signed-off-by: Juan Quintela <quintela@redhat.com>
| * ds1225y: Use stdio instead of QEMUFileJuan Quintela2011-10-201-12/+16
| | | | | | | | | | | | | | | | | | QEMUFile * is only intended for migration nowadays. Using it for anything else just adds pain and a layer of buffers for no good reason. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
* | Merge remote-tracking branch 'qemu-kvm-tmp/memory/batch' into stagingAnthony Liguori2011-10-2022-649/+544
|\ \
| * | tcx: convert to memory APIAvi Kivity2011-10-171-67/+85
| | | | | | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com>
| * | tc63963xb: convert to memory APIAvi Kivity2011-10-173-51/+25
| | | | | | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com>
| * | syborg: convert to memory APIAvi Kivity2011-10-171-3/+5
| | | | | | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com>
| * | sun4u: convert to memory APIAvi Kivity2011-10-171-9/+13
| | | | | | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com>
| * | sun4m: convert to memory APIAvi Kivity2011-10-171-17/+32
| | | | | | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com>
| * | strongarm: convert to memory APIAvi Kivity2011-10-173-106/+75
| | | | | | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com>
| * | spitz: convert to memory APIAvi Kivity2011-10-171-30/+18
| | | | | | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com>
| * | spapr: convert to memory APIAvi Kivity2011-10-171-3/+6
| | | | | | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com>