We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2e8284 commit a1cfb79Copy full SHA for a1cfb79
machine.go
@@ -163,6 +163,14 @@ func (m *Machine) Logger() *log.Entry {
163
return m.logger.WithField("subsystem", userAgent)
164
}
165
166
+// PID returns the machine's running process PID or an error if not running
167
+func (m *Machine) PID() (int, error) {
168
+ if m.cmd == nil || m.cmd.Process == nil {
169
+ return 0, fmt.Errorf("machine is not running")
170
+ }
171
+ return m.cmd.Process.Pid, nil
172
+}
173
+
174
// NetworkInterface represents a Firecracker microVM's network interface.
175
type NetworkInterface struct {
176
// MacAddress defines the MAC address that should be assigned to the network
0 commit comments