device-assignment: Byte-wise ROM read
commitc7a3973000248cf2c74e19ce8782b92fa00bc116
authorAlex Williamson <alex.williamson@redhat.com>
Fri, 30 Jul 2010 19:40:25 +0000 (30 13:40 -0600)
committerAvi Kivity <avi@redhat.com>
Tue, 17 Aug 2010 09:48:51 +0000 (17 12:48 +0300)
tree883c904d4f04653b989ed43016e357ef30a5d9f8
parentc890e259dfe412a18b685fa0ca60392c49712cb7
device-assignment: Byte-wise ROM read

The host kernel filters the PCI option ROM, returning only bytes for
the actual ROM size, not for the whole BAR.  That means we typically
do a short read of the PCI sysfs ROM file.  Read it a byte at a time
so we know how much to actually copy and only skip the copy if we
get nothing.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Acked-by: Chris Wright <chrisw@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
hw/device-assignment.c