Commit graph

97 commits

Author SHA1 Message Date
aliguori d5b4eb4016 Fix media detection on emulated CDROM (Gary Grebus)
This patch tweaks the ATAPI CDROM emulation to fix an annoyance seen
when running a variety of Linux guests: the desktop GUI shows a CDROM
device as present, but is unable to automount the media and display its
contents.

The patch adds the PLAY_AUDIO capability bit to the data returned by
MODE_SENSE commands.  That convinces the guest kernel to determine what
kind of media is present.

Arguably Linux could be smarter about this, but it's my guess there are
few (if any) hardware CDROM drives that don't set the bit, and there are
a large number of Linux distros that exhibit this problem.

Signed-off-by: Gary Grebus <ggrebus@virtualiron.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5752 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-19 15:03:36 +00:00
aliguori 9118e7f08f windows cdrom cache flush (Stefano Stabellini)
Windows only flushes its cache of a CDROM if it gets a
SENSE_UNIT_ATTENTION CHECK_CONDITION response to a REQUEST_SENSE
command.
Make sure it does so after we change the CD.

Tab damage fixed by Anthony Liguori

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Steven Smith <steven.smith@citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5698 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-11 20:57:30 +00:00
balrog 18c5f8eab1 Use the right format string to printf sector num with DEBUG_IDE.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5647 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-07 23:05:14 +00:00
aliguori 33256a25b3 Fix IDE DIAGNOSE for packet devices (Vincent Sanders)
The DIAGNOSE command in the qemu IDE implementation has an error when
use dfor packet devices. 

The status register value is dependant on the drive being a packet
device or not, this patch corrects the returned status.

From the ATA/PI specification (V6 draft):

"If the device implements the PACKET command feature set, the device
SHALL clear bits 6,5,4,3,2 and 0 in the Status register to zero."

A selection of physical devices have been checked and do conform to
the specifications behaviour.

Signed-off-by: Vincent Sanders <vince@simtec.co.uk>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5452 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-09 14:19:34 +00:00
balrog 5604e090cb Check that asynchronous (DMA) submission succeeds (Ian Jackson).
If it does not, abort the command immediately rather than dropping
it on the floor.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5369 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-01 01:43:16 +00:00
balrog e162cfb07b Actually check read/write errors in IDE (Ian Jackson).
This patch makes the ide emulation actually take notice of
error returns from bdrv_write and bdrv_aio_{read,write}.

(Cherry picked from qemu-xen e0e7a0afe0e324a1f7d64c240f567b15dbe454cf,
 first posted to qemu-devel Wed, 20 Feb 2008 15:26:41 +0000)

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5368 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-01 01:13:37 +00:00
aliguori fcdd25ab56 Ignore IDE command if issued while IDE is busy (Gleb Natapov)
Feature, Sector Count, LBA Low/Mid/High and Device registers should be
written only when both BSY and DRQ are cleared to zero.
Command register shall only be written when BSY and DRQ are set to zero
for all commands except DEVICE RESET.
Data Port register shall be accessed for host PIO data transfer only when
DRQ is set to one.

Signed-off-by: Gleb Natapov <gleb@qumranet.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5060 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-21 22:40:00 +00:00
aliguori 72c7b06cb7 Cancel IDE outstanding IO on device reset (Gleb Natapov)
Cancel AIO in IDE layer on device rest in order to be in deterministic state
during next boot.

Signed-off-by: Gleb Natapov <gleb@qumranet.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5011 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-15 18:21:58 +00:00
aliguori 41a2b9596c IDE SEEK_STAT flag
Add SEEK_STAT in all non-error cases except sleep request, since our
seek times are virtually 0.  Although this flag is deprecated by newer
ATA standards, Linux at least checks it for CD drives, and would timeout
in some case if we do not set it.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4994 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-11 18:52:14 +00:00
ths d1b5c20dcd ide: enable single word DMA, by Stefano Stabellini.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4890 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-18 16:49:42 +00:00
ths 8114e9e8fd Fix ATAPI read drive structure command, by Alex Williamson.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4831 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-03 03:57:14 +00:00
pbrook 18be518729 Remove duplicate device index calculations.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4818 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-01 21:31:54 +00:00
balrog 091d055b3e Fix ATAPI GET_CONFIGURATION function (Alexander Graf, Carlo Marcelo Arenas Belon).
The current implementation of GET_CONFIGURATION in the ATAPI stack of qemu
replies a different length depending on the buffer, the data should be
written into.

On the other hand the SCSI spec defines that length information has to be
consistent and independent of return buffer lengths.

This patch makes the ATAPI emulation behave according to the spec and fixes
the Darwin DVD driver.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Kevin Wolf <kwolf@suse.de>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4649 c046a42c-6fe2-441c-8c8c-71466251a162
2008-06-02 03:12:06 +00:00
aurel32 5b9a1293be ide: Enable byte&word access to DMA address register
(Jan Kiszka)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4354 c046a42c-6fe2-441c-8c8c-71466251a162
2008-05-06 09:55:56 +00:00
aurel32 1d8cde5beb IDE: Improve DMA transfers by increasing the buffer size
(Ian Jackson)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4132 c046a42c-6fe2-441c-8c8c-71466251a162
2008-03-29 12:15:35 +00:00
balrog c717d8bf13 Simplify guess_disk_lchs - should fix Windows stack corruption spotted by TeLeMan (patch by Tristan Gingold).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3953 c046a42c-6fe2-441c-8c8c-71466251a162
2008-02-03 03:37:46 +00:00
balrog 38453b93dd Set READY_STAT after a WIN_DIAGNOSE per ATA-3 (Till Straumann).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3912 c046a42c-6fe2-441c-8c8c-71466251a162
2008-01-14 03:15:20 +00:00
balrog 38cdea7ccf Multi-profile DVD-ROM support (Carlo Marcelo Arenas Belon).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3910 c046a42c-6fe2-441c-8c8c-71466251a162
2008-01-14 03:05:55 +00:00
balrog 33f002714b Add "cache" parameter to "-drive" (Laurent Vivier).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3848 c046a42c-6fe2-441c-8c8c-71466251a162
2007-12-24 14:33:24 +00:00
ths 69b349765c Fix miscellaneous minor things, by Andre Przywara.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3826 c046a42c-6fe2-441c-8c8c-71466251a162
2007-12-17 03:15:52 +00:00
ths 96b8f136f5 Fix bdrv_get_geometry to return uint64_t, by Andre Przywara.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3825 c046a42c-6fe2-441c-8c8c-71466251a162
2007-12-17 01:35:20 +00:00
ths bee8d6842d qemu_put signedness fixes, by Andre Przywara.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3824 c046a42c-6fe2-441c-8c8c-71466251a162
2007-12-16 23:41:11 +00:00
ths 60fe76f386 Fix wrong signedness, by Andre Przywara.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3815 c046a42c-6fe2-441c-8c8c-71466251a162
2007-12-16 03:02:09 +00:00
balrog f5fdd0a855 IDE should send irq after WIN_DIAGNOSE (Tristan Gingold).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3808 c046a42c-6fe2-441c-8c8c-71466251a162
2007-12-11 22:15:29 +00:00
ths 0d4a05a109 Fix Win98SE MyComputer regression, by Ben Taylor.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3783 c046a42c-6fe2-441c-8c8c-71466251a162
2007-12-09 05:01:52 +00:00
pbrook 9596ebb701 Add statics and missing #includes for prototypes.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3683 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-18 01:44:38 +00:00
pbrook 87ecb68bdf Break up vl.h.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-17 17:14:51 +00:00
ths 31c2a146ec Revert "Last AIO Patch" as requested by Fabrice, it is incomplete and
breaks other (non-Windows) systems.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3552 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-08 16:38:17 +00:00
ths 3b46e62427 find -type f | xargs sed -i 's/[\t ]*$//g' # Yes, again. Note the star in the regex.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3177 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-17 08:09:54 +00:00
ths 5fafdf24ef find -type f | xargs sed -i 's/[\t ]$//g' # on most files
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-16 21:08:06 +00:00
ths c3e88d8c4f Allow more IDE power management, by Ben Guthro.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3165 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-13 12:28:42 +00:00
ths d14049eaec Partial IDE DVD emulation, by Filip Navara.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3161 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-13 02:20:40 +00:00
ths f0c596cb3d Last AIO patch, by Vladimir N. Oleynik.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3147 c046a42c-6fe2-441c-8c8c-71466251a162
2007-08-26 17:42:20 +00:00
ths 7603d1568e Fix bugs in the ATAPI cdrom driver, by Brandon Philips.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3124 c046a42c-6fe2-441c-8c8c-71466251a162
2007-08-19 21:46:53 +00:00
ths aa1f17c18d Spelling fixes, by Stefan Weil.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3066 c046a42c-6fe2-441c-8c8c-71466251a162
2007-07-11 22:48:58 +00:00
ths afcc3cdfc4 Use the correct PCI IDs for Malta.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2945 c046a42c-6fe2-441c-8c8c-71466251a162
2007-06-06 16:26:14 +00:00
balrog aa941b9445 Savevm/loadvm bits for ARM core, the PXA2xx peripherals and Spitz hardware.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2857 c046a42c-6fe2-441c-8c8c-71466251a162
2007-05-24 18:50:09 +00:00
balrog 9e315fa93c PCMCIA addresses are 26-bit, widen the address type from 16 to 32 bits.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2797 c046a42c-6fe2-441c-8c8c-71466251a162
2007-05-09 20:25:36 +00:00
balrog 201a51fc38 PCMCIA bus support. Parts of CF-ATA command set. Hitachi DSCM microdrive emulation.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2748 c046a42c-6fe2-441c-8c8c-71466251a162
2007-04-30 00:51:09 +00:00
pbrook d537cf6c86 Unify IRQ handling.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2635 c046a42c-6fe2-441c-8c8c-71466251a162
2007-04-07 18:14:41 +00:00
pbrook 544c4be626 Remove dead code.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2631 c046a42c-6fe2-441c-8c8c-71466251a162
2007-04-07 01:24:43 +00:00
ths e1f63470e9 Don't fail for "revert to poweron defaults" IDE command, by Carlo
Marcelo Arenas Belon.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2485 c046a42c-6fe2-441c-8c8c-71466251a162
2007-03-17 14:55:30 +00:00
ths 39dfc926df Allow disabling IDE block mode, by Carlo Marcelo Arenas Belon.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2484 c046a42c-6fe2-441c-8c8c-71466251a162
2007-03-17 14:54:15 +00:00
ths 292eef5acb Ignore special flags in nsector variable.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2436 c046a42c-6fe2-441c-8c8c-71466251a162
2007-02-19 00:59:34 +00:00
ths e6a71ae327 Add support for 82371FB (Step A1) and Improved support for 82371SB
(Function 1), by Carlo Marcelo Arenas Belon.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2353 c046a42c-6fe2-441c-8c8c-71466251a162
2007-01-24 21:35:22 +00:00
ths 30c4bbace1 Fix DMA timeouts on FreeBSD, by Carlo Marcelo Arenas Belon.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2349 c046a42c-6fe2-441c-8c8c-71466251a162
2007-01-24 01:12:42 +00:00
ths 5f12ab4b10 Add more ATAPI CDROM DMA support, by Juergen Keil.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2338 c046a42c-6fe2-441c-8c8c-71466251a162
2007-01-20 01:12:17 +00:00
ths 4dbb0f5006 Fix for hard disk translation hints, by Volker Ruppert.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2297 c046a42c-6fe2-441c-8c8c-71466251a162
2007-01-05 18:58:34 +00:00
ths bd491d6a4e Fix CDROM change, by Anthony Liguori.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2262 c046a42c-6fe2-441c-8c8c-71466251a162
2006-12-22 02:14:49 +00:00
bellard 66c6ef7678 better support of removable media
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2123 c046a42c-6fe2-441c-8c8c-71466251a162
2006-08-19 11:44:21 +00:00