raw-posix: Fix test for host CD-ROM
commit65d21bc73bda6515fd9b4ff5b2e90454f7a0b419
authorMarkus Armbruster <armbru@redhat.com>
Mon, 28 Jun 2010 08:25:20 +0000 (28 10:25 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 6 Jul 2010 15:05:49 +0000 (6 17:05 +0200)
tree579b25d9c6d3692754a94756e821858376bc56e5
parentd246673dcb9911218ff555bcdf28b250e38fa46c
raw-posix: Fix test for host CD-ROM

raw_pread_aligned() retries up to two times if the block device backs
a virtual CD-ROM (a drive with media=cdrom and if=ide, scsi, xen or
none).  This makes no sense.  Whether retrying reads can correct read
errors can only depend on what we're reading, not on how the result
gets used.  We need to check what whether we're reading from a
physical CD-ROM or floppy here.

I doubt retrying is useful even then.  Left for another day.

Impact:

* Virtual CD-ROM backed by host_cdrom behaves the same.

* Virtual CD-ROM backed by file or host_device no longer retries.

* A drive backed by host_cdrom now retries even if it's not a virtual
  CD-ROM.

* Any drive backed by host_floppy now retries.

While there, clean up gratuitous use of goto.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/raw-posix.c