~ubuntu-branches/ubuntu/maverick/libvirt/maverick

« back to all changes in this revision

Viewing changes to docs/architecture.html

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2008-06-25 18:51:21 UTC
  • mto: (3.1.1 lenny) (1.2.1 upstream) (0.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 27.
  • Revision ID: james.westby@ubuntu.com-20080625185121-8dku38gpoluks1bx
Tags: upstream-0.4.4
ImportĀ upstreamĀ versionĀ 0.4.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
 
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="libvirt.css" /><link rel="SHORTCUT ICON" href="/32favicon.png" /><title>libvirt architecture</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">libvirt architecture</h1><p>Currently libvirt supports 2 kind of virtualization, and its
 
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
3
<html xmlns="http://www.w3.org/1999/xhtml">
 
4
<!--
 
5
        This file is autogenerated from architecture.html.in
 
6
        Do not edit this file. Changes will be lost.
 
7
      -->
 
8
  <head>
 
9
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
 
10
    <link rel="stylesheet" type="text/css" href="main.css" />
 
11
    <link rel="SHORTCUT ICON" href="32favicon.png" />
 
12
    <title>libvirt: libvirt architecture</title>
 
13
    <meta name="description" content="libvirt, virtualization, virtualization API" />
 
14
  </head>
 
15
  <body>
 
16
    <div id="header">
 
17
      <div id="headerLogo"></div>
 
18
      <div id="headerSearch">
 
19
        <form action="search.php" enctype="application/x-www-form-urlencoded" method="get">
 
20
          <div>
 
21
            <input id="query" name="query" type="text" size="12" value="" />
 
22
            <input id="submit" name="submit" type="submit" value="Search" />
 
23
          </div>
 
24
        </form>
 
25
      </div>
 
26
    </div>
 
27
    <div id="body">
 
28
      <div id="menu">
 
29
        <ul class="l0">
 
30
          <li>
 
31
            <div>
 
32
              <a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
 
33
            </div>
 
34
          </li>
 
35
          <li>
 
36
            <div>
 
37
              <a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
 
38
            </div>
 
39
          </li>
 
40
          <li>
 
41
            <div>
 
42
              <a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
 
43
            </div>
 
44
          </li>
 
45
          <li>
 
46
            <div>
 
47
              <a title="Information for users, administrators and developers" class="inactive" href="docs.html">Documentation</a>
 
48
            </div>
 
49
          </li>
 
50
          <li>
 
51
            <div>
 
52
              <a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
 
53
            </div>
 
54
          </li>
 
55
          <li>
 
56
            <div>
 
57
              <a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
 
58
            </div>
 
59
          </li>
 
60
          <li>
 
61
            <div>
 
62
              <a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
 
63
            </div>
 
64
          </li>
 
65
          <li>
 
66
            <div>
 
67
              <a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
 
68
            </div>
 
69
          </li>
 
70
          <li>
 
71
            <div>
 
72
              <a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
 
73
            </div>
 
74
          </li>
 
75
          <li>
 
76
            <div>
 
77
              <a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
 
78
            </div>
 
79
          </li>
 
80
        </ul>
 
81
      </div>
 
82
      <div id="content">
 
83
        <h1>libvirt architecture</h1>
 
84
        <p>Currently libvirt supports 2 kind of virtualization, and its
4
85
internal structure is based on a driver model which simplifies adding new
5
 
engines:</p><ul><li><a href="#Xen">Xen hypervisor</a></li>
6
 
  <li><a href="#QEmu">QEmu and KVM based virtualization</a></li>
7
 
  <li><a href="#drivers">the driver architecture</a></li>
8
 
</ul><h3><a name="Xen" id="Xen">Libvirt Xen support</a></h3><p>When running in a Xen environment, programs using libvirt have to execute
 
86
engines:</p>
 
87
        <ul>
 
88
          <li>
 
89
            <a href="#Xen">Xen hypervisor</a>
 
90
          </li>
 
91
          <li>
 
92
            <a href="#QEmu">QEmu and KVM based virtualization</a>
 
93
          </li>
 
94
          <li>
 
95
            <a href="#drivers">the driver architecture</a>
 
96
          </li>
 
97
        </ul>
 
98
        <h3>
 
99
          <a name="Xen" id="Xen">Libvirt Xen support</a>
 
100
        </h3>
 
101
        <p>When running in a Xen environment, programs using libvirt have to execute
9
102
in "Domain 0", which is the primary Linux OS loaded on the machine. That OS
10
103
kernel provides most if not all of the actual drivers used by the set of
11
104
domains. It also runs the Xen Store, a database of information shared by the
13
106
supervise the control and execution of the sets of domains. The hypervisor,
14
107
drivers, kernels and daemons communicate though a shared system bus
15
108
implemented in the hypervisor. The figure below tries to provide a view of
16
 
this environment:</p><img src="architecture.gif" alt="The Xen architecture" /><p>The library can be initialized in 2 ways depending on the level of
 
109
this environment:</p>
 
110
        <img src="architecture.gif" alt="The Xen architecture" />
 
111
        <p>The library can be initialized in 2 ways depending on the level of
17
112
privilege of the embedding program. If it runs with root access,
18
113
virConnectOpen() can be used, it will use three different ways to connect to
19
 
the Xen infrastructure:</p><ul><li>a connection to the Xen Daemon though an HTTP RPC layer</li>
20
 
  <li>a read/write connection to the Xen Store</li>
21
 
  <li>use Xen Hypervisor calls</li>
22
 
  <li>when used as non-root libvirt connect to a proxy daemon running
 
114
the Xen infrastructure:</p>
 
115
        <ul>
 
116
          <li>a connection to the Xen Daemon though an HTTP RPC layer</li>
 
117
          <li>a read/write connection to the Xen Store</li>
 
118
          <li>use Xen Hypervisor calls</li>
 
119
          <li>when used as non-root libvirt connect to a proxy daemon running
23
120
      as root and providing read-only support</li>
24
 
</ul><p>The library will usually interact with the Xen daemon for any operation
 
121
        </ul>
 
122
        <p>The library will usually interact with the Xen daemon for any operation
25
123
changing the state of the system, but for performance and accuracy reasons
26
124
may talk directly to the hypervisor when gathering state information at
27
125
least when possible (i.e. when the running program using libvirt has root
28
 
privilege access).</p><p>If it runs without root access virConnectOpenReadOnly() should be used to
 
126
privilege access).</p>
 
127
        <p>If it runs without root access virConnectOpenReadOnly() should be used to
29
128
connect to initialize the library. It will then fork a libvirt_proxy
30
129
program running as root and providing read_only access to the API, this is
31
 
then only useful for reporting and monitoring.</p><h3><a name="QEmu" id="QEmu">Libvirt QEmu and KVM support</a></h3><p>The model for QEmu and KVM is completely similar, basically KVM is based
 
130
then only useful for reporting and monitoring.</p>
 
131
        <h3>
 
132
          <a name="QEmu" id="QEmu">Libvirt QEmu and KVM support</a>
 
133
        </h3>
 
134
        <p>The model for QEmu and KVM is completely similar, basically KVM is based
32
135
on QEmu for the process controlling a new domain, only small details differs
33
136
between the two. In both case the libvirt API is provided by a controlling
34
137
process forked by libvirt in the background and which launch and control the
36
139
protocol to the library, and connects to the console of the QEmu process in
37
140
order to control and report on its status. Libvirt tries to expose all the
38
141
emulations models of QEmu, the selection is done when creating the new
39
 
domain, by specifying the architecture and machine type targeted.</p><p>The code controlling the QEmu process is available in the
40
 
<code>qemud/</code> directory.</p><h3><a name="drivers" id="drivers">the driver based architecture</a></h3><p>As the previous section explains, libvirt can communicate using different
 
142
domain, by specifying the architecture and machine type targeted.</p>
 
143
        <p>The code controlling the QEmu process is available in the
 
144
<code>qemud/</code> directory.</p>
 
145
        <h3>
 
146
          <a name="drivers" id="drivers">the driver based architecture</a>
 
147
        </h3>
 
148
        <p>As the previous section explains, libvirt can communicate using different
41
149
channels with the current hypervisor, and should also be able to use
42
150
different kind of hypervisor. To simplify the internal design, code, ease
43
151
maintenance and simplify the support of other virtualization engine the
46
154
defining a common set of routines. That way the Xen Daemon access, the Xen
47
155
Store one, the Hypervisor hypercall are all isolated in separate C modules
48
156
implementing at least a subset of the common operations defined by the
49
 
drivers present in driver.h:</p><ul><li>xend_internal: implements the driver functions though the Xen
 
157
drivers present in driver.h:</p>
 
158
        <ul>
 
159
          <li>xend_internal: implements the driver functions though the Xen
50
160
  Daemon</li>
51
 
  <li>xs_internal: implements the subset of the driver available though the
 
161
          <li>xs_internal: implements the subset of the driver available though the
52
162
    Xen Store</li>
53
 
  <li>xen_internal: provide the implementation of the functions possible via
 
163
          <li>xen_internal: provide the implementation of the functions possible via
54
164
    direct hypervisor access</li>
55
 
  <li>proxy_internal: provide read-only Xen access via a proxy, the proxy code
 
165
          <li>proxy_internal: provide read-only Xen access via a proxy, the proxy code
56
166
    is in the <code>proxy/</code>directory.</li>
57
 
  <li>xm_internal: provide support for Xen defined but not running
 
167
          <li>xm_internal: provide support for Xen defined but not running
58
168
    domains.</li>
59
 
  <li>qemu_internal: implement the driver functions for QEmu and
 
169
          <li>qemu_internal: implement the driver functions for QEmu and
60
170
    KVM virtualization engines. It also uses a qemud/ specific daemon
61
171
    which interacts with the QEmu process to implement libvirt API.</li>
62
 
  <li>test: this is a test driver useful for regression tests of the
 
172
          <li>test: this is a test driver useful for regression tests of the
63
173
    front-end part of libvirt.</li>
64
 
</ul><p>Note that a given driver may only implement a subset of those functions,
 
174
        </ul>
 
175
        <p>Note that a given driver may only implement a subset of those functions,
65
176
(for example saving a Xen domain state to disk and restoring it is only
66
177
possible though the Xen Daemon), in that case the driver entry points for
67
 
unsupported functions are initialized to NULL.</p><p></p></div></div><div class="linkList2"><div class="llinks2"><h3 class="links2"><span>main menu</span></h3><ul><li><a href="index.html">Home</a></li><li><a href="news.html">Releases</a></li><li><a href="intro.html">Introduction</a></li><li><a href="architecture.html">libvirt architecture</a></li><li><a href="downloads.html">Downloads</a></li><li><a href="format.html">XML Format</a></li><li><a href="python.html">Bindings for other languages</a></li><li><a href="errors.html">Handling of errors</a></li><li><a href="FAQ.html">FAQ</a></li><li><a href="bugs.html">Reporting bugs and getting help</a></li><li><a href="windows.html">Windows support</a></li><li><a href="remote.html">Remote support</a></li><li><a href="auth.html">Access control</a></li><li><a href="uri.html">Connection URIs</a></li><li><a href="hvsupport.html">Hypervisor support</a></li><li><a href="storage.html">Storage Management</a></li><li><a href="html/index.html">API Menu</a></li><li><a href="examples/index.html">C code examples</a></li><li><a href="ChangeLog.html">Recent Changes</a></li></ul></div><div class="llinks2"><h3 class="links2"><span>related links</span></h3><ul><li><a href="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><a href="https://bugzilla.redhat.com/bugzilla/buglist.cgi?product=Fedora+Core&amp;component=libvirt&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;bug_status=MODIFIED&amp;short_desc_type=allwordssubstr&amp;short_desc=&amp;long_desc_type=allwordssubstr">Open bugs</a></li><li><a href="http://virt-manager.et.redhat.com/">virt-manager</a></li><li><a href="http://search.cpan.org/~danberr/Sys-Virt-0.1.0/">Perl bindings</a></li><li><a href="http://libvirt.org/ocaml/">OCaml bindings</a></li><li><a href="http://libvirt.org/ruby/">Ruby bindings</a></li><li><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="12" value="Search..." /><input name="submit" type="submit" value="Go" /></form></li><li><a href="http://xmlsoft.org/"><img src="Libxml2-Logo-90x34.gif" alt="Made with Libxml2 Logo" /></a></li></ul><p class="credits">Graphics and design by <a href="mail:dfong@redhat.com">Diana Fong</a></p></div></div><div id="bottom"><p class="p1"></p></div></div></body></html>
 
178
unsupported functions are initialized to NULL.</p>
 
179
        <p></p>
 
180
      </div>
 
181
    </div>
 
182
    <div id="footer">
 
183
      <p id="sponsor">
 
184
            Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
 
185
    </div>
 
186
  </body>
 
187
</html>