Merge "libvirt: fix setting tx_queue_size when rx_queue_size is not set"
This commit is contained in:
commit
338a3df403
@ -205,3 +205,25 @@ class DesignerTestCase(test.NoDBTestCase):
|
||||
self.assertEqual('fake-path', conf.vhostuser_path)
|
||||
self.assertEqual(512, conf.vhost_rx_queue_size)
|
||||
self.assertEqual(1024, conf.vhost_tx_queue_size)
|
||||
|
||||
def test_set_vif_host_backend_vhostuser_config_tx_queue_size(self):
|
||||
conf = config.LibvirtConfigGuestInterface()
|
||||
designer.set_vif_host_backend_vhostuser_config(conf, 'fake-mode',
|
||||
'fake-path', None, 1024)
|
||||
self.assertEqual('vhostuser', conf.net_type)
|
||||
self.assertEqual('unix', conf.vhostuser_type)
|
||||
self.assertEqual('fake-mode', conf.vhostuser_mode)
|
||||
self.assertEqual('fake-path', conf.vhostuser_path)
|
||||
self.assertIsNone(conf.vhost_rx_queue_size)
|
||||
self.assertEqual(1024, conf.vhost_tx_queue_size)
|
||||
|
||||
def test_set_vif_host_backend_vhostuser_config_rx_queue_size(self):
|
||||
conf = config.LibvirtConfigGuestInterface()
|
||||
designer.set_vif_host_backend_vhostuser_config(conf, 'fake-mode',
|
||||
'fake-path', 512, None)
|
||||
self.assertEqual('vhostuser', conf.net_type)
|
||||
self.assertEqual('unix', conf.vhostuser_type)
|
||||
self.assertEqual('fake-mode', conf.vhostuser_mode)
|
||||
self.assertEqual('fake-path', conf.vhostuser_path)
|
||||
self.assertEqual(512, conf.vhost_rx_queue_size)
|
||||
self.assertIsNone(conf.vhost_tx_queue_size)
|
||||
|
@ -166,7 +166,7 @@ def set_vif_host_backend_vhostuser_config(conf, mode, path, rx_queue_size,
|
||||
conf.vhostuser_path = path
|
||||
if rx_queue_size:
|
||||
conf.vhost_rx_queue_size = rx_queue_size
|
||||
if rx_queue_size:
|
||||
if tx_queue_size:
|
||||
conf.vhost_tx_queue_size = tx_queue_size
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user