Skip to content
This repository has been archived by the owner on Feb 17, 2024. It is now read-only.

Spawn API #174

Merged
merged 14 commits into from
Jul 26, 2023
Merged

Spawn API #174

merged 14 commits into from
Jul 26, 2023

Conversation

chriso
Copy link
Contributor

@chriso chriso commented Jul 12, 2023

This partially brings back #82, giving guests the ability to spawn and kill processes.

@chriso chriso marked this pull request as ready for review July 12, 2023 22:15
@@ -156,6 +162,26 @@ func (pm *ProcessManager) Start(moduleSpec ModuleSpec, logSpec *LogSpec) (Proces
}
}()

infc, err := netns.InterfaceByName("en0")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we avoid hard-coding the interface name here? Maybe instead we could loop over interfaces, skip the loopback, and then return the first address we find?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say let's keep it as-is for now, I think we'll revisit those soon enough that it's not a big concern 👍


message SpawnResponse {
string process_id = 1;
string ip_address = 2;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we want to return both the ipv4 and ipv6 address when calling spawn, or whether just the ipv4 address is fine?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to my other comment, I think we'll want to have a more fleshed out description of the process configuration, including the list of network interfaces and their addresses.

Comment on lines +62 to +64
// Addr is a unique IP address for the process.
Addr netip.Addr

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good enough for now but I think we'll want to enhance the model later to have a representation of each network interface exposed to the process :)

@@ -156,6 +162,26 @@ func (pm *ProcessManager) Start(moduleSpec ModuleSpec, logSpec *LogSpec) (Proces
}
}()

infc, err := netns.InterfaceByName("en0")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say let's keep it as-is for now, I think we'll revisit those soon enough that it's not a big concern 👍


message SpawnResponse {
string process_id = 1;
string ip_address = 2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to my other comment, I think we'll want to have a more fleshed out description of the process configuration, including the list of network interfaces and their addresses.

@chriso chriso merged commit 7fc802e into main Jul 26, 2023
5 checks passed
@chriso chriso deleted the spawn branch July 26, 2023 05:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants