Make nic option rom loading less painful.
authorGlauber Costa <glommer@redhat.com>
Wed, 17 Jun 2009 13:05:30 +0000 (09:05 -0400)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 22 Jun 2009 15:10:50 +0000 (10:10 -0500)
commit6ec65a05c32208a062c8bd9f1df5287f6c5cad74
treed663a28ff170b87622a1f1aa51305cd4e2e2ebb9
parent7f4c5cce33dba770c51de3d8092da8350a2953a9
Make nic option rom loading less painful.

The code how it is today, is totally painful to read and keep.
To begin with, the code is duplicated with the option rom loading
code that linux_boot and vga are already using.

This patch introduces a "bootable" state in NICInfo structure,
that we can use to keep track of whether or not a given nic should
be bootable, avoiding the introduction of yet another global state.

With that in hands, we move the code in vl.c to hw/pc.c, and use
the already existing infra structure to load those option roms.

Error checking code suggested by Mark McLoughlin

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/pc.c
net.c
net.h
vl.c