ide: Check validity of logical block size
commitd20051856cd2fa8f10fed2d2a0b2751de5f7b20d
authorKevin Wolf <kwolf@redhat.com>
Wed, 3 Dec 2014 12:21:32 +0000 (3 13:21 +0100)
committerKevin Wolf <kwolf@redhat.com>
Wed, 10 Dec 2014 09:31:16 +0000 (10 10:31 +0100)
treeb052c749facaa4701a2f9d7bfbdac767aa8c5e51
parentbe0677a93cd4578122955db3c377c3de7e81fcd0
ide: Check validity of logical block size

Our IDE emulation can't handle logical block sizes other than 512. Check
for it.

The original assumption was that other values would silently be ignored
(which is bad enough), but it's not quite true: The physical block size
is exposed in IDENTIFY DEVICE as a multiple of the logical block size.
Setting a logical block size therefore also corrupts the physical block
size (4096/4096 doesn't silently downgrade to 4096/512, but 512/512).

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
hw/ide/qdev.c