Fix spice channel type

nova generate wrong spice channel type 'pty', which should be 'spicevmc'
Closes-Bug: #1634495
Change-Id: I58e9a8df9f40f900eeabd9d40429663cbbedb8d6
(cherry picked from commit f4be97d8cf)
This commit is contained in:
m4cr0v 2016-12-13 16:17:34 +08:00 committed by Matt Riedemann
parent d9f9d29721
commit 725f500d5e
2 changed files with 3 additions and 0 deletions

View File

@ -3584,6 +3584,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
vconfig.LibvirtConfigMemoryBalloon)
self.assertEqual(cfg.devices[4].target_name, "com.redhat.spice.0")
self.assertEqual(cfg.devices[4].type, 'spicevmc')
self.assertEqual(cfg.devices[5].type, "spice")
self.assertEqual(cfg.devices[6].type, "qxl")
@ -4116,6 +4117,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
self.assertEqual(cfg.devices[4].type, "tablet")
self.assertEqual(cfg.devices[5].target_name, "com.redhat.spice.0")
self.assertEqual(cfg.devices[5].type, 'spicevmc')
self.assertEqual(cfg.devices[6].type, "vnc")
self.assertEqual(cfg.devices[7].type, "spice")

View File

@ -4520,6 +4520,7 @@ class LibvirtDriver(driver.ComputeDriver):
if (CONF.spice.enabled and CONF.spice.agent_enabled and
virt_type not in ('lxc', 'uml', 'xen')):
channel = vconfig.LibvirtConfigGuestChannel()
channel.type = 'spicevmc'
channel.target_name = "com.redhat.spice.0"
guest.add_device(channel)