qemu emulation or virtualiztion, which one is it using?

Sean Mooney smooney at redhat.com
Tue Apr 2 08:51:16 UTC 2019


On Tue, 2019-04-02 at 06:37 +0000, Manuel Sopena Ballesteros wrote:
> Ok,
> 
> Thank you for your prompt response. I can see this in the nova.conf file:
> 
> [libvirt]
> ...
> virt_type = kvm
> ...
> 
> Can I assume qemu is using virtualization through kvm?
the short answer is yes the long answer is its using both.

qemu support several accleration drivers for lack of  a better term
kvm,xen and event the mttcg implementaion are all accleration drivers
that qemu can offload some of the compute context (the environment in which
a nova instance executes) it create.

specifically when using kvm the cpu instruction are offloaded via kvm to hardware virtualiastion
functionality in your cpu but devices like virtio-net-pci nics are still emulated by qemu.

this is why cpu architecutres that do not match the host cannot be acclerated with kvm,
qemu offloads the cpu emulation to kvm to virtualise using the host cpu hardware virualisation
feature if available. in doing so that mean the the cpu emulation code in qemu that woudl have
translated the machine instruction from the guest into somethign the host can execute is bypassed
and as a result you cant execute are arm vms on an x86 host with kvm.

you can however use still use other alleration backend like the multi threaded tiny code generator (mttcg)
which is just a muli thread version of qemus defualt non acclerated backend. when using mttcg you are using
pure software emulation that just happens to also execute 1 thread per guest cpu which provides more performance.

so in short the combinaiton of qemu and optionally an acceleration driver and the linux kernel together form a hypervior
that can levgerage hardware virtualisation or software emulation to provide a compute context which can execute a
gust. if virt_type is kvm however you can just say yes its using virtualistiaon to keep it simple but hopefully this has
helped a little.
> 
> Thank you
> 
> Manuel
> 
> From: Gary Kotton [mailto:gkotton at vmware.com]
> Sent: Tuesday, April 2, 2019 5:22 PM
> To: Manuel Sopena Ballesteros; openstack at lists.openstack.org
> Subject: Re: qemu emulation or virtualiztion, which one is it using?
> 
> Hi,
> This depends on the virtualization driver configured on your hypervisors. This can be one of many. For example, KVM,
> VMware VC, Hyper-V...
> Thanks
> Gary
> 
> ________________________________
> From: Manuel Sopena Ballesteros <manuel.sb at garvan.org.au>
> Sent: Tuesday, April 2, 2019 9:15 AM
> To: openstack at lists.openstack.org
> Subject: qemu emulation or virtualiztion, which one is it using?
> 
> 
> Hi,
> 
> 
> 
> "openstack hypervisor list" command shows qemu as type of hypervisor.
> 
> How do I know it is using virtualization and not qemu emulation?
> 
> 
> 
> Thank you
> 
> 
> NOTICE
> Please consider the environment before printing this email. This message and any attachments are intended for the
> addressee named and may contain legally privileged/confidential/copyright information. If you are not the intended
> recipient, you should not read, use, disclose, copy or distribute this communication. If you have received this
> message in error please notify us at once by return email and then delete both messages. We accept no liability for
> the distribution of viruses or similar in electronic communications. This notice should not be removed.
> NOTICE
> Please consider the environment before printing this email. This message and any attachments are intended for the
> addressee named and may contain legally privileged/confidential/copyright information. If you are not the intended
> recipient, you should not read, use, disclose, copy or distribute this communication. If you have received this
> message in error please notify us at once by return email and then delete both messages. We accept no liability for
> the distribution of viruses or similar in electronic communications. This notice should not be removed.




More information about the openstack-discuss mailing list