Why is Qemu Virtual CPU on my kvm guests

1,329

By default, QEMU/KVM exposes only a subset of CPU features to guests, so that a VM can be migrated from one CPU to another (e.g. from an Intel Xeon to an AMD Opteron) without any ill effects.

You can override this behavior if you wish, by passing parameters on the qemu command line, or setting the appropriate CPU options in your GUI/XML front end. You can select specific CPU features to expose, or to pass through all CPU features.

If you choose to override any of the parameters, then you will only be able to migrate the VM to another CPU which also has those features. If you choose to pass all host CPU features to the guest, then it will also expose the name of the CPU, and you will be unable to migrate the VM to a CPU of a different type.

The difference between QEMU and KVM is that QEMU is full processor emulation, while KVM provides full hardware virtualization (HVM) using the processor's native virtualization capability (Intel VT-x or AMD SVM) to provide near-native CPU performance. As a result, the former is much slower than the latter.

Share:
1,329

Related videos on Youtube

tunix
Author by

tunix

Updated on September 18, 2022

Comments

  • tunix
    tunix over 1 year

    I have an application which handles messages using an async consumer (via @RabbitListener). Inside this consumer method, an exception occurs and the message is requeued due to the policies I've defined:

    spring:
        rabbitmq:
            listener:
                simple:
                    default-requeue-rejected: false
                    retry:
                        enabled: true
                        max-attempts: 10
                        initial-interval: 60000 # a minute
                        multiplier: 2
                        max-interval: 600000 # 10 minutes
    

    The consumer method calls a private method which recursively fetches data from the DB and pushes into a queue using RabbitTemplate. I expect around 200 messages in this queue however it goes up to around 700k and then the consumer thread stops due to the retry policy exhaustion.

    The problem is that I cannot find any place to log the exception and therefore I cannot understand which part of the business logic causes this issue. I may try placing the whole function into a try/catch block and log the issue before rethrowing it for Spring AMQP's exception handling but I want to know whether a better approach exists.

    My project has the following dependencies:

    Spring Boot: 1.5.9.RELEASE
    Spring AMQP: 1.7.4.RELEASE
    RabbitMQ: 3.7.2

  • kevin
    kevin about 11 years
    Definitely i am not the one who gave - to your answer :).It looks like there are people who have this doubt.
  • Tom O'Connor
    Tom O'Connor about 11 years
    Eh. Some people are tossers.
  • kevin
    kevin about 11 years
    This does not answer my question fully,but got some idea.
  • NotoriousPyro
    NotoriousPyro almost 7 years
    It's also worth pointing out that QEMU doesn't do anything that KVM can do better. If QEMU doesn't need to emulate it (e.g. x86 guest on x86 host with Intel VT) then it won't. QEMU provides an abstraction layer between things it has to emulate and things KVM can run through full hardware virtualisation. In essence, by running QEMU, as long as you tweak the guest and host, you'll be running as optimised with as much virtualisation features, compatibility and stability as possible.
  • Gary Russell
    Gary Russell over 6 years