Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up*: add unprivileged-qemu platform #968
Conversation
9ad6e46
to
46933f2
This comment has been minimized.
This comment has been minimized.
|
Removing WIP, ready for review. From offline discussions, once this is merged we should open up an issue for refactoring the QEMU based platforms. A refactor would likely include a new Command interface that supports both namespaced & non-namespaced command sets as well as some form of a base QEMU cluster struct / interface that has methods which can be overwritten to support both clusters requirements (Local cluster, networking differences, etc.) |
|
And we're intending to support I only skimmed this...it seems sane. My biggest concern is the long term overlap between this and cosa's qemu bits but we'll figure that out somehow. |
| return nil, err | ||
| } | ||
|
|
||
| // parse /proc/net/tcp to determine the port selected by QEMU |
This comment has been minimized.
This comment has been minimized.
cgwalters
Mar 4, 2019
Member
Eeek. Ideally there'd be a way for us to bind the socket and pass it to qemu...may require a qemu patch though.
Or maybe the port is exposed over QMP?
This comment has been minimized.
This comment has been minimized.
arithx
Mar 4, 2019
Author
Contributor
A specific port can be selected and given in the hostfwd parameter, but it seemed easier to allow QEMU's auto-selection code to be used and then determine what they were using.
As for using QMP I delved into it for a bit and while it is probably possible I didn't find an easy/clean way of doing it that way.
This comment has been minimized.
This comment has been minimized.
|
Yes, |
This comment has been minimized.
This comment has been minimized.
|
I gave this a try and it seems to work for me. Let's ship it? |
This comment has been minimized.
This comment has been minimized.
|
Hey so...what's blocking this? |
This comment has been minimized.
This comment has been minimized.
|
I don't have merge rights to mantle it looks like. Any objections to adding me? From my PoV @arithx this is also good to merge. |
This comment has been minimized.
This comment has been minimized.
|
@cgwalters It's blocked on a full code review. |
|
Couple questions, overall LGTM. |
| @@ -174,7 +174,7 @@ func doSpawn(cmd *cobra.Command, args []string) error { | |||
| return fmt.Errorf("Could not read machine options: %v", err) | |||
| } | |||
|
|
|||
| var machineOpts qemu.MachineOptions | |||
| var machineOpts platform.MachineOptions | |||
This comment has been minimized.
This comment has been minimized.
ajeddeloh
Apr 11, 2019
Contributor
I think we should find a better home for this than platform, though not sure if that's worth blocking this PR.
This comment has been minimized.
This comment has been minimized.
arithx
Apr 11, 2019
Author
Contributor
If I recall correctly I originally had it in a platform/qemu sub-package but I don't remember why I changed it back to just being in platform. I wouldn't personally be opposed to either having it in a sub-package or leaving it inside of platform.
@bgilbert did you have a particularly strong opinion either way?
This comment has been minimized.
This comment has been minimized.
bgilbert
Apr 29, 2019
Member
platform seems like the obvious place for it. I don't think it's important to start a subpackage just for these structs. I'm okay with other approaches though.
This comment has been minimized.
This comment has been minimized.
arithx
Apr 30, 2019
Author
Contributor
I'll leave it in it's current place for this PR and we can decide later if we want to move it.
| checkPlatforms := []string{pltfrm} | ||
|
|
||
| // unprivileged-qemu has the same restrictions as QEMU but might also want additional restrictions due to the lack of a Local cluster | ||
| if pltfrm == "unprivileged-qemu" { |
This comment has been minimized.
This comment has been minimized.
ajeddeloh
Apr 11, 2019
Contributor
nit for later, not this PR, we should define these as const strings in each platform.
| @@ -174,7 +174,7 @@ func doSpawn(cmd *cobra.Command, args []string) error { | |||
| return fmt.Errorf("Could not read machine options: %v", err) | |||
| } | |||
|
|
|||
| var machineOpts qemu.MachineOptions | |||
| var machineOpts platform.MachineOptions | |||
This comment has been minimized.
This comment has been minimized.
bgilbert
Apr 29, 2019
Member
platform seems like the obvious place for it. I don't think it's important to start a subpackage just for these structs. I'm okay with other approaches though.
4997e43
to
849fcf3
This comment has been minimized.
This comment has been minimized.
|
Update pushed addressing comments |
|
Not super familiar with the codebase, though looks sane to me at a high-level! Just some minor notes. Would be cool to get this in and hooked up into the FCOS pipeline. |
Prepares to add the unprivileged-qemu platform by moving the qemu code to a centralized location.
Adds a new platform `unprivileged-qemu` which is meant to be ran without root access. It has a restricted set of functionality, such as a lack of the Local cluster and no networking between machines.
This comment has been minimized.
This comment has been minimized.
|
Rebased, updated per comments, and pushed |
|
LGTM |
arithx commentedJan 31, 2019
Adds a new platform
unprivileged-qemuwhich is meant to be ran withoutroot access. It has a restricted set of functionality, such as a lack of
the Local cluster and no networking between machines.