One of the most daunting tasks facing a virtual machine administrator is hardware management. The topic is confusing, because sometimes you have to deal with real hardware, and sometimes you are talking to virtualized hardware. In some cases, you'll be using full virtualization, and in some cases not. So, according to the virtualization technique that you are using, the hardware will be presented in a different way. In this article, you'll learn about the differences between hardware drivers in full virtual and paravirtual environments. I'll be using a Xen environment in this example.
In the Xen architecture, the Dom0 normally is the driver domain. The meaning of this is that only this domain is allowed to use "real" drivers to talk to the hardware devices directly. It is quite common that Domain0 is used as the driver domain, but it is not the only possibility. As you'll learn later, you can give management of certain drivers to certain domain if so required. All domains that are not the driver domain use virtual device drivers that work with the drivers in the driver domain.
In the Xen driver model, there is a back-end driver that runs in the driver domain -- typically dom0 -- and that talks directly to the hardware devices. In the DomU, there is a front-end driver that talks to the back-end driver in the driver domain. To communicate with the back-end driver, Xen creates the Xen bus. This is a virtual bus on which all front-end drivers can talk to the back-end driver in the driver domain. It is the task of this back end driver to handle communications to the hardware device.
The communication between the front-end and back-end drivers can happen in two ways. First, paravirtualization can be used. As an alternative when paravirtualization is not available, emulation can be used.
If you are using a paravirtualized operating system, you automatically will use paravirtualized drivers as well. In this scenario, the driver software knows that it i
To continue reading for free, register below or login
To read more you must become a member of SearchServerVirtualization.com
');
// -->

s used in a virtualized environment. As a result, the driver can generate optimized instructions to talk to the hardware directly.
Paravirtualized drivers are not only available in paravirtualization, as also in full virtualization paravirtualized drivers can be used. An example of this is when the Novell Virtual Machine Driver Pack is used. This driver pack, which is available for some operating systems, makes it possible to use paravirtualized drivers for block and network devices. Since these devices cause the highest workload, performance will increase enormously when these drivers are used.
The alternative for the paravirtualized driver is the driver in a full virtualized environment. Since in those environments, the driver is not aware that it is virtualized, all instructions that it generates have to be trapped and emulated. To do this, the Qemu solutions are used, see this Qemu page for more details. Qemu is a processor emulator that offers several solutions to talk to for example emulated disk devices.
To help drivers in the full virtualization, communication has to go through the driver in the driver domain and that negatively impacts performance. Fortunately, there is no extra memory overhead in the driver domain to handle the workload that is caused by these emulated drivers. This is because of a special technique -- which is known as "shadow pages" -- is used in the driver domain.
Driver properties
The properties of drivers in a Xen virtual environment depend on the virtualization technique that you are using. As a result, some operations may be possible in a full virtualized environment and not in a paravirtualized environment, and some problems may exist in one environment and not in another environment. In the following subsections, you'll find essential information about the types of devices and their properties in specific virtualization environments:
Benefits of paravirtualized device drivers
In this article, you've learned about the two ways that virtual drivers are used in a Xen environment. Even if you are working in an environment with full virtualization, it still is possible to use paravirtualized device drivers for some devices. This normally greatly enhances performance of these devices because paravirtual device drivers are aware of the fact that they are used in a virtualized environment.
About the author: Sander van Vugt is an author and independent technical trainer, specializing in Linux since 1994. Vugt is also a technical consultant for high-availability (HA) clustering and performance optimization, as well as an expert on SLED 10 administration.