Product SiteDocumentation Site

libvirt 0.7.5

Application Development Guide

A guide to application development with libvirt

Edition 1

Logo

Dani Coulson

Red Hat Engineering Content Services

Daniel Berrange

Red Hat Engineering, Virtualization

Daniel Veillard

Red Hat Engineering, Virtualization

Chris Lalancette

Red Hat Engineering, Virtualization

Laine Stump

Red Hat Engineering, Virtualization

David Jorm

Red Hat Engineering Content Services

Legal Notice

Copyright © 2009-2010 Red Hat, Inc.
Copyright © 2009-2010 Red Hat, Inc. and others.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. The original authors of this document, and Red Hat, designate the libvirt Project as the "Attribution Party" for purposes of CC-BY-SA. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, MetaMatrix, Fedora, the Infinity Logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
All other trademarks are the property of their respective owners.
Abstract
This document provides a guide for application developers using libvirt.

Preface
1. Document Conventions
1.1. Typographic Conventions
1.2. Pull-quote Conventions
1.3. Notes and Warnings
2. We Need Feedback!
1. Introduction
1.1. Overview
1.2. Glossary of terms
2. Architecture
2.1. Object model
2.1.1. Hypervisor connections
2.1.2. Guest domains
2.1.3. Virtual networks
2.1.4. Storage pools
2.1.5. Storage volumes
2.1.6. Host devices
2.2. Driver model
2.3. Remote management
2.3.1. Basic usage
2.3.2. Data Transports
2.3.3. Authentication schemes
2.4. Generating TLS certificates
2.4.1. Public Key Infrastructure setup
3. Connections
3.1. Overview
3.1.1. virConnectOpen
3.1.2. virConnectOpenReadOnly
3.1.3. virConnectOpenAuth
3.1.4. virConnectClose
3.2. URI formats
3.2.1. Local URIs
3.2.2. Remote URIs
3.3. Capability information
3.4. Host information
3.4.1. virConnectGetHostname
3.4.2. virConnectGetMaxVcpus
3.4.3. virNodeGetFreeMemory
3.4.4. virNodeGetInfo
3.4.5. virNodeGetCellsFreeMemory
3.4.6. virConnectGetType
3.4.7. virConnectGetVersion
3.4.8. virConnectGetLibVersion
3.4.9. virConnectGetURI
3.4.10. virConnectIsEncrypted
3.4.11. virConnectIsSecure
3.5. Event loop integration
3.6. Security model
3.7. Error handling
3.7.1. virSetErrorFunc
3.7.2. virConnSetErrorFunc
3.7.3. virCopyLastError
3.7.4. virGetLastError
3.7.5. virSaveLastError
3.7.6. virResetError
3.7.7. virFreeError
3.7.8. virConnResetError
3.7.9. virConnCopyLastError
3.7.10. virConnGetLastError
3.8. Debugging / logging
3.8.1. Environment Variables
3.9. Integrated example
4. Guest Domains
4.1. Domain overview
4.2. Listing domains
4.3. Lifecycle control
4.3.1. Provisioning and starting
4.3.2. Stopping
4.3.3. Suspend / Resume and Save / Restore
4.3.4. Migration
4.3.5. Autostart
4.4. Domain configuration
4.4.1. Boot modes
4.4.2. Memory / CPU resources
4.4.3. Lifecycle controls
4.4.4. Clock sync
4.4.5. Features
4.5. Monitoring performance
4.5.1. Domain performance
4.5.2. vCPU performance
4.5.3. I/O statistics
4.6. Device configuration
4.6.1. Emulator
4.6.2. Disks
4.6.3. Networking
4.6.4. Filesystems
4.6.5. Mice & tablets
4.6.6. USB device passthrough
4.6.7. PCI device passthrough
4.7. Live configuration change
4.7.1. Memory ballooning
4.7.2. CPU hotplug
4.7.3. Device hotplug / unplug
4.7.4. Device media change
4.8. Security model
4.9. Event notifications
4.10. Tuning
4.10.1. Scheduler parameters
4.10.2. NUMA placement
5. Storage Pools
5.1. Overview
5.2. Listing pools
5.3. Pool usage
5.4. Lifecycle control
5.5. Discovering pool sources
5.6. Pool configuration
5.7. Volume overview
5.8. Listing volumes
5.9. Volume information
5.10. Creating and deleting volumes
5.11. Cloning volumes
5.12. Configuring volumes
6. Virtual Networks
6.1. Overview
6.2. Listing networks
6.3. Lifecycle control
6.4. Network configuration
7. Network Interfaces
7.1. Overview
7.2. XML Interface Description Format
7.3. Retrieving Information About Interfaces
7.3.1. Enumerating Interfaces
7.3.2. Alternative method of enumerating interfaces
7.3.3. Obtaining a virInterfacePtr for an Interface
7.3.4. Retrieving Detailed Interface Information
7.4. Managing interface configuration files
7.4.1. Defining an interface configuration
7.4.2. Undefining an interface configuration
7.5. Interface lifecycle management
7.5.1. Activating an interface
7.5.2. Deactivating an interface
7.6. Interface object memory management
8. Host Devices
9. Alternative Language Bindings
9.1. Python
9.2. Perl
9.3. Java
A. Revision History