-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Add config for FML mode custom resolution #4264
Conversation
Great! Thank you! Later based on it we will choose the OVMF file... |
Would it make sense to have it configurable per app? Or is device-wide setting sufficient? |
I will split the doc commit later. |
Sure it can be, but that is the ask, It is needed to be device-wide, so they can set it and then deploy windows based FML apps and it should come up with the enforced resolution. |
1baaf14
to
054a98e
Compare
pkg/pillar/types/global.go
Outdated
@@ -943,6 +955,15 @@ func validateSyslogKernelLevel(level string) error { | |||
return nil | |||
} | |||
|
|||
func validateCustomResolution(res string) error { | |||
// it can be notset or one of the predefined resolutions | |||
if res == FmlResolutionNotSet || res == FmlResolution1024x768 || res == FmlResolution1920x1080 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is limiting the set of available resolutions? Qemu or our code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably we need to create custom OVMF variable (a binary that we can't generate on the fly) with predefined resolution and load it via qemu, so it needs to be one of the values we already created OVMF_vars for.
There is the -device VGA,xres=1280,yres=800
option too, but I'm not sure if that works, but if later works, then I will remove the limitation.
I'm just curious: do we support per-vm config props? |
I think we do, like VmMode or EnableVnc. |
Not that I'm aware of. |
Yeah, we have it in mind but do not go the "proper" way now, as we need to avoid API changes... |
1f57b55
to
20b6443
Compare
pkg/pillar/hypervisor/kvm.go
Outdated
@@ -796,6 +807,33 @@ func (ctx KvmContext) CreateDomConfig(domainName string, | |||
isVncShimVMEnabled(globalConfig, config) | |||
tmplCtx.DomainConfig.DisplayName = domainName | |||
|
|||
// if we are not getting the resolution from the cloud-init, check the | |||
// global config. | |||
fmlResolutions := status.FmlCustomResolution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, we need the resolution to be known earlier before calling CreateDomConfig. The resolution is used to define the OVMF file at the beginning of the Setup() function...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, this hasn't been updated with the changes of 9.4 backport.
I took the commits from this PR as part of #4261 |
this needs to be updated. |
Add a new global config value app.fml.resolution to set custom resolution for FML apps. This is a string value in the format of "widthxheight". This value can be set device-wide as a global config value or set in a per-app/vm setting by defining it as top-level variable in the cloud-config. Signed-off-by: Shahriyar Jalayeri <[email protected]>
Closing the PR as we moved the commits into #4261 |
Add a new config value
app.fml.resolution
to set custom resolution for FML apps. This is a string value in the format of "widthxheight" and must be one of the predefined values, it can be a global config set by zcli :or it can be set per-vm as part of the "cloud-config" top-level values:
This needs to be reworked and go after we #4261.
Tests
I've successfully tested the followings :
app.fml.resolution
does not make cloud-config invalid and it is not affecting the other configs in the cloud-config (tested with Ubuntu) ✅