Libvirt provides a portable, long term stable C API for managing the virtualization technologies provided by many operating systems. It includes support for QEMU, KVM, Xen, LXC, bhyve, Virtuozzo, VMware vCenter and ESX, VMware Desktop, Hyper-V, VirtualBox and the POWER Hypervisor.
Go to file
Jiri Denemark 7286882c34 Adds CPU selection infrastructure
Each driver supporting CPU selection must fill in host CPU capabilities.
When filling them, drivers for hypervisors running on the same node as
libvirtd can use cpuNodeData() to obtain raw CPU data. Other drivers,
such as VMware, need to implement their own way of getting such data.
Raw data can be decoded into virCPUDefPtr using cpuDecode() function.

When implementing virConnectCompareCPU(), a hypervisor driver can just
call cpuCompareXML() function with host CPU capabilities.

For each guest for which a driver supports selecting CPU models, it must
set the appropriate feature in guest's capabilities:

    virCapabilitiesAddGuestFeature(guest, "cpuselection", 1, 0)

Actions needed when a domain is being created depend on whether the
hypervisor understands raw CPU data (currently CPUID for i686, x86_64
architectures) or symbolic names has to be used.

Typical use by hypervisors which prefer CPUID (such as VMware and Xen):

- convert guest CPU configuration from domain's XML into a set of raw
  data structures each representing one of the feature policies:

    cpuEncode(conn, architecture, guest_cpu_config,
              &forced_data, &required_data, &optional_data,
              &disabled_data, &forbidden_data)

- create a mask or whatever the hypervisor expects to see and pass it
  to the hypervisor

Typical use by hypervisors with symbolic model names (such as QEMU):

- get raw CPU data for a computed guest CPU:

    cpuGuestData(conn, host_cpu, guest_cpu_config, &data)

- decode raw data into virCPUDefPtr with a possible restriction on
  allowed model names:

    cpuDecode(conn, guest, data, n_allowed_models, allowed_models)

- pass guest->model and guest->features to the hypervisor

* src/cpu/cpu.c src/cpu/cpu.h src/cpu/cpu_generic.c
  src/cpu/cpu_generic.h src/cpu/cpu_map.c src/cpu/cpu_map.h
  src/cpu/cpu_x86.c src/cpu/cpu_x86.h src/cpu/cpu_x86_data.h
* configure.in: check for CPUID instruction
* src/Makefile.am: glue the new files in
* src/libvirt_private.syms: add new private symbols
* po/POTFILES.in: add new cpu files containing translatable strings
2009-12-18 16:13:45 +01:00
.gnulib@3fd9a2df88 build: update gnulib submodule to latest 2009-12-15 17:46:04 +01:00
build-aux Initialize gcrypt threading 2009-12-17 18:22:09 +00:00
daemon CPU flags wire protocol format and server side 2009-12-18 15:49:34 +01:00
docs XML schema for CPU flags 2009-12-18 14:37:09 +01:00
examples add AppArmor test and examples to dist 2009-12-14 13:40:42 +01:00
include New public API definition virConnectCompareCPU() 2009-12-18 14:51:39 +01:00
m4 remove all .cvsignore files 2009-07-08 16:17:51 +02:00
po Adds CPU selection infrastructure 2009-12-18 16:13:45 +01:00
proxy XML parsing/formating code for CPU flags 2009-12-18 14:44:55 +01:00
python Fix install location for Python bindings 2009-12-14 22:14:06 +01:00
src Adds CPU selection infrastructure 2009-12-18 16:13:45 +01:00
tests avoid calling exit with a constant; use EXIT_* instead 2009-12-15 17:46:04 +01:00
tools virsh: avoid double-free 2009-12-14 16:26:44 +01:00
.gitignore Remove some auto-generated files 2009-10-09 13:01:22 +01:00
.gitmodules make .gnulib a submodule 2009-07-08 16:17:51 +02:00
.hgignore Add qemuhelptest to .*ignore files 2009-06-16 14:06:48 +00:00
.x-sc_avoid_ctype_macros exempt gnulib from ctype-macros prohibition 2008-10-28 17:36:31 +00:00
.x-sc_avoid_if_before_free avoid a "make syntax-check" failure 2009-07-09 20:00:37 +02:00
.x-sc_avoid_write Fully asynchronous monitor I/O processing 2009-11-10 13:27:18 +00:00
.x-sc_m4_quote_check syntax-check: enable more checks 2009-02-03 13:08:36 +00:00
.x-sc_prohibit_asprintf add .x-sc_prohibit_asprintf 2008-12-23 13:40:42 +00:00
.x-sc_prohibit_gethostby Various syntax-check fixes. 2009-10-26 10:34:05 +01:00
.x-sc_prohibit_gethostname Add a new syntax-check rule for gethostname. 2009-10-26 10:34:27 +01:00
.x-sc_prohibit_have_config_h maint: sync from coreutils 2009-01-29 18:06:19 +00:00
.x-sc_prohibit_HAVE_MBRTOWC maint: sync from coreutils 2009-01-29 18:06:19 +00:00
.x-sc_prohibit_nonreentrant Tighten up nonreentrant syntax-check. 2009-10-26 10:33:42 +01:00
.x-sc_prohibit_strcmp exempt gnulib/ from "make syntax-check" strcmp prohibition 2008-05-14 21:18:27 +00:00
.x-sc_prohibit_strcmp_and_strncmp Ignore docs/ directory for strcmp() syntax check 2009-11-23 11:58:13 +00:00
.x-sc_prohibit_strncpy Various syntax-check fixes. 2009-10-26 10:34:05 +01:00
.x-sc_prohibit_VIR_ERR_NO_MEMORY Various syntax-check fixes. 2009-10-26 10:34:05 +01:00
.x-sc_require_config_h Various syntax-check fixes. 2009-10-26 10:34:05 +01:00
.x-sc_require_config_h_first Misc syntax-check fixes 2009-09-21 14:41:47 +01:00
.x-sc_trailing_blank build: exempt *.ico files from the trailing blank check 2008-10-16 13:28:07 +00:00
acinclude.m4 remove all trailing blank lines 2009-07-16 15:06:42 +02:00
AUTHORS Fix cdub's surname spelling 2009-09-24 14:50:51 +01:00
autobuild.sh Enable ESX driver build on Mingw32 2009-07-31 16:15:51 +01:00
autogen.sh Add --system flag to autogen.sh to make it easy to build with right prefix 2009-12-07 14:13:53 +00:00
bootstrap avoid malfunction when virFileResolveLink is applied to non-POSIX FS 2009-12-15 17:46:04 +01:00
cfg.mk Add a new syntax-check rule for gethostname. 2009-10-26 10:34:27 +01:00
ChangeLog-old generate ChangeLog from git logs into distribution tarball 2009-07-08 16:17:51 +02:00
configure.in Adds CPU selection infrastructure 2009-12-18 16:13:45 +01:00
COPYING.LIB remove all trailing blank lines 2009-07-16 15:06:42 +02:00
HACKING Add virBufferFreeAndReset() and replace free() 2009-12-10 00:00:50 +01:00
libvirt.pc.in * libvirt.pc.in: applied patch from Daniel Berrange to fix --cflags 2006-03-24 13:18:12 +00:00
libvirt.spec.in remove all traces of lokkit support 2009-12-10 11:27:17 +00:00
Makefile.am add AppArmor test and examples to dist 2009-12-14 13:40:42 +01:00
Makefile.nonreentrant syntax-check: enable prohibit_nonreentrant 2009-02-05 16:28:41 +00:00
mingw32-libvirt.spec.in Make pki_check.sh into an installed & supported tool 2009-09-21 14:41:46 +01:00
README Correct typos in the documentation (Atsushi SAKAI) 2008-01-24 10:15:13 +00:00
README-hacking build: automatically rerun ./bootstrap when needed 2009-07-10 13:39:28 +02:00
TODO Remove all trailing blanks; turn on the rule to detect them. 2008-02-05 19:27:37 +00:00

         LibVirt : simple API for virtualization

  Libvirt is a C toolkit to interact with the virtualization capabilities
of recent versions of Linux (and other OSes). It is free software
available under the GNU Lesser General Public License. Virtualization of
the Linux Operating System means the ability to run multiple instances of
Operating Systems concurrently on a single hardware system where the basic
resources are driven by a Linux instance. The library aim at providing
long term stable C API initially for the Xen paravirtualization but
should be able to integrate other virtualization mechanisms if needed.

Daniel Veillard <veillard@redhat.com>