Bug 1770725 - Target model ignored on <console>
Summary: Target model ignored on <console>
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: libvirt
Version: 8.1
Hardware: All
OS: Linux
Target Milestone: rc
: 8.0
Assignee: Andrea Bolognani
QA Contact: jiyan
Depends On:
TreeView+ depends on / blocked
Reported: 2019-11-11 09:09 UTC by smitterl
Modified: 2020-02-11 16:34 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2020-02-11 16:34:03 UTC
Type: Bug
Target Upstream Version:

Attachments (Terms of Use)

Description smitterl 2019-11-11 09:09:30 UTC
Description of problem:
Target model for <console> is ignored.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. virsh edit x86_64 machine to only character device
<console type='pty'>
 <target port='0'>
  <model name='usb-serial'/>
2. Save changes
3. virsh dumpxml

Actual results:
The model is ignored; generated xml is
<serial type='pty'>
 <target type='isa-serial' port='0'>
  <model name='isa-serial'/>
<console type='pty'>
 <target type='serial' port='0'/>

Expected results:
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 
<serial type='pty'>
 <target type='usb-serial' port='0'>
  <model name='usb-serial'/>
(doc https://libvirt.org/formatdomain.html#elementsConsole)
B) Alternatively, I'd expect a validation error when target/model is used on console (instead of serial).

Comment 2 Andrea Bolognani 2020-02-11 14:46:58 UTC
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.

Comment 3 Andrea Bolognani 2020-02-11 16:34:03 UTC
Merged upstream.

  commit c4a78d00f8d00ef4ab84c3110ffb6975ed680554
  Author: Andrea Bolognani <abologna@redhat.com>
  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
    always happen.

    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 <abologna@redhat.com>
    Reviewed-by: Ján Tomko <jtomko@redhat.com>


Since we usually don't backport documentation changes, and the code
itself is already working as well as we can reasonably expect it to,

Note You need to log in before you can comment on or make changes to this bug.