Check block driver read error in pflash_cfi0x
authorVijay Kumar <vijaykumar@bravegnu.org>
Fri, 21 Aug 2009 04:57:38 +0000 (10:27 +0530)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 28 Aug 2009 01:35:30 +0000 (20:35 -0500)
commitd0e7605ee0d91c3737052127a79199ddab3ff653
tree5b9394d450e4134a99c3a3d892d7bd0668926390
parent4c0960c0c483fffc5f8e1dab169d946ac295bf44
Check block driver read error in pflash_cfi0x

If a flash file of size smaller than the flash size is specified in
the -pflash option, the block driver returns error. But the
pflash_cfi0x ignores the error. This results in a flash content of all
zeroes. And the simulation aborts while executing code.

This patch adds the checks for errors from bdrv_read and escalates it
to the calling code.

Signed-off-by: Vijay Kumar B. <vijaykumar@bravegnu.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/pflash_cfi01.c
hw/pflash_cfi02.c