-
Notifications
You must be signed in to change notification settings - Fork 621
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
Support for Virt driver #2032
Support for Virt driver #2032
Conversation
@@ -30,3 +30,9 @@ config GUESTAGENT_ARCH_RISCV64 | |||
help | |||
Build lima-guestagent for "riscv64" Arch | |||
default y | |||
|
|||
config PLUGIN_VIRT | |||
bool "plugin for vmType virt" |
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 think this should be called "libvirt"
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 also wonder if we can split out this to a separate plugin binary.
Same applies to the vbox driver, cloud drivers, etc.
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.
Sure, it just requires more work. And it would be needed, for cloud.
Apparently this experiment does not work, since putting libvirt in go.mod requires libvirt-dev:
This makes it impossible to disable, even if it is not used during the build. So it would need a separate module. |
This is a driver based on libvirt.org, for remote hypervisors. The libvirt functions are in a plugin, to minimize dependencies. Currently only shows version. Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
Simple test to see if the machine would even start properly. Needs more code for qemu:///system, like storage and network. Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
|
All that you needed to do was to set the build tag |
Hmm, libvirt has dozens of connection points (function wrappers) so maybe it should be a plugin after all. |
Would it be possible to just exec |
Yes, that should work. Something like func CreateDomain(xml string) error {
conn, err := libvirt.NewConnect(connectString)
if err != nil {
return err
}
defer conn.Close()
vm, err := conn.DomainDefineXML(xml)
if err != nil {
return err
}
return vm.Create()
} |
This is a driver based on libvirt.org, for remote hypervisors.
The libvirt functions are in a plugin, to minimize dependencies.
Currently only shows version:
To prove that it can access the API.