virtio-net: initialize to populate mac address

With commit aa9566d2e(virtio-net: move setup-mac to the open routine)
local-mac-address property started getting set during open routine. So
the netboot workflow was addressed. This was required as the device
needs to be probed before reading, after virtio 1.0 changes.

While boot from the disk and grub is set to get kernel over network, it
breaks. As grub looks for local-mac-address property first, which is not
there. Fix this by creating an instance and closing it. setup-mac in the
open will populate the local-mac-addres property

Reported-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
This commit is contained in:
Nikunj A Dadhania 2016-03-10 13:30:56 +05:30 committed by Alexey Kardashevskiy
parent 126e458fdc
commit d78d7322ef
1 changed files with 7 additions and 0 deletions

View File

@ -91,3 +91,10 @@ virtio-setup-vd VALUE virtiodev
THEN
;
setup-alias
\ Create instance, this will populate the mac address
: virtio-net-init ( -- )
0 0 get-node open-node ?dup 0= IF ." exiting " cr EXIT THEN
close-node
;
virtio-net-init