[libvirt] [PATCH 6/7] conf: Set source type of the stub console

Osier Yang jyang at redhat.com
Fri Nov 11 11:57:05 UTC 2011


As "serials[0]->source.type". This is for kvm tool driver only
supports one console currently, and it setup ptys (redirect
the stdout/stderr of kvm tool process to the master pty, and
the slave pty path will be set to source path of the console)
for connect to the guest via console. If the console config
is like:

      <console type='pty'>
        <target type='serial' port='0'/>
      </console>

Things don't work, as kvm tool driver only tries to find consoles
and set the slave pty path to "consoles[0]->source.path". Though
another solution is to set the slave pty path to "serials[0]->source.path"
if no console of type "pty" can be found.
---
 src/conf/domain_conf.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 55121d8..138105e 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7287,6 +7287,7 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
                 goto no_memory;
             chr->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE;
             chr->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
+            chr->source.type = def->serials[0]->source.type;
         }
 
         chr->target.port = i;
-- 
1.7.6




More information about the libvir-list mailing list