Dear Sir/Madam: I use virt-manager to create a new virtual machine(it's name is generic), then I edit generic to set it's cpu_mode as 'host-model', and I start it, but when dumpxml generic, it's cpu_mode is changed as 'custom'. I want to know that why it is? And what's the principle of dumpxml? Thanks! A user of libvirt
Daniel P. Berrangé
2019-Jul-30 12:12 UTC
Re: [libvirt-users] Libvirt Virtualization Problem
On Tue, Jul 30, 2019 at 08:06:01PM +0800, 王金磊 wrote:> Dear Sir/Madam: > I use virt-manager to create a new virtual machine(it's name is generic), > then I edit generic to set it's cpu_mode as 'host-model', and I start it, > but when dumpxml generic, it's cpu_mode is changed as 'custom'. > I want to know that why it is? > And what's the principle of dumpxml?"host-model" is a CPU type that will be expanded to a named CPU model and feature list that matches the host's CPU, as reported by the 'virsh domcapabilities' command. Libvirt actually stores two XML documents for most guests. There is the persistent config which is the master configuration that exists even when the guest is stopped. Then their is the live config which only exists whde the guest is running. When you ran 'virsh dumpxml' on a running guest, it will show you the live config, and that has the CPU model expanded to a named CPU + features, hence you see it reported as 'custom'. If you run 'virsh dumpxml --inactive' you'll see the persistent config and that should still report 'host-model'. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|