File: formatnode.html

package info (click to toggle)
libvirt 0.9.12.3-1%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 115,024 kB
  • sloc: ansic: 324,394; xml: 44,112; sh: 15,676; python: 6,198; makefile: 2,916; perl: 2,003; ml: 472; sed: 16
file content (288 lines) | stat: -rw-r--r-- 16,158 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
        This file is autogenerated from formatnode.html.in
        Do not edit this file. Changes will be lost.
      -->
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" type="text/css" href="main.css" />
    <link rel="SHORTCUT ICON" href="32favicon.png" />
    <title>libvirt: Node devices XML format</title>
    <meta name="description" content="libvirt, virtualization, virtualization API" />
  </head>
  <body>
    <div id="header">
      <div id="headerLogo"></div>
      <div id="headerSearch">
        <form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
            <input id="query" name="query" type="text" size="12" value="" />
            <input id="submit" name="submit" type="submit" value="Search" />
          </div></form>
      </div>
    </div>
    <div id="body">
      <div id="menu">
        <ul class="l0"><li>
            <div>
              <a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
            </div>
          </li><li>
            <div>
              <a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
            </div>
          </li><li>
            <div>
              <a title="Applications known to use libvirt" class="inactive" href="apps.html">Applications</a>
            </div>
          </li><li>
            <div>
              <a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
            </div>
          </li><li>
            <div>
              <a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
              <ul class="l1"><li>
                  <div>
                    <a title="How to compile libvirt" class="inactive" href="compiling.html">Compiling</a>
                  </div>
                </li><li>
                  <div>
                    <a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
                  </div>
                </li><li>
                  <div>
                    <a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
                  </div>
                </li><li>
                  <div>
                    <a title="Description of the XML formats used in libvirt" class="active" href="format.html">XML format</a>
                    <ul class="l2"><li>
                        <div>
                          <a title="The domain XML format" class="inactive" href="formatdomain.html">Domains</a>
                        </div>
                      </li><li>
                        <div>
                          <a title="The virtual network XML format" class="inactive" href="formatnetwork.html">Networks</a>
                        </div>
                      </li><li>
                        <div>
                          <a title="Network filter XML format" class="inactive" href="formatnwfilter.html">Network Filtering</a>
                        </div>
                      </li><li>
                        <div>
                          <a title="The storage pool and volume XML format" class="inactive" href="formatstorage.html">Storage</a>
                        </div>
                      </li><li>
                        <div>
                          <a title="Storage volume encryption XML format" class="inactive" href="formatstorageencryption.html">Storage Encryption</a>
                        </div>
                      </li><li>
                        <div>
                          <a title="The driver capabilities XML format" class="inactive" href="formatcaps.html">Capabilities</a>
                        </div>
                      </li><li>
                        <div>
                          <span class="active">Node Devices</span>
                        </div>
                      </li><li>
                        <div>
                          <a title="The secret XML format" class="inactive" href="formatsecret.html">Secrets</a>
                        </div>
                      </li><li>
                        <div>
                          <a title="The snapshot XML format" class="inactive" href="formatsnapshot.html">Snapshots</a>
                        </div>
                      </li></ul>
                  </div>
                </li><li>
                  <div>
                    <a title="Hypervisor specific driver information" class="inactive" href="drivers.html">Drivers</a>
                  </div>
                </li><li>
                  <div>
                    <a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
                  </div>
                </li><li>
                  <div>
                    <a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
                  </div>
                </li><li>
                  <div>
                    <a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
                  </div>
                </li><li>
                  <div>
                    <a title="A guide and reference for developing with libvirt" class="inactive" href="devguide.html">Development Guide</a>
                  </div>
                </li><li>
                  <div>
                    <a title="Command reference for virsh" class="inactive" href="virshcmdref.html">Virsh Commands</a>
                  </div>
                </li></ul>
            </div>
          </li><li>
            <div>
              <a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
            </div>
          </li><li>
            <div>
              <a title="Frequently asked questions" class="inactive" href="http://wiki.libvirt.org/page/FAQ">FAQ</a>
            </div>
          </li><li>
            <div>
              <a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
            </div>
          </li><li>
            <div>
              <a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
            </div>
          </li><li>
            <div>
              <a title="Available test suites for libvirt" class="inactive" href="testsuites.html">Test suites</a>
            </div>
          </li><li>
            <div>
              <a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
            </div>
          </li><li>
            <div>
              <a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
            </div>
          </li></ul>
      </div>
      <div id="content">
        <h1>Node devices XML format</h1>
        <ul><li>
            <a href="#NodedevAttributes">Node Device XML</a>
          </li><li>
            <a href="#nodeExample">Examples</a>
          </li></ul>
        <h2>
          <a name="NodedevAttributes" id="NodedevAttributes">Node Device XML</a>
        </h2>
        <p>
      There are several libvirt functions, all with the
      prefix <code>virNodeDevice</code>, which deal with management of
      host devices that can be handed to guests via passthrough as
      &lt;hostdev&gt; elements
      in <a href="formatdomain.html#elementsUSB">the domain XML</a>.
      These devices are represented as a hierarchy, where a device on
      a bus has a parent of the bus controller device; the root of the
      hierarchy is the node named "computer".
    </p>
        <p>
      When represented in XML, a node device uses the
      top-level <code>device</code> element, with the following
      elements present according to the type of device:
    </p>
        <dl><dt><code>name</code></dt><dd>The name for this device.  The name will be alphanumeric,
        with words separated by underscore.  For many devices, the
        name is just the bus type and address, as in
        "pci_0000_00_02_1" or "usb_1_5_3", but some devices are able
        to provide more specific names, such as
        "net_eth1_00_27_13_6a_fe_00".
      </dd><dt><code>parent</code></dt><dd>If this element is present, it names the parent device (that
        is, a controller to which this node belongs).
      </dd><dt><code>capability</code></dt><dd>This node appears for each capability that libvirt
        associates with a node.  A mandatory
        attribute <code>type</code> lists which category the device
        belongs to, and controls which further subelements will be
        present to describe the node:
        <dl><dt><code>system</code></dt><dd>Describes the overall host.  Sub-elements include:
            <dl><dt><code>product</code></dt><dd>If present, a simple text string giving the product
                name of the system.</dd><dt><code>hardware</code></dt><dd>Describes the hardware of the system, including
                sub-elements for <code>vendor</code>, <code>version</code>,
                <code>serial</code>, and <code>uuid</code>.</dd><dt><code>firmware</code></dt><dd>Describes the firmware of the system, including
                sub-elements for <code>vendor</code>, <code>version</code>,
                and <code>release_date</code>.</dd></dl>
          </dd><dt><code>pci</code></dt><dd>Describes a device on the host's PCI bus.  Sub-elements
            include:
            <dl><dt><code>domain</code></dt><dd>Which domain the device belongs to.</dd><dt><code>bus</code></dt><dd>Which bus within the domain.</dd><dt><code>slot</code></dt><dd>Which slot within the bus.</dd><dt><code>function</code></dt><dd>Which function within the slot.</dd><dt><code>product</code></dt><dd>Product details from the device ROM, including an
                attribute <code>id</code> with the hexadecimal product
                id, and an optional text description of that id.</dd><dt><code>vendor</code></dt><dd>Vendor details from the device ROM, including an
                attribute <code>id</code> with the hexadecimal vendor
                id, and an optional text name of that vendor.</dd></dl>
          </dd><dt><code>usb_device</code></dt><dd>Describes a device on the host's USB bus, based on its
            location within the bus.  Sub-elements include:
            <dl><dt><code>bus</code></dt><dd>Which bus the device belongs to.</dd><dt><code>device</code></dt><dd>Which device within the bus.</dd><dt><code>product</code></dt><dd>Product details from the device ROM, including an
                attribute <code>id</code> with the hexadecimal product
                id, and an optional text description of that id.</dd><dt><code>vendor</code></dt><dd>Vendor details from the device ROM, including an
                attribute <code>id</code> with the hexadecimal vendor
                id, and an optional text name of that vendor.</dd></dl>
          </dd><dt><code>usb</code></dt><dd>Describes a USB device, based on its advertised driver
            interface.  Sub-elements include:
            <dl><dt><code>number</code></dt><dd>The device number.</dd><dt><code>number</code></dt><dd>The device class.</dd><dt><code>number</code></dt><dd>The device subclass.</dd><dt><code>number</code></dt><dd>The device protocol.</dd><dt><code>description</code></dt><dd>If present, a description of the device.</dd></dl>
          </dd><dt><code>net</code></dt><dd>Describes a device capable for use as a network
            interface.  Sub-elements include:
            <dl><dt><code>interface</code></dt><dd>The interface name tied to this device.</dd><dt><code>address</code></dt><dd>If present, the MAC address of the device.</dd><dt><code>capability</code></dt><dd>A network protocol exposed by the device, where the
                attribute <code>type</code> can be "80203" for IEEE
                802.3, or "80211" for various flavors of IEEE 802.11.
              </dd></dl>
          </dd><dt><code>scsi_host</code></dt><dd>Describes a SCSI host device.  Sub-elements include:
            <dl><dt><code>host</code></dt><dd>The SCSI host number.</dd><dt><code>capability</code></dt><dd>Current capabilities include "vports_ops" (indicates
                vport operations are supported) and "fc_host", the later
                implies following sub-elements: <code>wwnn</code>,
                <code>wwpn</code>, <code>fabric_wwn</code>.
              </dd></dl>
          </dd><dt><code>scsi</code></dt><dd>Desribes a SCSI device.  Sub-elements include:
            <dl><dt><code>host</code></dt><dd>The SCSI host containing the device.</dd><dt><code>bus</code></dt><dd>The bus within the host.</dd><dt><code>target</code></dt><dd>The target within the bus.</dd><dt><code>lun</code></dt><dd>The lun within the target.</dd><dt><code>type</code></dt><dd>The type of SCSI device.</dd></dl>
          </dd><dt><code>storage</code></dt><dd>Describes a device usable for storage.  Sub-elements
            include:
            <dl><dt><code>block</code></dt><dd>A block device file name that accesses the storage
                present on the device.</dd><dt><code>bus</code></dt><dd>If present, the name of the bus the device is found
                on.</dd><dt><code>drive_type</code></dt><dd>The type of the drive, such as "disk" or
                "cdrom".</dd><dt><code>model</code></dt><dd>Any model information available from the
                device.</dd><dt><code>vendor</code></dt><dd>Any vendor information available from the
                device.</dd><dt><code>serial</code></dt><dd>Any serial number information available from the
                device.</dd><dt><code>size</code></dt><dd>For fixed-size storage, the amount of storage
                available.</dd><dt><code>capability</code></dt><dd>If present, an additional capability is listed via
                the attribute <code>type</code>.  Current capabilites
                include "hotpluggable" and "removable", with the
                latter implying the following
                sub-elements: <code>media_available</code> (0 or
                1), <code>media_size</code>,
                and <code>media_label</code>.</dd></dl>
          </dd></dl>
      </dd></dl>
        <h2>
          <a name="nodeExample" id="nodeExample">Examples</a>
        </h2>
        <p>The following are some example node device XML outputs:</p>
        <pre>
&lt;device&gt;
  &lt;name&gt;computer&lt;/name&gt;
  &lt;capability type='system'&gt;
    &lt;product&gt;2241B36&lt;/product&gt;
    &lt;hardware&gt;
      &lt;vendor&gt;LENOVO&lt;/vendor&gt;
      &lt;version&gt;ThinkPad T500&lt;/version&gt;
      &lt;serial&gt;R89055N&lt;/serial&gt;
      &lt;uuid&gt;c9488981-5049-11cb-9c1c-993d0230b4cd&lt;/uuid&gt;
    &lt;/hardware&gt;
    &lt;firmware&gt;
      &lt;vendor&gt;LENOVO&lt;/vendor&gt;
      &lt;version&gt;6FET82WW (3.12 )&lt;/version&gt;
      &lt;release_date&gt;11/26/2009&lt;/release_date&gt;
    &lt;/firmware&gt;
  &lt;/capability&gt;
&lt;/device&gt;

&lt;device&gt;
  &lt;name&gt;net_eth1_00_27_13_6a_fe_00&lt;/name&gt;
  &lt;parent&gt;pci_0000_00_19_0&lt;/parent&gt;
  &lt;capability type='net'&gt;
    &lt;interface&gt;eth1&lt;/interface&gt;
    &lt;address&gt;00:27:13:6a:fe:00&lt;/address&gt;
    &lt;capability type='80203'/&gt;
  &lt;/capability&gt;
&lt;/device&gt;</pre>
      </div>
    </div>
    <div id="footer">
      <p id="sponsor">
	    Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
    </div>
  </body>
</html>