Merge "Simply & unify console handling for libvirt drivers"

This commit is contained in:
Jenkins
2012-03-12 17:27:40 +00:00
committed by Gerrit Code Review
2 changed files with 24 additions and 6 deletions

View File

@@ -357,12 +357,17 @@ class Domain(object):
function='0x1'/>
</controller>
%(nics)s
<serial type='pty'>
<source pty='/dev/pts/27'/>
<serial type='file'>
<source path='dummy.log'/>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
<serial type='pty'>
<source pty='/dev/pts/27'/>
<target port='1'/>
</serial>
<console type='file'>
<source path='dummy.log'/>
<target port='0'/>
</console>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>

View File

@@ -879,6 +879,21 @@ class LibvirtConnTestCase(test.TestCase):
check = (lambda t: t.find('./os/initrd'), None)
check_list.append(check)
if hypervisor_type in ['qemu', 'kvm']:
check = (lambda t: t.findall('./devices/serial')[0].get(
'type'), 'file')
check_list.append(check)
check = (lambda t: t.findall('./devices/serial')[1].get(
'type'), 'pty')
check_list.append(check)
check = (lambda t: t.findall('./devices/serial/source')[0].get(
'path').split('/')[1], 'console.log')
check_list.append(check)
else:
check = (lambda t: t.find('./devices/console').get(
'type'), 'pty')
check_list.append(check)
parameter = './devices/interface/filterref/parameter'
common_checks = [
(lambda t: t.find('.').tag, 'domain'),
@@ -888,8 +903,6 @@ class LibvirtConnTestCase(test.TestCase):
(lambda t: t.findall(parameter)[1].get('name'), 'DHCPSERVER'),
(lambda t: _ipv4_like(t.findall(parameter)[1].get('value'),
'192.168.*.1'), True),
(lambda t: t.find('./devices/serial/source').get(
'path').split('/')[1], 'console.log'),
(lambda t: t.find('./memory').text, '2097152')]
if rescue:
common_checks += [