aboutsummaryrefslogtreecommitdiffstats
path: root/hw/scsi-disk.c
AgeCommit message (Collapse)AuthorFilesLines
2009-05-13Replace gcc variadic macro extension with C99 versionBlue Swirl1-5/+5
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-04-13Fix OpenSolaris gcc4 warnings: iovec type mismatches, missing 'static'blueswir11-2/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7103 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-07remove bdrv_aio_read/bdrv_aio_write (Christoph Hellwig)aliguori1-62/+63
Always use the vectored APIs to reduce code churn once we switch the BlockDriver API to be vectored. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7019 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-29Misc scsi disk/cdrom fixes/improvements 4/4blueswir11-0/+3
Implement Test Unit Ready command (return NOT READY as above if !bdrv_is_inserted(...)) Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6954 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-29misc scsi disk/cdrom fixes/improvements 3/4blueswir11-1/+9
Add asc 0x3a, ascq 0: Medium not present to NOT READY sense (needed to keep some guests from retrying causing long sleeps in the kernel) Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6953 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-29misc scsi disk/cdrom fixes/improvements 2/4blueswir11-0/+4
Implement cdrom load/eject functionality (Start Stop Unit command) Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6952 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-29misc scsi disk/cdrom fixes/improvements 1/4blueswir11-0/+1
Use correct sector size for cdrom Read TOC command Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6951 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-29check SCSI read/write requests against max LBA (Rik van Riel)aliguori1-0/+18
The bdrv layer uses a signed offset. Furthermore, block-raw-posix only seeks when that offset is positive. Passing a negative offset to block-raw-posix can result in data being written at the current seek cursor's position. It may be possible to exploit this to seek to the end of the disk and extend the virtual disk by writing data to a negative sector offset. After a reboot, this could lead to the guest having a larger disk than it had before. Close the hole by sanity checking the lba against the size of the disk. Signed-off-by: Rik van Riel <riel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6475 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-28SCSI divide capacity by s->cluster_size (Rik van Riel)aliguori1-0/+2
Paul Brook pointed out that the number of sectors reported by the SCSI read capacity commands needs to be divided by s->cluster_size, because bdrv_get_geometry reports the number of 512 byte sectors, while emulated CDROMs report 2048 byte sectors back to the guest. This has no consequences for emulated hard disks, which use a cluster size of 1. aliguori: fixed typo Signed-off-by: Rik van Riel <riel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6469 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-28support >2TB SCSI disks (Rik van Riel)aliguori1-7/+46
Implement SCSI READ(16), WRITE(16) and SAI READ CAPACITY(16) commands, so SCSI disks larger than 2TB can work with guests that support these newer SCSI commands. The cast to (uint64_t) is needed because otherwise gcc will use a signed int, which gets sign extended into uint64_t lba, resulting in bad block numbers for READ 10 and READ 16 with block numbers larger than 2^31. Signed-off-by: Rik van Riel <riel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6468 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-28fix signed/unsigned overflows in SCSI disk (Rik van Riel)aliguori1-3/+6
Sector numbers can overflow on a virtual scsi disk of over 1TB in size. Qemu's bdrv_read expects an int64_t, so fix the overflow by going to that data type. On large disks, we clip the capacity to 2TB instead of returning "capacity modulo 2TB". Turn sector_count into an unsigned to prevent a signed/unsigned overflow with SCSI transfers larger than 2TB. We're unlikely to ever hit this bug, but fixing it is just one line. Signed-off-by: Rik van Riel <riel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6467 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-22Stop VM on error in scsi-disk (Gleb Natapov)aliguori1-17/+69
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6409 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-14Make OpenBSD sparc-softmmu compile warning freeblueswir11-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6299 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-07add "serial" parameter to -drive flag (Gleb Natapov)aliguori1-4/+13
Windows calculates HW "uniqueness" based on a hard drive serial number among other things. The patch allows to specify drive serial number from a command line. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6214 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-07SCSI: Handle inquiry commands of varying length (Justin Chevrier).balrog1-3/+8
Openserver 5.0.5 sends an Inquiry command to the emulated SCSI disk expecting a response length of 40 bytes. Currently the response to an Inquiry command is hardcoded to 36 bytes. When receiving a response of length 36 instead of 40 Openserver panics. Modifications to original patch based on feedback from Ryan Harper and Paul Brook. Thanks guys. Signed-off-by: Justin Chevrier <address@hidden> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5903 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-11Correct SCSI error reporting (Laurent Vivier)blueswir11-15/+27
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5455 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-01qemu: improve scsi dma speed by increasing the dma buffer sizeaurel321-1/+1
taken from Xen 17267:f4a92f0db20f, original patch by Samuel Thibault. Signed-off-by: Avi Kivity <avi@qumranet.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5385 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-02Add rigid and flexible disk geometry page supportblueswir11-1/+70
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4821 c046a42c-6fe2-441c-8c8c-71466251a162
2008-06-03Spelling fixes, by Stefan Weil.ths1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4655 c046a42c-6fe2-441c-8c8c-71466251a162
2008-04-29Revert v4260, breaks Sparc32blueswir11-24/+13
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4280 c046a42c-6fe2-441c-8c8c-71466251a162
2008-04-26Fix scsi-disk sense-key/status confusion (Marcelo Tosatti).balrog1-13/+24
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4260 c046a42c-6fe2-441c-8c8c-71466251a162
2008-02-03Implement more INQUIRY command replies for scsi disk (Igor Kovalenko).balrog1-4/+125
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3955 c046a42c-6fe2-441c-8c8c-71466251a162
2007-12-24Add "cache" parameter to "-drive" (Laurent Vivier).balrog1-1/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3848 c046a42c-6fe2-441c-8c8c-71466251a162
2007-12-17Fix bdrv_get_geometry to return uint64_t, by Andre Przywara.ths1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3825 c046a42c-6fe2-441c-8c8c-71466251a162
2007-12-10SCSI cleanup, by Laurent Vivier.ths1-24/+38
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3797 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-17Break up vl.h.pbrook1-1/+3
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
2007-06-03Spelling fixes, by Stefan Weil.ths1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2927 c046a42c-6fe2-441c-8c8c-71466251a162
2007-04-28Buffer length fixes, by Wang Cheng Yeh.ths1-4/+5
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2736 c046a42c-6fe2-441c-8c8c-71466251a162
2006-08-29SCSI TCQ support.pbrook1-231/+263
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2139 c046a42c-6fe2-441c-8c8c-71466251a162
2006-08-19no need for bdrv_close()bellard1-1/+0
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2125 c046a42c-6fe2-441c-8c8c-71466251a162
2006-08-14scsi empty drive fix (Blue Swirl).pbrook1-0/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2109 c046a42c-6fe2-441c-8c8c-71466251a162
2006-08-12SCSI and USB async IO support.pbrook1-34/+118
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2107 c046a42c-6fe2-441c-8c8c-71466251a162
2006-08-06Add missing #define.pbrook1-0/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2092 c046a42c-6fe2-441c-8c8c-71466251a162
2006-08-06Fix SCSI off-by-one device size.pbrook1-9/+15
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2091 c046a42c-6fe2-441c-8c8c-71466251a162
2006-06-04Disk cache flush support.pbrook1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1949 c046a42c-6fe2-441c-8c8c-71466251a162
2006-06-03More SCSI commands (Blue Swirl).pbrook1-20/+72
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1948 c046a42c-6fe2-441c-8c8c-71466251a162
2006-05-30PCI SCSI HBA emulation.pbrook1-14/+28
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1946 c046a42c-6fe2-441c-8c8c-71466251a162
2006-05-26SCSI lun probing fix.pbrook1-3/+4
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1945 c046a42c-6fe2-441c-8c8c-71466251a162
2006-05-26Small read fix.pbrook1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1944 c046a42c-6fe2-441c-8c8c-71466251a162
2006-05-26Fix scsi sector size confusion (Blue Swirl).pbrook1-38/+41
Fix short TOC read. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1942 c046a42c-6fe2-441c-8c8c-71466251a162
2006-05-25Rearrange SCSI disk emulation code.pbrook1-0/+408
Add USB mass storage device emulation. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1940 c046a42c-6fe2-441c-8c8c-71466251a162