qemu/hw
Stefan Hajnoczi aad64f3193 ide: refuse WIN_READ_NATIVE_MAX on empty device
What is the highest addressable sector on an empty CD-ROM?  Nothing is
addressable so produce an error.

This patch prevents a divide-by-zero in ide_set_sector() since
s->sectors and s->heads would be 0.  Not to mention that a sector=-1
argument would be nonsense.

Note that WIN_READ_NATIVE_MAX can be triggered using hdparm -N 1024
/dev/cdrom.  The LBA bit will be set to 1 though, so the only easy way
to go down the ide_set_sector() CHS code path which divides by zero is
to comment out the s->select & 0x40 case for testing.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
2013-04-15 10:18:05 +02:00
..
9pfs virtio-9p: Fix virtio-9p no longer building after hw-dirs branch merge 2013-04-09 07:47:00 -05:00
acpi hw: move target-independent files to subdirectories 2013-04-08 18:13:12 +02:00
alpha hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
arm hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
audio hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
block Typo, spelling and grammatical fixes 2013-04-12 14:33:20 +02:00
bt hw: move target-independent files to subdirectories 2013-04-08 18:13:12 +02:00
char hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
core hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
cpu hw: move ARM CPU cores to hw/cpu/, configure with default-configs/ 2013-04-08 18:13:16 +02:00
cris hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
display hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
dma hw: move DMA controllers to hw/dma/, configure with default-configs/ 2013-04-08 18:13:14 +02:00
gpio hw: move GPIO interfaces to hw/gpio/, configure with default-configs/ 2013-04-08 18:13:16 +02:00
i2c hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
i386 hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
ide ide: refuse WIN_READ_NATIVE_MAX on empty device 2013-04-15 10:18:05 +02:00
input hw: move timer devices to hw/timer/, configure with default-configs/ 2013-04-08 18:13:14 +02:00
intc Typo, spelling and grammatical fixes 2013-04-12 14:33:20 +02:00
isa hw: move ISA bridges and devices to hw/isa/, configure with default-configs/ 2013-04-08 18:13:14 +02:00
lm32 hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
m68k hw: move char devices to hw/char/, configure via default-configs/ 2013-04-08 18:13:14 +02:00
microblaze hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
mips hw: move PCI bridges to hw/pci-* or hw/ARCH 2013-04-08 18:13:14 +02:00
misc hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
moxie hw: move MC146818RTC to hw/timer/, configure via default-configs/ 2013-04-08 18:13:13 +02:00
net Merge remote-tracking branch 'bonzini/hw-dirs' into staging 2013-04-08 13:12:33 -05:00
nvram hw: move NVRAM interfaces to hw/nvram/, configure with default-configs/ 2013-04-08 18:13:16 +02:00
openrisc hw: move headers to include/ 2013-04-08 18:13:10 +02:00
pci hw: move PCI bridges to hw/pci-* or hw/ARCH 2013-04-08 18:13:14 +02:00
pci-bridge hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
pci-host hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
ppc hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
s390x Typo, spelling and grammatical fixes 2013-04-12 14:33:20 +02:00
scsi hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
sd Typo, spelling and grammatical fixes 2013-04-12 14:33:20 +02:00
sh4 sh7750: Change cpu field type to SuperHCPU 2013-04-13 13:51:45 +02:00
sparc hw: move other devices to hw/misc/, configure with default-configs/ 2013-04-08 18:13:16 +02:00
sparc64 hw: move PCI bridges to hw/pci-* or hw/ARCH 2013-04-08 18:13:14 +02:00
ssi hw: move SSI controllers to hw/ssi/, configure via default-configs/ 2013-04-08 18:13:13 +02:00
timer hw: move timer devices to hw/timer/, configure with default-configs/ 2013-04-08 18:13:14 +02:00
unicore32 hw: move headers to include/ 2013-04-08 18:13:10 +02:00
usb Merge remote-tracking branch 'bonzini/hw-dirs' into staging 2013-04-08 13:12:33 -05:00
virtio hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
watchdog hw: move watchdogs to hw/watchdog, configure via default-configs/ 2013-04-08 18:13:13 +02:00
xen hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
xtensa hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
Makefile.objs hw: move VFIO and ivshmem to hw/misc/ 2013-04-08 18:13:14 +02:00