
On Thu, Mar 20, 2025 at 08:56:04AM +0100, Maximilian Immanuel Brandtner wrote:
I've been working on an RFC patch-set to implement resizing for consoles in QEMU. Now that the patch-set is in review I've turned my attention to bringing this feature to libvirt.
Can you point to the QEMU patchset URL ?
With the QEMU patch-set there are two ways to resize a pty chardev. 1. send a TIOCSWINSZ ioctl 2. send a QMP msg
The first approach doesn't work under Libvirt. Pty chardevs are proxied over a FIFO meaning the ioctl wouldn't get to libvirt. Furthermore, this approach is incompatible with remote management which libvirt seems to go to great lengths to support.
So we have the flow virsh console (or equiv mgmt equiv) -> virStream -> libvirtd/virtqemud -> virStream -> PTY -> QEMU chardev -> guest serial port / paravirt console NB I've always wanted to extend our console stream handling to support UNIX socket / TCP socket chardev instead of the PTY, as the connection semantics are so much saner to deal with.
Sending a QMP message is a QEMU specific feature. It seems to me that adding a new handle (something like domainResizeConsole) would have to be added to the virHypervisorDriver struct. It would be really nifty if the resize handle could be implemented in the virStream, however it seems that all the virStreamDriver handlers are common code (aka shared across all hypervisors). From what I've seen it seems that the only way to switch from common code to hypervisor specific code would be over the virHypervisorDriver. As it stands it seems to me that the best course of action would be adding a new handle to the virHypervisorDriver, but I'm unsure whether that's really the right call.
How is the window resize supposed to be passed to the QEMU chardev backend for the different chardev backend types ?
TLDR I have the following 2 questions: - Should the resize handle be implemented in the virHypervisorDriver directly or in the virStreamDriver?
Unclear currently. I did think about this a long while back and tried to hack something into virStream, but never completed it and it was not as simple as it first seemed
- Is there a way to get the QMP alias of a chardev from a virStream?
No, currently the stream only knows about the underlying host OS channel, nothing about the hypervisor With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|