]> git.ipfire.org Git - thirdparty/libvirt.git/commit
libxl: use serial device for console when targetType is serial
authorJim Fehlig <jfehlig@suse.com>
Wed, 22 Jun 2016 02:25:23 +0000 (20:25 -0600)
committerJim Fehlig <jfehlig@suse.com>
Wed, 22 Jun 2016 21:06:27 +0000 (15:06 -0600)
commit76d58716483c665e927b04063456b58a186a6f6c
treef7da7a3eb4ef15ecd5321d26f56776bcc83b6a3c
parenta921699ad97808319990a9a8aa80e528df901405
libxl: use serial device for console when targetType is serial

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:
src/libxl/libxl_domain.c
src/libxl/libxl_driver.c