Lei Zhang
2017-Jun-29 02:55 UTC
[libvirt-users] Way to detect virtual machine cpu features
Hello everyone I want to know how can I use libvirt to detect what cpu features a virtual machine will see. I guess I could do it in following way: 1. if cpu mode is 'custom', use 'virsh cpu-baseline --features' on the cpu model to get model features. 2. if cpu mode is 'host-passthrough' or 'host-model', do a 'virsh capabilities' to list cpu features of physical host, they are identical to features of virtual machine. Is this right way to do things? Look forward to your valuable comments. Best regards, Lei
Lei Zhang
2017-Jul-04 01:08 UTC
Re: [libvirt-users] Way to detect virtual machine cpu features
Hi, any comment or suggestion On Thu, Jun 29, 2017 at 10:55 AM, Lei Zhang <lei12zhang12@gmail.com> wrote:> Hello everyone > > I want to know how can I use libvirt to detect what cpu features a > virtual machine will see. > > I guess I could do it in following way: > > 1. if cpu mode is 'custom', use 'virsh cpu-baseline --features' on the > cpu model to get model features. > 2. if cpu mode is 'host-passthrough' or 'host-model', do a 'virsh > capabilities' to list cpu features of physical host, they are identical to > features of virtual machine. > > Is this right way to do things? Look forward to your valuable comments. > > Best regards, > Lei >
Marko Weber | 8000
2017-Jul-19 10:07 UTC
Re: [libvirt-users] Way to detect virtual machine cpu features
Hi, Am 2017-07-04 03:08, schrieb Lei Zhang:> Hi, any comment or suggestion > > On Thu, Jun 29, 2017 at 10:55 AM, Lei Zhang <lei12zhang12@gmail.com> > wrote: > >> Hello everyone >> >> I want to know how can I use libvirt to detect what cpu features a >> virtual machine will see. >> >> I guess I could do it in following way: >> >> 1. if cpu mode is 'custom', use 'virsh cpu-baseline --features' on >> the cpu model to get model features. >> 2. if cpu mode is 'host-passthrough' or 'host-model', do a 'virsh >> capabilities' to list cpu features of physical host, they are >> identical to features of virtual machine. >> >> Is this right way to do things? Look forward to your valuable >> comments. >> >> Best regards, >> Lei > _______________________________________________ > libvirt-users mailing list > libvirt-users@redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-userswhy dont u fire up on 'host' & 'vm' lscpu? lscpu in vm on our server: # lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 2 On-line CPU(s) list: 0,1 Thread(s) per core: 2 Core(s) per socket: 1 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 60 Model name: Intel Core Processor (Haswell) Stepping: 4 CPU MHz: 3595.608 BogoMIPS: 7191.21 Hypervisor vendor: KVM <======================================================================================== Inside a VM !!! Virtualization type: full L1d cache: 32K L1i cache: 32K L2 cache: 4096K L3 cache: 16384K NUMA node0 CPU(s): 0,1 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm xsaveopt arat and there u see the cpu features....... is this what u you want to see? marko
Reasonably Related Threads
- Way to detect virtual machine cpu features
- Virsh with CPU features on XML file not working!
- [LLVMdev] Request for Help: Teach ARM target to auto-detect cpu / subtarget features
- [LLVMdev] Request for Help: Teach ARM target to auto-detect cpu / subtarget features
- [LLVMdev] Request for Help: Teach ARM target to auto-detect cpu / subtarget features