Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How nova modifies libvirt.xml and customizes xml files to modify nova code to support vhost

2025-03-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report