Skip to content

Commit

Permalink
Merge pull request #121 from flatcar-linux/kai/qemu-debug
Browse files Browse the repository at this point in the history
Improve QEMU debugging
  • Loading branch information
pothos authored Jul 31, 2020
2 parents 88df9ed + 79fd1cc commit 5d44f28
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
4 changes: 0 additions & 4 deletions kola/tests/misc/nfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ func testNFS(c cluster.TestCluster, nfsversion int, remotePath string) {
c.Fatalf("Cluster.NewMachine: %s", err)
}

defer m1.Destroy()

c.Log("NFS server booted.")

/* poke a file in /tmp */
Expand Down Expand Up @@ -126,8 +124,6 @@ systemd:
c.Fatalf("Cluster.NewMachine: %s", err)
}

defer m2.Destroy()

c.Log("NFS client booted.")

checkmount := func() error {
Expand Down
1 change: 0 additions & 1 deletion kola/tests/misc/ntp.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func NTP(c cluster.TestCluster) {
if err != nil {
c.Fatalf("Cluster.NewMachine: %s", err)
}
defer m.Destroy()

out := c.MustSSH(m, "networkctl status eth0")
if !bytes.Contains(out, []byte("NTP: 10.0.0.1")) {
Expand Down
2 changes: 0 additions & 2 deletions kola/tests/systemd/journald.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ func journalRemote(c cluster.TestCluster) {
if err != nil {
c.Fatalf("Cluster.NewMachine: %s", err)
}
defer gateway.Destroy()

// log a unique message on gatewayd machine
msg := "supercalifragilisticexpialidocious"
Expand All @@ -86,7 +85,6 @@ func journalRemote(c cluster.TestCluster) {
if err != nil {
c.Fatalf("Cluster.NewMachine: %s", err)
}
defer collector.Destroy()

// collect logs from gatewayd machine
cmd := fmt.Sprintf("sudo systemd-run --unit systemd-journal-remote-client /usr/lib/systemd/systemd-journal-remote --url http://%s:19531", gateway.PrivateIP())
Expand Down
2 changes: 2 additions & 0 deletions platform/local/dnsmasq.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ func NewDnsmasq() (*Dnsmasq, error) {
return nil, err
}

plog.Debugf("dnsmasq PID (manual cleanup needed if --remove=false): %v", dm.dnsmasq.Pid())

var configTemplate *template.Template

if plog.LevelAt(capnslog.DEBUG) {
Expand Down
4 changes: 3 additions & 1 deletion platform/machine/qemu/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (qc *Cluster) NewMachineWithOptions(userdata *conf.UserData, options platfo
fdnum += 1
extraFiles = append(extraFiles, tap.File)

plog.Debugf("NewMachine: %q", qmCmd)
plog.Debugf("NewMachine: %q, %q, %q", qmCmd, qm.IP(), qm.PrivateIP())

qm.qemu = qm.qc.NewCommand(qmCmd[0], qmCmd[1:]...)

Expand All @@ -133,6 +133,8 @@ func (qc *Cluster) NewMachineWithOptions(userdata *conf.UserData, options platfo
return nil, err
}

plog.Debugf("qemu PID (manual cleanup needed if --remove=false): %v", qm.qemu.Pid())

if err := platform.StartMachine(qm, qm.journal); err != nil {
qm.Destroy()
return nil, err
Expand Down
4 changes: 4 additions & 0 deletions platform/machine/unprivqemu/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ func (qc *Cluster) NewMachineWithOptions(userdata *conf.UserData, options platfo
return nil, err
}

plog.Debugf("qemu PID (manual cleanup needed if --remove=false): %v", qm.qemu.Pid())

pid := strconv.Itoa(qm.qemu.Pid())
err = util.Retry(6, 5*time.Second, func() error {
var err error
Expand All @@ -131,6 +133,8 @@ func (qc *Cluster) NewMachineWithOptions(userdata *conf.UserData, options platfo
return nil, err
}

plog.Debugf("Localhost port for SSH connections: %q", qm.ip)

if err := platform.StartMachine(qm, qm.journal); err != nil {
qm.Destroy()
return nil, err
Expand Down

0 comments on commit 5d44f28

Please sign in to comment.