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 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
This file is autogenerated from html/libvirt-libvirt-nodedev.html.in
Do not edit this file. Changes will be lost.
-->
<!--
This page was generated at Thu Jan 10 20:48:18 UTC 2019.
-->
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" type="text/css" href="../main.css"/>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/>
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/>
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/>
<link rel="manifest" href="/manifest.json"/>
<meta name="theme-color" content="#ffffff"/>
<title>libvirt: Module libvirt-nodedev from libvirt</title>
<meta name="description" content="libvirt, virtualization, virtualization API"/>
<script type="text/javascript">
<!--
function init() {
window.addEventListener('scroll', function(e){
var distanceY = window.pageYOffset || document.documentElement.scrollTop,
shrinkOn = 94
home = document.getElementById("home");
links = document.getElementById("jumplinks");
search = document.getElementById("search");
body = document.getElementById("body");
if (distanceY > shrinkOn) {
if (home.className != "navhide") {
body.className = "navhide"
home.className = "navhide"
links.className = "navhide"
search.className = "navhide"
}
} else {
if (home.className == "navhide") {
body.className = ""
home.className = ""
links.className = ""
search.className = ""
}
}
});
}
window.onload = init();
-->
</script>
</head>
<body>
<div id="body">
<div id="content">
<h1>Module libvirt-nodedev from libvirt</h1>
<p>Provides APIs for the management of nodedevs Copyright (C) 2006-2014 Red Hat, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.</p>
<h2>Table of Contents</h2>
<h3>
<a href="#macros">Macros</a>
</h3>
<pre class="api"><span class="directive">#define</span> <a href="#VIR_NODE_DEVICE_EVENT_CALLBACK">VIR_NODE_DEVICE_EVENT_CALLBACK</a>
</pre>
<h3>
<a href="#types">Types</a>
</h3>
<pre class="api"><span class="keyword">typedef</span> <span class="keyword">enum</span> <a href="#virConnectListAllNodeDeviceFlags">virConnectListAllNodeDeviceFlags</a>
<span class="keyword">typedef</span> <span class="type">struct _virNodeDevice</span> <a href="#virNodeDevice">virNodeDevice</a>
<span class="keyword">typedef</span> <span class="keyword">enum</span> <a href="#virNodeDeviceEventID">virNodeDeviceEventID</a>
<span class="keyword">typedef</span> <span class="keyword">enum</span> <a href="#virNodeDeviceEventLifecycleType">virNodeDeviceEventLifecycleType</a>
<span class="keyword">typedef</span> <span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevice">virNodeDevice</a> *</span> <a name="virNodeDevicePtr">virNodeDevicePtr</a>
</pre>
<h3>
<a href="#functions">Functions</a>
</h3>
<pre class="api"><span class="type">int</span> <a href="#virConnectListAllNodeDevices">virConnectListAllNodeDevices</a> (<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn, <br/> <span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a> **</span> devices, <br/> <span class="type">unsigned int</span> flags)
<span class="type">int</span> <a href="#virConnectNodeDeviceEventDeregisterAny">virConnectNodeDeviceEventDeregisterAny</a> (<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn, <br/> <span class="type">int</span> callbackID)
<span class="keyword">typedef</span> <a href="#virConnectNodeDeviceEventGenericCallback">virConnectNodeDeviceEventGenericCallback</a>
<span class="type">void</span> <a href="#virConnectNodeDeviceEventGenericCallback">virConnectNodeDeviceEventGenericCallback</a> (<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn, <br/> <span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev, <br/> <span class="type">void *</span> opaque)
<span class="keyword">typedef</span> <a href="#virConnectNodeDeviceEventLifecycleCallback">virConnectNodeDeviceEventLifecycleCallback</a>
<span class="type">void</span> <a href="#virConnectNodeDeviceEventLifecycleCallback">virConnectNodeDeviceEventLifecycleCallback</a> (<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn, <br/> <span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev, <br/> <span class="type">int</span> event, <br/> <span class="type">int</span> detail, <br/> <span class="type">void *</span> opaque)
<span class="type">int</span> <a href="#virConnectNodeDeviceEventRegisterAny">virConnectNodeDeviceEventRegisterAny</a> (<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn, <br/> <span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev, <br/> <span class="type">int</span> eventID, <br/> <span class="type"><a href="libvirt-libvirt-nodedev.html#virConnectNodeDeviceEventGenericCallback">virConnectNodeDeviceEventGenericCallback</a></span> cb, <br/> <span class="type">void *</span> opaque, <br/> <span class="type"><a href="libvirt-libvirt-common.html#virFreeCallback">virFreeCallback</a></span> freecb)
<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> <a href="#virNodeDeviceCreateXML">virNodeDeviceCreateXML</a> (<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn, <br/> <span class="type">const char *</span> xmlDesc, <br/> <span class="type">unsigned int</span> flags)
<span class="type">int</span> <a href="#virNodeDeviceDestroy">virNodeDeviceDestroy</a> (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev)
<span class="type">int</span> <a href="#virNodeDeviceDetachFlags">virNodeDeviceDetachFlags</a> (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev, <br/> <span class="type">const char *</span> driverName, <br/> <span class="type">unsigned int</span> flags)
<span class="type">int</span> <a href="#virNodeDeviceDettach">virNodeDeviceDettach</a> (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev)
<span class="type">int</span> <a href="#virNodeDeviceFree">virNodeDeviceFree</a> (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev)
<span class="type">const char *</span> <a href="#virNodeDeviceGetName">virNodeDeviceGetName</a> (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev)
<span class="type">const char *</span> <a href="#virNodeDeviceGetParent">virNodeDeviceGetParent</a> (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev)
<span class="type">char *</span> <a href="#virNodeDeviceGetXMLDesc">virNodeDeviceGetXMLDesc</a> (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev, <br/> <span class="type">unsigned int</span> flags)
<span class="type">int</span> <a href="#virNodeDeviceListCaps">virNodeDeviceListCaps</a> (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev, <br/> <span class="type">char ** const</span> names, <br/> <span class="type">int</span> maxnames)
<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> <a href="#virNodeDeviceLookupByName">virNodeDeviceLookupByName</a> (<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn, <br/> <span class="type">const char *</span> name)
<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> <a href="#virNodeDeviceLookupSCSIHostByWWN">virNodeDeviceLookupSCSIHostByWWN</a> (<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn, <br/> <span class="type">const char *</span> wwnn, <br/> <span class="type">const char *</span> wwpn, <br/> <span class="type">unsigned int</span> flags)
<span class="type">int</span> <a href="#virNodeDeviceNumOfCaps">virNodeDeviceNumOfCaps</a> (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev)
<span class="type">int</span> <a href="#virNodeDeviceReAttach">virNodeDeviceReAttach</a> (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev)
<span class="type">int</span> <a href="#virNodeDeviceRef">virNodeDeviceRef</a> (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev)
<span class="type">int</span> <a href="#virNodeDeviceReset">virNodeDeviceReset</a> (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev)
<span class="type">int</span> <a href="#virNodeListDevices">virNodeListDevices</a> (<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn, <br/> <span class="type">const char *</span> cap, <br/> <span class="type">char ** const</span> names, <br/> <span class="type">int</span> maxnames, <br/> <span class="type">unsigned int</span> flags)
<span class="type">int</span> <a href="#virNodeNumOfDevices">virNodeNumOfDevices</a> (<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn, <br/> <span class="type">const char *</span> cap, <br/> <span class="type">unsigned int</span> flags)
</pre>
<h2>Description</h2>
<h3>
<a name="macros">Macros</a>
</h3>
<h3>
<a name="VIR_NODE_DEVICE_EVENT_CALLBACK">
<code>VIR_NODE_DEVICE_EVENT_CALLBACK</code>
</a>
</h3>
<pre class="api"><span class="directive">#define</span> VIR_NODE_DEVICE_EVENT_CALLBACK</pre>
<div class="description">
<p>Used to cast the event specific callback into the generic one for use for <a href="libvirt-libvirt-nodedev.html#virConnectNodeDeviceEventRegisterAny">virConnectNodeDeviceEventRegisterAny</a>()</p>
</div>
<h3>
<a name="types">Types</a>
</h3>
<h3>
<a name="virConnectListAllNodeDeviceFlags">
<code>virConnectListAllNodeDeviceFlags</code>
</a>
</h3>
<div class="api">
<pre><span class="keyword">enum</span> virConnectListAllNodeDeviceFlags {
</pre>
<table>
<tr>
<td>
<a name="VIR_CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM">VIR_CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM</a>
</td>
<td> = </td>
<td>1</td>
<td>
<div class="comment">System capability</div>
</td>
</tr>
<tr>
<td>
<a name="VIR_CONNECT_LIST_NODE_DEVICES_CAP_PCI_DEV">VIR_CONNECT_LIST_NODE_DEVICES_CAP_PCI_DEV</a>
</td>
<td> = </td>
<td>2</td>
<td>
<div class="comment">PCI device</div>
</td>
</tr>
<tr>
<td>
<a name="VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_DEV">VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_DEV</a>
</td>
<td> = </td>
<td>4</td>
<td>
<div class="comment">USB device</div>
</td>
</tr>
<tr>
<td>
<a name="VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_INTERFACE">VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_INTERFACE</a>
</td>
<td> = </td>
<td>8</td>
<td>
<div class="comment">USB interface</div>
</td>
</tr>
<tr>
<td>
<a name="VIR_CONNECT_LIST_NODE_DEVICES_CAP_NET">VIR_CONNECT_LIST_NODE_DEVICES_CAP_NET</a>
</td>
<td> = </td>
<td>16</td>
<td>
<div class="comment">Network device</div>
</td>
</tr>
<tr>
<td>
<a name="VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_HOST">VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_HOST</a>
</td>
<td> = </td>
<td>32</td>
<td>
<div class="comment">SCSI Host Bus Adapter</div>
</td>
</tr>
<tr>
<td>
<a name="VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_TARGET">VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_TARGET</a>
</td>
<td> = </td>
<td>64</td>
<td>
<div class="comment">SCSI Target</div>
</td>
</tr>
<tr>
<td>
<a name="VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI">VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI</a>
</td>
<td> = </td>
<td>128</td>
<td>
<div class="comment">SCSI device</div>
</td>
</tr>
<tr>
<td>
<a name="VIR_CONNECT_LIST_NODE_DEVICES_CAP_STORAGE">VIR_CONNECT_LIST_NODE_DEVICES_CAP_STORAGE</a>
</td>
<td> = </td>
<td>256</td>
<td>
<div class="comment">Storage device</div>
</td>
</tr>
<tr>
<td>
<a name="VIR_CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST">VIR_CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST</a>
</td>
<td> = </td>
<td>512</td>
<td>
<div class="comment">FC Host Bus Adapter</div>
</td>
</tr>
<tr>
<td>
<a name="VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS">VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS</a>
</td>
<td> = </td>
<td>1024</td>
<td>
<div class="comment">Capable of vport</div>
</td>
</tr>
<tr>
<td>
<a name="VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC">VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC</a>
</td>
<td> = </td>
<td>2048</td>
<td>
<div class="comment">Capable of scsi_generic</div>
</td>
</tr>
<tr>
<td>
<a name="VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM">VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM</a>
</td>
<td> = </td>
<td>4096</td>
<td>
<div class="comment">DRM device</div>
</td>
</tr>
<tr>
<td>
<a name="VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES">VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES</a>
</td>
<td> = </td>
<td>8192</td>
<td>
<div class="comment">Capable of mediated devices</div>
</td>
</tr>
<tr>
<td>
<a name="VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV">VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV</a>
</td>
<td> = </td>
<td>16384</td>
<td>
<div class="comment">Mediated device</div>
</td>
</tr>
<tr>
<td>
<a name="VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV">VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV</a>
</td>
<td> = </td>
<td>32768</td>
<td>
<div class="comment">CCW device</div>
</td>
</tr>
</table>
<pre>}
</pre>
</div>
<h3>
<a name="virNodeDevice">
<code>virNodeDevice</code>
</a>
</h3>
<div class="api">
<pre><span class="keyword">struct </span>virNodeDevice {
</pre>
<div class="undisclosed">The content of this structure is not made public by the API</div>
<pre>
}
</pre>
</div>
<h3>
<a name="virNodeDeviceEventID">
<code>virNodeDeviceEventID</code>
</a>
</h3>
<div class="api">
<pre><span class="keyword">enum</span> virNodeDeviceEventID {
</pre>
<table>
<tr>
<td>
<a name="VIR_NODE_DEVICE_EVENT_ID_LIFECYCLE">VIR_NODE_DEVICE_EVENT_ID_LIFECYCLE</a>
</td>
<td> = </td>
<td>0</td>
<td>
<div class="comment">
<a href="libvirt-libvirt-nodedev.html#virConnectNodeDeviceEventLifecycleCallback">virConnectNodeDeviceEventLifecycleCallback</a>
</div>
</td>
</tr>
<tr>
<td>
<a name="VIR_NODE_DEVICE_EVENT_ID_UPDATE">VIR_NODE_DEVICE_EVENT_ID_UPDATE</a>
</td>
<td> = </td>
<td>1</td>
<td>
<div class="comment">
<a href="libvirt-libvirt-nodedev.html#virConnectNodeDeviceEventGenericCallback">virConnectNodeDeviceEventGenericCallback</a>
</div>
</td>
</tr>
<tr>
<td>
<a name="VIR_NODE_DEVICE_EVENT_ID_LAST">VIR_NODE_DEVICE_EVENT_ID_LAST</a>
</td>
<td> = </td>
<td>2</td>
<td>
<div class="comment">NB: this enum value will increase over time as new events are added to the libvirt API. It reflects the last event ID supported by this version of the libvirt API.</div>
</td>
</tr>
</table>
<pre>}
</pre>
</div>
<h3>
<a name="virNodeDeviceEventLifecycleType">
<code>virNodeDeviceEventLifecycleType</code>
</a>
</h3>
<div class="api">
<pre><span class="keyword">enum</span> virNodeDeviceEventLifecycleType {
</pre>
<table>
<tr>
<td>
<a name="VIR_NODE_DEVICE_EVENT_CREATED">VIR_NODE_DEVICE_EVENT_CREATED</a>
</td>
<td> = </td>
<td colspan="2">0</td>
</tr>
<tr>
<td>
<a name="VIR_NODE_DEVICE_EVENT_DELETED">VIR_NODE_DEVICE_EVENT_DELETED</a>
</td>
<td> = </td>
<td colspan="2">1</td>
</tr>
<tr>
<td>
<a name="VIR_NODE_DEVICE_EVENT_LAST">VIR_NODE_DEVICE_EVENT_LAST</a>
</td>
<td> = </td>
<td colspan="2">2</td>
</tr>
</table>
<pre>}
</pre>
</div>
<h3>
<a name="functions">Functions</a>
</h3>
<h3>
<a name="virConnectListAllNodeDevices">
<code>virConnectListAllNodeDevices</code>
</a>
</h3>
<pre class="api"><span class="type">int</span> virConnectListAllNodeDevices (<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn,
<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a> **</span> devices,
<span class="type">unsigned int</span> flags)</pre>
<div class="description">
<p>Collect the list of node devices, and allocate an array to store those objects.</p>
<p>Normally, all node devices are returned; however, @flags can be used to filter the results for a smaller list of targeted node devices. The valid flags are divided into groups, where each group contains bits that describe mutually exclusive attributes of a node device, and where all bits within a group describe all possible node devices.</p>
<p>Only one group of the @flags is provided to filter the node devices by capability type, flags include: <a href="libvirt-libvirt-nodedev.html#VIR_CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM">VIR_CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM</a> <a href="libvirt-libvirt-nodedev.html#VIR_CONNECT_LIST_NODE_DEVICES_CAP_PCI_DEV">VIR_CONNECT_LIST_NODE_DEVICES_CAP_PCI_DEV</a> <a href="libvirt-libvirt-nodedev.html#VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_DEV">VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_DEV</a> <a href="libvirt-libvirt-nodedev.html#VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_INTERFACE">VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_INTERFACE</a> <a href="libvirt-libvirt-nodedev.html#VIR_CONNECT_LIST_NODE_DEVICES_CAP_NET">VIR_CONNECT_LIST_NODE_DEVICES_CAP_NET</a> <a href="libvirt-libvirt-nodedev.html#VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_HOST">VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_HOST</a> <a href="libvirt-libvirt-nodedev.html#VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_TARGET">VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_TARGET</a> <a href="libvirt-libvirt-nodedev.html#VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI">VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI</a> <a href="libvirt-libvirt-nodedev.html#VIR_CONNECT_LIST_NODE_DEVICES_CAP_STORAGE">VIR_CONNECT_LIST_NODE_DEVICES_CAP_STORAGE</a> <a href="libvirt-libvirt-nodedev.html#VIR_CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST">VIR_CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST</a> <a href="libvirt-libvirt-nodedev.html#VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS">VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS</a> <a href="libvirt-libvirt-nodedev.html#VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC">VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC</a> <a href="libvirt-libvirt-nodedev.html#VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM">VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM</a> <a href="libvirt-libvirt-nodedev.html#VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES">VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES</a> <a href="libvirt-libvirt-nodedev.html#VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV">VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV</a> <a href="libvirt-libvirt-nodedev.html#VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV">VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV</a></p>
</div>
<dl class="variablelist">
<dt>conn</dt>
<dd>Pointer to the hypervisor connection.</dd>
<dt>devices</dt>
<dd>Pointer to a variable to store the array containing the node device objects or NULL if the list is not required (just returns number of node devices).</dd>
<dt>flags</dt>
<dd>bitwise-OR of <a href="libvirt-libvirt-nodedev.html#virConnectListAllNodeDeviceFlags">virConnectListAllNodeDeviceFlags</a>.</dd>
<dt>Returns</dt>
<dd>the number of node devices found or -1 and sets @devices to NULL in case of error. On success, the array stored into @devices is guaranteed to have an extra allocated element set to NULL but not included in the return count, to make iteration easier. The caller is responsible for calling <a href="libvirt-libvirt-nodedev.html#virNodeDeviceFree">virNodeDeviceFree</a>() on each array element, then calling free() on @devices.</dd>
</dl>
<div class="acl"/>
<h3>
<a name="virConnectNodeDeviceEventDeregisterAny">
<code>virConnectNodeDeviceEventDeregisterAny</code>
</a>
</h3>
<pre class="api"><span class="type">int</span> virConnectNodeDeviceEventDeregisterAny (<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn,
<span class="type">int</span> callbackID)</pre>
<div class="description">
<p>Removes an event callback. The callbackID parameter should be the value obtained from a previous <a href="libvirt-libvirt-nodedev.html#virConnectNodeDeviceEventRegisterAny">virConnectNodeDeviceEventRegisterAny</a>() method.</p>
</div>
<dl class="variablelist">
<dt>conn</dt>
<dd>pointer to the connection</dd>
<dt>callbackID</dt>
<dd>the callback identifier</dd>
<dt>Returns</dt>
<dd>0 on success, -1 on failure.</dd>
</dl>
<div class="acl"/>
<h3>
<a name="virConnectNodeDeviceEventGenericCallback">
<code>virConnectNodeDeviceEventGenericCallback</code>
</a>
</h3>
<pre class="api"><span class="keyword">typedef</span> <span class="type">void</span> (*virConnectNodeDeviceEventGenericCallback) (<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn,
<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev,
<span class="type">void *</span> opaque)
</pre>
<div class="description">
<p>A generic node device event callback handler, for use with <a href="libvirt-libvirt-nodedev.html#virConnectNodeDeviceEventRegisterAny">virConnectNodeDeviceEventRegisterAny</a>(). Specific events usually have a customization with extra parameters, often with @opaque being passed in a different parameter position; use <a href="libvirt-libvirt-nodedev.html#VIR_NODE_DEVICE_EVENT_CALLBACK">VIR_NODE_DEVICE_EVENT_CALLBACK</a>() when registering an appropriate handler.</p>
</div>
<dl class="variablelist">
<dt>conn</dt>
<dd>the connection pointer</dd>
<dt>dev</dt>
<dd>the node device pointer</dd>
<dt>opaque</dt>
<dd>application specified data</dd>
</dl>
<br/>
<h3>
<a name="virConnectNodeDeviceEventLifecycleCallback">
<code>virConnectNodeDeviceEventLifecycleCallback</code>
</a>
</h3>
<pre class="api"><span class="keyword">typedef</span> <span class="type">void</span> (*virConnectNodeDeviceEventLifecycleCallback) (<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn,
<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev,
<span class="type">int</span> event,
<span class="type">int</span> detail,
<span class="type">void *</span> opaque)
</pre>
<div class="description">
<p>This callback is called when a node device lifecycle action is performed, like added or removed.</p>
<p>The callback signature to use when registering for an event of type <a href="libvirt-libvirt-nodedev.html#VIR_NODE_DEVICE_EVENT_ID_LIFECYCLE">VIR_NODE_DEVICE_EVENT_ID_LIFECYCLE</a> with <a href="libvirt-libvirt-nodedev.html#virConnectNodeDeviceEventRegisterAny">virConnectNodeDeviceEventRegisterAny</a>()</p>
</div>
<dl class="variablelist">
<dt>conn</dt>
<dd>connection object</dd>
<dt>dev</dt>
<dd>node device on which the event occurred</dd>
<dt>event</dt>
<dd>The specific virNodeDeviceEventLifeCycleType which occurred</dd>
<dt>detail</dt>
<dd>contains some details on the reason of the event.</dd>
<dt>opaque</dt>
<dd>application specified data</dd>
</dl>
<br/>
<h3>
<a name="virConnectNodeDeviceEventRegisterAny">
<code>virConnectNodeDeviceEventRegisterAny</code>
</a>
</h3>
<pre class="api"><span class="type">int</span> virConnectNodeDeviceEventRegisterAny (<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn,
<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev,
<span class="type">int</span> eventID,
<span class="type"><a href="libvirt-libvirt-nodedev.html#virConnectNodeDeviceEventGenericCallback">virConnectNodeDeviceEventGenericCallback</a></span> cb,
<span class="type">void *</span> opaque,
<span class="type"><a href="libvirt-libvirt-common.html#virFreeCallback">virFreeCallback</a></span> freecb)</pre>
<div class="description">
<p>Adds a callback to receive notifications of arbitrary node device events occurring on a node device. This function requires that an event loop has been previously registered with <a href="libvirt-libvirt-event.html#virEventRegisterImpl">virEventRegisterImpl</a>() or <a href="libvirt-libvirt-event.html#virEventRegisterDefaultImpl">virEventRegisterDefaultImpl</a>().</p>
<p>If @dev is NULL, then events will be monitored for any node device. If @dev is non-NULL, then only the specific node device will be monitored.</p>
<p>Most types of events have a callback providing a custom set of parameters for the event. When registering an event, it is thus necessary to use the <a href="libvirt-libvirt-nodedev.html#VIR_NODE_DEVICE_EVENT_CALLBACK">VIR_NODE_DEVICE_EVENT_CALLBACK</a>() macro to cast the supplied function pointer to match the signature of this method.</p>
<p>The <a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a> object handle passed into the callback upon delivery of an event is only valid for the duration of execution of the callback. If the callback wishes to keep the node device object after the callback returns, it shall take a reference to it, by calling <a href="libvirt-libvirt-nodedev.html#virNodeDeviceRef">virNodeDeviceRef</a>(). The reference can be released once the object is no longer required by calling <a href="libvirt-libvirt-nodedev.html#virNodeDeviceFree">virNodeDeviceFree</a>().</p>
<p>The return value from this method is a positive integer identifier for the callback. To unregister a callback, this callback ID should be passed to the <a href="libvirt-libvirt-nodedev.html#virConnectNodeDeviceEventDeregisterAny">virConnectNodeDeviceEventDeregisterAny</a>() method.</p>
</div>
<dl class="variablelist">
<dt>conn</dt>
<dd>pointer to the connection</dd>
<dt>dev</dt>
<dd>pointer to the node device</dd>
<dt>eventID</dt>
<dd>the event type to receive</dd>
<dt>cb</dt>
<dd>callback to the function handling node device events</dd>
<dt>opaque</dt>
<dd>opaque data to pass on to the callback</dd>
<dt>freecb</dt>
<dd>optional function to deallocate opaque when not used anymore</dd>
<dt>Returns</dt>
<dd>a callback identifier on success, -1 on failure.</dd>
</dl>
<div class="acl"/>
<h3>
<a name="virNodeDeviceCreateXML">
<code>virNodeDeviceCreateXML</code>
</a>
</h3>
<pre class="api"><span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> virNodeDeviceCreateXML (<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn,
<span class="type">const char *</span> xmlDesc,
<span class="type">unsigned int</span> flags)</pre>
<div class="description">
<p>Create a new device on the VM host machine, for example, virtual HBAs created using vport_create.</p>
<p><a href="libvirt-libvirt-nodedev.html#virNodeDeviceFree">virNodeDeviceFree</a> should be used to free the resources after the node device object is no longer needed.</p>
</div>
<dl class="variablelist">
<dt>conn</dt>
<dd>pointer to the hypervisor connection</dd>
<dt>xmlDesc</dt>
<dd>string containing an XML description of the device to be created</dd>
<dt>flags</dt>
<dd>extra flags; not used yet, so callers should always pass 0</dd>
<dt>Returns</dt>
<dd>a node device object if successful, NULL in case of failure</dd>
</dl>
<div class="acl"/>
<h3>
<a name="virNodeDeviceDestroy">
<code>virNodeDeviceDestroy</code>
</a>
</h3>
<pre class="api"><span class="type">int</span> virNodeDeviceDestroy (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev)</pre>
<div class="description">
<p>Destroy the device object. The virtual device (only works for vHBA currently) is removed from the host operating system. This function may require privileged access.</p>
</div>
<dl class="variablelist">
<dt>dev</dt>
<dd>a device object</dd>
<dt>Returns</dt>
<dd>0 in case of success and -1 in case of failure.</dd>
</dl>
<div class="acl"/>
<h3>
<a name="virNodeDeviceDetachFlags">
<code>virNodeDeviceDetachFlags</code>
</a>
</h3>
<pre class="api"><span class="type">int</span> virNodeDeviceDetachFlags (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev,
<span class="type">const char *</span> driverName,
<span class="type">unsigned int</span> flags)</pre>
<div class="description">
<p>Detach the node device from the node itself so that it may be assigned to a guest domain.</p>
<p>Depending on the hypervisor, this may involve operations such as unbinding any device drivers from the device, binding the device to a dummy device driver and resetting the device. Different backend drivers expect the device to be bound to different dummy devices. For example, QEMU's "kvm" backend driver (the default) expects the device to be bound to "pci-stub", but its "vfio" backend driver expects the device to be bound to "vfio-pci".</p>
<p>If the device is currently in use by the node, this method may fail.</p>
<p>Once the device is not assigned to any guest, it may be re-attached to the node using the <a href="libvirt-libvirt-nodedev.html#virNodeDeviceReAttach">virNodeDeviceReAttach</a>() method.</p>
</div>
<dl class="variablelist">
<dt>dev</dt>
<dd>pointer to the node device</dd>
<dt>driverName</dt>
<dd>name of backend driver that will be used for later device assignment to a domain. NULL means "use the hypervisor default driver"</dd>
<dt>flags</dt>
<dd>extra flags; not used yet, so callers should always pass 0</dd>
<dt>Returns</dt>
<dd>0 in case of success, -1 in case of failure.</dd>
</dl>
<div class="acl"/>
<h3>
<a name="virNodeDeviceDettach">
<code>virNodeDeviceDettach</code>
</a>
</h3>
<pre class="api"><span class="type">int</span> virNodeDeviceDettach (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev)</pre>
<div class="description">
<p>Dettach the node device from the node itself so that it may be assigned to a guest domain.</p>
<p>Depending on the hypervisor, this may involve operations such as unbinding any device drivers from the device, binding the device to a dummy device driver and resetting the device.</p>
<p>If the device is currently in use by the node, this method may fail.</p>
<p>Once the device is not assigned to any guest, it may be re-attached to the node using the virNodeDeviceReattach() method.</p>
<p>If the caller needs control over which backend driver will be used during PCI device assignment (to use something other than the default, for example VFIO), the newer <a href="libvirt-libvirt-nodedev.html#virNodeDeviceDetachFlags">virNodeDeviceDetachFlags</a>() API should be used instead.</p>
</div>
<dl class="variablelist">
<dt>dev</dt>
<dd>pointer to the node device</dd>
<dt>Returns</dt>
<dd>0 in case of success, -1 in case of failure.</dd>
</dl>
<div class="acl"/>
<h3>
<a name="virNodeDeviceFree">
<code>virNodeDeviceFree</code>
</a>
</h3>
<pre class="api"><span class="type">int</span> virNodeDeviceFree (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev)</pre>
<div class="description">
<p>Drops a reference to the node device, freeing it if this was the last reference.</p>
</div>
<dl class="variablelist">
<dt>dev</dt>
<dd>pointer to the node device</dd>
<dt>Returns</dt>
<dd>the 0 for success, -1 for error.</dd>
</dl>
<div class="acl"/>
<h3>
<a name="virNodeDeviceGetName">
<code>virNodeDeviceGetName</code>
</a>
</h3>
<pre class="api"><span class="type">const char *</span> virNodeDeviceGetName (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev)</pre>
<div class="description">
<p>Just return the device name</p>
</div>
<dl class="variablelist">
<dt>dev</dt>
<dd>the device</dd>
<dt>Returns</dt>
<dd>the device name or NULL in case of error</dd>
</dl>
<div class="acl"/>
<h3>
<a name="virNodeDeviceGetParent">
<code>virNodeDeviceGetParent</code>
</a>
</h3>
<pre class="api"><span class="type">const char *</span> virNodeDeviceGetParent (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev)</pre>
<div class="description">
<p>Accessor for the parent of the device</p>
</div>
<dl class="variablelist">
<dt>dev</dt>
<dd>the device</dd>
<dt>Returns</dt>
<dd>the name of the device's parent, or NULL if an error occurred or when the device has no parent.</dd>
</dl>
<div class="acl"/>
<h3>
<a name="virNodeDeviceGetXMLDesc">
<code>virNodeDeviceGetXMLDesc</code>
</a>
</h3>
<pre class="api"><span class="type">char *</span> virNodeDeviceGetXMLDesc (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev,
<span class="type">unsigned int</span> flags)</pre>
<div class="description">
<p>Fetch an XML document describing all aspects of the device.</p>
</div>
<dl class="variablelist">
<dt>dev</dt>
<dd>pointer to the node device</dd>
<dt>flags</dt>
<dd>extra flags; not used yet, so callers should always pass 0</dd>
<dt>Returns</dt>
<dd>the XML document, or NULL on error</dd>
</dl>
<div class="acl"/>
<h3>
<a name="virNodeDeviceListCaps">
<code>virNodeDeviceListCaps</code>
</a>
</h3>
<pre class="api"><span class="type">int</span> virNodeDeviceListCaps (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev,
<span class="type">char ** const</span> names,
<span class="type">int</span> maxnames)</pre>
<div class="description">
<p>Lists the names of the capabilities supported by the device.</p>
</div>
<dl class="variablelist">
<dt>dev</dt>
<dd>the device</dd>
<dt>names</dt>
<dd>array to collect the list of capability names</dd>
<dt>maxnames</dt>
<dd>size of @names</dd>
<dt>Returns</dt>
<dd>the number of capability names listed in @names or -1 in case of error.</dd>
</dl>
<div class="acl"/>
<h3>
<a name="virNodeDeviceLookupByName">
<code>virNodeDeviceLookupByName</code>
</a>
</h3>
<pre class="api"><span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> virNodeDeviceLookupByName (<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn,
<span class="type">const char *</span> name)</pre>
<div class="description">
<p>Lookup a node device by its name.</p>
<p><a href="libvirt-libvirt-nodedev.html#virNodeDeviceFree">virNodeDeviceFree</a> should be used to free the resources after the node device object is no longer needed.</p>
</div>
<dl class="variablelist">
<dt>conn</dt>
<dd>pointer to the hypervisor connection</dd>
<dt>name</dt>
<dd>unique device name</dd>
<dt>Returns</dt>
<dd>a <a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a> if found, NULL otherwise.</dd>
</dl>
<div class="acl"/>
<h3>
<a name="virNodeDeviceLookupSCSIHostByWWN">
<code>virNodeDeviceLookupSCSIHostByWWN</code>
</a>
</h3>
<pre class="api"><span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> virNodeDeviceLookupSCSIHostByWWN (<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn,
<span class="type">const char *</span> wwnn,
<span class="type">const char *</span> wwpn,
<span class="type">unsigned int</span> flags)</pre>
<div class="description">
<p>Lookup SCSI Host which is capable with 'fc_host' by its WWNN and WWPN.</p>
<p><a href="libvirt-libvirt-nodedev.html#virNodeDeviceFree">virNodeDeviceFree</a> should be used to free the resources after the node device object is no longer needed.</p>
</div>
<dl class="variablelist">
<dt>conn</dt>
<dd>pointer to the hypervisor connection</dd>
<dt>wwnn</dt>
<dd>WWNN of the SCSI Host.</dd>
<dt>wwpn</dt>
<dd>WWPN of the SCSI Host.</dd>
<dt>flags</dt>
<dd>extra flags; not used yet, so callers should always pass 0</dd>
<dt>Returns</dt>
<dd>a <a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a> if found, NULL otherwise.</dd>
</dl>
<div class="acl"/>
<h3>
<a name="virNodeDeviceNumOfCaps">
<code>virNodeDeviceNumOfCaps</code>
</a>
</h3>
<pre class="api"><span class="type">int</span> virNodeDeviceNumOfCaps (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev)</pre>
<div class="description">
<p>Accessor for the number of capabilities supported by the device.</p>
</div>
<dl class="variablelist">
<dt>dev</dt>
<dd>the device</dd>
<dt>Returns</dt>
<dd>the number of capabilities supported by the device or -1 in case of error.</dd>
</dl>
<div class="acl"/>
<h3>
<a name="virNodeDeviceReAttach">
<code>virNodeDeviceReAttach</code>
</a>
</h3>
<pre class="api"><span class="type">int</span> virNodeDeviceReAttach (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev)</pre>
<div class="description">
<p>Re-attach a previously detached node device to the node so that it may be used by the node again.</p>
<p>Depending on the hypervisor, this may involve operations such as resetting the device, unbinding it from a dummy device driver and binding it to its appropriate driver.</p>
<p>If the device is currently in use by a guest, this method may fail.</p>
</div>
<dl class="variablelist">
<dt>dev</dt>
<dd>pointer to the node device</dd>
<dt>Returns</dt>
<dd>0 in case of success, -1 in case of failure.</dd>
</dl>
<div class="acl"/>
<h3>
<a name="virNodeDeviceRef">
<code>virNodeDeviceRef</code>
</a>
</h3>
<pre class="api"><span class="type">int</span> virNodeDeviceRef (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev)</pre>
<div class="description">
<p>Increment the reference count on the dev. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt-nodedev.html#virNodeDeviceFree">virNodeDeviceFree</a> to release the reference count, once the caller no longer needs the reference to this object.</p>
<p>This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a dev would increment the reference count.</p>
</div>
<dl class="variablelist">
<dt>dev</dt>
<dd>the dev to hold a reference on</dd>
<dt>Returns</dt>
<dd>0 in case of success, -1 in case of failure.</dd>
</dl>
<div class="acl"/>
<h3>
<a name="virNodeDeviceReset">
<code>virNodeDeviceReset</code>
</a>
</h3>
<pre class="api"><span class="type">int</span> virNodeDeviceReset (<span class="type"><a href="libvirt-libvirt-nodedev.html#virNodeDevicePtr">virNodeDevicePtr</a></span> dev)</pre>
<div class="description">
<p>Reset a previously detached node device to the node before or after assigning it to a guest.</p>
<p>The exact reset semantics depends on the hypervisor and device type but, for example, KVM will attempt to reset PCI devices with a Function Level Reset, Secondary Bus Reset or a Power Management D-State reset.</p>
<p>If the reset will affect other devices which are currently in use, this function may fail.</p>
</div>
<dl class="variablelist">
<dt>dev</dt>
<dd>pointer to the node device</dd>
<dt>Returns</dt>
<dd>0 in case of success, -1 in case of failure.</dd>
</dl>
<div class="acl"/>
<h3>
<a name="virNodeListDevices">
<code>virNodeListDevices</code>
</a>
</h3>
<pre class="api"><span class="type">int</span> virNodeListDevices (<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn,
<span class="type">const char *</span> cap,
<span class="type">char ** const</span> names,
<span class="type">int</span> maxnames,
<span class="type">unsigned int</span> flags)</pre>
<div class="description">
<p>Collect the list of node devices, and store their names in @names</p>
<p>For more control over the results, see <a href="libvirt-libvirt-nodedev.html#virConnectListAllNodeDevices">virConnectListAllNodeDevices</a>().</p>
<p>If the optional 'cap' argument is non-NULL, then the count will be restricted to devices with the specified capability</p>
</div>
<dl class="variablelist">
<dt>conn</dt>
<dd>pointer to the hypervisor connection</dd>
<dt>cap</dt>
<dd>capability name</dd>
<dt>names</dt>
<dd>array to collect the list of node device names</dd>
<dt>maxnames</dt>
<dd>size of @names</dd>
<dt>flags</dt>
<dd>extra flags; not used yet, so callers should always pass 0</dd>
<dt>Returns</dt>
<dd>the number of node devices found or -1 in case of error</dd>
</dl>
<div class="acl"/>
<h3>
<a name="virNodeNumOfDevices">
<code>virNodeNumOfDevices</code>
</a>
</h3>
<pre class="api"><span class="type">int</span> virNodeNumOfDevices (<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn,
<span class="type">const char *</span> cap,
<span class="type">unsigned int</span> flags)</pre>
<div class="description">
<p>Provides the number of node devices.</p>
<p>If the optional 'cap' argument is non-NULL, then the count will be restricted to devices with the specified capability</p>
</div>
<dl class="variablelist">
<dt>conn</dt>
<dd>pointer to the hypervisor connection</dd>
<dt>cap</dt>
<dd>capability name</dd>
<dt>flags</dt>
<dd>extra flags; not used yet, so callers should always pass 0</dd>
<dt>Returns</dt>
<dd>the number of node devices or -1 in case of error</dd>
</dl>
<div class="acl"/>
</div>
</div>
<div id="nav">
<div id="home">
<a href="../index.html">Home</a>
</div>
<div id="jumplinks">
<ul>
<li>
<a href="../downloads.html">Download</a>
</li>
<li>
<a href="../contribute.html">Contribute</a>
</li>
<li>
<a href="../docs.html">Docs</a>
</li>
</ul>
</div>
<div id="search">
<form action="../search.php" enctype="application/x-www-form-urlencoded" method="get">
<div>
<input name="query" type="text" size="12" value=""/>
<input name="submit" type="submit" value="Go"/>
</div>
</form>
</div>
</div>
<div id="footer">
<div id="contact">
<h3>Contact</h3>
<ul>
<li>
<a href="../contact.html#email">email</a>
</li>
<li>
<a href="../contact.html#irc">irc</a>
</li>
</ul>
</div>
<div id="community">
<h3>Community</h3>
<ul>
<li>
<a href="https://twitter.com/hashtag/libvirt">twitter</a>
</li>
<li>
<a href="https://plus.google.com/communities/109522598353007505282">google+</a>
</li>
<li>
<a href="http://stackoverflow.com/questions/tagged/libvirt">stackoverflow</a>
</li>
<li>
<a href="http://serverfault.com/questions/tagged/libvirt">serverfault</a>
</li>
</ul>
</div>
<div id="conduct">
Participants in the libvirt project agree to abide by <a href="../governance.html#codeofconduct">the project code of conduct</a></div>
<br class="clear"/>
</div>
</body>
</html>
|