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.
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. 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. Furthermore, if we don't want to broadcast a QMP message to every chardev, the handle needs to determine the alias with which the chardev can be adressed in QMP. in qemuDomainOpenConsole the alias for the console is set and added as the callback argument for the internal close function. There doesn't seem to be a way to get the alias of a console from virStream. It seems that I need to add an alias string field to the virStream or the virStreamFDData. I could however be mistaken and there is already a way to get the alias for a virStream, hence this email TLDR I have the following 2 questions: - Should the resize handle be implemented in the virHypervisorDriver directly or in the virStreamDriver? - Is there a way to get the QMP alias of a chardev from a virStream? Thanks in advance Max