Description of problem:
Target model for <console> is ignored.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. virsh edit x86_64 machine to only character device
2. Save changes
3. virsh dumpxml
The model is ignored; generated xml is
<target type='isa-serial' port='0'>
<target type='serial' port='0'/>
A) As documentation says "In each of these directives, the top-level element name (parallel, serial, console, channel) describes how the device is presented to the guest. The guest interface is configured by the target element." I expected the shown definition to be equivalent with
<target type='usb-serial' port='0'>
B) Alternatively, I'd expect a validation error when target/model is used on console (instead of serial).
Unfortunately we can't really make this scenario work the way you'd
expect, so the best I can offer is a documentation update.
Patch posted upstream:
More information in the commit message.
Author: Andrea Bolognani <firstname.lastname@example.org>
Date: Tue Feb 11 15:37:05 2020 +0100
docs: Improve documentation for <serial> and <console>
Users expect to be able to configure the <console> element and see
that configuration reflected into the <serial> element or at least
sticking, however due to our crazy back-compat code that doesn't
There's really not much we can do to make this kind of corner cases
work as the user would expect, especially not without introducing
additional complexity in a part of libvirt that already has more
than a fair share of it; we can, however, improve the documentation
so that it will nudge said users in the right direction.
Signed-off-by: Andrea Bolognani <email@example.com>
Reviewed-by: Ján Tomko <firstname.lastname@example.org>
Since we usually don't backport documentation changes, and the code
itself is already working as well as we can reasonably expect it to,
I'll mark this as CLOSED CURRENTRELEASE.