-
Notifications
You must be signed in to change notification settings - Fork 699
refactor: support external drivers for the recent changes #3910
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
refactor: support external drivers for the recent changes #3910
Conversation
Please rebase
cmd/lima-driver-vz/main_darwin.go
Outdated
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.
?
pkg/driver/external/server/server.go
Outdated
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.
Can't we use logrus?
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.
If we change this to logrus, it will not be clean. For e.g:
➜ lima2 git:(refactor/support-external-drivers) ✗ ./_output/bin/limactl edit default2 --mount-type virtiofs
FATA[0000] failed to resolve vm for "/Users/ansumansahoo/.lima/default2/lima.yaml": external driver stderr:
time="2025-08-27T01:51:33+05:30" level=error msg="Failed to accept config: config not supported by the QEMU driver:
field `mountType` must be \"reverse-sshfs\" or \"9p\" for QEMU driver on non-Linux, got \"virtiofs\""
Using fmt.Fprintf results in a clean error:
➜ lima2 git:(refactor/support-external-drivers) ✗ ./_output/bin/limactl edit default2 --mount-type virtiofs
FATA[0000] failed to resolve vm for "/Users/ansumansahoo/.lima/default2/lima.yaml":
external driver stderr: Failed to accept config: config not supported by the QEMU driver:
field `mountType` must be "reverse-sshfs" or "9p" for QEMU driver on non-Linux, got "virtiofs"
And since it will be never be stored in the driver.stderr.log
pkg/driverutil/vm.go
Outdated
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.
ctx should be passed from the caller
pkg/driverutil/vm.go
Outdated
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.
Same
pkg/driver/driver.go
Outdated
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.
This can be moved to DriverFeatures
7e99f45
to
3cf0d16
Compare
I will open the PR after some time, working on making the pre-validation action error handling better.
8c27373
to
3990779
Compare
Signed-off-by: Ansuman Sahoo <anshumansahoo500@gmail.com>
3990779
to
d4dc0a5
Compare
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.
Next time please split a commit for this
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.
Name does not seem to be a feature
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.
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.
Thanks
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.
Thanks
f7861fb
into
lima-vm:master
Note
This is the last PR of the three PRs, which depends on #3901. Merging all will close #3769.
Key Changes
.proto
files to incorporate with the driver interface.FillConfig()
andAcceptConfig()
are both pre-configured driver operations, I have implemented stdio piping transport using json betweenlimactl
and the driver binary. The driver binary can know thatlimactl
is calling for a pre-grpc action by a boolean flag--pre-driver-action
.One more thing, we tend to inspect instances a lot throughout the codebase(even for simply listing Lima instances through
limactl ls
) so I have also implemented the same stdio transport mechanism forInspectStatus()
so that it saves us time and resource but it is an add-on, let me know if we don't need this then I can revert the changes!