Skip to content

Conversation

afbjorklund
Copy link
Member

@afbjorklund afbjorklund commented Sep 7, 2025

This is supposed to be provided by the driver, and passed to the
hostagent as features. The cidata and hostagent doesn't know VZ.

Note: this also excludes the VMOpts.VZ from default and override,
similar to the change made to VMOpts.QEMU already. It is unknown.

@afbjorklund
Copy link
Member Author

afbjorklund commented Sep 7, 2025

Still need to fix VMOpts.VZ in the templates:

templates/docker-rootful.yaml:  {{- if .Instance.Config.VMOpts.VZ.Rosetta.Enabled}}
templates/docker.yaml:  {{- if .Instance.Config.VMOpts.VZ.Rosetta.Enabled}}

It is a bit over-engineered at the moment, since the docker templates don't set VMOpts.
i.e. there is no particular reason why it has to mention the AOT and CDI in the message

@afbjorklund afbjorklund force-pushed the vmopts-rosetta branch 2 times, most recently from 6dd9aad to 8c936aa Compare September 7, 2025 16:20
@AkihiroSuda AkihiroSuda added this to the v2.0.0 milestone Sep 11, 2025
@@ -118,7 +118,7 @@ func setupEnv(instConfigEnv map[string]string, propagateProxyEnv bool, slirpGate
return env, nil
}

func templateArgs(ctx context.Context, bootScripts bool, instDir, name string, instConfig *limatype.LimaYAML, udpDNSLocalPort, tcpDNSLocalPort, vsockPort int, virtioPort string) (*TemplateArgs, error) {
func templateArgs(ctx context.Context, bootScripts bool, instDir, name string, instConfig *limatype.LimaYAML, udpDNSLocalPort, tcpDNSLocalPort, vsockPort int, virtioPort string, rosettaEnabled, rosettaBinFmt bool) (*TemplateArgs, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this be changed again when #3899 comes in the future?

Copy link
Member Author

Choose a reason for hiding this comment

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

Possibly, but not until the deprecated fields are gone from the top

rosettaEnabled := limaDriver.Info().Features.RosettaEnabled
rosettaBinFmt := limaDriver.Info().Features.RosettaBinFmt
// Disable Rosetta in Plain mode
if *inst.Config.Plain {
Copy link
Contributor

Choose a reason for hiding this comment

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

If the hostagent could query the plain mode config to the driver, wouldn't the hostagent be able to pass them to the functions that process the template without touching the contents of the config?

Copy link
Member Author

@afbjorklund afbjorklund Sep 12, 2025

Choose a reason for hiding this comment

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

Yes, it would be possible to move the logic from the hostagent to the guest and the boot scripts and have them read $LIMA_CIDATA_PLAIN instead (if one is willing to make them more "smart" like that)

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, should the hostagent be able to receive the template string used for lima.env from the driver?

Copy link
Member Author

Choose a reason for hiding this comment

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

The lima.env is not handled by the driver, it is hostagent that creates the cidata (which includes lima.env)

This is supposed to be provided by the driver, and passed to the
hostagent as features. The cidata and hostagent doesn't know VZ.

Note: this also excludes the VMOpts.VZ from default and override,
similar to the change made to VMOpts.QEMU already. It is unknown.

Signed-off-by: Anders F Björklund <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants