libvirt: Make vif_driver.plug() returns None

The return value of vif_driver.plug() was used only when nova wrote the
libvirt.xml file on initial boot of the instance. Make it returns None,
and add get_config() to get the configurations if needed.

If LibvirtBridgeDriver is used when the nova-comptue inits, we call
vif_driver.plug() without get the VIF configurations. By doing this
plug doesn't raise if the instance has not yet got a fixed-ip. Fixes
bug 1076309.

Change-Id: I0fafb3d98e3139bce0ef2cee04cab428a0621696
This commit is contained in:
Jian Wen
2012-12-12 22:14:18 +08:00
parent 33d2bd0100
commit a8afb6bd94

View File

@@ -74,7 +74,7 @@ class LibvirtVifTestCase(test.TestCase):
conf.memory = 100 * 1024
conf.vcpus = 4
nic = driver.plug(self.instance, (self.net, self.mapping))
nic = driver.get_config(self.instance, self.net, self.mapping)
conf.add_device(nic)
return conf.to_xml()