Skip to content
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

Make error logs more descriptive #682

Open
dorjoy03 opened this issue Jul 10, 2024 · 0 comments
Open

Make error logs more descriptive #682

dorjoy03 opened this issue Jul 10, 2024 · 0 comments

Comments

@dorjoy03
Copy link
Contributor

If I run vhost-device-vsock with a vring queue size smaller than 1024 with QEMU's vhost-user-vsock-device (i.e., the mmio version, not the pci one) an error is printed on the vhost-device-vsock terminal:

[2024-06-30T10:57:54Z ERROR vhost_device_vsock] Fatal error: failed to handle request: invalid parameters 

The commands to reproduce this are:

shell1: ./target/release/vhost-device-vsock --vm guest-cid=4,uds-path=/tmp/vm4.vsock,socket=/tmp/vhost4.socket

shell2: ./qemu-system-x86_64 -M microvm,memory-backend=mem0 -kernel ./bzImage -nographic -append "console=ttyS0 nokaslr" -initrd ./initramfs.cpio.gz -m 4G --enable-kvm -cpu host -object memory-backend-memfd,id=mem0,size=4G -chardev socket,id=char0,reconnect=0,path=/tmp/vhost4.socket -device vhost-user-vsock-device,chardev=char0

The error comes from set_vring_num when QEMU's device side tries to set the vring queue size to 1024 but vhost-device-vsock has a max queue size less than that.

The error log "invalid parameters" does not convey enough details why there was this error whereas the error log should contain more details that the error was due to trying to set vring queue size more than the max queue size currently allocated in vhost-device-vsock. Only saying "invalid parameters" makes it very hard to debug why there was an error.

This issue is about making the error logs (or other logs as well?) more descriptive so that it's easier to understand why there was an error.

See discussion around #679 (comment) for more context.

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

No branches or pull requests

1 participant