• J
    libxl: use serial device for console when targetType is serial · 76d58716
    Jim Fehlig 提交于
    When domXML contains only <console type='pty'> and no corresponding
    <serial>, the console is "stolen" [1] and used as the first <serial>
    device. When this "stolen" console is accessed from the libxl driver
    (in libxlConsoleCallback and libxlDomainOpenConsole), check if the
    targetType is VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL, and use the
    "stolen" device in def->serials[0] instead. Prior to this change,
    creating a domain with input XML containing only a <console> device
    and subsequently attempting to access its console with
    'virsh console' would fail
    
    error: internal error: character device <null> is not using a PTY
    
    [1] See comments associated with virDomainDefAddConsoleCompat() in
        $LIBVIRT-SRC/src/conf/domain_conf.c:
    76d58716
libxl_domain.c 38.5 KB