cockpit-project / cockpit-machines

Cockpit UI for virtual machines
GNU Lesser General Public License v2.1
298 stars 75 forks source link

Too long description of the VM will cause an error #1889

Closed yunmingyang closed 1 week ago

yunmingyang commented 3 weeks ago

Description of problem: When setting a description for a VM, if setting a too long string, such as 3964928 * 's', there will be an error shown on the dialog, maybe we need to limit the length of the description

Version-Release number of selected components (if applicable): cockpit-machines-322-11-g63ac3f46

mvollmer commented 3 weeks ago

Yes, I can reproduce this. Cockpit has a limit of 128KiB for a protocol message, and setting the description works by passing it inside a "channel open" control message to the bridge. If the description makes that message exceed 128KiB, cockpit-ws will forcefully disconnect the session.

As you say, it's probably to just limit the size of the description before sending such a large message. I didn't find a quick way to make virt-xml read the description from stdin, for example.