-
Notifications
You must be signed in to change notification settings - Fork 32
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
add virtio-balloon device #255
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @iwinux. Thanks for your PR. I'm waiting for a crc-org member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
https://developer.apple.com/documentation/virtualization/vzvirtiotraditionalmemoryballoondevice?language=objc has some explanations how to interact with the balloon device. I don't know if these properties are supported in Code-Hex/vz though |
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.
Looks good to me, thanks for the patch!
Can you also add a balloon test to
Lines 201 to 230 in 9c685bc
var pciidTests = map[string]pciidTest{ | |
"virtio-net": { | |
vendorID: 0x1af4, // Red Hat | |
deviceID: 0x1041, | |
createDev: func(_ *testing.T) (config.VirtioDevice, error) { | |
return config.VirtioNetNew("") | |
}, | |
}, | |
"virtio-serial": { | |
vendorID: 0x1af4, // Red Hat | |
deviceID: 0x1043, | |
createDev: func(t *testing.T) (config.VirtioDevice, error) { | |
return config.VirtioSerialNew(filepath.Join(t.TempDir(), "serial.log")) | |
}, | |
}, | |
"virtio-rng": { | |
vendorID: 0x1af4, // Red Hat | |
deviceID: 0x1044, | |
createDev: func(_ *testing.T) (config.VirtioDevice, error) { | |
return config.VirtioRngNew() | |
}, | |
}, | |
"virtio-fs": { | |
vendorID: 0x1af4, // Red Hat | |
deviceID: 0x105a, | |
createDev: func(_ *testing.T) (config.VirtioDevice, error) { | |
return config.VirtioFsNew("./", "vfkit-share-test") | |
}, | |
}, | |
} |
?
And adding it to the documentation would also be useful, for example before/after virtio-rng https://github.com/crc-org/vfkit/blob/main/doc/usage.md#random-number-generator
Documentation for the virtualization framework says that it's only allowed to have one virtio-balloon device at a time in a VM, do you know if we get an error if we pass --device virtio-balloon
multiple times?
@cfergeau After reading the page I realize that this patch has only enabled the virtio-balloon device for guests, but hasn't utilized the device at the host side for memory allocation. The latter task seems a bit more complicated, should I leave it as a separate issue? https://github.com/firecracker-microvm/firecracker/blob/main/docs/ballooning.md also provides some insights on how the device can be used. |
No objections to that, this definitely can be addressed later on, I was just trying to provide guidance as you were unsure how to test it. |
Passing Output of
Output of
|
The virtio-balloon device is added to the VM when
--device virtio-balloon
is specified. However, I'm not sure how to verify it's actually working inside the VM.$ find /sys -iname '*balloon*' /sys/kernel/btf/virtio_balloon /sys/bus/virtio/drivers/virtio_balloon /sys/module/virtio_balloon /sys/module/virtio_balloon/drivers/virtio:virtio_balloon
TODOs:
usage.md