• A
    conf: Fix check for chardev source path · 614193fa
    Andrea Bolognani 提交于
    Attempting to use a chardev definition like
    
      <serial type='unix'>
        <target type='isa-serial'/>
      </serial>
    
    correctly results in an error being reported, since the source
    path - a required piece of information - is missing; however,
    the very similar
    
      <serial type='unix'>
        <target type='pci-serial'/>
      </serial>
    
    was happily accepted by libvirt, only to result in libvirtd
    crashing as soon as the guest was started.
    
    The issue was caused by checking the chardev's targetType
    against whitelisted values from virDomainChrChannelTargetType
    without first checking the chardev's deviceType to make sure
    it is actually a channel, for which the check makes sense,
    rather than a different type of chardev.
    
    The only reason this wasn't spotted earlier is that the
    whitelisted values just so happen to correspond to USB and
    PCI serial devices and Xen and UML consoles respectively,
    all of which are fairly uncommon.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1609720Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
    Reviewed-by: NJán Tomko <jtomko@redhat.com>
    614193fa
domain_conf.c 952.4 KB