Add a debug log entry in DHCP before fetching the bootspec.

Adding this line lets us time the bootspec retrieval by comparing
the timestamps of "Got valid request..." and "Offering to boot..."
This commit is contained in:
David Anderson 2017-03-01 20:57:47 -08:00
parent 4ffbe802e0
commit 63c4bab4d1
2 changed files with 13 additions and 0 deletions

View File

@ -42,6 +42,8 @@ func (s *Server) serveDHCP(conn *dhcp4.Conn) error {
continue
}
s.debug("DHCP", "Got valid request to boot %s (%s)", mach.MAC, mach.Arch)
spec, err := s.Booter.BootSpec(mach)
if err != nil {
s.log("DHCP", "Couldn't get bootspec for %s: %s", pkt.HardwareAddr, err)

View File

@ -53,6 +53,17 @@ const (
ArchX64
)
func (a Architecture) String() string {
switch a {
case ArchIA32:
return "IA32"
case ArchX64:
return "X64"
default:
return "Unknown architecture"
}
}
// A Machine describes a machine that is attempting to boot.
type Machine struct {
MAC net.HardwareAddr