How nova modifies libvirt.xml and customizes xml files to modify nova code to support vhost
This article mainly introduces how nova modifies libvirt.xml and custom xml files to modify nova code to support vhost. The article is very detailed and has a certain reference value. Interested friends must read it!
# with this configuration file, there will be vhost=off in the parameters of the started virtual machine.
Modify nova code support:
Def get_config (self, instance, vif, image_meta, inst_type):
Conf = vconfig.LibvirtConfigGuestInterface ()
# Default to letting libvirt / the hypervisor choose the model
Model = None
Driver = None
# If the user has specified a 'vif_model' against the
# image then honour that model
If image_meta:
Vif_model = image_meta.get ('properties'
{}) .get ('hw_vif_model')
If vif_model is not None:
Model = vif_model
# Else if the virt type is KVM/QEMU, use virtio according
# to the global config parameter
If (model is None and
CONF.libvirt.virt_type in ('kvm',' qemu') and
CONF.libvirt.use_virtio_for_bridges):
Model = "virtio"
# Workaround libvirt bug, where it mistakenly
# enables vhost mode, even for non-KVM guests
If model = = "virtio" and CONF.libvirt.virt_type = = "qemu":
Driver = "qemu"
Modified to:
If model = = "virtio" and CONF.libvirt.virt_type = = "qemu":
Driver = "qemu"
Driver = "qemu" / / add this sentence to represent always qemu
The above is all the contents of the article "how nova modifies libvirt.xml and customizes xml files to modify nova code to support vhost". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!