Skip to content

Commit

Permalink
Add a debug log entry in DHCP before fetching the bootspec.
Browse files Browse the repository at this point in the history
Adding this line lets us time the bootspec retrieval by comparing
the timestamps of "Got valid request..." and "Offering to boot..."
  • Loading branch information
danderson committed Mar 2, 2017
1 parent 4ffbe80 commit 63c4bab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pixiecore/dhcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 11 additions & 0 deletions pixiecore/pixiecore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 63c4bab

Please sign in to comment.