# PaCkAgE DaTaStReAm SUNWlibvirt 1 8174 # end of header 0707010002bb3f000081a40000000000000000000000014ae194b3000001ef000000b600010006ffffffffffffffff0000001400000000SUNWlibvirt/pkginfoPKG=SUNWlibvirt NAME=Virtualization Management Library (Usr) ARCH=i386 VERSION=11.11,REV=2009.10.23.10.12 SUNW_PRODNAME=SunOS SUNW_PRODVERS=5.11/SunOS Development SUNW_PKGTYPE=usr SUNW_PKG_ALLZONES=true SUNW_PKG_HOLLOW=true SUNW_PKG_THISZONE=false MAXINST=1000 CATEGORY=system DESC=Library for management of virtualization technologies VENDOR=Sun Microsystems, Inc. HOTLINE=Please contact your local service provider EMAIL= CLASSES=none BASEDIR=/ SUNW_PKGVERS=1.0 PSTAMP=priscilla20091023113411 0707010002bb3e000081a40000000000000000000000014ae194b300001573000000b600010006ffffffffffffffff0000001300000000SUNWlibvirt/pkgmap: 1 8174 1 i copyright 18479 5190 1256282684 1 i depend 2105 49457 1256282684 1 i pkginfo 495 40299 1256297651 1 i postinstall 1115 30611 1256282684 1 d none usr 0755 root sys 1 d none usr/bin 0755 root bin 1 d none usr/bin/amd64 0755 root bin 1 f none usr/bin/amd64/virsh 0555 root bin 144768 49171 1256297384 1 d none usr/bin/i86 0755 root bin 1 f none usr/bin/i86/virsh 0555 root bin 112780 32985 1256297603 1 l none usr/bin/virsh=../../usr/lib/isaexec 1 d none usr/include 0755 root bin 1 d none usr/include/libvirt 0755 root bin 1 f none usr/include/libvirt/libvirt.h 0644 root bin 52565 56525 1256297529 1 f none usr/include/libvirt/virterror.h 0644 root bin 8741 26572 1256297529 1 d none usr/lib 0755 root bin 1 d none usr/lib/amd64 0755 root bin 1 s none usr/lib/amd64/libvirt.so=libvirt.so.0 1 s none usr/lib/amd64/libvirt.so.0=libvirt.so.0.7.0 1 f none usr/lib/amd64/libvirt.so.0.7.0 0755 root bin 1067312 3315 1256297384 1 f none usr/lib/amd64/libvirtd 0755 root bin 318064 4352 1256297392 1 d none usr/lib/amd64/pkgconfig 0755 root other 1 f none usr/lib/amd64/pkgconfig/libvirt.pc 0644 root bin 231 21157 1256297428 1 d none usr/lib/i86 0755 root bin 1 f none usr/lib/i86/libvirtd 0755 root bin 256360 40502 1256297610 1 s none usr/lib/libvirt.so=libvirt.so.0 1 s none usr/lib/libvirt.so.0=libvirt.so.0.7.0 1 f none usr/lib/libvirt.so.0.7.0 0755 root bin 894844 46719 1256297602 1 l none usr/lib/libvirtd=../../usr/lib/isaexec 1 d none usr/lib/pkgconfig 0755 root other 1 f none usr/lib/pkgconfig/libvirt.pc 0644 root bin 231 21157 1256297644 1 d none usr/lib/python2.4 0755 root bin 1 d none usr/lib/python2.4/vendor-packages 0755 root bin 1 d none usr/lib/python2.4/vendor-packages/64 0755 root bin 1 f none usr/lib/python2.4/vendor-packages/64/libvirtmod.so 0755 root bin 136936 56657 1256297403 1 f none usr/lib/python2.4/vendor-packages/libvirt.py 0644 root bin 79749 59224 1256297620 1 f none usr/lib/python2.4/vendor-packages/libvirt.pyc 0644 root bin 92663 15347 1256297644 1 f none usr/lib/python2.4/vendor-packages/libvirtmod.so 0755 root bin 103224 13089 1256297621 1 f none usr/lib/virt-console 4755 root bin 19664 27696 1256297603 1 d none usr/share 0755 root sys 1 d none usr/share/doc 0755 root other 1 d none usr/share/doc/libvirt 0755 root bin 1 d none usr/share/doc/libvirt/html 0755 root bin 1 f none usr/share/doc/libvirt/html/FAQ.html 0644 root bin 8304 52452 1256297614 1 f none usr/share/doc/libvirt/html/Libxml2-Logo-90x34.gif 0644 root bin 3070 5797 1256297614 1 f none usr/share/doc/libvirt/html/examples.xml 0644 root bin 3274 7148 1256297613 1 f none usr/share/doc/libvirt/html/examples.xsl 0644 root bin 5758 10033 1256297613 1 d none usr/share/doc/libvirt/html/html 0755 root bin 1 f none usr/share/doc/libvirt/html/html/home.png 0644 root bin 654 8089 1256297614 1 f none usr/share/doc/libvirt/html/html/index.html 0644 root bin 4169 38653 1256297614 1 f none usr/share/doc/libvirt/html/html/left.png 0644 root bin 459 49669 1256297614 1 f none usr/share/doc/libvirt/html/html/libvirt-libvirt.html 0644 root bin 240613 2213 1256297614 1 f none usr/share/doc/libvirt/html/html/libvirt-virterror.html 0644 root bin 32063 36554 1256297614 1 f none usr/share/doc/libvirt/html/html/right.png 0644 root bin 472 50613 1256297614 1 f none usr/share/doc/libvirt/html/html/up.png 0644 root bin 406 41501 1256297614 1 f none usr/share/doc/libvirt/html/index.html 0644 root bin 5434 21838 1256297613 1 f none usr/share/doc/libvirt/html/info1.c 0644 root bin 1524 54278 1256297613 1 f none usr/share/doc/libvirt/html/suspend.c 0644 root bin 3553 1211 1256297613 1 d none usr/share/gtk-doc 0755 root bin 1 d none usr/share/gtk-doc/html 0755 root bin 1 d none usr/share/gtk-doc/html/libvirt 0755 root bin 1 f none usr/share/gtk-doc/html/libvirt/general.html 0644 root bin 1640 61354 1256297614 1 f none usr/share/gtk-doc/html/libvirt/home.png 0644 root bin 654 8089 1256297614 1 f none usr/share/gtk-doc/html/libvirt/index.html 0644 root bin 2051 39168 1256297614 1 f none usr/share/gtk-doc/html/libvirt/left.png 0644 root bin 459 49669 1256297614 1 f none usr/share/gtk-doc/html/libvirt/libvirt-libvirt.html 0644 root bin 247881 64089 1256297614 1 f none usr/share/gtk-doc/html/libvirt/libvirt-virterror.html 0644 root bin 24559 63060 1256297614 1 f none usr/share/gtk-doc/html/libvirt/libvirt.devhelp 0644 root bin 42022 61250 1256297614 1 f none usr/share/gtk-doc/html/libvirt/right.png 0644 root bin 472 50613 1256297614 1 f none usr/share/gtk-doc/html/libvirt/style.css 0644 root bin 809 1481 1256297614 1 f none usr/share/gtk-doc/html/libvirt/up.png 0644 root bin 406 41501 1256297614 1 d none usr/share/lib 0755 root sys 1 d none usr/share/lib/xml 0755 root sys 1 d none usr/share/lib/xml/rng 0755 root sys 1 s none usr/share/lib/xml/rng/libvirt=../../../libvirt/schemas 1 d none usr/share/libvirt 0755 root sys 1 d none usr/share/libvirt/schemas 0755 root sys 1 f none usr/share/libvirt/schemas/capability.rng 0444 root bin 5976 61879 1256297611 1 f none usr/share/libvirt/schemas/domain.rng 0444 root bin 32747 10414 1256297611 1 f none usr/share/libvirt/schemas/interface.rng 0444 root bin 10897 17795 1256297611 1 f none usr/share/libvirt/schemas/network.rng 0444 root bin 2638 5099 1256297611 1 f none usr/share/libvirt/schemas/nodedev.rng 0444 root bin 7067 12036 1256297611 1 f none usr/share/libvirt/schemas/storagepool.rng 0444 root bin 7498 53487 1256297611 1 f none usr/share/libvirt/schemas/storagevol.rng 0444 root bin 3893 34345 1256297611 07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000b00000000TRAILER!!!0707010002bb3f000081a40000000000000000000000014ae194b3000001ef000000b600010006ffffffffffffffff0000000800000000pkginfoPKG=SUNWlibvirt NAME=Virtualization Management Library (Usr) ARCH=i386 VERSION=11.11,REV=2009.10.23.10.12 SUNW_PRODNAME=SunOS SUNW_PRODVERS=5.11/SunOS Development SUNW_PKGTYPE=usr SUNW_PKG_ALLZONES=true SUNW_PKG_HOLLOW=true SUNW_PKG_THISZONE=false MAXINST=1000 CATEGORY=system DESC=Library for management of virtualization technologies VENDOR=Sun Microsystems, Inc. HOTLINE=Please contact your local service provider EMAIL= CLASSES=none BASEDIR=/ SUNW_PKGVERS=1.0 PSTAMP=priscilla20091023113411 0707010002bb3e000081a40000000000000000000000014ae194b300001573000000b600010006ffffffffffffffff0000000700000000pkgmap: 1 8174 1 i copyright 18479 5190 1256282684 1 i depend 2105 49457 1256282684 1 i pkginfo 495 40299 1256297651 1 i postinstall 1115 30611 1256282684 1 d none usr 0755 root sys 1 d none usr/bin 0755 root bin 1 d none usr/bin/amd64 0755 root bin 1 f none usr/bin/amd64/virsh 0555 root bin 144768 49171 1256297384 1 d none usr/bin/i86 0755 root bin 1 f none usr/bin/i86/virsh 0555 root bin 112780 32985 1256297603 1 l none usr/bin/virsh=../../usr/lib/isaexec 1 d none usr/include 0755 root bin 1 d none usr/include/libvirt 0755 root bin 1 f none usr/include/libvirt/libvirt.h 0644 root bin 52565 56525 1256297529 1 f none usr/include/libvirt/virterror.h 0644 root bin 8741 26572 1256297529 1 d none usr/lib 0755 root bin 1 d none usr/lib/amd64 0755 root bin 1 s none usr/lib/amd64/libvirt.so=libvirt.so.0 1 s none usr/lib/amd64/libvirt.so.0=libvirt.so.0.7.0 1 f none usr/lib/amd64/libvirt.so.0.7.0 0755 root bin 1067312 3315 1256297384 1 f none usr/lib/amd64/libvirtd 0755 root bin 318064 4352 1256297392 1 d none usr/lib/amd64/pkgconfig 0755 root other 1 f none usr/lib/amd64/pkgconfig/libvirt.pc 0644 root bin 231 21157 1256297428 1 d none usr/lib/i86 0755 root bin 1 f none usr/lib/i86/libvirtd 0755 root bin 256360 40502 1256297610 1 s none usr/lib/libvirt.so=libvirt.so.0 1 s none usr/lib/libvirt.so.0=libvirt.so.0.7.0 1 f none usr/lib/libvirt.so.0.7.0 0755 root bin 894844 46719 1256297602 1 l none usr/lib/libvirtd=../../usr/lib/isaexec 1 d none usr/lib/pkgconfig 0755 root other 1 f none usr/lib/pkgconfig/libvirt.pc 0644 root bin 231 21157 1256297644 1 d none usr/lib/python2.4 0755 root bin 1 d none usr/lib/python2.4/vendor-packages 0755 root bin 1 d none usr/lib/python2.4/vendor-packages/64 0755 root bin 1 f none usr/lib/python2.4/vendor-packages/64/libvirtmod.so 0755 root bin 136936 56657 1256297403 1 f none usr/lib/python2.4/vendor-packages/libvirt.py 0644 root bin 79749 59224 1256297620 1 f none usr/lib/python2.4/vendor-packages/libvirt.pyc 0644 root bin 92663 15347 1256297644 1 f none usr/lib/python2.4/vendor-packages/libvirtmod.so 0755 root bin 103224 13089 1256297621 1 f none usr/lib/virt-console 4755 root bin 19664 27696 1256297603 1 d none usr/share 0755 root sys 1 d none usr/share/doc 0755 root other 1 d none usr/share/doc/libvirt 0755 root bin 1 d none usr/share/doc/libvirt/html 0755 root bin 1 f none usr/share/doc/libvirt/html/FAQ.html 0644 root bin 8304 52452 1256297614 1 f none usr/share/doc/libvirt/html/Libxml2-Logo-90x34.gif 0644 root bin 3070 5797 1256297614 1 f none usr/share/doc/libvirt/html/examples.xml 0644 root bin 3274 7148 1256297613 1 f none usr/share/doc/libvirt/html/examples.xsl 0644 root bin 5758 10033 1256297613 1 d none usr/share/doc/libvirt/html/html 0755 root bin 1 f none usr/share/doc/libvirt/html/html/home.png 0644 root bin 654 8089 1256297614 1 f none usr/share/doc/libvirt/html/html/index.html 0644 root bin 4169 38653 1256297614 1 f none usr/share/doc/libvirt/html/html/left.png 0644 root bin 459 49669 1256297614 1 f none usr/share/doc/libvirt/html/html/libvirt-libvirt.html 0644 root bin 240613 2213 1256297614 1 f none usr/share/doc/libvirt/html/html/libvirt-virterror.html 0644 root bin 32063 36554 1256297614 1 f none usr/share/doc/libvirt/html/html/right.png 0644 root bin 472 50613 1256297614 1 f none usr/share/doc/libvirt/html/html/up.png 0644 root bin 406 41501 1256297614 1 f none usr/share/doc/libvirt/html/index.html 0644 root bin 5434 21838 1256297613 1 f none usr/share/doc/libvirt/html/info1.c 0644 root bin 1524 54278 1256297613 1 f none usr/share/doc/libvirt/html/suspend.c 0644 root bin 3553 1211 1256297613 1 d none usr/share/gtk-doc 0755 root bin 1 d none usr/share/gtk-doc/html 0755 root bin 1 d none usr/share/gtk-doc/html/libvirt 0755 root bin 1 f none usr/share/gtk-doc/html/libvirt/general.html 0644 root bin 1640 61354 1256297614 1 f none usr/share/gtk-doc/html/libvirt/home.png 0644 root bin 654 8089 1256297614 1 f none usr/share/gtk-doc/html/libvirt/index.html 0644 root bin 2051 39168 1256297614 1 f none usr/share/gtk-doc/html/libvirt/left.png 0644 root bin 459 49669 1256297614 1 f none usr/share/gtk-doc/html/libvirt/libvirt-libvirt.html 0644 root bin 247881 64089 1256297614 1 f none usr/share/gtk-doc/html/libvirt/libvirt-virterror.html 0644 root bin 24559 63060 1256297614 1 f none usr/share/gtk-doc/html/libvirt/libvirt.devhelp 0644 root bin 42022 61250 1256297614 1 f none usr/share/gtk-doc/html/libvirt/right.png 0644 root bin 472 50613 1256297614 1 f none usr/share/gtk-doc/html/libvirt/style.css 0644 root bin 809 1481 1256297614 1 f none usr/share/gtk-doc/html/libvirt/up.png 0644 root bin 406 41501 1256297614 1 d none usr/share/lib 0755 root sys 1 d none usr/share/lib/xml 0755 root sys 1 d none usr/share/lib/xml/rng 0755 root sys 1 s none usr/share/lib/xml/rng/libvirt=../../../libvirt/schemas 1 d none usr/share/libvirt 0755 root sys 1 d none usr/share/libvirt/schemas 0755 root sys 1 f none usr/share/libvirt/schemas/capability.rng 0444 root bin 5976 61879 1256297611 1 f none usr/share/libvirt/schemas/domain.rng 0444 root bin 32747 10414 1256297611 1 f none usr/share/libvirt/schemas/interface.rng 0444 root bin 10897 17795 1256297611 1 f none usr/share/libvirt/schemas/network.rng 0444 root bin 2638 5099 1256297611 1 f none usr/share/libvirt/schemas/nodedev.rng 0444 root bin 7067 12036 1256297611 1 f none usr/share/libvirt/schemas/storagepool.rng 0444 root bin 7498 53487 1256297611 1 f none usr/share/libvirt/schemas/storagevol.rng 0444 root bin 3893 34345 1256297611 0707010002bb40000041ed0000000000000000000000024ae194b300000000000000b600010006ffffffffffffffff0000000800000000install0707010002bb42000081a40000000000000000000000014ae15a3c00000839000000b600010006ffffffffffffffff0000000f00000000install/depend# # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # This package information file defines software dependencies associated # with the pkg. You can define three types of pkg dependencies with this file: # P indicates a prerequisite for installation # I indicates an incompatible package # R indicates a reverse dependency # see pkginfo(4), PKG parameter # see pkginfo(4), NAME parameter # see pkginfo(4), VERSION parameter # see pkginfo(4), ARCH parameter # # () # () # ... # # ... P SUNWcar Core Architecture, (Root) P SUNWcakr Core Solaris Kernel Architecture (Root) P SUNWkvm Core Architecture, (Kvm) P SUNWcsr Core Solaris, (Root) P SUNWckr Core Solaris Kernel (Root) P SUNWcnetr Core Solaris Network Infrastructure (Root) P SUNWcsu Core Solaris, (Usr) P SUNWcsd Core Solaris Devices P SUNWcsl Core Solaris Libraries P SUNWxvmdomr Hypervisor Domain Tools (Root) P SUNWxvmdomu Hypervisor Domain Tools (Usr) P SUNWxvmr Hypervisor (Root) P SUNWxvmu Hypervisor (Usr) P SUNWgnutls GNU transport layer security library P SUNWlibvirtr Libvirt (Root) P SUNWlxml The XML Library P SUNWlibmsr Math & Microtasking Libraries (Root) 0707010002bb41000081a40000000000000000000000014ae15a3c0000482f000000b600010006ffffffffffffffff0000001200000000install/copyright For the avoidance of doubt, except that if any license choice other than GPL or LGPL is available it will apply instead, Sun elects to use only the General Public License version 2 (GPLv2) at this time for any software where a choice of GPL license versions is made available with the language indicating that GPLv2 or any later version may be used, or where a choice of which version of the GPL is applied is otherwise unspecified. GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. 0707010002bb43000081ed0000000000000000000000014ae15a3c0000045b000000b600010006ffffffffffffffff0000001400000000install/postinstall# # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # # we can't use platform profiles, so we must explictly enable our services # during boot. # cat >>$PKG_INSTALL_ROOT/var/svc/profile/upgrade < */ #ifndef __VIR_VIRLIB_H__ #define __VIR_VIRLIB_H__ #include #ifdef __cplusplus extern "C" { #endif #ifndef VIR_DEPRECATED /* The feature is present in gcc-3.1 and newer. */ # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) # define VIR_DEPRECATED __attribute__((__deprecated__)) # else # define VIR_DEPRECATED /* nothing */ # endif #endif /* VIR_DEPRECATED */ /** * virConnect: * * a virConnect is a private structure representing a connection to * the Hypervisor. */ typedef struct _virConnect virConnect; /** * virConnectPtr: * * a virConnectPtr is pointer to a virConnect private structure, this is the * type used to reference a connection to the Hypervisor in the API. */ typedef virConnect *virConnectPtr; /** * virDomain: * * a virDomain is a private structure representing a domain. */ typedef struct _virDomain virDomain; /** * virDomainPtr: * * a virDomainPtr is pointer to a virDomain private structure, this is the * type used to reference a domain in the API. */ typedef virDomain *virDomainPtr; /** * virDomainState: * * A domain may be in different states at a given point in time */ typedef enum { VIR_DOMAIN_NOSTATE = 0, /* no state */ VIR_DOMAIN_RUNNING = 1, /* the domain is running */ VIR_DOMAIN_BLOCKED = 2, /* the domain is blocked on resource */ VIR_DOMAIN_PAUSED = 3, /* the domain is paused by user */ VIR_DOMAIN_SHUTDOWN= 4, /* the domain is being shut down */ VIR_DOMAIN_SHUTOFF = 5, /* the domain is shut off */ VIR_DOMAIN_CRASHED = 6 /* the domain is crashed */ } virDomainState; /** * virDomainInfoPtr: * * a virDomainInfo is a structure filled by virDomainGetInfo() and extracting * runtime information for a given active Domain */ typedef struct _virDomainInfo virDomainInfo; struct _virDomainInfo { unsigned char state; /* the running state, one of virDomainState */ unsigned long maxMem; /* the maximum memory in KBytes allowed */ unsigned long memory; /* the memory in KBytes used by the domain */ unsigned short nrVirtCpu; /* the number of virtual CPUs for the domain */ unsigned long long cpuTime; /* the CPU time used in nanoseconds */ }; /** * virDomainInfoPtr: * * a virDomainInfoPtr is a pointer to a virDomainInfo structure. */ typedef virDomainInfo *virDomainInfoPtr; /** * virDomainCreateFlags: * * Flags OR'ed together to provide specific behaviour when creating a * Domain. */ typedef enum { VIR_DOMAIN_NONE = 0 } virDomainCreateFlags; /** * VIR_SECURITY_LABEL_BUFLEN: * * Macro providing the maximum length of the virSecurityLabel label string. * Note that this value is based on that used by Labeled NFS. */ #define VIR_SECURITY_LABEL_BUFLEN (4096 + 1) /** * virSecurityLabel: * * a virSecurityLabel is a structure filled by virDomainGetSecurityLabel(), * providing the security label and associated attributes for the specified * domain. * */ typedef struct _virSecurityLabel { char label[VIR_SECURITY_LABEL_BUFLEN]; /* security label string */ int enforcing; /* 1 if security policy is being enforced for domain */ } virSecurityLabel; /** * virSecurityLabelPtr: * * a virSecurityLabelPtr is a pointer to a virSecurityLabel. */ typedef virSecurityLabel *virSecurityLabelPtr; /** * VIR_SECURITY_MODEL_BUFLEN: * * Macro providing the maximum length of the virSecurityModel model string. */ #define VIR_SECURITY_MODEL_BUFLEN (256 + 1) /** * VIR_SECURITY_DOI_BUFLEN: * * Macro providing the maximum length of the virSecurityModel doi string. */ #define VIR_SECURITY_DOI_BUFLEN (256 + 1) /** * virSecurityModel: * * a virSecurityModel is a structure filled by virNodeGetSecurityModel(), * providing the per-hypervisor security model and DOI attributes for the * specified domain. * */ typedef struct _virSecurityModel { char model[VIR_SECURITY_MODEL_BUFLEN]; /* security model string */ char doi[VIR_SECURITY_DOI_BUFLEN]; /* domain of interpetation */ } virSecurityModel; /** * virSecurityModelPtr: * * a virSecurityModelPtr is a pointer to a virSecurityModel. */ typedef virSecurityModel *virSecurityModelPtr; /** * virNodeInfoPtr: * * a virNodeInfo is a structure filled by virNodeGetInfo() and providing * the information for the Node. */ typedef struct _virNodeInfo virNodeInfo; struct _virNodeInfo { char model[32]; /* string indicating the CPU model */ unsigned long memory;/* memory size in kilobytes */ unsigned int cpus; /* the number of active CPUs */ unsigned int mhz; /* expected CPU frequency */ unsigned int nodes; /* the number of NUMA cell, 1 for uniform mem access */ unsigned int sockets;/* number of CPU socket per node */ unsigned int cores; /* number of core per socket */ unsigned int threads;/* number of threads per core */ }; /** * virDomainSchedParameterType: * * A scheduler parameter field type */ typedef enum { VIR_DOMAIN_SCHED_FIELD_INT = 1, /* integer case */ VIR_DOMAIN_SCHED_FIELD_UINT = 2, /* unsigned integer case */ VIR_DOMAIN_SCHED_FIELD_LLONG = 3, /* long long case */ VIR_DOMAIN_SCHED_FIELD_ULLONG = 4, /* unsigned long long case */ VIR_DOMAIN_SCHED_FIELD_DOUBLE = 5, /* double case */ VIR_DOMAIN_SCHED_FIELD_BOOLEAN = 6 /* boolean(character) case */ } virSchedParameterType; /** * VIR_DOMAIN_SCHED_FIELD_LENGTH: * * Macro providing the field length of virSchedParameter */ #define VIR_DOMAIN_SCHED_FIELD_LENGTH 80 /** * virDomainSchedParameter: * * a virDomainSchedParameter is the set of scheduler parameters */ typedef struct _virSchedParameter virSchedParameter; struct _virSchedParameter { char field[VIR_DOMAIN_SCHED_FIELD_LENGTH]; /* parameter name */ int type; /* parameter type */ union { int i; /* data for integer case */ unsigned int ui; /* data for unsigned integer case */ long long int l; /* data for long long integer case */ unsigned long long int ul; /* data for unsigned long long integer case */ double d; /* data for double case */ char b; /* data for char case */ } value; /* parameter value */ }; /** * virSchedParameterPtr: * * a virSchedParameterPtr is a pointer to a virSchedParameter structure. */ typedef virSchedParameter *virSchedParameterPtr; /* * Fetch scheduler parameters, caller allocates 'params' field of size 'nparams' */ int virDomainGetSchedulerParameters (virDomainPtr domain, virSchedParameterPtr params, int *nparams); /* * Change scheduler parameters */ int virDomainSetSchedulerParameters (virDomainPtr domain, virSchedParameterPtr params, int nparams); /** * virDomainBlockStats: * * Block device stats for virDomainBlockStats. * * Hypervisors may return a field set to ((long long)-1) which indicates * that the hypervisor does not support that statistic. * * NB. Here 'long long' means 64 bit integer. */ typedef struct _virDomainBlockStats virDomainBlockStatsStruct; struct _virDomainBlockStats { long long rd_req; /* number of read requests */ long long rd_bytes; /* number of read bytes */ long long wr_req; /* number of write requests */ long long wr_bytes; /* number of written bytes */ long long errs; /* In Xen this returns the mysterious 'oo_req'. */ }; /** * virDomainBlockStatsPtr: * * A pointer to a virDomainBlockStats structure */ typedef virDomainBlockStatsStruct *virDomainBlockStatsPtr; /** * virDomainInterfaceStats: * * Network interface stats for virDomainInterfaceStats. * * Hypervisors may return a field set to ((long long)-1) which indicates * that the hypervisor does not support that statistic. * * NB. Here 'long long' means 64 bit integer. */ typedef struct _virDomainInterfaceStats virDomainInterfaceStatsStruct; struct _virDomainInterfaceStats { long long rx_bytes; long long rx_packets; long long rx_errs; long long rx_drop; long long tx_bytes; long long tx_packets; long long tx_errs; long long tx_drop; }; /** * virDomainInterfaceStatsPtr: * * A pointer to a virDomainInterfaceStats structure */ typedef virDomainInterfaceStatsStruct *virDomainInterfaceStatsPtr; /* Domain migration flags. */ typedef enum { VIR_MIGRATE_LIVE = 1, /* live migration */ VIR_MIGRATE_DRYRUN = 2, /* dry-run test */ } virDomainMigrateFlags; /* Domain migration. */ virDomainPtr virDomainMigrate (virDomainPtr domain, virConnectPtr dconn, unsigned long flags, const char *dname, const char *uri, unsigned long bandwidth); /** * VIR_NODEINFO_MAXCPUS: * @nodeinfo: virNodeInfo instance * * This macro is to calculate the total number of CPUs supported * but not necessary active in the host. */ #define VIR_NODEINFO_MAXCPUS(nodeinfo) ((nodeinfo).nodes*(nodeinfo).sockets*(nodeinfo).cores*(nodeinfo).threads) /** * virNodeInfoPtr: * * a virNodeInfoPtr is a pointer to a virNodeInfo structure. */ typedef virNodeInfo *virNodeInfoPtr; /** * virConnectFlags * * Flags when opening a connection to a hypervisor */ typedef enum { VIR_CONNECT_RO = 1, /* A readonly connection */ } virConnectFlags; typedef enum { VIR_CRED_USERNAME = 1, /* Identity to act as */ VIR_CRED_AUTHNAME = 2, /* Identify to authorize as */ VIR_CRED_LANGUAGE = 3, /* RFC 1766 languages, comma separated */ VIR_CRED_CNONCE = 4, /* client supplies a nonce */ VIR_CRED_PASSPHRASE = 5, /* Passphrase secret */ VIR_CRED_ECHOPROMPT = 6, /* Challenge response */ VIR_CRED_NOECHOPROMPT = 7, /* Challenge response */ VIR_CRED_REALM = 8, /* Authentication realm */ VIR_CRED_EXTERNAL = 9, /* Externally managed credential */ /* More may be added - expect the unexpected */ } virConnectCredentialType; struct _virConnectCredential { int type; /* One of virConnectCredentialType constants */ const char *prompt; /* Prompt to show to user */ const char *challenge; /* Additional challenge to show */ const char *defresult; /* Optional default result */ char *result; /* Result to be filled with user response (or defresult) */ unsigned int resultlen; /* Length of the result */ }; typedef struct _virConnectCredential virConnectCredential; typedef virConnectCredential *virConnectCredentialPtr; /** * virConnectCredCallbackPtr * * @param authtype type of authentication being performed * @param cred list of virConnectCredential object to fetch from user * @param ncred size of cred list * @param cbdata opaque data passed to virConnectOpenAuth * * When authentication requires one or more interactions, this callback * is invoked. For each interaction supplied, data must be gathered * from the user and filled in to the 'result' and 'resultlen' fields. * If an interaction can not be filled, fill in NULL and 0. * * Return 0 if all interactions were filled, or -1 upon error */ typedef int (*virConnectAuthCallbackPtr)(virConnectCredentialPtr cred, unsigned int ncred, void *cbdata); struct _virConnectAuth { int *credtype; /* List of supported virConnectCredentialType values */ unsigned int ncredtype; virConnectAuthCallbackPtr cb; /* Callback used to collect credentials */ void *cbdata; }; typedef struct _virConnectAuth virConnectAuth; typedef virConnectAuth *virConnectAuthPtr; extern virConnectAuthPtr virConnectAuthPtrDefault; /** * VIR_UUID_BUFLEN: * * This macro provides the length of the buffer required * for virDomainGetUUID() */ #define VIR_UUID_BUFLEN (16) /** * VIR_UUID_STRING_BUFLEN: * * This macro provides the length of the buffer required * for virDomainGetUUIDString() */ #define VIR_UUID_STRING_BUFLEN (36+1) /* library versioning */ /** * LIBVIR_VERSION_NUMBER: * * Macro providing the version of the library as * version * 1,000,000 + minor * 1000 + micro */ #define LIBVIR_VERSION_NUMBER 7000 int virGetVersion (unsigned long *libVer, const char *type, unsigned long *typeVer); /* * Connection and disconnections to the Hypervisor */ int virInitialize (void); virConnectPtr virConnectOpen (const char *name); virConnectPtr virConnectOpenReadOnly (const char *name); virConnectPtr virConnectOpenAuth (const char *name, virConnectAuthPtr auth, int flags); int virConnectRef (virConnectPtr conn); int virConnectClose (virConnectPtr conn); const char * virConnectGetType (virConnectPtr conn); int virConnectGetVersion (virConnectPtr conn, unsigned long *hvVer); char * virConnectGetHostname (virConnectPtr conn); char * virConnectGetURI (virConnectPtr conn); /* * Capabilities of the connection / driver. */ int virConnectGetMaxVcpus (virConnectPtr conn, const char *type); int virNodeGetInfo (virConnectPtr conn, virNodeInfoPtr info); char * virConnectGetCapabilities (virConnectPtr conn); unsigned long long virNodeGetFreeMemory (virConnectPtr conn); int virNodeGetSecurityModel (virConnectPtr conn, virSecurityModelPtr secmodel); /* * Gather list of running domains */ int virConnectListDomains (virConnectPtr conn, int *ids, int maxids); /* * Number of domains */ int virConnectNumOfDomains (virConnectPtr conn); /* * Get connection from domain. */ virConnectPtr virDomainGetConnect (virDomainPtr domain); /* * Domain creation and destruction */ virDomainPtr virDomainCreateXML (virConnectPtr conn, const char *xmlDesc, unsigned int flags); virDomainPtr virDomainLookupByName (virConnectPtr conn, const char *name); virDomainPtr virDomainLookupByID (virConnectPtr conn, int id); virDomainPtr virDomainLookupByUUID (virConnectPtr conn, const unsigned char *uuid); virDomainPtr virDomainLookupByUUIDString (virConnectPtr conn, const char *uuid); int virDomainShutdown (virDomainPtr domain); int virDomainReboot (virDomainPtr domain, unsigned int flags); int virDomainDestroy (virDomainPtr domain); int virDomainRef (virDomainPtr domain); int virDomainFree (virDomainPtr domain); /* * Domain suspend/resume */ int virDomainSuspend (virDomainPtr domain); int virDomainResume (virDomainPtr domain); /* * Domain save/restore */ int virDomainSave (virDomainPtr domain, const char *to); int virDomainRestore (virConnectPtr conn, const char *from); /* * Domain core dump */ int virDomainCoreDump (virDomainPtr domain, const char *to, int flags); char * virDomainGetRelativeXMLDesc (virDomainPtr domain, int flags, const char *relpath); /* * Domain runtime information */ int virDomainGetInfo (virDomainPtr domain, virDomainInfoPtr info); /* * Return scheduler type in effect 'sedf', 'credit', 'linux' */ char * virDomainGetSchedulerType(virDomainPtr domain, int *nparams); /* * Dynamic control of domains */ const char * virDomainGetName (virDomainPtr domain); unsigned int virDomainGetID (virDomainPtr domain); int virDomainGetUUID (virDomainPtr domain, unsigned char *uuid); int virDomainGetUUIDString (virDomainPtr domain, char *buf); char * virDomainGetOSType (virDomainPtr domain); unsigned long virDomainGetMaxMemory (virDomainPtr domain); int virDomainSetMaxMemory (virDomainPtr domain, unsigned long memory); int virDomainSetMemory (virDomainPtr domain, unsigned long memory); int virDomainGetMaxVcpus (virDomainPtr domain); int virDomainGetSecurityLabel (virDomainPtr domain, virSecurityLabelPtr seclabel); /* * XML domain description */ /** * virDomainXMLFlags: * * Flags available for virDomainGetXMLDesc */ typedef enum { VIR_DOMAIN_XML_SECURE = 1, /* dump security sensitive information too */ VIR_DOMAIN_XML_INACTIVE = 2/* dump inactive domain information */ } virDomainXMLFlags; char * virDomainGetXMLDesc (virDomainPtr domain, int flags); char * virConnectDomainXMLFromNative(virConnectPtr conn, const char *nativeFormat, const char *nativeConfig, unsigned int flags); char * virConnectDomainXMLToNative(virConnectPtr conn, const char *nativeFormat, const char *domainXml, unsigned int flags); int virDomainBlockStats (virDomainPtr dom, const char *path, virDomainBlockStatsPtr stats, size_t size); int virDomainInterfaceStats (virDomainPtr dom, const char *path, virDomainInterfaceStatsPtr stats, size_t size); int virDomainBlockPeek (virDomainPtr dom, const char *path, unsigned long long offset, size_t size, void *buffer, unsigned int flags); /* Memory peeking flags. */ typedef enum { VIR_MEMORY_VIRTUAL = 1, /* addresses are virtual addresses */ VIR_MEMORY_PHYSICAL = 2, /* addresses are physical addresses */ } virDomainMemoryFlags; int virDomainMemoryPeek (virDomainPtr dom, unsigned long long start, size_t size, void *buffer, unsigned int flags); /* * defined but not running domains */ virDomainPtr virDomainDefineXML (virConnectPtr conn, const char *xml); virDomainPtr virDomainDefineRelativeXML (virConnectPtr conn, const char *xml, const char *relpath); int virDomainUndefine (virDomainPtr domain); int virConnectNumOfDefinedDomains (virConnectPtr conn); int virConnectListDefinedDomains (virConnectPtr conn, char **const names, int maxnames); int virDomainCreate (virDomainPtr domain); int virDomainGetAutostart (virDomainPtr domain, int *autostart); int virDomainSetAutostart (virDomainPtr domain, int autostart); /** * virVcpuInfo: structure for information about a virtual CPU in a domain. */ typedef enum { VIR_VCPU_OFFLINE = 0, /* the virtual CPU is offline */ VIR_VCPU_RUNNING = 1, /* the virtual CPU is running */ VIR_VCPU_BLOCKED = 2, /* the virtual CPU is blocked on resource */ } virVcpuState; typedef struct _virVcpuInfo virVcpuInfo; struct _virVcpuInfo { unsigned int number; /* virtual CPU number */ int state; /* value from virVcpuState */ unsigned long long cpuTime; /* CPU time used, in nanoseconds */ int cpu; /* real CPU number, or -1 if offline */ }; typedef virVcpuInfo *virVcpuInfoPtr; int virDomainSetVcpus (virDomainPtr domain, unsigned int nvcpus); int virDomainPinVcpu (virDomainPtr domain, unsigned int vcpu, unsigned char *cpumap, int maplen); /** * VIR_USE_CPU: * @cpumap: pointer to a bit map of real CPUs (in 8-bit bytes) (IN/OUT) * @cpu: the physical CPU number * * This macro is to be used in conjunction with virDomainPinVcpu() API. * USE_CPU macro set the bit (CPU usable) of the related cpu in cpumap. */ #define VIR_USE_CPU(cpumap,cpu) (cpumap[(cpu)/8] |= (1<<((cpu)%8))) /** * VIR_UNUSE_CPU: * @cpumap: pointer to a bit map of real CPUs (in 8-bit bytes) (IN/OUT) * @cpu: the physical CPU number * * This macro is to be used in conjunction with virDomainPinVcpu() API. * USE_CPU macro reset the bit (CPU not usable) of the related cpu in cpumap. */ #define VIR_UNUSE_CPU(cpumap,cpu) (cpumap[(cpu)/8] &= ~(1<<((cpu)%8))) /** * VIR_CPU_MAPLEN: * @cpu: number of physical CPUs * * This macro is to be used in conjunction with virDomainPinVcpu() API. * It returns the length (in bytes) required to store the complete * CPU map between a single virtual & all physical CPUs of a domain. */ #define VIR_CPU_MAPLEN(cpu) (((cpu)+7)/8) int virDomainGetVcpus (virDomainPtr domain, virVcpuInfoPtr info, int maxinfo, unsigned char *cpumaps, int maplen); /** * VIR_CPU_USABLE: * @cpumaps: pointer to an array of cpumap (in 8-bit bytes) (IN) * @maplen: the length (in bytes) of one cpumap * @vcpu: the virtual CPU number * @cpu: the physical CPU number * * This macro is to be used in conjunction with virDomainGetVcpus() API. * VIR_CPU_USABLE macro returns a non zero value (true) if the cpu * is usable by the vcpu, and 0 otherwise. */ #define VIR_CPU_USABLE(cpumaps,maplen,vcpu,cpu) \ (cpumaps[((vcpu)*(maplen))+((cpu)/8)] & (1<<((cpu)%8))) /** * VIR_COPY_CPUMAP: * @cpumaps: pointer to an array of cpumap (in 8-bit bytes) (IN) * @maplen: the length (in bytes) of one cpumap * @vcpu: the virtual CPU number * @cpumap: pointer to a cpumap (in 8-bit bytes) (OUT) * This cpumap must be previously allocated by the caller * (ie: malloc(maplen)) * * This macro is to be used in conjunction with virDomainGetVcpus() and * virDomainPinVcpu() APIs. VIR_COPY_CPUMAP macro extract the cpumap of * the specified vcpu from cpumaps array and copy it into cpumap to be used * later by virDomainPinVcpu() API. */ #define VIR_COPY_CPUMAP(cpumaps,maplen,vcpu,cpumap) \ memcpy(cpumap, &(cpumaps[(vcpu)*(maplen)]), (maplen)) /** * VIR_GET_CPUMAP: * @cpumaps: pointer to an array of cpumap (in 8-bit bytes) (IN) * @maplen: the length (in bytes) of one cpumap * @vcpu: the virtual CPU number * * This macro is to be used in conjunction with virDomainGetVcpus() and * virDomainPinVcpu() APIs. VIR_GET_CPUMAP macro returns a pointer to the * cpumap of the specified vcpu from cpumaps array. */ #define VIR_GET_CPUMAP(cpumaps,maplen,vcpu) &(cpumaps[(vcpu)*(maplen)]) int virDomainAttachDevice(virDomainPtr domain, const char *xml); int virDomainDetachDevice(virDomainPtr domain, const char *xml); /* * NUMA support */ int virNodeGetCellsFreeMemory(virConnectPtr conn, unsigned long long *freeMems, int startCell, int maxCells); /* * Virtual Networks API */ /** * virNetwork: * * a virNetwork is a private structure representing a virtual network. */ typedef struct _virNetwork virNetwork; /** * virNetworkPtr: * * a virNetworkPtr is pointer to a virNetwork private structure, this is the * type used to reference a virtual network in the API. */ typedef virNetwork *virNetworkPtr; /* * Get connection from network. */ virConnectPtr virNetworkGetConnect (virNetworkPtr network); /* * List active networks */ int virConnectNumOfNetworks (virConnectPtr conn); int virConnectListNetworks (virConnectPtr conn, char **const names, int maxnames); /* * List inactive networks */ int virConnectNumOfDefinedNetworks (virConnectPtr conn); int virConnectListDefinedNetworks (virConnectPtr conn, char **const names, int maxnames); /* * Lookup network by name or uuid */ virNetworkPtr virNetworkLookupByName (virConnectPtr conn, const char *name); virNetworkPtr virNetworkLookupByUUID (virConnectPtr conn, const unsigned char *uuid); virNetworkPtr virNetworkLookupByUUIDString (virConnectPtr conn, const char *uuid); /* * Create active transient network */ virNetworkPtr virNetworkCreateXML (virConnectPtr conn, const char *xmlDesc); /* * Define inactive persistent network */ virNetworkPtr virNetworkDefineXML (virConnectPtr conn, const char *xmlDesc); /* * Delete persistent network */ int virNetworkUndefine (virNetworkPtr network); /* * Activate persistent network */ int virNetworkCreate (virNetworkPtr network); /* * Network destroy/free */ int virNetworkDestroy (virNetworkPtr network); int virNetworkRef (virNetworkPtr network); int virNetworkFree (virNetworkPtr network); /* * Network information */ const char* virNetworkGetName (virNetworkPtr network); int virNetworkGetUUID (virNetworkPtr network, unsigned char *uuid); int virNetworkGetUUIDString (virNetworkPtr network, char *buf); char * virNetworkGetXMLDesc (virNetworkPtr network, int flags); char * virNetworkGetBridgeName (virNetworkPtr network); int virNetworkGetAutostart (virNetworkPtr network, int *autostart); int virNetworkSetAutostart (virNetworkPtr network, int autostart); /* * Physical host interface configuration API */ /** * virInterface: * * a virInterface is a private structure representing a virtual interface. */ typedef struct _virInterface virInterface; /** * virInterfacePtr: * * a virInterfacePtr is pointer to a virInterface private structure, this is the * type used to reference a virtual interface in the API. */ typedef virInterface *virInterfacePtr; virConnectPtr virInterfaceGetConnect (virInterfacePtr iface); int virConnectNumOfInterfaces (virConnectPtr conn); int virConnectListInterfaces (virConnectPtr conn, char **const names, int maxnames); int virConnectNumOfDefinedInterfaces (virConnectPtr conn); int virConnectListDefinedInterfaces (virConnectPtr conn, char **const names, int maxnames); virInterfacePtr virInterfaceLookupByName (virConnectPtr conn, const char *name); virInterfacePtr virInterfaceLookupByMACString (virConnectPtr conn, const char *mac); const char* virInterfaceGetName (virInterfacePtr iface); const char* virInterfaceGetMACString (virInterfacePtr iface); char * virInterfaceGetXMLDesc (virInterfacePtr iface, unsigned int flags); virInterfacePtr virInterfaceDefineXML (virConnectPtr conn, const char *xmlDesc, unsigned int flags); int virInterfaceUndefine (virInterfacePtr iface); int virInterfaceCreate (virInterfacePtr iface, unsigned int flags); int virInterfaceDestroy (virInterfacePtr iface, unsigned int flags); int virInterfaceRef (virInterfacePtr iface); int virInterfaceFree (virInterfacePtr iface); /** * virStoragePool: * * a virStoragePool is a private structure representing a storage pool */ typedef struct _virStoragePool virStoragePool; /** * virStoragePoolPtr: * * a virStoragePoolPtr is pointer to a virStoragePool private structure, this is the * type used to reference a storage pool in the API. */ typedef virStoragePool *virStoragePoolPtr; typedef enum { VIR_STORAGE_POOL_INACTIVE = 0, /* Not running */ VIR_STORAGE_POOL_BUILDING = 1, /* Initializing pool, not available */ VIR_STORAGE_POOL_RUNNING = 2, /* Running normally */ VIR_STORAGE_POOL_DEGRADED = 3, /* Running degraded */ } virStoragePoolState; typedef enum { VIR_STORAGE_POOL_BUILD_NEW = 0, /* Regular build from scratch */ VIR_STORAGE_POOL_BUILD_REPAIR = 1, /* Repair / reinitialize */ VIR_STORAGE_POOL_BUILD_RESIZE = 2 /* Extend existing pool */ } virStoragePoolBuildFlags; typedef enum { VIR_STORAGE_POOL_DELETE_NORMAL = 0, /* Delete metadata only (fast) */ VIR_STORAGE_POOL_DELETE_ZEROED = 1, /* Clear all data to zeros (slow) */ } virStoragePoolDeleteFlags; typedef struct _virStoragePoolInfo virStoragePoolInfo; struct _virStoragePoolInfo { int state; /* virStoragePoolState flags */ unsigned long long capacity; /* Logical size bytes */ unsigned long long allocation; /* Current allocation bytes */ unsigned long long available; /* Remaining free space bytes */ }; typedef virStoragePoolInfo *virStoragePoolInfoPtr; /** * virStorageVol: * * a virStorageVol is a private structure representing a storage volume */ typedef struct _virStorageVol virStorageVol; /** * virStorageVolPtr: * * a virStorageVolPtr is pointer to a virStorageVol private structure, this is the * type used to reference a storage volume in the API. */ typedef virStorageVol *virStorageVolPtr; typedef enum { VIR_STORAGE_VOL_FILE = 0, /* Regular file based volumes */ VIR_STORAGE_VOL_BLOCK = 1, /* Block based volumes */ } virStorageVolType; typedef enum { VIR_STORAGE_VOL_DELETE_NORMAL = 0, /* Delete metadata only (fast) */ VIR_STORAGE_VOL_DELETE_ZEROED = 1, /* Clear all data to zeros (slow) */ } virStorageVolDeleteFlags; typedef struct _virStorageVolInfo virStorageVolInfo; struct _virStorageVolInfo { int type; /* virStorageVolType flags */ unsigned long long capacity; /* Logical size bytes */ unsigned long long allocation; /* Current allocation bytes */ }; typedef virStorageVolInfo *virStorageVolInfoPtr; /* * Get connection from pool. */ virConnectPtr virStoragePoolGetConnect (virStoragePoolPtr pool); /* * List active storage pools */ int virConnectNumOfStoragePools (virConnectPtr conn); int virConnectListStoragePools (virConnectPtr conn, char **const names, int maxnames); /* * List inactive storage pools */ int virConnectNumOfDefinedStoragePools(virConnectPtr conn); int virConnectListDefinedStoragePools(virConnectPtr conn, char **const names, int maxnames); /* * Query a host for storage pools of a particular type */ char * virConnectFindStoragePoolSources(virConnectPtr conn, const char *type, const char *srcSpec, unsigned int flags); /* * Lookup pool by name or uuid */ virStoragePoolPtr virStoragePoolLookupByName (virConnectPtr conn, const char *name); virStoragePoolPtr virStoragePoolLookupByUUID (virConnectPtr conn, const unsigned char *uuid); virStoragePoolPtr virStoragePoolLookupByUUIDString(virConnectPtr conn, const char *uuid); virStoragePoolPtr virStoragePoolLookupByVolume (virStorageVolPtr vol); /* * Creating/destroying pools */ virStoragePoolPtr virStoragePoolCreateXML (virConnectPtr conn, const char *xmlDesc, unsigned int flags); virStoragePoolPtr virStoragePoolDefineXML (virConnectPtr conn, const char *xmlDesc, unsigned int flags); int virStoragePoolBuild (virStoragePoolPtr pool, unsigned int flags); int virStoragePoolUndefine (virStoragePoolPtr pool); int virStoragePoolCreate (virStoragePoolPtr pool, unsigned int flags); int virStoragePoolDestroy (virStoragePoolPtr pool); int virStoragePoolDelete (virStoragePoolPtr pool, unsigned int flags); int virStoragePoolRef (virStoragePoolPtr pool); int virStoragePoolFree (virStoragePoolPtr pool); int virStoragePoolRefresh (virStoragePoolPtr pool, unsigned int flags); /* * StoragePool information */ const char* virStoragePoolGetName (virStoragePoolPtr pool); int virStoragePoolGetUUID (virStoragePoolPtr pool, unsigned char *uuid); int virStoragePoolGetUUIDString (virStoragePoolPtr pool, char *buf); int virStoragePoolGetInfo (virStoragePoolPtr vol, virStoragePoolInfoPtr info); char * virStoragePoolGetXMLDesc (virStoragePoolPtr pool, unsigned int flags); int virStoragePoolGetAutostart (virStoragePoolPtr pool, int *autostart); int virStoragePoolSetAutostart (virStoragePoolPtr pool, int autostart); /* * List/lookup storage volumes within a pool */ int virStoragePoolNumOfVolumes (virStoragePoolPtr pool); int virStoragePoolListVolumes (virStoragePoolPtr pool, char **const names, int maxnames); virConnectPtr virStorageVolGetConnect (virStorageVolPtr vol); /* * Lookup volumes based on various attributes */ virStorageVolPtr virStorageVolLookupByName (virStoragePoolPtr pool, const char *name); virStorageVolPtr virStorageVolLookupByKey (virConnectPtr conn, const char *key); virStorageVolPtr virStorageVolLookupByPath (virConnectPtr conn, const char *path); const char* virStorageVolGetName (virStorageVolPtr vol); const char* virStorageVolGetKey (virStorageVolPtr vol); virStorageVolPtr virStorageVolCreateXML (virStoragePoolPtr pool, const char *xmldesc, unsigned int flags); virStorageVolPtr virStorageVolCreateXMLFrom (virStoragePoolPtr pool, const char *xmldesc, virStorageVolPtr clonevol, unsigned int flags); int virStorageVolDelete (virStorageVolPtr vol, unsigned int flags); int virStorageVolRef (virStorageVolPtr vol); int virStorageVolFree (virStorageVolPtr vol); int virStorageVolGetInfo (virStorageVolPtr vol, virStorageVolInfoPtr info); char * virStorageVolGetXMLDesc (virStorageVolPtr pool, unsigned int flags); char * virStorageVolGetPath (virStorageVolPtr vol); /* * Deprecated calls */ virDomainPtr virDomainCreateLinux (virConnectPtr conn, const char *xmlDesc, unsigned int flags); /* * Host device enumeration */ /** * virNodeDevice: * * A virNodeDevice contains a node (host) device details. */ typedef struct _virNodeDevice virNodeDevice; /** * virNodeDevicePtr: * * A virNodeDevicePtr is a pointer to a virNodeDevice structure. Get * one via virNodeDeviceLookupByKey, virNodeDeviceLookupByName, or * virNodeDeviceCreate. Be sure to Call virNodeDeviceFree when done * using a virNodeDevicePtr obtained from any of the above functions to * avoid leaking memory. */ typedef virNodeDevice *virNodeDevicePtr; int virNodeNumOfDevices (virConnectPtr conn, const char *cap, unsigned int flags); int virNodeListDevices (virConnectPtr conn, const char *cap, char **const names, int maxnames, unsigned int flags); virNodeDevicePtr virNodeDeviceLookupByName (virConnectPtr conn, const char *name); const char * virNodeDeviceGetName (virNodeDevicePtr dev); const char * virNodeDeviceGetParent (virNodeDevicePtr dev); int virNodeDeviceNumOfCaps (virNodeDevicePtr dev); int virNodeDeviceListCaps (virNodeDevicePtr dev, char **const names, int maxnames); char * virNodeDeviceGetXMLDesc (virNodeDevicePtr dev, unsigned int flags); int virNodeDeviceRef (virNodeDevicePtr dev); int virNodeDeviceFree (virNodeDevicePtr dev); int virNodeDeviceDettach (virNodeDevicePtr dev); int virNodeDeviceReAttach (virNodeDevicePtr dev); int virNodeDeviceReset (virNodeDevicePtr dev); virNodeDevicePtr virNodeDeviceCreateXML (virConnectPtr conn, const char *xmlDesc, unsigned int flags); int virNodeDeviceDestroy (virNodeDevicePtr dev); /* * Domain Event Notification */ /** * virDomainEventType: * * a virDomainEventType is emitted during domain lifecycle events */ typedef enum { VIR_DOMAIN_EVENT_DEFINED = 0, VIR_DOMAIN_EVENT_UNDEFINED = 1, VIR_DOMAIN_EVENT_STARTED = 2, VIR_DOMAIN_EVENT_SUSPENDED = 3, VIR_DOMAIN_EVENT_RESUMED = 4, VIR_DOMAIN_EVENT_STOPPED = 5, } virDomainEventType; /** * virDomainEventDefinedDetailType: * * Details on the caused of the 'defined' lifecycle event */ typedef enum { VIR_DOMAIN_EVENT_DEFINED_ADDED = 0, /* Newly created config file */ VIR_DOMAIN_EVENT_DEFINED_UPDATED = 1, /* Changed config file */ } virDomainEventDefinedDetailType; /** * virDomainEventUndefinedDetailType: * * Details on the caused of the 'undefined' lifecycle event */ typedef enum { VIR_DOMAIN_EVENT_UNDEFINED_REMOVED = 0, /* Deleted the config file */ } virDomainEventUndefinedDetailType; /** * virDomainEventStartedDetailType: * * Details on the caused of the 'started' lifecycle event */ typedef enum { VIR_DOMAIN_EVENT_STARTED_BOOTED = 0, /* Normal startup from boot */ VIR_DOMAIN_EVENT_STARTED_MIGRATED = 1, /* Incoming migration from another host */ VIR_DOMAIN_EVENT_STARTED_RESTORED = 2, /* Restored from a state file */ } virDomainEventStartedDetailType; /** * virDomainEventSuspendedDetailType: * * Details on the caused of the 'suspended' lifecycle event */ typedef enum { VIR_DOMAIN_EVENT_SUSPENDED_PAUSED = 0, /* Normal suspend due to admin pause */ VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED = 1, /* Suspended for offline migration */ } virDomainEventSuspendedDetailType; /** * virDomainEventResumedDetailType: * * Details on the caused of the 'resumed' lifecycle event */ typedef enum { VIR_DOMAIN_EVENT_RESUMED_UNPAUSED = 0, /* Normal resume due to admin unpause */ VIR_DOMAIN_EVENT_RESUMED_MIGRATED = 1, /* Resumed for completion of migration */ } virDomainEventResumedDetailType; /** * virDomainEventStoppedDetailType: * * Details on the caused of the 'stopped' lifecycle event */ typedef enum { VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN = 0, /* Normal shutdown */ VIR_DOMAIN_EVENT_STOPPED_DESTROYED = 1, /* Forced poweroff from host */ VIR_DOMAIN_EVENT_STOPPED_CRASHED = 2, /* Guest crashed */ VIR_DOMAIN_EVENT_STOPPED_MIGRATED = 3, /* Migrated off to another host */ VIR_DOMAIN_EVENT_STOPPED_SAVED = 4, /* Saved to a state file */ VIR_DOMAIN_EVENT_STOPPED_FAILED = 5, /* Host emulator/mgmt failed */ } virDomainEventStoppedDetailType; /** * virConnectDomainEventCallback: * @conn: virConnect connection * @dom: The domain on which the event occured * @event: The specfic virDomainEventType which occured * @detail: event specific detail information * @opaque: opaque user data * * A callback function to be registered, and called when a domain event occurs */ typedef int (*virConnectDomainEventCallback)(virConnectPtr conn, virDomainPtr dom, int event, int detail, void *opaque); typedef void (*virFreeCallback)(void *opaque); int virConnectDomainEventRegister(virConnectPtr conn, virConnectDomainEventCallback cb, void *opaque, virFreeCallback freecb); int virConnectDomainEventDeregister(virConnectPtr conn, virConnectDomainEventCallback cb); /* * Events Implementation */ /** * virEventHandleType: * * a virEventHandleType is used similar to POLLxxx FD events, but is specific * to libvirt. A client app must translate to, and from POLL events when using * this construct. */ typedef enum { VIR_EVENT_HANDLE_READABLE = (1 << 0), VIR_EVENT_HANDLE_WRITABLE = (1 << 1), VIR_EVENT_HANDLE_ERROR = (1 << 2), VIR_EVENT_HANDLE_HANGUP = (1 << 3), } virEventHandleType; /** * virEventHandleCallback: * * @watch: watch on which the event occurred * @fd: file handle on which the event occurred * @events: bitset of events from virEventHandleType constants * @opaque: user data registered with handle * * Callback for receiving file handle events. The callback will * be invoked once for each event which is pending. */ typedef void (*virEventHandleCallback)(int watch, int fd, int events, void *opaque); /** * virEventAddHandleFunc: * @fd: file descriptor to listen on * @event: bitset of events on which to fire the callback * @cb: the callback to be called when an event occurrs * @opaque: user data to pass to the callback * @ff: the callback invoked to free opaque data blob * * Part of the EventImpl, this callback Adds a file handle callback to * listen for specific events. The same file handle can be registered * multiple times provided the requested event sets are non-overlapping * * If the opaque user data requires free'ing when the handle * is unregistered, then a 2nd callback can be supplied for * this purpose. * * Returns a handle watch number to be used for updating * and unregistering for events */ typedef int (*virEventAddHandleFunc)(int fd, int event, virEventHandleCallback cb, void *opaque, virFreeCallback ff); /** * virEventUpdateHandleFunc: * @watch: file descriptor watch to modify * @event: new events to listen on * * Part of the EventImpl, this user-provided callback is notified when * events to listen on change */ typedef void (*virEventUpdateHandleFunc)(int watch, int event); /** * virEventRemoveHandleFunc: * @watch: file descriptor watch to stop listening on * * Part of the EventImpl, this user-provided callback is notified when * an fd is no longer being listened on. * * If a virEventHandleFreeFunc was supplied when the handle was * registered, it will be invoked some time during, or after this * function call, when it is safe to release the user data. */ typedef int (*virEventRemoveHandleFunc)(int watch); /** * virEventTimeoutCallback: * * @timer: timer id emitting the event * @opaque: user data registered with handle * * callback for receiving timer events */ typedef void (*virEventTimeoutCallback)(int timer, void *opaque); /** * virEventAddTimeoutFunc: * @timeout: The timeout to monitor * @cb: the callback to call when timeout has expired * @opaque: user data to pass to the callback * @ff: the callback invoked to free opaque data blob * * Part of the EventImpl, this user-defined callback handles adding an * event timeout. * * If the opaque user data requires free'ing when the handle * is unregistered, then a 2nd callback can be supplied for * this purpose. * * Returns a timer value */ typedef int (*virEventAddTimeoutFunc)(int timeout, virEventTimeoutCallback cb, void *opaque, virFreeCallback ff); /** * virEventUpdateTimeoutFunc: * @timer: the timer to modify * @timeout: the new timeout value * * Part of the EventImpl, this user-defined callback updates an * event timeout. */ typedef void (*virEventUpdateTimeoutFunc)(int timer, int timeout); /** * virEventRemoveTimeoutFunc: * @timer: the timer to remove * * Part of the EventImpl, this user-defined callback removes a timer * * If a virEventTimeoutFreeFunc was supplied when the handle was * registered, it will be invoked some time during, or after this * function call, when it is safe to release the user data. * * Returns 0 on success, -1 on failure */ typedef int (*virEventRemoveTimeoutFunc)(int timer); void virEventRegisterImpl(virEventAddHandleFunc addHandle, virEventUpdateHandleFunc updateHandle, virEventRemoveHandleFunc removeHandle, virEventAddTimeoutFunc addTimeout, virEventUpdateTimeoutFunc updateTimeout, virEventRemoveTimeoutFunc removeTimeout); #ifdef __cplusplus } #endif #endif /* __VIR_VIRLIB_H__ */ 0707010002bb4e000081a40000000000000002000000014ae1943900002225000000b600010006ffffffffffffffff0000002600000000reloc/usr/include/libvirt/virterror.h/* * virterror.h: * Summary: error handling interfaces for the libvirt library * Description: Provides the interfaces of the libvirt library to handle * errors raised while using the library. * * Copy: Copyright (C) 2006 Red Hat, Inc. * * See COPYING.LIB for the License of this software * * Author: Daniel Veillard */ #ifndef __VIR_VIRERR_H__ #define __VIR_VIRERR_H__ #include #ifdef __cplusplus extern "C" { #endif /** * virErrorLevel: * * Indicates the level of an error */ typedef enum { VIR_ERR_NONE = 0, VIR_ERR_WARNING = 1, /* A simple warning */ VIR_ERR_ERROR = 2 /* An error */ } virErrorLevel; /** * virErrorDomain: * * Indicates where an error may have come from */ typedef enum { VIR_FROM_NONE = 0, VIR_FROM_XEN, /* Error at Xen hypervisor layer */ VIR_FROM_XEND, /* Error at connection with xend daemon */ VIR_FROM_XENSTORE, /* Error at connection with xen store */ VIR_FROM_SEXPR, /* Error in the S-Expression code */ VIR_FROM_XML, /* Error in the XML code */ VIR_FROM_DOM, /* Error when operating on a domain */ VIR_FROM_RPC, /* Error in the XML-RPC code */ VIR_FROM_PROXY, /* Error in the proxy code */ VIR_FROM_CONF, /* Error in the configuration file handling */ VIR_FROM_QEMU, /* Error at the QEMU daemon */ VIR_FROM_NET, /* Error when operating on a network */ VIR_FROM_TEST, /* Error from test driver */ VIR_FROM_REMOTE, /* Error from remote driver */ VIR_FROM_OPENVZ, /* Error from OpenVZ driver */ VIR_FROM_XENXM, /* Error at Xen XM layer */ VIR_FROM_STATS_LINUX,/* Error in the Linux Stats code */ VIR_FROM_LXC, /* Error from Linux Container driver */ VIR_FROM_STORAGE, /* Error from storage driver */ VIR_FROM_NETWORK, /* Error from network config */ VIR_FROM_DOMAIN, /* Error from domain config */ VIR_FROM_UML, /* Error at the UML driver */ VIR_FROM_NODEDEV, /* Error from node device monitor */ VIR_FROM_XEN_INOTIFY,/* Error from xen inotify layer */ VIR_FROM_SECURITY, /* Error from security framework */ VIR_FROM_VBOX, /* Error from VirtualBox driver */ VIR_FROM_INTERFACE, /* Error when operating on an interface */ VIR_FROM_ONE, /* Error from OpenNebula driver */ VIR_FROM_ESX, /* Error from ESX driver */ VIR_FROM_PHYP, /* Error from IBM power hypervisor */ } virErrorDomain; /** * virError: * * A libvirt Error instance. * * The conn, dom and net fields should be used with extreme care. * Reference counts are not incremented so the underlying objects * may be deleted without notice after the error has been delivered. */ typedef struct _virError virError; typedef virError *virErrorPtr; struct _virError { int code; /* The error code, a virErrorNumber */ int domain; /* What part of the library raised this error */ char *message;/* human-readable informative error message */ virErrorLevel level;/* how consequent is the error */ virConnectPtr conn VIR_DEPRECATED; /* connection if available, deprecated see note above */ virDomainPtr dom VIR_DEPRECATED; /* domain if available, deprecated see note above */ char *str1; /* extra string information */ char *str2; /* extra string information */ char *str3; /* extra string information */ int int1; /* extra number information */ int int2; /* extra number information */ virNetworkPtr net VIR_DEPRECATED; /* network if available, deprecated see note above */ }; /** * virErrorNumber: * * The full list of errors the library can generate */ typedef enum { VIR_ERR_OK = 0, VIR_ERR_INTERNAL_ERROR, /* internal error */ VIR_ERR_NO_MEMORY, /* memory allocation failure */ VIR_ERR_NO_SUPPORT, /* no support for this function */ VIR_ERR_UNKNOWN_HOST,/* could not resolve hostname */ VIR_ERR_NO_CONNECT, /* can't connect to hypervisor */ VIR_ERR_INVALID_CONN,/* invalid connection object */ VIR_ERR_INVALID_DOMAIN,/* invalid domain object */ VIR_ERR_INVALID_ARG,/* invalid function argument */ VIR_ERR_OPERATION_FAILED,/* a command to hypervisor failed */ VIR_ERR_GET_FAILED,/* a HTTP GET command to failed */ VIR_ERR_POST_FAILED,/* a HTTP POST command to failed */ VIR_ERR_HTTP_ERROR,/* unexpected HTTP error code */ VIR_ERR_SEXPR_SERIAL,/* failure to serialize an S-Expr */ VIR_ERR_NO_XEN,/* could not open Xen hypervisor control */ VIR_ERR_XEN_CALL,/* failure doing an hypervisor call */ VIR_ERR_OS_TYPE, /* unknown OS type */ VIR_ERR_NO_KERNEL, /* missing kernel information */ VIR_ERR_NO_ROOT, /* missing root device information */ VIR_ERR_NO_SOURCE, /* missing source device information */ VIR_ERR_NO_TARGET, /* missing target device information */ VIR_ERR_NO_NAME, /* missing domain name information */ VIR_ERR_NO_OS, /* missing domain OS information */ VIR_ERR_NO_DEVICE, /* missing domain devices information */ VIR_ERR_NO_XENSTORE,/* could not open Xen Store control */ VIR_ERR_DRIVER_FULL, /* too many drivers registered */ VIR_ERR_CALL_FAILED, /* not supported by the drivers (DEPRECATED) */ VIR_ERR_XML_ERROR, /* an XML description is not well formed or broken */ VIR_ERR_DOM_EXIST,/* the domain already exist */ VIR_ERR_OPERATION_DENIED, /* operation forbidden on read-only connections */ VIR_ERR_OPEN_FAILED, /* failed to open a conf file */ VIR_ERR_READ_FAILED, /* failed to read a conf file */ VIR_ERR_PARSE_FAILED, /* failed to parse a conf file */ VIR_ERR_CONF_SYNTAX, /* failed to parse the syntax of a conf file */ VIR_ERR_WRITE_FAILED, /* failed to write a conf file */ VIR_ERR_XML_DETAIL, /* detail of an XML error */ VIR_ERR_INVALID_NETWORK, /* invalid network object */ VIR_ERR_NETWORK_EXIST, /* the network already exist */ VIR_ERR_SYSTEM_ERROR, /* general system call failure */ VIR_ERR_RPC, /* some sort of RPC error */ VIR_ERR_GNUTLS_ERROR, /* error from a GNUTLS call */ VIR_WAR_NO_NETWORK, /* failed to start network */ VIR_ERR_NO_DOMAIN, /* domain not found or unexpectedly disappeared */ VIR_ERR_NO_NETWORK, /* network not found */ VIR_ERR_INVALID_MAC, /* invalid MAC address */ VIR_ERR_AUTH_FAILED, /* authentication failed */ VIR_ERR_INVALID_STORAGE_POOL, /* invalid storage pool object */ VIR_ERR_INVALID_STORAGE_VOL, /* invalid storage vol object */ VIR_WAR_NO_STORAGE, /* failed to start storage */ VIR_ERR_NO_STORAGE_POOL, /* storage pool not found */ VIR_ERR_NO_STORAGE_VOL, /* storage pool not found */ VIR_WAR_NO_NODE, /* failed to start node driver */ VIR_ERR_INVALID_NODE_DEVICE,/* invalid node device object */ VIR_ERR_NO_NODE_DEVICE,/* node device not found */ VIR_ERR_NO_SECURITY_MODEL, /* security model not found */ VIR_ERR_OPERATION_INVALID, /* operation is not applicable at this time */ VIR_WAR_NO_INTERFACE, /* failed to start interface driver */ VIR_ERR_NO_INTERFACE, /* interface driver not running */ VIR_ERR_INVALID_INTERFACE, /* invalid interface object */ VIR_ERR_MULTIPLE_INTERFACES, /* more than one matching interface found */ } virErrorNumber; /** * virErrorFunc: * @userData: user provided data for the error callback * @error: the error being raised. * * Signature of a function to use when there is an error raised by the library. */ typedef void (*virErrorFunc) (void *userData, virErrorPtr error); /* * Errors can be handled as asynchronous callbacks or after the routine * failed. They can also be handled globally at the library level, or * at the connection level (which then has priority). */ virErrorPtr virGetLastError (void); virErrorPtr virSaveLastError (void); void virResetLastError (void); void virResetError (virErrorPtr err); void virFreeError (virErrorPtr err); virErrorPtr virConnGetLastError (virConnectPtr conn); void virConnResetLastError (virConnectPtr conn); int virCopyLastError (virErrorPtr to); void virDefaultErrorFunc (virErrorPtr err); void virSetErrorFunc (void *userData, virErrorFunc handler); void virConnSetErrorFunc (virConnectPtr conn, void *userData, virErrorFunc handler); int virConnCopyLastError (virConnectPtr conn, virErrorPtr to); #ifdef __cplusplus } #endif #endif /* __VIR_VIRERR_H__ */ 0707010002bb62000041ed0000000000000000000000054ae194b300000000000000b600010006ffffffffffffffff0000001000000000reloc/usr/share0707010002bb75000041ed0000000000000000000000034ae194b300000000000000b600010006ffffffffffffffff0000001800000000reloc/usr/share/gtk-doc0707010002bb76000041ed0000000000000000000000034ae194b300000000000000b600010006ffffffffffffffff0000001d00000000reloc/usr/share/gtk-doc/html0707010002bb77000041ed0000000000000000000000024ae194b300000000000000b600010006ffffffffffffffff0000002500000000reloc/usr/share/gtk-doc/html/libvirt0707010002bb7c000081a40000000000000002000000014ae1948e0003c849000000b600010006ffffffffffffffff0000003a00000000reloc/usr/share/gtk-doc/html/libvirt/libvirt-libvirt.html libvirt: core interfaces for the libvirt library

libvirt

libvirt - core interfaces for the libvirt library

Provides the interfaces of the libvirt library to handle virtualized domains

Author(s): Daniel Veillard <veillard@redhat.com>

Synopsis

#define VIR_NODEINFO_MAXCPUS(nodeinfo);
#define LIBVIR_VERSION_NUMBER;
#define VIR_USE_CPU(cpumap, cpu);
#define VIR_SECURITY_DOI_BUFLEN;
#define VIR_CPU_MAPLEN(cpu);
#define VIR_SECURITY_LABEL_BUFLEN;
#define VIR_CPU_USABLE(cpumaps, maplen, vcpu, cpu);
#define VIR_COPY_CPUMAP(cpumaps, maplen, vcpu, cpumap);
#define VIR_DOMAIN_SCHED_FIELD_LENGTH;
#define VIR_SECURITY_MODEL_BUFLEN;
#define VIR_UUID_STRING_BUFLEN;
#define VIR_GET_CPUMAP(cpumaps, maplen, vcpu);
#define VIR_UUID_BUFLEN;
#define VIR_UNUSE_CPU(cpumap, cpu);
typedef struct _virDomainBlockStats virDomainBlockStatsStruct;
typedef enum virDomainMigrateFlags;
typedef struct _virNodeInfo virNodeInfo;
typedef struct _virNetwork virNetwork;
typedef enum virDomainEventResumedDetailType;
typedef virDomainBlockStatsStruct * virDomainBlockStatsPtr;
typedef struct _virConnect virConnect;
typedef enum virDomainEventStartedDetailType;
typedef struct _virDomainInfo virDomainInfo;
typedef enum virStoragePoolDeleteFlags;
typedef enum virEventHandleType;
typedef struct _virStoragePool virStoragePool;
typedef enum virDomainEventType;
typedef struct _virDomainInterfaceStats virDomainInterfaceStatsStruct;
typedef struct _virStoragePoolInfo virStoragePoolInfo;
typedef enum virDomainState;
typedef struct _virDomain virDomain;
typedef virDomainInterfaceStatsStruct * virDomainInterfaceStatsPtr;
typedef virConnectAuth * virConnectAuthPtr;
typedef struct _virStorageVolInfo virStorageVolInfo;
typedef enum virSchedParameterType;
typedef struct _virSecurityLabel virSecurityLabel;
typedef virStorageVolInfo * virStorageVolInfoPtr;
typedef virConnectCredential * virConnectCredentialPtr;
typedef virStoragePool * virStoragePoolPtr;
typedef virNodeInfo * virNodeInfoPtr;
typedef virNetwork * virNetworkPtr;
typedef virDomainInfo * virDomainInfoPtr;
typedef struct _virNodeDevice virNodeDevice;
typedef virConnect * virConnectPtr;
typedef struct _virStorageVol virStorageVol;
typedef virNodeDevice * virNodeDevicePtr;
typedef struct _virInterface virInterface;
typedef struct _virSchedParameter virSchedParameter;
typedef enum virConnectFlags;
typedef enum virDomainEventDefinedDetailType;
typedef virInterface * virInterfacePtr;
typedef enum virDomainMemoryFlags;
typedef enum virDomainEventStoppedDetailType;
typedef virStorageVol * virStorageVolPtr;
typedef enum virVcpuState;
typedef enum virStorageVolDeleteFlags;
typedef struct _virVcpuInfo virVcpuInfo;
typedef virSchedParameter * virSchedParameterPtr;
typedef struct _virConnectAuth virConnectAuth;
typedef struct _virConnectCredential virConnectCredential;
typedef virSecurityModel * virSecurityModelPtr;
typedef enum virDomainEventSuspendedDetailType;
typedef virVcpuInfo * virVcpuInfoPtr;
typedef enum virStoragePoolBuildFlags;
typedef enum virDomainXMLFlags;
typedef enum virStorageVolType;
typedef enum virDomainEventUndefinedDetailType;
typedef virDomain * virDomainPtr;
typedef enum virConnectCredentialType;
typedef enum virStoragePoolState;
typedef virStoragePoolInfo * virStoragePoolInfoPtr;
typedef enum virDomainCreateFlags;
typedef virSecurityLabel * virSecurityLabelPtr;
typedef struct _virSecurityModel virSecurityModel;
char *	virStoragePoolGetXMLDesc	(virStoragePoolPtr pool, 
unsigned int flags); const char * virStorageVolGetKey (virStorageVolPtr vol); typedef void virEventUpdateTimeoutFunc (int timer,
int timeout); int virConnectClose (virConnectPtr conn); virDomainPtr virDomainDefineXML (virConnectPtr conn,
const char * xml); int virDomainShutdown (virDomainPtr domain); int virConnectListStoragePools (virConnectPtr conn,
char ** const names,
int maxnames); int virGetVersion (unsigned long * libVer,
const char * type,
unsigned long * typeVer); int virNodeGetCellsFreeMemory (virConnectPtr conn,
unsigned long long * freeMems,
int startCell,
int maxCells); int virInitialize (void); const char * virNodeDeviceGetName (virNodeDevicePtr dev); int virStoragePoolSetAutostart (virStoragePoolPtr pool,
int autostart); char * virConnectDomainXMLFromNative (virConnectPtr conn,
const char * nativeFormat,
const char * nativeConfig,
unsigned int flags); int virNodeDeviceDettach (virNodeDevicePtr dev); int virDomainGetSecurityLabel (virDomainPtr domain,
virSecurityLabelPtr seclabel); int virConnectDomainEventDeregister (virConnectPtr conn,
virConnectDomainEventCallback cb); int virDomainGetSchedulerParameters (virDomainPtr domain,
virSchedParameterPtr params,
int * nparams); virDomainPtr virDomainLookupByUUIDString (virConnectPtr conn,
const char * uuidstr); int virConnectNumOfDefinedNetworks (virConnectPtr conn); int virConnectListDefinedInterfaces (virConnectPtr conn,
char ** const names,
int maxnames); int virNetworkGetUUID (virNetworkPtr network,
unsigned char * uuid); char * virInterfaceGetXMLDesc (virInterfacePtr iface,
unsigned int flags); virConnectPtr virStoragePoolGetConnect (virStoragePoolPtr pool); int virConnectGetVersion (virConnectPtr conn,
unsigned long * hvVer); int virDomainFree (virDomainPtr domain); int virStorageVolRef (virStorageVolPtr vol); const char * virStoragePoolGetName (virStoragePoolPtr pool); int virDomainSetAutostart (virDomainPtr domain,
int autostart); virStoragePoolPtr virStoragePoolDefineXML (virConnectPtr conn,
const char * xml,
unsigned int flags); virStorageVolPtr virStorageVolLookupByPath (virConnectPtr conn,
const char * path); virStorageVolPtr virStorageVolLookupByName (virStoragePoolPtr pool,
const char * name); int virNetworkCreate (virNetworkPtr network); int virDomainSetMaxMemory (virDomainPtr domain,
unsigned long memory); void virEventRegisterImpl (virEventAddHandleFunc addHandle,
virEventUpdateHandleFunc updateHandle,
virEventRemoveHandleFunc removeHandle,
virEventAddTimeoutFunc addTimeout,
virEventUpdateTimeoutFunc updateTimeout,
virEventRemoveTimeoutFunc removeTimeout); virInterfacePtr virInterfaceDefineXML (virConnectPtr conn,
const char * xml,
unsigned int flags); virDomainPtr virDomainMigrate (virDomainPtr domain,
virConnectPtr dconn,
unsigned long flags,
const char * dname,
const char * uri,
unsigned long bandwidth); int virDomainSuspend (virDomainPtr domain); virDomainPtr virDomainCreateLinux (virConnectPtr conn,
const char * xmlDesc,
unsigned int flags); char * virNodeDeviceGetXMLDesc (virNodeDevicePtr dev,
unsigned int flags); typedef void virEventUpdateHandleFunc (int watch,
int event); int virDomainDestroy (virDomainPtr domain); int virConnectNumOfNetworks (virConnectPtr conn); virStoragePoolPtr virStoragePoolLookupByUUIDString (virConnectPtr conn,
const char * uuidstr); int virInterfaceCreate (virInterfacePtr iface,
unsigned int flags); char * virDomainGetXMLDesc (virDomainPtr domain,
int flags); int virStoragePoolGetUUID (virStoragePoolPtr pool,
unsigned char * uuid); int virNodeDeviceFree (virNodeDevicePtr dev); int virStorageVolGetInfo (virStorageVolPtr vol,
virStorageVolInfoPtr info); int virDomainGetInfo (virDomainPtr domain,
virDomainInfoPtr info); virNodeDevicePtr virNodeDeviceCreateXML (virConnectPtr conn,
const char * xmlDesc,
unsigned int flags); int virNetworkDestroy (virNetworkPtr network); virStoragePoolPtr virStoragePoolLookupByName (virConnectPtr conn,
const char * name); virStoragePoolPtr virStoragePoolCreateXML (virConnectPtr conn,
const char * xmlDesc,
unsigned int flags); int virNetworkGetAutostart (virNetworkPtr network,
int * autostart); char * virNetworkGetBridgeName (virNetworkPtr network); char * virStorageVolGetXMLDesc (virStorageVolPtr vol,
unsigned int flags); char * virConnectDomainXMLToNative (virConnectPtr conn,
const char * nativeFormat,
const char * domainXml,
unsigned int flags); int virDomainSetSchedulerParameters (virDomainPtr domain,
virSchedParameterPtr params,
int nparams); const char * virConnectGetType (virConnectPtr conn); virStorageVolPtr virStorageVolCreateXML (virStoragePoolPtr pool,
const char * xmldesc,
unsigned int flags); int virDomainSave (virDomainPtr domain,
const char * to); int virDomainCreate (virDomainPtr domain); int virConnectListDomains (virConnectPtr conn,
int * ids,
int maxids); int virDomainCoreDump (virDomainPtr domain,
const char * to,
int flags); int virDomainSetMemory (virDomainPtr domain,
unsigned long memory); const char * virInterfaceGetName (virInterfacePtr iface); int virStoragePoolCreate (virStoragePoolPtr pool,
unsigned int flags); int virNodeGetInfo (virConnectPtr conn,
virNodeInfoPtr info); int virNetworkSetAutostart (virNetworkPtr network,
int autostart); unsigned long virDomainGetMaxMemory (virDomainPtr domain); int virStoragePoolFree (virStoragePoolPtr pool); int virConnectNumOfDefinedInterfaces (virConnectPtr conn); typedef void virFreeCallback (void * opaque); virNetworkPtr virNetworkDefineXML (virConnectPtr conn,
const char * xml); int virNodeDeviceListCaps (virNodeDevicePtr dev,
char ** const names,
int maxnames); int virDomainBlockStats (virDomainPtr dom,
const char * path,
virDomainBlockStatsPtr stats,
size_t size); virConnectPtr virConnectOpenAuth (const char * name,
virConnectAuthPtr auth,
int flags); int virStoragePoolDelete (virStoragePoolPtr pool,
unsigned int flags); typedef int virEventRemoveHandleFunc (int watch); const char * virStorageVolGetName (virStorageVolPtr vol); int virStoragePoolGetAutostart (virStoragePoolPtr pool,
int * autostart); int virDomainGetAutostart (virDomainPtr domain,
int * autostart); int virStoragePoolListVolumes (virStoragePoolPtr pool,
char ** const names,
int maxnames); char * virConnectGetHostname (virConnectPtr conn); typedef int virEventRemoveTimeoutFunc (int timer); const char * virDomainGetName (virDomainPtr domain); int virStoragePoolRef (virStoragePoolPtr pool); char * virNetworkGetXMLDesc (virNetworkPtr network,
int flags); int virConnectNumOfStoragePools (virConnectPtr conn); virConnectPtr virInterfaceGetConnect (virInterfacePtr iface); const char * virNetworkGetName (virNetworkPtr network); int virConnectListDefinedDomains (virConnectPtr conn,
char ** const names,
int maxnames); char * virConnectGetCapabilities (virConnectPtr conn); virDomainPtr virDomainLookupByName (virConnectPtr conn,
const char * name); char * virConnectFindStoragePoolSources (virConnectPtr conn,
const char * type,
const char * srcSpec,
unsigned int flags); int virDomainPinVcpu (virDomainPtr domain,
unsigned int vcpu,
unsigned char * cpumap,
int maplen); int virNodeGetSecurityModel (virConnectPtr conn,
virSecurityModelPtr secmodel); int virDomainRestore (virConnectPtr conn,
const char * from); int virNodeDeviceDestroy (virNodeDevicePtr dev); char * virStorageVolGetPath (virStorageVolPtr vol); virNetworkPtr virNetworkLookupByUUIDString (virConnectPtr conn,
const char * uuidstr); typedef int virConnectDomainEventCallback (virConnectPtr conn,
virDomainPtr dom,
int event,
int detail,
void * opaque); virDomainPtr virDomainLookupByID (virConnectPtr conn,
int id); int virStorageVolDelete (virStorageVolPtr vol,
unsigned int flags); int virStorageVolFree (virStorageVolPtr vol); int virConnectListInterfaces (virConnectPtr conn,
char ** const names,
int maxnames); int virDomainMemoryPeek (virDomainPtr dom,
unsigned long long start,
size_t size,
void * buffer,
unsigned int flags); virNetworkPtr virNetworkLookupByUUID (virConnectPtr conn,
const unsigned char * uuid); int virConnectListDefinedNetworks (virConnectPtr conn,
char ** const names,
int maxnames); int virConnectRef (virConnectPtr conn); int virDomainGetUUID (virDomainPtr domain,
unsigned char * uuid); virNetworkPtr virNetworkCreateXML (virConnectPtr conn,
const char * xmlDesc); int virNetworkUndefine (virNetworkPtr network); int virConnectDomainEventRegister (virConnectPtr conn,
virConnectDomainEventCallback cb,
void * opaque,
virFreeCallback freecb); int virDomainGetVcpus (virDomainPtr domain,
virVcpuInfoPtr info,
int maxinfo,
unsigned char * cpumaps,
int maplen); virNodeDevicePtr virNodeDeviceLookupByName (virConnectPtr conn,
const char * name); int virStoragePoolGetInfo (virStoragePoolPtr pool,
virStoragePoolInfoPtr info); int virDomainResume (virDomainPtr domain); int virInterfaceRef (virInterfacePtr iface); const char * virInterfaceGetMACString (virInterfacePtr iface); int virConnectNumOfDomains (virConnectPtr conn); int virStoragePoolRefresh (virStoragePoolPtr pool,
unsigned int flags); int virConnectNumOfDefinedDomains (virConnectPtr conn); virStorageVolPtr virStorageVolCreateXMLFrom (virStoragePoolPtr pool,
const char * xmldesc,
virStorageVolPtr clonevol,
unsigned int flags); int virDomainUndefine (virDomainPtr domain); int virDomainReboot (virDomainPtr domain,
unsigned int flags); int virNetworkGetUUIDString (virNetworkPtr network,
char * buf); virNetworkPtr virNetworkLookupByName (virConnectPtr conn,
const char * name); int virDomainGetMaxVcpus (virDomainPtr domain); typedef void virEventHandleCallback (int watch,
int fd,
int events,
void * opaque); char * virDomainGetSchedulerType (virDomainPtr domain,
int * nparams); int virNodeDeviceReset (virNodeDevicePtr dev); int virDomainDetachDevice (virDomainPtr domain,
const char * xml); int virStoragePoolNumOfVolumes (virStoragePoolPtr pool); int virStoragePoolGetUUIDString (virStoragePoolPtr pool,
char * buf); int virNodeDeviceReAttach (virNodeDevicePtr dev); int virStoragePoolUndefine (virStoragePoolPtr pool); typedef int virConnectAuthCallbackPtr (virConnectCredentialPtr cred,
unsigned int ncred,
void * cbdata); int virDomainAttachDevice (virDomainPtr domain,
const char * xml); char * virConnectGetURI (virConnectPtr conn); virConnectPtr virConnectOpenReadOnly (const char * name); int virNetworkFree (virNetworkPtr network); virStoragePoolPtr virStoragePoolLookupByUUID (virConnectPtr conn,
const unsigned char * uuid); typedef int virEventAddHandleFunc (int fd,
int event,
virEventHandleCallback cb,
void * opaque,
virFreeCallback ff); int virNetworkRef (virNetworkPtr network); int virConnectListDefinedStoragePools (virConnectPtr conn,
char ** const names,
int maxnames); typedef void virEventTimeoutCallback (int timer,
void * opaque); int virInterfaceFree (virInterfacePtr iface); int virNodeDeviceNumOfCaps (virNodeDevicePtr dev); virInterfacePtr virInterfaceLookupByMACString (virConnectPtr conn,
const char * macstr); virConnectPtr virNetworkGetConnect (virNetworkPtr net); unsigned long long virNodeGetFreeMemory (virConnectPtr conn); int virInterfaceDestroy (virInterfacePtr iface,
unsigned int flags); virConnectPtr virStorageVolGetConnect (virStorageVolPtr vol); int virNodeNumOfDevices (virConnectPtr conn,
const char * cap,
unsigned int flags); int virStoragePoolDestroy (virStoragePoolPtr pool); virStoragePoolPtr virStoragePoolLookupByVolume (virStorageVolPtr vol); virDomainPtr virDomainLookupByUUID (virConnectPtr conn,
const unsigned char * uuid); char * virDomainGetOSType (virDomainPtr domain); int virStoragePoolBuild (virStoragePoolPtr pool,
unsigned int flags); int virConnectGetMaxVcpus (virConnectPtr conn,
const char * type); int virDomainGetUUIDString (virDomainPtr domain,
char * buf); virConnectPtr virDomainGetConnect (virDomainPtr dom); int virConnectNumOfDefinedStoragePools (virConnectPtr conn); int virNodeListDevices (virConnectPtr conn,
const char * cap,
char ** const names,
int maxnames,
unsigned int flags); const char * virNodeDeviceGetParent (virNodeDevicePtr dev); virConnectPtr virConnectOpen (const char * name); virDomainPtr virDomainCreateXML (virConnectPtr conn,
const char * xmlDesc,
unsigned int flags); int virNodeDeviceRef (virNodeDevicePtr dev); int virInterfaceUndefine (virInterfacePtr iface); int virDomainSetVcpus (virDomainPtr domain,
unsigned int nvcpus); int virDomainRef (virDomainPtr domain); int virConnectNumOfInterfaces (virConnectPtr conn); unsigned int virDomainGetID (virDomainPtr domain); int virDomainBlockPeek (virDomainPtr dom,
const char * path,
unsigned long long offset,
size_t size,
void * buffer,
unsigned int flags); typedef int virEventAddTimeoutFunc (int timeout,
virEventTimeoutCallback cb,
void * opaque,
virFreeCallback ff); virInterfacePtr virInterfaceLookupByName (virConnectPtr conn,
const char * name); int virDomainInterfaceStats (virDomainPtr dom,
const char * path,
virDomainInterfaceStatsPtr stats,
size_t size); int virConnectListNetworks (virConnectPtr conn,
char ** const names,
int maxnames); virStorageVolPtr virStorageVolLookupByKey (virConnectPtr conn,
const char * key);

Description

Details

Macro LIBVIR_VERSION_NUMBER

#define LIBVIR_VERSION_NUMBER;

Macro providing the version of the library as version * 1,000,000 + minor * 1000 + micro


Macro VIR_COPY_CPUMAP

#define VIR_COPY_CPUMAP(cpumaps, maplen, vcpu, cpumap);

This macro is to be used in conjunction with virDomainGetVcpus() and virDomainPinVcpu() APIs. VIR_COPY_CPUMAP macro extract the cpumap of the specified vcpu from cpumaps array and copy it into cpumap to be used later by virDomainPinVcpu() API.

cpumaps:pointer to an array of cpumap (in 8-bit bytes) (IN)
maplen:the length (in bytes) of one cpumap
vcpu:the virtual CPU number
cpumap:pointer to a cpumap (in 8-bit bytes) (OUT) This cpumap must be previously allocated by the caller (ie: malloc(maplen))

Macro VIR_CPU_MAPLEN

#define VIR_CPU_MAPLEN(cpu);

This macro is to be used in conjunction with virDomainPinVcpu() API. It returns the length (in bytes) required to store the complete CPU map between a single virtual & all physical CPUs of a domain.

cpu:number of physical CPUs

Macro VIR_CPU_USABLE

#define VIR_CPU_USABLE(cpumaps, maplen, vcpu, cpu);

This macro is to be used in conjunction with virDomainGetVcpus() API. VIR_CPU_USABLE macro returns a non zero value (true) if the cpu is usable by the vcpu, and 0 otherwise.

cpumaps:pointer to an array of cpumap (in 8-bit bytes) (IN)
maplen:the length (in bytes) of one cpumap
vcpu:the virtual CPU number
cpu:the physical CPU number

Macro VIR_DOMAIN_SCHED_FIELD_LENGTH

#define VIR_DOMAIN_SCHED_FIELD_LENGTH;

Macro providing the field length of virSchedParameter


Macro VIR_GET_CPUMAP

#define VIR_GET_CPUMAP(cpumaps, maplen, vcpu);

This macro is to be used in conjunction with virDomainGetVcpus() and virDomainPinVcpu() APIs. VIR_GET_CPUMAP macro returns a pointer to the cpumap of the specified vcpu from cpumaps array.

cpumaps:pointer to an array of cpumap (in 8-bit bytes) (IN)
maplen:the length (in bytes) of one cpumap
vcpu:the virtual CPU number

Macro VIR_NODEINFO_MAXCPUS

#define VIR_NODEINFO_MAXCPUS(nodeinfo);

This macro is to calculate the total number of CPUs supported but not necessary active in the host.

nodeinfo:virNodeInfo instance

Macro VIR_SECURITY_DOI_BUFLEN

#define VIR_SECURITY_DOI_BUFLEN;

Macro providing the maximum length of the virSecurityModel doi string.


Macro VIR_SECURITY_LABEL_BUFLEN

#define VIR_SECURITY_LABEL_BUFLEN;

Macro providing the maximum length of the virSecurityLabel label string. Note that this value is based on that used by Labeled NFS.


Macro VIR_SECURITY_MODEL_BUFLEN

#define VIR_SECURITY_MODEL_BUFLEN;

Macro providing the maximum length of the virSecurityModel model string.


Macro VIR_UNUSE_CPU

#define VIR_UNUSE_CPU(cpumap, cpu);

This macro is to be used in conjunction with virDomainPinVcpu() API. USE_CPU macro reset the bit (CPU not usable) of the related cpu in cpumap.

cpumap:pointer to a bit map of real CPUs (in 8-bit bytes) (IN/OUT)
cpu:the physical CPU number

Macro VIR_USE_CPU

#define VIR_USE_CPU(cpumap, cpu);

This macro is to be used in conjunction with virDomainPinVcpu() API. USE_CPU macro set the bit (CPU usable) of the related cpu in cpumap.

cpumap:pointer to a bit map of real CPUs (in 8-bit bytes) (IN/OUT)
cpu:the physical CPU number

Macro VIR_UUID_BUFLEN

#define VIR_UUID_BUFLEN;

This macro provides the length of the buffer required for virDomainGetUUID()


Macro VIR_UUID_STRING_BUFLEN

#define VIR_UUID_STRING_BUFLEN;

This macro provides the length of the buffer required for virDomainGetUUIDString()


Structure virConnect

struct _virConnect {
The content of this structure is not made public by the API.
} virConnect;


Structure virConnectAuth

struct _virConnectAuth {
    int *	credtype	: List of supported virConnectCredentialType values
    unsigned int	ncredtype
    virConnectAuthCallbackPtr	cb	: Callback used to collect credentials
    void *	cbdata
} virConnectAuth;


Typedef virConnectAuthPtr

virConnectAuth * virConnectAuthPtr;


Structure virConnectCredential

struct _virConnectCredential {
    int	type	: One of virConnectCredentialType constants
    const char *	prompt	: Prompt to show to user
    const char *	challenge	: Additional challenge to show
    const char *	defresult	: Optional default result
    char *	result	: Result to be filled with user response (or defresult)
    unsigned int	resultlen	: Length of the result
} virConnectCredential;


Typedef virConnectCredentialPtr

virConnectCredential * virConnectCredentialPtr;


Enum virConnectCredentialType

enum virConnectCredentialType {
    VIR_CRED_USERNAME = 1 /* Identity to act as */
    VIR_CRED_AUTHNAME = 2 /* Identify to authorize as */
    VIR_CRED_LANGUAGE = 3 /* RFC 1766 languages, comma separated */
    VIR_CRED_CNONCE = 4 /* client supplies a nonce */
    VIR_CRED_PASSPHRASE = 5 /* Passphrase secret */
    VIR_CRED_ECHOPROMPT = 6 /* Challenge response */
    VIR_CRED_NOECHOPROMPT = 7 /* Challenge response */
    VIR_CRED_REALM = 8 /* Authentication realm */
    VIR_CRED_EXTERNAL = 9 /*  Externally managed credential More may be added - expect the unexpected */
};


Enum virConnectFlags

enum virConnectFlags {
    VIR_CONNECT_RO = 1 /*  A readonly connection */
};


Typedef virConnectPtr

virConnect * virConnectPtr;

a virConnectPtr is pointer to a virConnect private structure, this is the type used to reference a connection to the Hypervisor in the API.


Structure virDomain

struct _virDomain {
The content of this structure is not made public by the API.
} virDomain;


Typedef virDomainBlockStatsPtr

virDomainBlockStatsStruct * virDomainBlockStatsPtr;

A pointer to a virDomainBlockStats structure


Structure virDomainBlockStatsStruct

struct _virDomainBlockStats {
    long long	rd_req	: number of read requests
    long long	rd_bytes	: number of read bytes
    long long	wr_req	: number of write requests
    long long	wr_bytes	: number of written bytes
    long long	errs	: In Xen this returns the mysterious 'oo_req'.
} virDomainBlockStatsStruct;


Enum virDomainCreateFlags

enum virDomainCreateFlags {
    VIR_DOMAIN_NONE = 0
};


Enum virDomainEventDefinedDetailType

enum virDomainEventDefinedDetailType {
    VIR_DOMAIN_EVENT_DEFINED_ADDED = 0 /* Newly created config file */
    VIR_DOMAIN_EVENT_DEFINED_UPDATED = 1 /*  Changed config file */
};


Enum virDomainEventResumedDetailType

enum virDomainEventResumedDetailType {
    VIR_DOMAIN_EVENT_RESUMED_UNPAUSED = 0 /* Normal resume due to admin unpause */
    VIR_DOMAIN_EVENT_RESUMED_MIGRATED = 1 /*  Resumed for completion of migration */
};


Enum virDomainEventStartedDetailType

enum virDomainEventStartedDetailType {
    VIR_DOMAIN_EVENT_STARTED_BOOTED = 0 /* Normal startup from boot */
    VIR_DOMAIN_EVENT_STARTED_MIGRATED = 1 /* Incoming migration from another host */
    VIR_DOMAIN_EVENT_STARTED_RESTORED = 2 /*  Restored from a state file */
};


Enum virDomainEventStoppedDetailType

enum virDomainEventStoppedDetailType {
    VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN = 0 /* Normal shutdown */
    VIR_DOMAIN_EVENT_STOPPED_DESTROYED = 1 /* Forced poweroff from host */
    VIR_DOMAIN_EVENT_STOPPED_CRASHED = 2 /* Guest crashed */
    VIR_DOMAIN_EVENT_STOPPED_MIGRATED = 3 /* Migrated off to another host */
    VIR_DOMAIN_EVENT_STOPPED_SAVED = 4 /* Saved to a state file */
    VIR_DOMAIN_EVENT_STOPPED_FAILED = 5 /*  Host emulator/mgmt failed */
};


Enum virDomainEventSuspendedDetailType

enum virDomainEventSuspendedDetailType {
    VIR_DOMAIN_EVENT_SUSPENDED_PAUSED = 0 /* Normal suspend due to admin pause */
    VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED = 1 /*  Suspended for offline migration */
};



Enum virDomainEventUndefinedDetailType

enum virDomainEventUndefinedDetailType {
    VIR_DOMAIN_EVENT_UNDEFINED_REMOVED = 0 /*  Deleted the config file */
};


Structure virDomainInfo

struct _virDomainInfo {
    unsigned char	state	: the running state, one of virDomainState
    unsigned long	maxMem	: the maximum memory in KBytes allowed
    unsigned long	memory	: the memory in KBytes used by the domain
    unsigned short	nrVirtCpu	: the number of virtual CPUs for the domain
    unsigned long long	cpuTime	: the CPU time used in nanoseconds
} virDomainInfo;


Typedef virDomainInfoPtr

virDomainInfo * virDomainInfoPtr;

a virDomainInfoPtr is a pointer to a virDomainInfo structure.


Typedef virDomainInterfaceStatsPtr

virDomainInterfaceStatsStruct * virDomainInterfaceStatsPtr;

A pointer to a virDomainInterfaceStats structure


Structure virDomainInterfaceStatsStruct

struct _virDomainInterfaceStats {
    long long	rx_bytes
    long long	rx_packets
    long long	rx_errs
    long long	rx_drop
    long long	tx_bytes
    long long	tx_packets
    long long	tx_errs
    long long	tx_drop
} virDomainInterfaceStatsStruct;


Enum virDomainMemoryFlags

enum virDomainMemoryFlags {
    VIR_MEMORY_VIRTUAL = 1 /* addresses are virtual addresses */
    VIR_MEMORY_PHYSICAL = 2 /*  addresses are physical addresses */
};


Enum virDomainMigrateFlags

enum virDomainMigrateFlags {
    VIR_MIGRATE_LIVE = 1 /*  live migration */
};


Typedef virDomainPtr

virDomain * virDomainPtr;

a virDomainPtr is pointer to a virDomain private structure, this is the type used to reference a domain in the API.


Enum virDomainState

enum virDomainState {
    VIR_DOMAIN_NOSTATE = 0 /* no state */
    VIR_DOMAIN_RUNNING = 1 /* the domain is running */
    VIR_DOMAIN_BLOCKED = 2 /* the domain is blocked on resource */
    VIR_DOMAIN_PAUSED = 3 /* the domain is paused by user */
    VIR_DOMAIN_SHUTDOWN = 4 /* the domain is being shut down */
    VIR_DOMAIN_SHUTOFF = 5 /* the domain is shut off */
    VIR_DOMAIN_CRASHED = 6 /*  the domain is crashed */
};


Enum virDomainXMLFlags

enum virDomainXMLFlags {
    VIR_DOMAIN_XML_SECURE = 1 /* dump security sensitive information too */
    VIR_DOMAIN_XML_INACTIVE = 2 /*  dump inactive domain information */
};



Structure virInterface

struct _virInterface {
The content of this structure is not made public by the API.
} virInterface;


Typedef virInterfacePtr

virInterface * virInterfacePtr;

a virInterfacePtr is pointer to a virInterface private structure, this is the type used to reference a virtual interface in the API.


Structure virNetwork

struct _virNetwork {
The content of this structure is not made public by the API.
} virNetwork;


Typedef virNetworkPtr

virNetwork * virNetworkPtr;

a virNetworkPtr is pointer to a virNetwork private structure, this is the type used to reference a virtual network in the API.


Structure virNodeDevice

struct _virNodeDevice {
The content of this structure is not made public by the API.
} virNodeDevice;


Typedef virNodeDevicePtr

virNodeDevice * virNodeDevicePtr;

A virNodeDevicePtr is a pointer to a virNodeDevice structure. Get one via virNodeDeviceLookupByKey, virNodeDeviceLookupByName, or virNodeDeviceCreate. Be sure to Call virNodeDeviceFree when done using a virNodeDevicePtr obtained from any of the above functions to avoid leaking memory.


Structure virNodeInfo

struct _virNodeInfo {
    charmodel[32]	model	: string indicating the CPU model
    unsigned long	memory	: memory size in kilobytes
    unsigned int	cpus	: the number of active CPUs
    unsigned int	mhz	: expected CPU frequency
    unsigned int	nodes	: the number of NUMA cell, 1 for uniform mem access
    unsigned int	sockets	: number of CPU socket per node
    unsigned int	cores	: number of core per socket
    unsigned int	threads	: number of threads per core
} virNodeInfo;


Typedef virNodeInfoPtr

virNodeInfo * virNodeInfoPtr;

a virNodeInfoPtr is a pointer to a virNodeInfo structure.


Structure virSchedParameter

struct _virSchedParameter {
    charfield[VIR_DOMAIN_SCHED_FIELD_LENGTH]	field	: parameter name
    int	type	: parameter type
} virSchedParameter;


Typedef virSchedParameterPtr

virSchedParameter * virSchedParameterPtr;

a virSchedParameterPtr is a pointer to a virSchedParameter structure.


Enum virSchedParameterType

enum virSchedParameterType {
    VIR_DOMAIN_SCHED_FIELD_INT = 1 /* integer case */
    VIR_DOMAIN_SCHED_FIELD_UINT = 2 /* unsigned integer case */
    VIR_DOMAIN_SCHED_FIELD_LLONG = 3 /* long long case */
    VIR_DOMAIN_SCHED_FIELD_ULLONG = 4 /* unsigned long long case */
    VIR_DOMAIN_SCHED_FIELD_DOUBLE = 5 /* double case */
    VIR_DOMAIN_SCHED_FIELD_BOOLEAN = 6 /*  boolean(character) case */
};


Structure virSecurityLabel

struct _virSecurityLabel {
The content of this structure is not made public by the API.
} virSecurityLabel;


Typedef virSecurityLabelPtr

virSecurityLabel * virSecurityLabelPtr;

a virSecurityLabelPtr is a pointer to a virSecurityLabel.


Structure virSecurityModel

struct _virSecurityModel {
The content of this structure is not made public by the API.
} virSecurityModel;


Typedef virSecurityModelPtr

virSecurityModel * virSecurityModelPtr;

a virSecurityModelPtr is a pointer to a virSecurityModel.


Structure virStoragePool

struct _virStoragePool {
The content of this structure is not made public by the API.
} virStoragePool;


Enum virStoragePoolBuildFlags

enum virStoragePoolBuildFlags {
    VIR_STORAGE_POOL_BUILD_NEW = 0 /* Regular build from scratch */
    VIR_STORAGE_POOL_BUILD_REPAIR = 1 /* Repair / reinitialize */
    VIR_STORAGE_POOL_BUILD_RESIZE = 2 /*  Extend existing pool */
};


Enum virStoragePoolDeleteFlags

enum virStoragePoolDeleteFlags {
    VIR_STORAGE_POOL_DELETE_NORMAL = 0 /* Delete metadata only    (fast) */
    VIR_STORAGE_POOL_DELETE_ZEROED = 1 /*  Clear all data to zeros (slow) */
};


Structure virStoragePoolInfo

struct _virStoragePoolInfo {
    int	state	: virStoragePoolState flags
    unsigned long long	capacity	: Logical size bytes
    unsigned long long	allocation	: Current allocation bytes
    unsigned long long	available	: Remaining free space bytes
} virStoragePoolInfo;


Typedef virStoragePoolInfoPtr

virStoragePoolInfo * virStoragePoolInfoPtr;


Typedef virStoragePoolPtr

virStoragePool * virStoragePoolPtr;

a virStoragePoolPtr is pointer to a virStoragePool private structure, this is the type used to reference a storage pool in the API.


Enum virStoragePoolState

enum virStoragePoolState {
    VIR_STORAGE_POOL_INACTIVE = 0 /* Not running */
    VIR_STORAGE_POOL_BUILDING = 1 /* Initializing pool, not available */
    VIR_STORAGE_POOL_RUNNING = 2 /* Running normally */
    VIR_STORAGE_POOL_DEGRADED = 3 /*  Running degraded */
};


Structure virStorageVol

struct _virStorageVol {
The content of this structure is not made public by the API.
} virStorageVol;


Enum virStorageVolDeleteFlags

enum virStorageVolDeleteFlags {
    VIR_STORAGE_VOL_DELETE_NORMAL = 0 /* Delete metadata only    (fast) */
    VIR_STORAGE_VOL_DELETE_ZEROED = 1 /*  Clear all data to zeros (slow) */
};


Structure virStorageVolInfo

struct _virStorageVolInfo {
    int	type	: virStorageVolType flags
    unsigned long long	capacity	: Logical size bytes
    unsigned long long	allocation	: Current allocation bytes
} virStorageVolInfo;


Typedef virStorageVolInfoPtr

virStorageVolInfo * virStorageVolInfoPtr;


Typedef virStorageVolPtr

virStorageVol * virStorageVolPtr;

a virStorageVolPtr is pointer to a virStorageVol private structure, this is the type used to reference a storage volume in the API.


Enum virStorageVolType

enum virStorageVolType {
    VIR_STORAGE_VOL_FILE = 0 /* Regular file based volumes */
    VIR_STORAGE_VOL_BLOCK = 1 /*  Block based volumes */
};


Structure virVcpuInfo

struct _virVcpuInfo {
    unsigned int	number	: virtual CPU number
    int	state	: value from virVcpuState
    unsigned long long	cpuTime	: CPU time used, in nanoseconds
    int	cpu	: real CPU number, or -1 if offline
} virVcpuInfo;


Typedef virVcpuInfoPtr

virVcpuInfo * virVcpuInfoPtr;


Enum virVcpuState

enum virVcpuState {
    VIR_VCPU_OFFLINE = 0 /* the virtual CPU is offline */
    VIR_VCPU_RUNNING = 1 /* the virtual CPU is running */
    VIR_VCPU_BLOCKED = 2 /*  the virtual CPU is blocked on resource */
};


Function type virConnectAuthCallbackPtr

int	virConnectAuthCallbackPtr	(virConnectCredentialPtr cred, 
unsigned int ncred,
void * cbdata)

cred:
ncred:
cbdata:
Returns:

Function type virConnectDomainEventCallback

int	virConnectDomainEventCallback	(virConnectPtr conn, 
virDomainPtr dom,
int event,
int detail,
void * opaque)

A callback function to be registered, and called when a domain event occurs

conn:virConnect connection
dom:The domain on which the event occured
event:The specfic virDomainEventType which occured
detail:event specific detail information
opaque:opaque user data
Returns:

Function type virEventAddHandleFunc

int	virEventAddHandleFunc		(int fd, 
int event,
virEventHandleCallback cb,
void * opaque,
virFreeCallback ff)

Part of the EventImpl, this callback Adds a file handle callback to listen for specific events. The same file handle can be registered multiple times provided the requested event sets are non-overlapping If the opaque user data requires free'ing when the handle is unregistered, then a 2nd callback can be supplied for this purpose.

fd:file descriptor to listen on
event:bitset of events on which to fire the callback
cb:the callback to be called when an event occurrs
opaque:user data to pass to the callback
ff:the callback invoked to free opaque data blob
Returns:a handle watch number to be used for updating and unregistering for events

Function type virEventAddTimeoutFunc

int	virEventAddTimeoutFunc		(int timeout, 
virEventTimeoutCallback cb,
void * opaque,
virFreeCallback ff)

Part of the EventImpl, this user-defined callback handles adding an event timeout. If the opaque user data requires free'ing when the handle is unregistered, then a 2nd callback can be supplied for this purpose.

timeout:The timeout to monitor
cb:the callback to call when timeout has expired
opaque:user data to pass to the callback
ff:the callback invoked to free opaque data blob
Returns:a timer value








Variable virConnectAuthPtrDefault

virConnectAuthPtr virConnectAuthPtrDefault;


virConnectClose ()

int	virConnectClose			(virConnectPtr conn)

This function closes the connection to the Hypervisor. This should not be called if further interaction with the Hypervisor are needed especially if there is running domain which need further monitoring by the application.

conn:pointer to the hypervisor connection
Returns:0 in case of success or -1 in case of error.

virConnectDomainEventDeregister ()

int	virConnectDomainEventDeregister	(virConnectPtr conn, 
virConnectDomainEventCallback cb)

Removes a Domain Event Callback. De-registering for a domain callback will disable delivery of this event type

conn:pointer to the connection
cb:callback to the function handling domain events
Returns:0 on success, -1 on failure

virConnectDomainEventRegister ()

int	virConnectDomainEventRegister	(virConnectPtr conn, 
virConnectDomainEventCallback cb,
void * opaque,
virFreeCallback freecb)

Adds a Domain Event Callback. Registering for a domain callback will enable delivery of the events The virDomainPtr 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 domain object after the callback

conn:pointer to the connection
cb:callback to the function handling domain events
opaque:opaque data to pass on to the callback
freecb:optional function to deallocate opaque when not used anymore
Returns:it shall take a reference to it, by calling virDomainRef. The reference can be released once the object is no longer required by calling virDomainFree. Returns 0 on success, -1 on failure

virConnectDomainXMLFromNative ()

char *	virConnectDomainXMLFromNative	(virConnectPtr conn, 
const char * nativeFormat,
const char * nativeConfig,
unsigned int flags)

Reads native configuration data describing a domain, and generates libvirt domain XML. The format of the native data is hypervisor dependant.

conn:a connection object
nativeFormat:configuration format importing from
nativeConfig:the configuration data to import
flags:currently unused, pass 0
Returns:a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free() the returned value.

virConnectDomainXMLToNative ()

char *	virConnectDomainXMLToNative	(virConnectPtr conn, 
const char * nativeFormat,
const char * domainXml,
unsigned int flags)

Reads a domain XML configuration document, and generates generates a native configuration file describing the domain. The format of the native data is hypervisor dependant.

conn:a connection object
nativeFormat:configuration format exporting to
domainXml:the domain configuration to export
flags:currently unused, pass 0
Returns:a 0 terminated UTF-8 encoded native config datafile, or NULL in case of error. the caller must free() the returned value.

virConnectFindStoragePoolSources ()

char *	virConnectFindStoragePoolSources	(virConnectPtr conn, 
const char * type,
const char * srcSpec,
unsigned int flags)

Talks to a storage backend and attempts to auto-discover the set of available storage pool sources. e.g. For iSCSI this would be a set of iSCSI targets. For NFS this would be a list of exported paths. The srcSpec (optional for some storage pool types, e.g. local ones) is an instance of the storage pool's source element specifying where to look for the pools. srcSpec is not required for some types (e.g., those querying local storage resources only)

conn:pointer to hypervisor connection
type:type of storage pool sources to discover
srcSpec:XML document specifying discovery source
flags:flags for discovery (unused, pass 0)
Returns:an xml document consisting of a SourceList element containing a source document appropriate to the given pool type for each discovered source.

virConnectGetCapabilities ()

char *	virConnectGetCapabilities	(virConnectPtr conn)

Provides capabilities of the hypervisor / driver.

conn:pointer to the hypervisor connection
Returns:NULL in case of error, or an XML string defining the capabilities. The client must free the returned string after use.

virConnectGetHostname ()

char *	virConnectGetHostname		(virConnectPtr conn)

This returns the system hostname on which the hypervisor is running (the result of the gethostname(2) system call). If we are connected to a remote system, then this returns the hostname of the remote system.

conn:pointer to a hypervisor connection
Returns:the hostname which must be freed by the caller, or NULL if there was an error.

virConnectGetMaxVcpus ()

int	virConnectGetMaxVcpus		(virConnectPtr conn, 
const char * type)

Provides the maximum number of virtual CPUs supported for a guest VM of a specific type. The 'type' parameter here corresponds to the 'type' attribute in the <domain> element of the XML.

conn:pointer to the hypervisor connection
type:value of the 'type' attribute in the <domain> element
Returns:the maximum of virtual CPU or -1 in case of error.

virConnectGetType ()

const char *	virConnectGetType	(virConnectPtr conn)

Get the name of the Hypervisor software used.

conn:pointer to the hypervisor connection
Returns:NULL in case of error, a static zero terminated string otherwise. See also: http://www.redhat.com/archives/libvir-list/2007-February/msg00096.html

virConnectGetURI ()

char *	virConnectGetURI		(virConnectPtr conn)

This returns the URI (name) of the hypervisor connection. Normally this is the same as or similar to the string passed to the virConnectOpen/virConnectOpenReadOnly call, but the driver may make the URI canonical. If name == NULL was passed to virConnectOpen, then the driver will return a non-NULL URI which can be used to connect to the same hypervisor later.

conn:pointer to a hypervisor connection
Returns:the URI string which must be freed by the caller, or NULL if there was an error.

virConnectGetVersion ()

int	virConnectGetVersion		(virConnectPtr conn, 
unsigned long * hvVer)

Get the version level of the Hypervisor running. This may work only with hypervisor call, i.e. with privileged access to the hypervisor, not with a Read-Only connection.

conn:pointer to the hypervisor connection
hvVer:return value for the version of the running hypervisor (OUT)
Returns:-1 in case of error, 0 otherwise. if the version can't be extracted by lack of capacities returns 0 and @hvVer is 0, otherwise @hvVer value is major * 1,000,000 + minor * 1,000 + release

virConnectListDefinedDomains ()

int	virConnectListDefinedDomains	(virConnectPtr conn, 
char ** const names,
int maxnames)

list the defined but inactive domains, stores the pointers to the names in @names

conn:pointer to the hypervisor connection
names:pointer to an array to store the names
maxnames:size of the array
Returns:the number of names provided in the array or -1 in case of error

virConnectListDefinedInterfaces ()

int	virConnectListDefinedInterfaces	(virConnectPtr conn, 
char ** const names,
int maxnames)

Collect the list of defined (inactive) physical host interfaces, and store their names in @names.

conn:pointer to the hypervisor connection
names:array to collect the list of names of interfaces
maxnames:size of @names
Returns:the number of interfaces found or -1 in case of error

virConnectListDefinedNetworks ()

int	virConnectListDefinedNetworks	(virConnectPtr conn, 
char ** const names,
int maxnames)

list the inactive networks, stores the pointers to the names in @names

conn:pointer to the hypervisor connection
names:pointer to an array to store the names
maxnames:size of the array
Returns:the number of names provided in the array or -1 in case of error

virConnectListDefinedStoragePools ()

int	virConnectListDefinedStoragePools	(virConnectPtr conn, 
char ** const names,
int maxnames)

Provides the list of names of inactive storage pools upto maxnames. If there are more than maxnames, the remaining names will be silently ignored.

conn:pointer to hypervisor connection
names:array of char * to fill with pool names (allocated by caller)
maxnames:size of the names array
Returns:0 on success, -1 on error

virConnectListDomains ()

int	virConnectListDomains		(virConnectPtr conn, 
int * ids,
int maxids)

Collect the list of active domains, and store their ID in @maxids

conn:pointer to the hypervisor connection
ids:array to collect the list of IDs of active domains
maxids:size of @ids
Returns:the number of domain found or -1 in case of error

virConnectListInterfaces ()

int	virConnectListInterfaces	(virConnectPtr conn, 
char ** const names,
int maxnames)

Collect the list of active physical host interfaces, and store their names in @names

conn:pointer to the hypervisor connection
names:array to collect the list of names of interfaces
maxnames:size of @names
Returns:the number of interfaces found or -1 in case of error

virConnectListNetworks ()

int	virConnectListNetworks		(virConnectPtr conn, 
char ** const names,
int maxnames)

Collect the list of active networks, and store their names in @names

conn:pointer to the hypervisor connection
names:array to collect the list of names of active networks
maxnames:size of @names
Returns:the number of networks found or -1 in case of error

virConnectListStoragePools ()

int	virConnectListStoragePools	(virConnectPtr conn, 
char ** const names,
int maxnames)

Provides the list of names of active storage pools upto maxnames. If there are more than maxnames, the remaining names will be silently ignored.

conn:pointer to hypervisor connection
names:array of char * to fill with pool names (allocated by caller)
maxnames:size of the names array
Returns:0 on success, -1 on error

virConnectNumOfDefinedDomains ()

int	virConnectNumOfDefinedDomains	(virConnectPtr conn)

Provides the number of defined but inactive domains.

conn:pointer to the hypervisor connection
Returns:the number of domain found or -1 in case of error

virConnectNumOfDefinedInterfaces ()

int	virConnectNumOfDefinedInterfaces	(virConnectPtr conn)

Provides the number of defined (inactive) interfaces on the physical host.

conn:pointer to the hypervisor connection
Returns:the number of defined interface found or -1 in case of error

virConnectNumOfDefinedNetworks ()

int	virConnectNumOfDefinedNetworks	(virConnectPtr conn)

Provides the number of inactive networks.

conn:pointer to the hypervisor connection
Returns:the number of networks found or -1 in case of error

virConnectNumOfDefinedStoragePools ()

int	virConnectNumOfDefinedStoragePools	(virConnectPtr conn)

Provides the number of inactive storage pools

conn:pointer to hypervisor connection
Returns:the number of pools found, or -1 on error

virConnectNumOfDomains ()

int	virConnectNumOfDomains		(virConnectPtr conn)

Provides the number of active domains.

conn:pointer to the hypervisor connection
Returns:the number of domain found or -1 in case of error

virConnectNumOfInterfaces ()

int	virConnectNumOfInterfaces	(virConnectPtr conn)

Provides the number of active interfaces on the physical host.

conn:pointer to the hypervisor connection
Returns:the number of active interfaces found or -1 in case of error

virConnectNumOfNetworks ()

int	virConnectNumOfNetworks		(virConnectPtr conn)

Provides the number of active networks.

conn:pointer to the hypervisor connection
Returns:the number of network found or -1 in case of error

virConnectNumOfStoragePools ()

int	virConnectNumOfStoragePools	(virConnectPtr conn)

Provides the number of active storage pools

conn:pointer to hypervisor connection
Returns:the number of pools found, or -1 on error

virConnectOpen ()

virConnectPtr	virConnectOpen		(const char * name)

This function should be called first to get a connection to the Hypervisor and xen store

name:URI of the hypervisor
Returns:a pointer to the hypervisor connection or NULL in case of error If @name is NULL then probing will be done to determine a suitable default driver to activate. This involves trying each hypervisor in turn until one successfully opens. If the LIBVIRT_DEFAULT_URI environment variable is set, then it will be used in preference to probing for a driver. If connecting to an unprivileged hypervisor driver which requires the libvirtd daemon to be active, it will automatically be launched if not already running. This can be prevented by setting the environment variable LIBVIRT_AUTOSTART=0 URIs are documented at http://libvirt.org/uri.html

virConnectOpenAuth ()

virConnectPtr	virConnectOpenAuth	(const char * name, 
virConnectAuthPtr auth,
int flags)

This function should be called first to get a connection to the Hypervisor. If necessary, authentication will be performed fetching credentials via the callback See virConnectOpen for notes about environment variables which can have an effect on opening drivers

name:URI of the hypervisor
auth:Authenticate callback parameters
flags:Open flags
Returns:a pointer to the hypervisor connection or NULL in case of error URIs are documented at http://libvirt.org/uri.html

virConnectOpenReadOnly ()

virConnectPtr	virConnectOpenReadOnly	(const char * name)

This function should be called first to get a restricted connection to the library functionalities. The set of APIs usable are then restricted on the available methods to control the domains. See virConnectOpen for notes about environment variables which can have an effect on opening drivers

name:URI of the hypervisor
Returns:a pointer to the hypervisor connection or NULL in case of error URIs are documented at http://libvirt.org/uri.html

virConnectRef ()

int	virConnectRef			(virConnectPtr conn)

Increment the reference count on the connection. For each additional call to this method, there shall be a corresponding call to virConnectClose to release the reference count, once the caller no longer needs the reference to this object. 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 connection would increment the reference count.

conn:the connection to hold a reference on
Returns:0 in case of success, -1 in case of failure

virDomainAttachDevice ()

int	virDomainAttachDevice		(virDomainPtr domain, 
const char * xml)

Create a virtual device attachment to backend.

domain:pointer to domain object
xml:pointer to XML description of one device
Returns:0 in case of success, -1 in case of failure.

virDomainBlockPeek ()

int	virDomainBlockPeek		(virDomainPtr dom, 
const char * path,
unsigned long long offset,
size_t size,
void * buffer,
unsigned int flags)

This function allows you to read the contents of a domain's disk device. Typical uses for this are to determine if the domain has written a Master Boot Record (indicating that the domain has completed installation), or to try to work out the state of the domain's filesystems. (Note that in the local case you might try to open the block device or file directly, but that won't work in the remote case, nor if you don't have sufficient permission. Hence the need for this call). 'path' must be a device or file corresponding to the domain. In other words it must be the precise string returned in a <disk><source dev='...'/></disk> from virDomainGetXMLDesc. 'offset' and 'size' represent an area which must lie entirely within the device or file. 'size' may be 0 to test if the call would succeed. 'buffer' is the return buffer and must be at least 'size' bytes. NB. The remote driver imposes a 64K byte limit on 'size'. For your program to be able to work reliably over a remote connection you should split large requests to <= 65536 bytes.

dom:pointer to the domain object
path:path to the block device
offset:offset within block device
size:size to read
buffer:return buffer (must be at least size bytes)
flags:unused, always pass 0
Returns:0 in case of success or -1 in case of failure. really 64 bits

virDomainBlockStats ()

int	virDomainBlockStats		(virDomainPtr dom, 
const char * path,
virDomainBlockStatsPtr stats,
size_t size)

This function returns block device (disk) stats for block devices attached to the domain. The path parameter is the name of the block device. Get this by calling virDomainGetXMLDesc and finding the <target dev='...'> attribute within //domain/devices/disk. (For example, "xvda"). Domains may have more than one block device. To get stats for each you should make multiple calls to this function. Individual fields within the stats structure may be returned as -1, which indicates that the hypervisor does not support that particular statistic.

dom:pointer to the domain object
path:path to the block device
stats:block device stats (returned)
size:size of stats structure
Returns:0 in case of success or -1 in case of failure.

virDomainCoreDump ()

int	virDomainCoreDump		(virDomainPtr domain, 
const char * to,
int flags)

This method will dump the core of a domain on a given file for analysis. Note that for remote Xen Daemon the file path will be interpreted in the remote host.

domain:a domain object
to:path for the core file
flags:extra flags, currently unused
Returns:0 in case of success and -1 in case of failure.

virDomainCreate ()

int	virDomainCreate			(virDomainPtr domain)

launch a defined domain. If the call succeed the domain moves from the defined to the running domains pools.

domain:pointer to a defined domain
Returns:0 in case of success, -1 in case of error

virDomainCreateLinux ()

virDomainPtr	virDomainCreateLinux	(virConnectPtr conn, 
const char * xmlDesc,
unsigned int flags)

Deprecated after 0.4.6. Renamed to virDomainCreateXML() providing identical functionality. This existing name will left indefinitely for API compatability.

conn:pointer to the hypervisor connection
xmlDesc:string containing an XML description of the domain
flags:callers should always pass 0
Returns:a new domain object or NULL in case of failure

virDomainCreateXML ()

virDomainPtr	virDomainCreateXML	(virConnectPtr conn, 
const char * xmlDesc,
unsigned int flags)

Launch a new guest domain, based on an XML description similar to the one returned by virDomainGetXMLDesc() This function may requires privileged access to the hypervisor. The domain is not persistent, so its definition will disappear when it is destroyed, or if the host is restarted (see virDomainDefineXML() to define persistent domains).

conn:pointer to the hypervisor connection
xmlDesc:string containing an XML description of the domain
flags:callers should always pass 0
Returns:a new domain object or NULL in case of failure

virDomainDefineXML ()

virDomainPtr	virDomainDefineXML	(virConnectPtr conn, 
const char * xml)

Define a domain, but does not start it. This definition is persistent, until explicitly undefined with virDomainUndefine(). A previous definition for this domain would be overriden if it already exists.

conn:pointer to the hypervisor connection
xml:the XML description for the domain, preferably in UTF-8
Returns:NULL in case of error, a pointer to the domain otherwise

virDomainDestroy ()

int	virDomainDestroy		(virDomainPtr domain)

Destroy the domain object. The running instance is shutdown if not down already and all resources used by it are given back to the hypervisor. This does not free the associated virDomainPtr object. This function may require privileged access

domain:a domain object
Returns:0 in case of success and -1 in case of failure.

virDomainDetachDevice ()

int	virDomainDetachDevice		(virDomainPtr domain, 
const char * xml)

Destroy a virtual device attachment to backend.

domain:pointer to domain object
xml:pointer to XML description of one device
Returns:0 in case of success, -1 in case of failure.

virDomainFree ()

int	virDomainFree			(virDomainPtr domain)

Free the domain object. The running instance is kept alive. The data structure is freed and should not be used thereafter.

domain:a domain object
Returns:0 in case of success and -1 in case of failure.

virDomainGetAutostart ()

int	virDomainGetAutostart		(virDomainPtr domain, 
int * autostart)

Provides a boolean value indicating whether the domain configured to be automatically started when the host machine boots.

domain:a domain object
autostart:the value returned
Returns:-1 in case of error, 0 in case of success

virDomainGetConnect ()

virConnectPtr	virDomainGetConnect	(virDomainPtr dom)

Provides the connection pointer associated with a domain. The reference counter on the connection is not increased by this call. WARNING: When writing libvirt bindings in other languages, do not use this function. Instead, store the connection and the domain object together.

dom:pointer to a domain
Returns:the virConnectPtr or NULL in case of failure.

virDomainGetID ()

unsigned int	virDomainGetID		(virDomainPtr domain)

Get the hypervisor ID number for the domain

domain:a domain object
Returns:the domain ID number or (unsigned int) -1 in case of error

virDomainGetInfo ()

int	virDomainGetInfo		(virDomainPtr domain, 
virDomainInfoPtr info)

Extract information about a domain. Note that if the connection used to get the domain is limited only a partial set of the information can be extracted.

domain:a domain object
info:pointer to a virDomainInfo structure allocated by the user
Returns:0 in case of success and -1 in case of failure.

virDomainGetMaxMemory ()

unsigned long	virDomainGetMaxMemory	(virDomainPtr domain)

Retrieve the maximum amount of physical memory allocated to a domain. If domain is NULL, then this get the amount of memory reserved to Domain0 i.e. the domain where the application runs.

domain:a domain object or NULL
Returns:the memory size in kilobytes or 0 in case of error.

virDomainGetMaxVcpus ()

int	virDomainGetMaxVcpus		(virDomainPtr domain)

Provides the maximum number of virtual CPUs supported for the guest VM. If the guest is inactive, this is basically the same as virConnectGetMaxVcpus. If the guest is running this will reflect the maximum number of virtual CPUs the guest was booted with.

domain:pointer to domain object
Returns:the maximum of virtual CPU or -1 in case of error.

virDomainGetName ()

const char *	virDomainGetName	(virDomainPtr domain)

Get the public name for that domain

domain:a domain object
Returns:a pointer to the name or NULL, the string need not be deallocated its lifetime will be the same as the domain object.

virDomainGetOSType ()

char *	virDomainGetOSType		(virDomainPtr domain)

Get the type of domain operation system.

domain:a domain object
Returns:the new string or NULL in case of error, the string must be freed by the caller.

virDomainGetSchedulerParameters ()

int	virDomainGetSchedulerParameters	(virDomainPtr domain, 
virSchedParameterPtr params,
int * nparams)

Get the scheduler parameters, the @params array will be filled with the values.

domain:pointer to domain object
params:pointer to scheduler parameter object (return value)
nparams:pointer to number of scheduler parameter (this value should be same than the returned value nparams of virDomainGetSchedulerType)
Returns:-1 in case of error, 0 in case of success.

virDomainGetSchedulerType ()

char *	virDomainGetSchedulerType	(virDomainPtr domain, 
int * nparams)

Get the scheduler type.

domain:pointer to domain object
nparams:number of scheduler parameters(return value)
Returns:NULL in case of error. The caller must free the returned string.

virDomainGetSecurityLabel ()

int	virDomainGetSecurityLabel	(virDomainPtr domain, 
virSecurityLabelPtr seclabel)

Extract security label of an active domain. The 'label' field in the @seclabel argument will be initialized to the empty string if the domain is not running under a security model.

domain:a domain object
seclabel:pointer to a virSecurityLabel structure
Returns:0 in case of success, -1 in case of failure

virDomainGetUUID ()

int	virDomainGetUUID		(virDomainPtr domain, 
unsigned char * uuid)

Get the UUID for a domain

domain:a domain object
uuid:pointer to a VIR_UUID_BUFLEN bytes array
Returns:-1 in case of error, 0 in case of success

virDomainGetUUIDString ()

int	virDomainGetUUIDString		(virDomainPtr domain, 
char * buf)

Get the UUID for a domain as string. For more information about UUID see RFC4122.

domain:a domain object
buf:pointer to a VIR_UUID_STRING_BUFLEN bytes array
Returns:-1 in case of error, 0 in case of success

virDomainGetVcpus ()

int	virDomainGetVcpus		(virDomainPtr domain, 
virVcpuInfoPtr info,
int maxinfo,
unsigned char * cpumaps,
int maplen)

Extract information about virtual CPUs of domain, store it in info array and also in cpumaps if this pointer isn't NULL.

domain:pointer to domain object, or NULL for Domain0
info:pointer to an array of virVcpuInfo structures (OUT)
maxinfo:number of structures in info array
cpumaps:pointer to an bit map of real CPUs for all vcpus of this domain (in 8-bit bytes) (OUT) If cpumaps is NULL, then no cpumap information is returned by the API. It's assumed there is <maxinfo> cpumap in cpumaps array. The memory allocated to cpumaps must be (maxinfo * maplen) bytes (ie: calloc(maxinfo, maplen)). One cpumap inside cpumaps has the format described in virDomainPinVcpu() API.
maplen:number of bytes in one cpumap, from 1 up to size of CPU map in underlying virtualization system (Xen...).
Returns:the number of info filled in case of success, -1 in case of failure.

virDomainGetXMLDesc ()

char *	virDomainGetXMLDesc		(virDomainPtr domain, 
int flags)

Provide an XML description of the domain. The description may be reused later to relaunch the domain with virDomainCreateXML().

domain:a domain object
flags:an OR'ed set of virDomainXMLFlags
Returns:a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free() the returned value.

virDomainInterfaceStats ()

int	virDomainInterfaceStats		(virDomainPtr dom, 
const char * path,
virDomainInterfaceStatsPtr stats,
size_t size)

This function returns network interface stats for interfaces attached to the domain. The path parameter is the name of the network interface. Domains may have more than network interface. To get stats for each you should make multiple calls to this function. Individual fields within the stats structure may be returned as -1, which indicates that the hypervisor does not support that particular statistic.

dom:pointer to the domain object
path:path to the interface
stats:network interface stats (returned)
size:size of stats structure
Returns:0 in case of success or -1 in case of failure.

virDomainLookupByID ()

virDomainPtr	virDomainLookupByID	(virConnectPtr conn, 
int id)

Try to find a domain based on the hypervisor ID number Note that this won't work for inactive domains which have an ID of -1, in that case a lookup based on the Name or UUId need to be done instead.

conn:pointer to the hypervisor connection
id:the domain ID number
Returns:a new domain object or NULL in case of failure. If the domain cannot be found, then VIR_ERR_NO_DOMAIN error is raised.

virDomainLookupByName ()

virDomainPtr	virDomainLookupByName	(virConnectPtr conn, 
const char * name)

Try to lookup a domain on the given hypervisor based on its name.

conn:pointer to the hypervisor connection
name:name for the domain
Returns:a new domain object or NULL in case of failure. If the domain cannot be found, then VIR_ERR_NO_DOMAIN error is raised.

virDomainLookupByUUID ()

virDomainPtr	virDomainLookupByUUID	(virConnectPtr conn, 
const unsigned char * uuid)

Try to lookup a domain on the given hypervisor based on its UUID.

conn:pointer to the hypervisor connection
uuid:the raw UUID for the domain
Returns:a new domain object or NULL in case of failure. If the domain cannot be found, then VIR_ERR_NO_DOMAIN error is raised.

virDomainLookupByUUIDString ()

virDomainPtr	virDomainLookupByUUIDString	(virConnectPtr conn, 
const char * uuidstr)

Try to lookup a domain on the given hypervisor based on its UUID.

conn:pointer to the hypervisor connection
uuidstr:the string UUID for the domain
Returns:a new domain object or NULL in case of failure. If the domain cannot be found, then VIR_ERR_NO_DOMAIN error is raised.

virDomainMemoryPeek ()

int	virDomainMemoryPeek		(virDomainPtr dom, 
unsigned long long start,
size_t size,
void * buffer,
unsigned int flags)

This function allows you to read the contents of a domain's memory. The memory which is read is controlled by the 'start', 'size' and 'flags' parameters. If 'flags' is VIR_MEMORY_VIRTUAL then the 'start' and 'size' parameters are interpreted as virtual memory addresses for whichever task happens to be running on the domain at the moment. Although this sounds haphazard it is in fact what you want in order to read Linux kernel state, because it ensures that pointers in the kernel image can be interpreted coherently. 'buffer' is the return buffer and must be at least 'size' bytes. 'size' may be 0 to test if the call would succeed. NB. The remote driver imposes a 64K byte limit on 'size'. For your program to be able to work reliably over a remote connection you should split large requests to <= 65536 bytes.

dom:pointer to the domain object
start:start of memory to peek
size:size of memory to peek
buffer:return buffer (must be at least size bytes)
flags:flags, see below
Returns:0 in case of success or -1 in case of failure. really 64 bits

virDomainMigrate ()

virDomainPtr	virDomainMigrate	(virDomainPtr domain, 
virConnectPtr dconn,
unsigned long flags,
const char * dname,
const char * uri,
unsigned long bandwidth)

Migrate the domain object from its current host to the destination host given by dconn (a connection to the destination host). Flags may be one of more of the following: VIR_MIGRATE_LIVE Attempt a live migration. If a hypervisor supports renaming domains during migration, then you may set the dname parameter to the new name (otherwise it keeps the same name). If this is not supported by the hypervisor, dname must be NULL or else you will get an error. Since typically the two hypervisors connect directly to each other in order to perform the migration, you may need to specify a path from the source to the destination. This is the purpose of the uri parameter. If uri is NULL, then libvirt will try to find the best method. Uri may specify the hostname or IP address of the destination host as seen from the source. Or uri may be a URI giving transport, hostname, user, port, etc. in the usual form. Refer to driver documentation for the particular URIs supported. The maximum bandwidth (in Mbps) that will be used to do migration can be specified with the bandwidth parameter. If set to 0, libvirt will choose a suitable default. Some hypervisors do not support this feature and will return an error if bandwidth is not 0. To see which features are supported by the current hypervisor, see virConnectGetCapabilities, /capabilities/host/migration_features. There are many limitations on migration imposed by the underlying technology - for example it may not be possible to migrate between different processors even with the same architecture, or between different types of hypervisor.

domain:a domain object
dconn:destination host (a connection object)
flags:flags
dname:(optional) rename domain to this at destination
uri:(optional) dest hostname/URI as seen from the source host
bandwidth:(optional) specify migration bandwidth limit in Mbps
Returns:the new domain object if the migration was successful, or NULL in case of error. Note that the new domain object exists in the scope of the destination connection (dconn).

virDomainPinVcpu ()

int	virDomainPinVcpu		(virDomainPtr domain, 
unsigned int vcpu,
unsigned char * cpumap,
int maplen)

Dynamically change the real CPUs which can be allocated to a virtual CPU. This function requires privileged access to the hypervisor.

domain:pointer to domain object, or NULL for Domain0
vcpu:virtual CPU number
cpumap:pointer to a bit map of real CPUs (in 8-bit bytes) (IN) Each bit set to 1 means that corresponding CPU is usable. Bytes are stored in little-endian order: CPU0-7, 8-15... In each byte, lowest CPU number is least significant bit.
maplen:number of bytes in cpumap, from 1 up to size of CPU map in underlying virtualization system (Xen...). If maplen < size, missing bytes are set to zero. If maplen > size, failure code is returned.
Returns:0 in case of success, -1 in case of failure.

virDomainReboot ()

int	virDomainReboot			(virDomainPtr domain, 
unsigned int flags)

Reboot a domain, the domain object is still usable there after but the domain OS is being stopped for a restart. Note that the guest OS may ignore the request.

domain:a domain object
flags:extra flags for the reboot operation, not used yet
Returns:0 in case of success and -1 in case of failure.

virDomainRef ()

int	virDomainRef			(virDomainPtr domain)

Increment the reference count on the domain. For each additional call to this method, there shall be a corresponding call to virDomainFree to release the reference count, once the caller no longer needs the reference to this object. 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 domain would increment the reference count.

domain:the domain to hold a reference on
Returns:0 in case of success and -1 in case of failure.

virDomainRestore ()

int	virDomainRestore		(virConnectPtr conn, 
const char * from)

This method will restore a domain saved to disk by virDomainSave().

conn:pointer to the hypervisor connection
from:path to the
Returns:0 in case of success and -1 in case of failure.

virDomainResume ()

int	virDomainResume			(virDomainPtr domain)

Resume an suspended domain, the process is restarted from the state where it was frozen by calling virSuspendDomain(). This function may requires privileged access

domain:a domain object
Returns:0 in case of success and -1 in case of failure.

virDomainSave ()

int	virDomainSave			(virDomainPtr domain, 
const char * to)

This method will suspend a domain and save its memory contents to a file on disk. After the call, if successful, the domain is not listed as running anymore (this may be a problem). Use virDomainRestore() to restore a domain after saving.

domain:a domain object
to:path for the output file
Returns:0 in case of success and -1 in case of failure.

virDomainSetAutostart ()

int	virDomainSetAutostart		(virDomainPtr domain, 
int autostart)

Configure the domain to be automatically started when the host machine boots.

domain:a domain object
autostart:whether the domain should be automatically started 0 or 1
Returns:-1 in case of error, 0 in case of success

virDomainSetMaxMemory ()

int	virDomainSetMaxMemory		(virDomainPtr domain, 
unsigned long memory)

Dynamically change the maximum amount of physical memory allocated to a domain. If domain is NULL, then this change the amount of memory reserved to Domain0 i.e. the domain where the application runs. This function requires privileged access to the hypervisor.

domain:a domain object or NULL
memory:the memory size in kilobytes
Returns:0 in case of success and -1 in case of failure.

virDomainSetMemory ()

int	virDomainSetMemory		(virDomainPtr domain, 
unsigned long memory)

Dynamically change the target amount of physical memory allocated to a domain. If domain is NULL, then this change the amount of memory reserved to Domain0 i.e. the domain where the application runs. This function may requires privileged access to the hypervisor.

domain:a domain object or NULL
memory:the memory size in kilobytes
Returns:0 in case of success and -1 in case of failure.

virDomainSetSchedulerParameters ()

int	virDomainSetSchedulerParameters	(virDomainPtr domain, 
virSchedParameterPtr params,
int nparams)

Change the scheduler parameters

domain:pointer to domain object
params:pointer to scheduler parameter objects
nparams:number of scheduler parameter (this value should be same or less than the returned value nparams of virDomainGetSchedulerType)
Returns:-1 in case of error, 0 in case of success.

virDomainSetVcpus ()

int	virDomainSetVcpus		(virDomainPtr domain, 
unsigned int nvcpus)

Dynamically change the number of virtual CPUs used by the domain. Note that this call may fail if the underlying virtualization hypervisor does not support it or if growing the number is arbitrary limited. This function requires privileged access to the hypervisor.

domain:pointer to domain object, or NULL for Domain0
nvcpus:the new number of virtual CPUs for this domain
Returns:0 in case of success, -1 in case of failure.

virDomainShutdown ()

int	virDomainShutdown		(virDomainPtr domain)

Shutdown a domain, the domain object is still usable there after but the domain OS is being stopped. Note that the guest OS may ignore the request. TODO: should we add an option for reboot, knowing it may not be doable in the general case ?

domain:a domain object
Returns:0 in case of success and -1 in case of failure.

virDomainSuspend ()

int	virDomainSuspend		(virDomainPtr domain)

Suspends an active domain, the process is frozen without further access to CPU resources and I/O but the memory used by the domain at the hypervisor level will stay allocated. Use virDomainResume() to reactivate the domain. This function may requires privileged access.

domain:a domain object
Returns:0 in case of success and -1 in case of failure.

virDomainUndefine ()

int	virDomainUndefine		(virDomainPtr domain)

Undefine a domain but does not stop it if it is running

domain:pointer to a defined domain
Returns:0 in case of success, -1 in case of error

virEventRegisterImpl ()

void	virEventRegisterImpl		(virEventAddHandleFunc addHandle, 
virEventUpdateHandleFunc updateHandle,
virEventRemoveHandleFunc removeHandle,
virEventAddTimeoutFunc addTimeout,
virEventUpdateTimeoutFunc updateTimeout,
virEventRemoveTimeoutFunc removeTimeout)

addHandle:
updateHandle:
removeHandle:
addTimeout:
updateTimeout:
removeTimeout:



virInterfaceCreate ()

int	virInterfaceCreate		(virInterfacePtr iface, 
unsigned int flags)

Activate an interface (ie call "ifup")

iface:pointer to a defined interface
flags:and OR'ed set of extraction flags, not used yet
Returns:0 in case of success, -1 in case of error

virInterfaceDefineXML ()

virInterfacePtr	virInterfaceDefineXML	(virConnectPtr conn, 
const char * xml,
unsigned int flags)

Define an interface (or modify existing interface configuration)

conn:pointer to the hypervisor connection
xml:the XML description for the interface, preferably in UTF-8
flags:and OR'ed set of extraction flags, not used yet
Returns:NULL in case of error, a pointer to the interface otherwise

virInterfaceDestroy ()

int	virInterfaceDestroy		(virInterfacePtr iface, 
unsigned int flags)

deactivate an interface (ie call "ifdown") This does not remove the interface from the config, and does not free the associated virInterfacePtr object.

iface:an interface object
flags:and OR'ed set of extraction flags, not used yet
Returns:0 in case of success and -1 in case of failure.

virInterfaceFree ()

int	virInterfaceFree		(virInterfacePtr iface)

Free the interface object. The interface itself is unaltered. The data structure is freed and should not be used thereafter.

iface:a interface object
Returns:0 in case of success and -1 in case of failure.

virInterfaceGetConnect ()

virConnectPtr	virInterfaceGetConnect	(virInterfacePtr iface)

Provides the connection pointer associated with an interface. The reference counter on the connection is not increased by this call. WARNING: When writing libvirt bindings in other languages, do not use this function. Instead, store the connection and the interface object together.

iface:pointer to a interface
Returns:the virConnectPtr or NULL in case of failure.

virInterfaceGetMACString ()

const char *	virInterfaceGetMACString	(virInterfacePtr iface)

Get the MAC for a interface as string. For more information about MAC see RFC4122.

iface:a interface object
Returns:a pointer to the MAC address (in null-terminated ASCII format) or NULL, the string need not be deallocated its lifetime will be the same as the interface object.

virInterfaceGetName ()

const char *	virInterfaceGetName	(virInterfacePtr iface)

Get the public name for that interface

iface:a interface object
Returns:a pointer to the name or NULL, the string need not be deallocated its lifetime will be the same as the interface object.

virInterfaceGetXMLDesc ()

char *	virInterfaceGetXMLDesc		(virInterfacePtr iface, 
unsigned int flags)

Provide an XML description of the interface. The description may be reused later to recreate the interface with virInterfaceCreateXML().

iface:a interface object
flags:and OR'ed set of extraction flags, not used yet
Returns:a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free() the returned value.

virInterfaceLookupByMACString ()

virInterfacePtr	virInterfaceLookupByMACString	(virConnectPtr conn, 
const char * macstr)

Try to lookup an interface on the given hypervisor based on its MAC.

conn:pointer to the hypervisor connection
macstr:the MAC for the interface (null-terminated ASCII format)
Returns:a new interface object or NULL in case of failure. If the interface cannot be found, then VIR_ERR_NO_INTERFACE error is raised.

virInterfaceLookupByName ()

virInterfacePtr	virInterfaceLookupByName	(virConnectPtr conn, 
const char * name)

Try to lookup an interface on the given hypervisor based on its name.

conn:pointer to the hypervisor connection
name:name for the interface
Returns:a new interface object or NULL in case of failure. If the interface cannot be found, then VIR_ERR_NO_INTERFACE error is raised.

virInterfaceRef ()

int	virInterfaceRef			(virInterfacePtr iface)

Increment the reference count on the interface. For each additional call to this method, there shall be a corresponding call to virInterfaceFree to release the reference count, once the caller no longer needs the reference to this object. 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 interface would increment the reference count.

iface:the interface to hold a reference on
Returns:0 in case of success, -1 in case of failure.

virInterfaceUndefine ()

int	virInterfaceUndefine		(virInterfacePtr iface)

Undefine an interface, ie remove it from the config. This does not free the associated virInterfacePtr object.

iface:pointer to a defined interface
Returns:0 in case of success, -1 in case of error

virNetworkCreate ()

int	virNetworkCreate		(virNetworkPtr network)

Create and start a defined network. If the call succeed the network moves from the defined to the running networks pools.

network:pointer to a defined network
Returns:0 in case of success, -1 in case of error

virNetworkCreateXML ()

virNetworkPtr	virNetworkCreateXML	(virConnectPtr conn, 
const char * xmlDesc)

Create and start a new virtual network, based on an XML description similar to the one returned by virNetworkGetXMLDesc()

conn:pointer to the hypervisor connection
xmlDesc:an XML description of the network
Returns:a new network object or NULL in case of failure

virNetworkDefineXML ()

virNetworkPtr	virNetworkDefineXML	(virConnectPtr conn, 
const char * xml)

Define a network, but does not create it

conn:pointer to the hypervisor connection
xml:the XML description for the network, preferably in UTF-8
Returns:NULL in case of error, a pointer to the network otherwise

virNetworkDestroy ()

int	virNetworkDestroy		(virNetworkPtr network)

Destroy the network object. The running instance is shutdown if not down already and all resources used by it are given back to the hypervisor. This does not free the associated virNetworkPtr object. This function may require privileged access

network:a network object
Returns:0 in case of success and -1 in case of failure.

virNetworkFree ()

int	virNetworkFree			(virNetworkPtr network)

Free the network object. The running instance is kept alive. The data structure is freed and should not be used thereafter.

network:a network object
Returns:0 in case of success and -1 in case of failure.

virNetworkGetAutostart ()

int	virNetworkGetAutostart		(virNetworkPtr network, 
int * autostart)

Provides a boolean value indicating whether the network configured to be automatically started when the host machine boots.

network:a network object
autostart:the value returned
Returns:-1 in case of error, 0 in case of success

virNetworkGetBridgeName ()

char *	virNetworkGetBridgeName		(virNetworkPtr network)

Provides a bridge interface name to which a domain may connect a network interface in order to join the network.

network:a network object
Returns:a 0 terminated interface name, or NULL in case of error. the caller must free() the returned value.

virNetworkGetConnect ()

virConnectPtr	virNetworkGetConnect	(virNetworkPtr net)

Provides the connection pointer associated with a network. The reference counter on the connection is not increased by this call. WARNING: When writing libvirt bindings in other languages, do not use this function. Instead, store the connection and the network object together.

net:pointer to a network
Returns:the virConnectPtr or NULL in case of failure.

virNetworkGetName ()

const char *	virNetworkGetName	(virNetworkPtr network)

Get the public name for that network

network:a network object
Returns:a pointer to the name or NULL, the string need not be deallocated its lifetime will be the same as the network object.

virNetworkGetUUID ()

int	virNetworkGetUUID		(virNetworkPtr network, 
unsigned char * uuid)

Get the UUID for a network

network:a network object
uuid:pointer to a VIR_UUID_BUFLEN bytes array
Returns:-1 in case of error, 0 in case of success

virNetworkGetUUIDString ()

int	virNetworkGetUUIDString		(virNetworkPtr network, 
char * buf)

Get the UUID for a network as string. For more information about UUID see RFC4122.

network:a network object
buf:pointer to a VIR_UUID_STRING_BUFLEN bytes array
Returns:-1 in case of error, 0 in case of success

virNetworkGetXMLDesc ()

char *	virNetworkGetXMLDesc		(virNetworkPtr network, 
int flags)

Provide an XML description of the network. The description may be reused later to relaunch the network with virNetworkCreateXML().

network:a network object
flags:and OR'ed set of extraction flags, not used yet
Returns:a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free() the returned value.

virNetworkLookupByName ()

virNetworkPtr	virNetworkLookupByName	(virConnectPtr conn, 
const char * name)

Try to lookup a network on the given hypervisor based on its name.

conn:pointer to the hypervisor connection
name:name for the network
Returns:a new network object or NULL in case of failure. If the network cannot be found, then VIR_ERR_NO_NETWORK error is raised.

virNetworkLookupByUUID ()

virNetworkPtr	virNetworkLookupByUUID	(virConnectPtr conn, 
const unsigned char * uuid)

Try to lookup a network on the given hypervisor based on its UUID.

conn:pointer to the hypervisor connection
uuid:the raw UUID for the network
Returns:a new network object or NULL in case of failure. If the network cannot be found, then VIR_ERR_NO_NETWORK error is raised.

virNetworkLookupByUUIDString ()

virNetworkPtr	virNetworkLookupByUUIDString	(virConnectPtr conn, 
const char * uuidstr)

Try to lookup a network on the given hypervisor based on its UUID.

conn:pointer to the hypervisor connection
uuidstr:the string UUID for the network
Returns:a new network object or NULL in case of failure. If the network cannot be found, then VIR_ERR_NO_NETWORK error is raised.

virNetworkRef ()

int	virNetworkRef			(virNetworkPtr network)

Increment the reference count on the network. For each additional call to this method, there shall be a corresponding call to virNetworkFree to release the reference count, once the caller no longer needs the reference to this object. 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 network would increment the reference count.

network:the network to hold a reference on
Returns:0 in case of success, -1 in case of failure.

virNetworkSetAutostart ()

int	virNetworkSetAutostart		(virNetworkPtr network, 
int autostart)

Configure the network to be automatically started when the host machine boots.

network:a network object
autostart:whether the network should be automatically started 0 or 1
Returns:-1 in case of error, 0 in case of success

virNetworkUndefine ()

int	virNetworkUndefine		(virNetworkPtr network)

Undefine a network but does not stop it if it is running

network:pointer to a defined network
Returns:0 in case of success, -1 in case of error

virNodeDeviceCreateXML ()

virNodeDevicePtr	virNodeDeviceCreateXML	(virConnectPtr conn, 
const char * xmlDesc,
unsigned int flags)

Create a new device on the VM host machine, for example, virtual HBAs created using vport_create.

conn:pointer to the hypervisor connection
xmlDesc:string containing an XML description of the device to be created
flags:callers should always pass 0
Returns:a node device object if successful, NULL in case of failure

virNodeDeviceDestroy ()

int	virNodeDeviceDestroy		(virNodeDevicePtr dev)

Destroy the device object. The virtual device is removed from the host operating system. This function may require privileged access

dev:a device object
Returns:0 in case of success and -1 in case of failure.

virNodeDeviceDettach ()

int	virNodeDeviceDettach		(virNodeDevicePtr dev)

Dettach the node device from the node itself so that it may be assigned to a guest domain. 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. If the device is currently in use by the node, this method may fail. Once the device is not assigned to any guest, it may be re-attached to the node using the virNodeDeviceReattach() method.

dev:pointer to the node device
Returns:0 in case of success, -1 in case of failure.

virNodeDeviceFree ()

int	virNodeDeviceFree		(virNodeDevicePtr dev)

Drops a reference to the node device, freeing it if this was the last reference.

dev:pointer to the node device
Returns:the 0 for success, -1 for error.

virNodeDeviceGetName ()

const char *	virNodeDeviceGetName	(virNodeDevicePtr dev)

Just return the device name

dev:the device
Returns:the device name or NULL in case of error

virNodeDeviceGetParent ()

const char *	virNodeDeviceGetParent	(virNodeDevicePtr dev)

Accessor for the parent of the device

dev:the device
Returns:the name of the device's parent, or NULL if the device has no parent.

virNodeDeviceGetXMLDesc ()

char *	virNodeDeviceGetXMLDesc		(virNodeDevicePtr dev, 
unsigned int flags)

Fetch an XML document describing all aspects of the device.

dev:pointer to the node device
flags:flags for XML generation (unused, pass 0)
Returns:the XML document, or NULL on error

virNodeDeviceListCaps ()

int	virNodeDeviceListCaps		(virNodeDevicePtr dev, 
char ** const names,
int maxnames)

Lists the names of the capabilities supported by the device.

dev:the device
names:array to collect the list of capability names
maxnames:size of @names
Returns:the number of capability names listed in @names.

virNodeDeviceLookupByName ()

virNodeDevicePtr	virNodeDeviceLookupByName	(virConnectPtr conn, 
const char * name)

Lookup a node device by its name.

conn:pointer to the hypervisor connection
name:unique device name
Returns:a virNodeDevicePtr if found, NULL otherwise.

virNodeDeviceNumOfCaps ()

int	virNodeDeviceNumOfCaps		(virNodeDevicePtr dev)

Accessor for the number of capabilities supported by the device.

dev:the device
Returns:the number of capabilities supported by the device.

virNodeDeviceReAttach ()

int	virNodeDeviceReAttach		(virNodeDevicePtr dev)

Re-attach a previously dettached node device to the node so that it may be used by the node again. 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. If the device is currently in use by a guest, this method may fail.

dev:pointer to the node device
Returns:0 in case of success, -1 in case of failure.

virNodeDeviceRef ()

int	virNodeDeviceRef		(virNodeDevicePtr dev)

Increment the reference count on the dev. For each additional call to this method, there shall be a corresponding call to virNodeDeviceFree to release the reference count, once the caller no longer needs the reference to this object. 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.

dev:the dev to hold a reference on
Returns:0 in case of success, -1 in case of failure.

virNodeDeviceReset ()

int	virNodeDeviceReset		(virNodeDevicePtr dev)

Reset a previously dettached node device to the node before or after assigning it to a guest. 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. If the reset will affect other devices which are currently in use, this function may fail.

dev:pointer to the node device
Returns:0 in case of success, -1 in case of failure.

virNodeGetCellsFreeMemory ()

int	virNodeGetCellsFreeMemory	(virConnectPtr conn, 
unsigned long long * freeMems,
int startCell,
int maxCells)

This call returns the amount of free memory in one or more NUMA cells. The @freeMems array must be allocated by the caller and will be filled with the amount of free memory in kilobytes for each cell requested, starting with startCell (in freeMems[0]), up to either (startCell + maxCells), or the number of additional cells in the node, whichever is smaller.

conn:pointer to the hypervisor connection
freeMems:pointer to the array of unsigned long long
startCell:index of first cell to return freeMems info on.
maxCells:Maximum number of cells for which freeMems information can be returned.
Returns:the number of entries filled in freeMems, or -1 in case of error.

virNodeGetFreeMemory ()

unsigned long long	virNodeGetFreeMemory	(virConnectPtr conn)

provides the free memory available on the Node Note: most libvirt APIs provide memory sizes in kilobytes, but in this function the returned value is in bytes. Divide by 1024 as necessary.

conn:pointer to the hypervisor connection
Returns:the available free memory in bytes or 0 in case of error

virNodeGetInfo ()

int	virNodeGetInfo			(virConnectPtr conn, 
virNodeInfoPtr info)

Extract hardware information about the node.

conn:pointer to the hypervisor connection
info:pointer to a virNodeInfo structure allocated by the user
Returns:0 in case of success and -1 in case of failure.

virNodeGetSecurityModel ()

int	virNodeGetSecurityModel		(virConnectPtr conn, 
virSecurityModelPtr secmodel)

Extract the security model of a hypervisor. The 'model' field in the @secmodel argument may be initialized to the empty string if the driver has not activated a security model.

conn:a connection object
secmodel:pointer to a virSecurityModel structure
Returns:0 in case of success, -1 in case of failure

virNodeListDevices ()

int	virNodeListDevices		(virConnectPtr conn, 
const char * cap,
char ** const names,
int maxnames,
unsigned int flags)

Collect the list of node devices, and store their names in @names If the optional 'cap' argument is non-NULL, then the count will be restricted to devices with the specified capability

conn:pointer to the hypervisor connection
cap:capability name
names:array to collect the list of node device names
maxnames:size of @names
flags:flags (unused, pass 0)
Returns:the number of node devices found or -1 in case of error

virNodeNumOfDevices ()

int	virNodeNumOfDevices		(virConnectPtr conn, 
const char * cap,
unsigned int flags)

Provides the number of node devices. If the optional 'cap' argument is non-NULL, then the count will be restricted to devices with the specified capability

conn:pointer to the hypervisor connection
cap:capability name
flags:flags (unused, pass 0)
Returns:the number of node devices or -1 in case of error

virStoragePoolBuild ()

int	virStoragePoolBuild		(virStoragePoolPtr pool, 
unsigned int flags)

Build the underlying storage pool

pool:pointer to storage pool
flags:future flags, use 0 for now
Returns:0 on success, or -1 upon failure

virStoragePoolCreate ()

int	virStoragePoolCreate		(virStoragePoolPtr pool, 
unsigned int flags)

Starts an inactive storage pool

pool:pointer to storage pool
flags:future flags, use 0 for now
Returns:0 on success, or -1 if it could not be started

virStoragePoolCreateXML ()

virStoragePoolPtr	virStoragePoolCreateXML	(virConnectPtr conn, 
const char * xmlDesc,
unsigned int flags)

Create a new storage based on its XML description. The pool is not persistent, so its definition will disappear when it is destroyed, or if the host is restarted

conn:pointer to hypervisor connection
xmlDesc:XML description for new pool
flags:future flags, use 0 for now
Returns:a virStoragePoolPtr object, or NULL if creation failed

virStoragePoolDefineXML ()

virStoragePoolPtr	virStoragePoolDefineXML	(virConnectPtr conn, 
const char * xml,
unsigned int flags)

Define a new inactive storage pool based on its XML description. The pool is persistent, until explicitly undefined.

conn:pointer to hypervisor connection
xml:XML description for new pool
flags:future flags, use 0 for now
Returns:a virStoragePoolPtr object, or NULL if creation failed

virStoragePoolDelete ()

int	virStoragePoolDelete		(virStoragePoolPtr pool, 
unsigned int flags)

Delete the underlying pool resources. This is a non-recoverable operation. The virStoragePoolPtr object itself is not free'd.

pool:pointer to storage pool
flags:flags for obliteration process
Returns:0 on success, or -1 if it could not be obliterate

virStoragePoolDestroy ()

int	virStoragePoolDestroy		(virStoragePoolPtr pool)

Destroy an active storage pool. This will deactivate the pool on the host, but keep any persistent config associated with it. If it has a persistent config it can later be restarted with virStoragePoolCreate(). This does not free the associated virStoragePoolPtr object.

pool:pointer to storage pool
Returns:0 on success, or -1 if it could not be destroyed

virStoragePoolFree ()

int	virStoragePoolFree		(virStoragePoolPtr pool)

Free a storage pool object, releasing all memory associated with it. Does not change the state of the pool on the host.

pool:pointer to storage pool
Returns:0 on success, or -1 if it could not be free'd.

virStoragePoolGetAutostart ()

int	virStoragePoolGetAutostart	(virStoragePoolPtr pool, 
int * autostart)

Fetches the value of the autostart flag, which determines whether the pool is automatically started at boot time

pool:pointer to storage pool
autostart:location in which to store autostart flag
Returns:0 on success, -1 on failure

virStoragePoolGetConnect ()

virConnectPtr	virStoragePoolGetConnect	(virStoragePoolPtr pool)

Provides the connection pointer associated with a storage pool. The reference counter on the connection is not increased by this call. WARNING: When writing libvirt bindings in other languages, do not use this function. Instead, store the connection and the pool object together.

pool:pointer to a pool
Returns:the virConnectPtr or NULL in case of failure.

virStoragePoolGetInfo ()

int	virStoragePoolGetInfo		(virStoragePoolPtr pool, 
virStoragePoolInfoPtr info)

Get volatile information about the storage pool such as free space / usage summary

pool:pointer to storage pool
info:pointer at which to store info
Returns:0 on success, or -1 on failure.

virStoragePoolGetName ()

const char *	virStoragePoolGetName	(virStoragePoolPtr pool)

Fetch the locally unique name of the storage pool

pool:pointer to storage pool
Returns:the name of the pool, or NULL on error

virStoragePoolGetUUID ()

int	virStoragePoolGetUUID		(virStoragePoolPtr pool, 
unsigned char * uuid)

Fetch the globally unique ID of the storage pool

pool:pointer to storage pool
uuid:buffer of VIR_UUID_BUFLEN bytes in size
Returns:0 on success, or -1 on error;

virStoragePoolGetUUIDString ()

int	virStoragePoolGetUUIDString	(virStoragePoolPtr pool, 
char * buf)

Fetch the globally unique ID of the storage pool as a string

pool:pointer to storage pool
buf:buffer of VIR_UUID_STRING_BUFLEN bytes in size
Returns:0 on success, or -1 on error;

virStoragePoolGetXMLDesc ()

char *	virStoragePoolGetXMLDesc	(virStoragePoolPtr pool, 
unsigned int flags)

Fetch an XML document describing all aspects of the storage pool. This is suitable for later feeding back into the virStoragePoolCreateXML method.

pool:pointer to storage pool
flags:flags for XML format options (set of virDomainXMLFlags)
Returns:a XML document, or NULL on error

virStoragePoolListVolumes ()

int	virStoragePoolListVolumes	(virStoragePoolPtr pool, 
char ** const names,
int maxnames)

Fetch list of storage volume names, limiting to at most maxnames.

pool:pointer to storage pool
names:array in which to storage volume names
maxnames:size of names array
Returns:the number of names fetched, or -1 on error

virStoragePoolLookupByName ()

virStoragePoolPtr	virStoragePoolLookupByName	(virConnectPtr conn, 
const char * name)

Fetch a storage pool based on its unique name

conn:pointer to hypervisor connection
name:name of pool to fetch
Returns:a virStoragePoolPtr object, or NULL if no matching pool is found

virStoragePoolLookupByUUID ()

virStoragePoolPtr	virStoragePoolLookupByUUID	(virConnectPtr conn, 
const unsigned char * uuid)

Fetch a storage pool based on its globally unique id

conn:pointer to hypervisor connection
uuid:globally unique id of pool to fetch
Returns:a virStoragePoolPtr object, or NULL if no matching pool is found

virStoragePoolLookupByUUIDString ()

virStoragePoolPtr	virStoragePoolLookupByUUIDString	(virConnectPtr conn, 
const char * uuidstr)

Fetch a storage pool based on its globally unique id

conn:pointer to hypervisor connection
uuidstr:globally unique id of pool to fetch
Returns:a virStoragePoolPtr object, or NULL if no matching pool is found

virStoragePoolLookupByVolume ()

virStoragePoolPtr	virStoragePoolLookupByVolume	(virStorageVolPtr vol)

Fetch a storage pool which contains a particular volume

vol:pointer to storage volume
Returns:a virStoragePoolPtr object, or NULL if no matching pool is found

virStoragePoolNumOfVolumes ()

int	virStoragePoolNumOfVolumes	(virStoragePoolPtr pool)

Fetch the number of storage volumes within a pool

pool:pointer to storage pool
Returns:the number of storage pools, or -1 on failure

virStoragePoolRef ()

int	virStoragePoolRef		(virStoragePoolPtr pool)

Increment the reference count on the pool. For each additional call to this method, there shall be a corresponding call to virStoragePoolFree to release the reference count, once the caller no longer needs the reference to this object. 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 pool would increment the reference count.

pool:the pool to hold a reference on
Returns:0 in case of success, -1 in case of failure.

virStoragePoolRefresh ()

int	virStoragePoolRefresh		(virStoragePoolPtr pool, 
unsigned int flags)

Request that the pool refresh its list of volumes. This may involve communicating with a remote server, and/or initializing new devices at the OS layer

pool:pointer to storage pool
flags:flags to control refresh behaviour (currently unused, use 0)
Returns:0 if the volume list was refreshed, -1 on failure

virStoragePoolSetAutostart ()

int	virStoragePoolSetAutostart	(virStoragePoolPtr pool, 
int autostart)

Sets the autostart flag

pool:pointer to storage pool
autostart:new flag setting
Returns:0 on success, -1 on failure

virStoragePoolUndefine ()

int	virStoragePoolUndefine		(virStoragePoolPtr pool)

Undefine an inactive storage pool

pool:pointer to storage pool
Returns:0 on success, -1 on failure

virStorageVolCreateXML ()

virStorageVolPtr	virStorageVolCreateXML	(virStoragePoolPtr pool, 
const char * xmldesc,
unsigned int flags)

Create a storage volume within a pool based on an XML description. Not all pools support creation of volumes

pool:pointer to storage pool
xmldesc:description of volume to create
flags:flags for creation (unused, pass 0)
Returns:the storage volume, or NULL on error

virStorageVolCreateXMLFrom ()

virStorageVolPtr	virStorageVolCreateXMLFrom	(virStoragePoolPtr pool, 
const char * xmldesc,
virStorageVolPtr clonevol,
unsigned int flags)

Create a storage volume in the parent pool, using the 'clonevol' volume as input. Information for the new volume (name, perms) are passed via a typical volume XML description.

pool:pointer to parent pool for the new volume
xmldesc:description of volume to create
clonevol:storage volume to use as input
flags:flags for creation (unused, pass 0)
Returns:the storage volume, or NULL on error

virStorageVolDelete ()

int	virStorageVolDelete		(virStorageVolPtr vol, 
unsigned int flags)

Delete the storage volume from the pool

vol:pointer to storage volume
flags:future flags, use 0 for now
Returns:0 on success, or -1 on error

virStorageVolFree ()

int	virStorageVolFree		(virStorageVolPtr vol)

Release the storage volume handle. The underlying storage volume continues to exist.

vol:pointer to storage volume
Returns:0 on success, or -1 on error

virStorageVolGetConnect ()

virConnectPtr	virStorageVolGetConnect	(virStorageVolPtr vol)

Provides the connection pointer associated with a storage volume. The reference counter on the connection is not increased by this call. WARNING: When writing libvirt bindings in other languages, do not use this function. Instead, store the connection and the volume object together.

vol:pointer to a pool
Returns:the virConnectPtr or NULL in case of failure.

virStorageVolGetInfo ()

int	virStorageVolGetInfo		(virStorageVolPtr vol, 
virStorageVolInfoPtr info)

Fetches volatile information about the storage volume such as its current allocation

vol:pointer to storage volume
info:pointer at which to store info
Returns:0 on success, or -1 on failure

virStorageVolGetKey ()

const char *	virStorageVolGetKey	(virStorageVolPtr vol)

Fetch the storage volume key. This is globally unique, so the same volume will have the same key no matter what host it is accessed from

vol:pointer to storage volume
Returns:the volume key, or NULL on error

virStorageVolGetName ()

const char *	virStorageVolGetName	(virStorageVolPtr vol)

Fetch the storage volume name. This is unique within the scope of a pool

vol:pointer to storage volume
Returns:the volume name, or NULL on error

virStorageVolGetPath ()

char *	virStorageVolGetPath		(virStorageVolPtr vol)

Fetch the storage volume path. Depending on the pool configuration this is either persistent across hosts, or dynamically assigned at pool startup. Consult pool documentation for information on getting the persistent naming

vol:pointer to storage volume
Returns:the storage volume path, or NULL on error

virStorageVolGetXMLDesc ()

char *	virStorageVolGetXMLDesc		(virStorageVolPtr vol, 
unsigned int flags)

Fetch an XML document describing all aspects of the storage volume

vol:pointer to storage volume
flags:flags for XML generation (unused, pass 0)
Returns:the XML document, or NULL on error

virStorageVolLookupByKey ()

virStorageVolPtr	virStorageVolLookupByKey	(virConnectPtr conn, 
const char * key)

Fetch a pointer to a storage volume based on its globally unique key

conn:pointer to hypervisor connection
key:globally unique key
Returns:a storage volume, or NULL if not found / error

virStorageVolLookupByName ()

virStorageVolPtr	virStorageVolLookupByName	(virStoragePoolPtr pool, 
const char * name)

Fetch a pointer to a storage volume based on its name within a pool

pool:pointer to storage pool
name:name of storage volume
Returns:a storage volume, or NULL if not found / error

virStorageVolLookupByPath ()

virStorageVolPtr	virStorageVolLookupByPath	(virConnectPtr conn, 
const char * path)

Fetch a pointer to a storage volume based on its locally (host) unique path

conn:pointer to hypervisor connection
path:locally unique path
Returns:a storage volume, or NULL if not found / error

virStorageVolRef ()

int	virStorageVolRef		(virStorageVolPtr vol)

Increment the reference count on the vol. For each additional call to this method, there shall be a corresponding call to virStorageVolFree to release the reference count, once the caller no longer needs the reference to this object. 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 vol would increment the reference count.

vol:the vol to hold a reference on
Returns:0 in case of success, -1 in case of failure.

0707010002bb7f000081a40000000000000002000000014ae1948e000001d8000000b600010006ffffffffffffffff0000002f00000000reloc/usr/share/gtk-doc/html/libvirt/right.pngPNG  IHDRw=bKGD pHYs  ~tIME2 I%=eIDATx!o@.'**M0$$?1~vIeEuLl&4䝠Bݛ|>$ݶoc libvirt Reference Manual

libvirt Reference Manual

Libvir 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.

If you get lost searching for some specific API use, try the online search engine hosted on libvirt.org it indexes the project page, the APIs as well as the mailing-list archives.

0707010002bb7d000081a40000000000000002000000014ae1948e00005fef000000b600010006ffffffffffffffff0000003c00000000reloc/usr/share/gtk-doc/html/libvirt/libvirt-virterror.html virterror: error handling interfaces for the libvirt library

virterror

virterror - error handling interfaces for the libvirt library

Provides the interfaces of the libvirt library to handle errors raised while using the library.

Author(s): Daniel Veillard <veillard@redhat.com>

Synopsis

typedef virError * virErrorPtr;
typedef enum virErrorLevel;
typedef enum virErrorDomain;
typedef enum virErrorNumber;
typedef struct _virError virError;
void	virFreeError			(virErrorPtr err);
int	virCopyLastError		(virErrorPtr to);
void	virConnSetErrorFunc		(virConnectPtr conn, 
void * userData,
virErrorFunc handler); void virResetLastError (void); typedef void virErrorFunc (void * userData,
virErrorPtr error); void virResetError (virErrorPtr err); virErrorPtr virConnGetLastError (virConnectPtr conn); void virDefaultErrorFunc (virErrorPtr err); virErrorPtr virGetLastError (void); void virSetErrorFunc (void * userData,
virErrorFunc handler); int virConnCopyLastError (virConnectPtr conn,
virErrorPtr to); void virConnResetLastError (virConnectPtr conn); virErrorPtr virSaveLastError (void);

Description

Details

Structure virError

struct _virError {
    int	code	: The error code, a virErrorNumber
    int	domain	: What part of the library raised this error
    char *	message	: human-readable informative error message
    virErrorLevel	level	: how consequent is the error
    virConnectPtr	conn	: connection if available, deprecated see note above
    virDomainPtr	dom	: domain if available, deprecated see note above
    char *	str1	: extra string information
    char *	str2	: extra string information
    char *	str3	: extra string information
    int	int1	: extra number information
    int	int2	: extra number information
    virNetworkPtr	net	: network if available, deprecated see note above
} virError;


Enum virErrorDomain

enum virErrorDomain {
    VIR_FROM_NONE = 0
    VIR_FROM_XEN = 1 /* Error at Xen hypervisor layer */
    VIR_FROM_XEND = 2 /* Error at connection with xend daemon */
    VIR_FROM_XENSTORE = 3 /* Error at connection with xen store */
    VIR_FROM_SEXPR = 4 /* Error in the S-Expression code */
    VIR_FROM_XML = 5 /* Error in the XML code */
    VIR_FROM_DOM = 6 /* Error when operating on a domain */
    VIR_FROM_RPC = 7 /* Error in the XML-RPC code */
    VIR_FROM_PROXY = 8 /* Error in the proxy code */
    VIR_FROM_CONF = 9 /* Error in the configuration file handling */
    VIR_FROM_QEMU = 10 /* Error at the QEMU daemon */
    VIR_FROM_NET = 11 /* Error when operating on a network */
    VIR_FROM_TEST = 12 /* Error from test driver */
    VIR_FROM_REMOTE = 13 /* Error from remote driver */
    VIR_FROM_OPENVZ = 14 /* Error from OpenVZ driver */
    VIR_FROM_XENXM = 15 /* Error at Xen XM layer */
    VIR_FROM_STATS_LINUX = 16 /* Error in the Linux Stats code */
    VIR_FROM_LXC = 17 /* Error from Linux Container driver */
    VIR_FROM_STORAGE = 18 /* Error from storage driver */
    VIR_FROM_NETWORK = 19 /* Error from network config */
    VIR_FROM_DOMAIN = 20 /* Error from domain config */
    VIR_FROM_UML = 21 /* Error at the UML driver */
    VIR_FROM_NODEDEV = 22 /* Error from node device monitor */
    VIR_FROM_XEN_INOTIFY = 23 /* Error from xen inotify layer */
    VIR_FROM_SECURITY = 24 /* Error from security framework */
    VIR_FROM_VBOX = 25 /* Error from VirtualBox driver */
    VIR_FROM_INTERFACE = 26 /* Error when operating on an interface */
    VIR_FROM_ONE = 27 /* Error from OpenNebula driver */
    VIR_FROM_ESX = 28 /* Error from ESX driver */
    VIR_FROM_PHYP = 29 /*  Error from IBM power hypervisor */
};


Enum virErrorLevel

enum virErrorLevel {
    VIR_ERR_NONE = 0
    VIR_ERR_WARNING = 1 /* A simple warning */
    VIR_ERR_ERROR = 2 /*  An error */
};


Enum virErrorNumber

enum virErrorNumber {
    VIR_ERR_OK = 0
    VIR_ERR_INTERNAL_ERROR = 1 /* internal error */
    VIR_ERR_NO_MEMORY = 2 /* memory allocation failure */
    VIR_ERR_NO_SUPPORT = 3 /* no support for this function */
    VIR_ERR_UNKNOWN_HOST = 4 /* could not resolve hostname */
    VIR_ERR_NO_CONNECT = 5 /* can't connect to hypervisor */
    VIR_ERR_INVALID_CONN = 6 /* invalid connection object */
    VIR_ERR_INVALID_DOMAIN = 7 /* invalid domain object */
    VIR_ERR_INVALID_ARG = 8 /* invalid function argument */
    VIR_ERR_OPERATION_FAILED = 9 /* a command to hypervisor failed */
    VIR_ERR_GET_FAILED = 10 /* a HTTP GET command to failed */
    VIR_ERR_POST_FAILED = 11 /* a HTTP POST command to failed */
    VIR_ERR_HTTP_ERROR = 12 /* unexpected HTTP error code */
    VIR_ERR_SEXPR_SERIAL = 13 /* failure to serialize an S-Expr */
    VIR_ERR_NO_XEN = 14 /* could not open Xen hypervisor control */
    VIR_ERR_XEN_CALL = 15 /* failure doing an hypervisor call */
    VIR_ERR_OS_TYPE = 16 /* unknown OS type */
    VIR_ERR_NO_KERNEL = 17 /* missing kernel information */
    VIR_ERR_NO_ROOT = 18 /* missing root device information */
    VIR_ERR_NO_SOURCE = 19 /* missing source device information */
    VIR_ERR_NO_TARGET = 20 /* missing target device information */
    VIR_ERR_NO_NAME = 21 /* missing domain name information */
    VIR_ERR_NO_OS = 22 /* missing domain OS information */
    VIR_ERR_NO_DEVICE = 23 /* missing domain devices information */
    VIR_ERR_NO_XENSTORE = 24 /* could not open Xen Store control */
    VIR_ERR_DRIVER_FULL = 25 /* too many drivers registered */
    VIR_ERR_CALL_FAILED = 26 /* not supported by the drivers (DEPRECATED) */
    VIR_ERR_XML_ERROR = 27 /* an XML description is not well formed or broken */
    VIR_ERR_DOM_EXIST = 28 /* the domain already exist */
    VIR_ERR_OPERATION_DENIED = 29 /* operation forbidden on read-only connections */
    VIR_ERR_OPEN_FAILED = 30 /* failed to open a conf file */
    VIR_ERR_READ_FAILED = 31 /* failed to read a conf file */
    VIR_ERR_PARSE_FAILED = 32 /* failed to parse a conf file */
    VIR_ERR_CONF_SYNTAX = 33 /* failed to parse the syntax of a conf file */
    VIR_ERR_WRITE_FAILED = 34 /* failed to write a conf file */
    VIR_ERR_XML_DETAIL = 35 /* detail of an XML error */
    VIR_ERR_INVALID_NETWORK = 36 /* invalid network object */
    VIR_ERR_NETWORK_EXIST = 37 /* the network already exist */
    VIR_ERR_SYSTEM_ERROR = 38 /* general system call failure */
    VIR_ERR_RPC = 39 /* some sort of RPC error */
    VIR_ERR_GNUTLS_ERROR = 40 /* error from a GNUTLS call */
    VIR_WAR_NO_NETWORK = 41 /* failed to start network */
    VIR_ERR_NO_DOMAIN = 42 /* domain not found or unexpectedly disappeared */
    VIR_ERR_NO_NETWORK = 43 /* network not found */
    VIR_ERR_INVALID_MAC = 44 /* invalid MAC address */
    VIR_ERR_AUTH_FAILED = 45 /* authentication failed */
    VIR_ERR_INVALID_STORAGE_POOL = 46 /* invalid storage pool object */
    VIR_ERR_INVALID_STORAGE_VOL = 47 /* invalid storage vol object */
    VIR_WAR_NO_STORAGE = 48 /* failed to start storage */
    VIR_ERR_NO_STORAGE_POOL = 49 /* storage pool not found */
    VIR_ERR_NO_STORAGE_VOL = 50 /* storage pool not found */
    VIR_WAR_NO_NODE = 51 /* failed to start node driver */
    VIR_ERR_INVALID_NODE_DEVICE = 52 /* invalid node device object */
    VIR_ERR_NO_NODE_DEVICE = 53 /* node device not found */
    VIR_ERR_NO_SECURITY_MODEL = 54 /* security model not found */
    VIR_ERR_OPERATION_INVALID = 55 /* operation is not applicable at this time */
    VIR_WAR_NO_INTERFACE = 56 /* failed to start interface driver */
    VIR_ERR_NO_INTERFACE = 57 /* interface driver not running */
    VIR_ERR_INVALID_INTERFACE = 58 /* invalid interface object */
    VIR_ERR_MULTIPLE_INTERFACES = 59 /*  more than one matching interface found */
};


Typedef virErrorPtr

virError * virErrorPtr;


Function type virErrorFunc

void	virErrorFunc			(void * userData, 
virErrorPtr error)

Signature of a function to use when there is an error raised by the library.

userData:user provided data for the error callback
error:the error being raised.

virConnCopyLastError ()

int	virConnCopyLastError		(virConnectPtr conn, 
virErrorPtr to)

Copy the content of the last error caught on that connection This method is not protected against access from multiple threads. In a multi-threaded application, always use the global virGetLastError() API which is backed by thread local storage. If the connection object was discovered to be invalid by an API call, then the error will be reported against the global error object. Since 0.6.0, all errors reported in the per-connection object are also duplicated in the global error object. As such an application can always use virGetLastError(). This method remains for backwards compatability. One will need to free the result with virResetError()

conn:pointer to the hypervisor connection
to:target to receive the copy
Returns:0 if no error was found and the error code otherwise and -1 in case of parameter error.

virConnGetLastError ()

virErrorPtr	virConnGetLastError	(virConnectPtr conn)

Provide a pointer to the last error caught on that connection This method is not protected against access from multiple threads. In a multi-threaded application, always use the global virGetLastError() API which is backed by thread local storage. If the connection object was discovered to be invalid by an API call, then the error will be reported against the global error object. Since 0.6.0, all errors reported in the per-connection object are also duplicated in the global error object. As such an application can always use virGetLastError(). This method remains for backwards compatability.

conn:pointer to the hypervisor connection
Returns:a pointer to the last error or NULL if none occurred.

virConnResetLastError ()

void	virConnResetLastError		(virConnectPtr conn)

The error object is kept in thread local storage, so separate threads can safely access this concurrently. Reset the last error caught on that connection

conn:pointer to the hypervisor connection

virConnSetErrorFunc ()

void	virConnSetErrorFunc		(virConnectPtr conn, 
void * userData,
virErrorFunc handler)

Set a connection error handling function, if @handler is NULL it will reset to default which is to pass error back to the global library handler.

conn:pointer to the hypervisor connection
userData:pointer to the user data provided in the handler callback
handler:the function to get called in case of error or NULL

virCopyLastError ()

int	virCopyLastError		(virErrorPtr to)

Copy the content of the last error caught at the library level The error object is kept in thread local storage, so separate threads can safely access this concurrently. One will need to free the result with virResetError()

to:target to receive the copy
Returns:0 if no error was found and the error code otherwise and -1 in case of parameter error.

virDefaultErrorFunc ()

void	virDefaultErrorFunc		(virErrorPtr err)

Default routine reporting an error to stderr.

err:pointer to the error.

virFreeError ()

void	virFreeError			(virErrorPtr err)

Resets and frees the given error.

err:error to free

virGetLastError ()

virErrorPtr	virGetLastError		(void)

Provide a pointer to the last error caught at the library level The error object is kept in thread local storage, so separate threads can safely access this concurrently.

Returns:a pointer to the last error or NULL if none occurred.

virResetError ()

void	virResetError			(virErrorPtr err)

Reset the error being pointed to

err:pointer to the virError to clean up


virSaveLastError ()

virErrorPtr	virSaveLastError	(void)

Save the last error into a new error object.

Returns:a pointer to the copied error or NULL if allocation failed. It is the caller's responsibility to free the error with virFreeError().

virSetErrorFunc ()

void	virSetErrorFunc			(void * userData, 
virErrorFunc handler)

Set a library global error handling function, if @handler is NULL, it will reset to default printing on stderr. The error raised there are those for which no handler at the connection level could caught.

userData:pointer to the user data provided in the handler callback
handler:the function to get called in case of error or NULL

0707010002bb79000081a40000000000000002000000014ae1948e0000028e000000b600010006ffffffffffffffff0000002e00000000reloc/usr/share/gtk-doc/html/libvirt/home.pngPNG  IHDRw=bKGD pHYs  ~tIME1KvIDATxՕkq?rCp ~CnpCAAJ .B-\'G]:ܠC -(8 Ԁ!fDғklbRoyxwpðIJ<of_-@RHf֟t^ښ$Q|pgv;X^^&s(bwwZF9&3඙ ^IRZUE.0Z]]U PYM8HGIekqqҀ! $۬3n e{-/seeeÌXOͷ$8==USQRR'9-s+B^ Cەs+%<7W :2IENDB`0707010002bb7b000081a40000000000000002000000014ae1948e000001cb000000b600010006ffffffffffffffff0000002e00000000reloc/usr/share/gtk-doc/html/libvirt/left.pngPNG  IHDRw=bKGD pHYs  ~tIME1&[(XIDATx!OPE*ID%~ꊯ"p'ŏ`sܖrKf hmiIz}ܯI.p\`x l?l[,Hk<#c%\AUx[S7n6rzEs1j@NL$ݤi0 5/}\EKIo͓$a0jdFbkIAh>WlC'?tk;|/t*INZ^`y4Nr]׮ J<ڐt`X1@p䀸dZ')hK $V?%]+LsgUK"w53OIENDB`0707010002bb80000081a40000000000000002000000014ae1948e00000329000000b600010006ffffffffffffffff0000002f00000000reloc/usr/share/gtk-doc/html/libvirt/style.css.synopsis, .classsynopsis { background: #eeeeee; border: solid 1px #aaaaaa; padding: 0.5em; } .programlisting { background: #eeeeff; border: solid 1px #aaaaff; padding: 0.5em; } .variablelist { padding: 4px; margin-left: 3em; } .variablelist td:first-child { vertical-align: top; } table.navigation { background: #ffeeee; border: solid 1px #ffaaaa; margin-top: 0.5em; margin-bottom: 0.5em; } .navigation a { color: #770000; } .navigation a:visited { color: #550000; } .navigation .title { font-size: 200%; } div.refnamediv { margin-top: 2em; } div.gallery-float { float: left; padding: 10px; } div.gallery-float img { border-style: none; } div.gallery-spacer { clear: both; } a { text-decoration: none; } a:hover { text-decoration: underline; color: #FF0000; } 0707010002bb7e000081a40000000000000002000000014ae1948e0000a426000000b600010006ffffffffffffffff0000003500000000reloc/usr/share/gtk-doc/html/libvirt/libvirt.devhelp 0707010002bb81000081a40000000000000002000000014ae1948e00000196000000b600010006ffffffffffffffff0000002c00000000reloc/usr/share/gtk-doc/html/libvirt/up.pngPNG  IHDRw=bKGD pHYs  ~tIME2.E#IDATx=J@Fo] !+2[Z<@/9|t$D9nnBjBRIsI:H8UPN1fcsN95M㧖ɵ 束1~pEe$I 7nrDf!;`'ykI䲤sI_]y^^I>O>?YBIENDB`0707010002bb78000081a40000000000000002000000014ae1948e00000668000000b600010006ffffffffffffffff0000003200000000reloc/usr/share/gtk-doc/html/libvirt/general.html libvirt:

libvirt API Modules

libvirt - core interfaces for the libvirt library
virterror - error handling interfaces for the libvirt library

0707010002bb82000041ed0000000000000000000000034ae194b300000000000000b600010006ffffffffffffffff0000001800000000reloc/usr/share/libvirt0707010002bb83000041ed0000000000000000000000024ae194b300000000000000b600010006ffffffffffffffff0000002000000000reloc/usr/share/libvirt/schemas0707010002bb86000081a40000000000000002000000014ae1948b00002a91000000b600010006ffffffffffffffff0000002e00000000reloc/usr/share/libvirt/schemas/interface.rng ethernet vlan bridge bond balance-rr active-backup balance-xor broadcast 802.3ad balance-tlb balance-alb ioctl netif none active backup all onboot none hotplug ipv4 on off yes no [0-9]+ [a-zA-Z0-9_\.\-:/]+ [a-fA-F0-9]{32} [a-fA-F0-9]{8}\-([a-fA-F0-9]{4}\-){3}[a-fA-F0-9]{12} ([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2} ([0-2]?[0-9]?[0-9]\.){3}[0-2]?[0-9]?[0-9] [1-9]|[12][0-9]|3[0-2] 4096 0707010002bb88000081a40000000000000002000000014ae1948b00001b9b000000b600010006ffffffffffffffff0000002c00000000reloc/usr/share/libvirt/schemas/nodedev.rng system pci usb_device usb net 80203 80211 scsi_host scsi storage hotpluggable removable 1 0 [a-fA-F0-9]{32} [a-fA-F0-9]{8}\-([a-fA-F0-9]{4}\-){3}[a-fA-F0-9]{12} [0-9]+ (0x)?[0-9a-f]+ ([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2} /[a-zA-Z0-9_\+\-/%]+ 0707010002bb85000081a40000000000000002000000014ae1948b00007feb000000b600010006ffffffffffffffff0000002b00000000reloc/usr/share/libvirt/schemas/domain.rng dynamic static xen kvm kqemu qemu lxc openvz test i686 x86_64 ia64 xenpv xenner xen linux hvm i686 x86_64 xenfv pc isapc mips mips sparc sun4m ppc g3beige mac99 prep exe localtime utc hd fd cdrom network floppy disk cdrom file block ide fdc scsi virtio xen usb uml none writeback writethrough file block mount template bridge ethernet network user internal gigabit megabit kilobit second millisecond microsecond sdl yes no vnc yes no rdp yes no yes no yes no desktop yes no vga cirrus vmvga xen vbox destroy restart preserve rename-restart dev file pipe unix tcp udp null stdio vc pty sb16 es1370 pcspk ac97 tablet mouse ps2 usb xen subsystem capabilities usb pci yes no [0-9]+ [0-9]+ 1 -1 [0-9]+ 4000 [A-Za-z0-9_\.\+\-&:/]+ [a-zA-Z0-9_\+\-]+ [a-fA-F0-9]{32} [a-fA-F0-9]{8}\-([a-fA-F0-9]{4}\-){3}[a-fA-F0-9]{12} [a-zA-Z0-9_\.\+\-&/%]+ /[a-zA-Z0-9_\.\+\-&/%]+ /[a-zA-Z0-9_\.\+\-&/%]* /[a-zA-Z0-9_\+\-/%]+ [a-zA-Z0-9_\.\-:/]+ ([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2} ([0-2]?[0-9]?[0-9]\.){3}[0-2]?[0-9]?[0-9] (0x)?[0-9a-fA-F]{1,4} (0x)?[0-9a-fA-F]{1,3} (0x)?[0-9a-fA-F]{1,4} (0x)?[0-9a-fA-F]{1,2} (0x)?[0-1]?[0-9a-fA-F] (0x)?[0-7] 0707010002bb87000081a40000000000000002000000014ae1948b00000a4e000000b600010006ffffffffffffffff0000002c00000000reloc/usr/share/libvirt/schemas/network.rng on off nat routed 0707010002bb84000081a40000000000000002000000014ae1948b00001758000000b600010006ffffffffffffffff0000002f00000000reloc/usr/share/libvirt/schemas/capability.rng xenmigr xen linux hvm exe uml 31 32 64 qemu kqemu kvm xen uml lxc openvz test yes no on off i686 x86_64 ppc ppc64 ia64 s390 mips mipsel sparc [0-9]+ /[a-zA-Z0-9_\+\-/%]+ 0707010002bb8a000081a40000000000000002000000014ae1948b00000f35000000b600010006ffffffffffffffff0000002f00000000reloc/usr/share/libvirt/schemas/storagevol.rng none auto ext2 ext3 ext4 ufs iso9660 udf gfs gfs2 vfat hfs+ xfs raw dir bochs cloop cow dmg iso qcow qcow2 vmdk vpc [a-zA-Z0-9_\+\-\.]+ [0-9]+ /[a-zA-Z0-9_\+\-\./%]+ [kKmMgGtTpPyYzZ] 0707010002bb89000081a40000000000000002000000014ae1948b00001d4a000000b600010006ffffffffffffffff0000003000000000reloc/usr/share/libvirt/schemas/storagepool.rng dir fs netfs logical disk iscsi scsi auto ext2 ext3 ext4 ufs iso9660 udf gfs gfs2 vfat hfs+ xfs auto nfs none dos dvh gpt mac bsd pc98 sun lvm2 auto lvm2 [a-zA-Z0-9_\+\-]+ [a-fA-F0-9]{32} [a-fA-F0-9]{8}\-([a-fA-F0-9]{4}\-){3}[a-fA-F0-9]{12} [0-9]+ /[a-zA-Z0-9_\+\-/%]+ 0707010002bb63000041ed0000000000000000000000034ae194b300000000000000b600010006ffffffffffffffff0000001400000000reloc/usr/share/doc0707010002bb64000041ed0000000000000000000000034ae194b300000000000000b600010006ffffffffffffffff0000001c00000000reloc/usr/share/doc/libvirt0707010002bb65000041ed0000000000000000000000034ae194b300000000000000b600010006ffffffffffffffff0000002100000000reloc/usr/share/doc/libvirt/html0707010002bb73000081a40000000000000002000000014ae1948d000005f4000000b600010006ffffffffffffffff0000002900000000reloc/usr/share/doc/libvirt/html/info1.c/** * section: Informations * synopsis: Extract information about Xen domain 0 * purpose: Demonstrate the basic use of the library to connect to the * hypervisor and extract domain information. * usage: info1 * test: info1 * author: Daniel Veillard * copy: see Copyright for the status of this software. */ #include #include /** * getDomainInfo: * @id: the id of the domain * * extract the domain 0 information */ static void getDomainInfo(int id) { virConnectPtr conn = NULL; /* the hypervisor connection */ virDomainPtr dom = NULL; /* the domain being checked */ virDomainInfo info; /* the information being fetched */ int ret; /* NULL means connect to local Xen hypervisor */ conn = virConnectOpenReadOnly(NULL); if (conn == NULL) { fprintf(stderr, "Failed to connect to hypervisor\n"); goto error; } /* Find the domain of the given id */ dom = virDomainLookupByID(conn, id); if (dom == NULL) { fprintf(stderr, "Failed to find Domain %d\n", id); goto error; } /* Get the information */ ret = virDomainGetInfo(dom, &info); if (ret < 0) { fprintf(stderr, "Failed to get information for Domain %d\n", id); goto error; } printf("Domains %d: %d CPUs\n", id, info.nrVirtCpu); error: if (dom != NULL) virDomainFree(dom); if (conn != NULL) virConnectClose(conn); } int main() { getDomainInfo(0); return(0); } 0707010002bb66000081a40000000000000002000000014ae1948e00002070000000b600010006ffffffffffffffff0000002a00000000reloc/usr/share/doc/libvirt/html/FAQ.html libvirt: FAQ

FAQ

Table of Contents:

License(s)

  1. Licensing Terms for libvirt

    libvirt is released under the GNU Lesser General Public License, see the file COPYING.LIB in the distribution for the precise wording. The only library that libvirt depends upon is the Xen store access library which is also licenced under the LGPL.

  2. Can I embed libvirt in a proprietary application ?

    Yes. The LGPL allows you to embed libvirt into a proprietary application. It would be graceful to send-back bug fixes and improvements as patches for possible incorporation in the main development tree. It will decrease your maintenance costs anyway if you do so.

Installation

  1. Where can I get libvirt ?

    The original distribution comes from ftp://libvirt.org/libvirt/.

  2. I can't install the libvirt/libvirt-devel RPM packages due to failed dependencies

    The most generic solution is to re-fetch the latest src.rpm , and rebuild it locally with

    rpm --rebuild libvirt-xxx.src.rpm.

    If everything goes well it will generate two binary rpm packages (one providing the shared libs and virsh, and the other one, the -devel package, providing includes, static libraries and scripts needed to build applications with libvirt that you can install locally.

    One can also rebuild the RPMs from a tarball:

    rpmbuild -ta libdir-xxx.tar.gz

    Or from a configured tree with:

    make rpm

  3. Failure to use the API for non-root users

    Large parts of the API may only be accessible with root privileges, however the read only access to the xenstore data doesnot have to be forbidden to user, at least for monitoring purposes. If "virsh dominfo" fails to run as an user, change the mode of the xenstore read-only socket with:

    chmod 666 /var/run/xenstored/socket_ro

    and also make sure that the Xen Daemon is running correctly with local HTTP server enabled, this is defined in /etc/xen/xend-config.sxp which need the following line to be enabled:

    (xend-http-server yes)

    If needed restart the xend daemon after making the change with the following command run as root:

    service xend restart

Compilation

  1. What is the process to compile libvirt ?

    As most UNIX libraries libvirt follows the "standard":

    gunzip -c libvirt-xxx.tar.gz | tar xvf -

    cd libvirt-xxxx

    ./configure --help

    to see the options, then the compilation/installation proper

    ./configure [possible options]

    make

    make install

    At that point you may have to rerun ldconfig or a similar utility to update your list of installed shared libs.

  2. What other libraries are needed to compile/install libvirt ?

    Libvirt requires libxenstore, which is usually provided by the xen packages as well as the public headers to compile against libxenstore.

  3. I use the CVS version and there is no configure script

    The configure script (and other Makefiles) are generated. Use the autogen.sh script to regenerate the configure script and Makefiles, like:

    ./autogen.sh --prefix=/usr --disable-shared

Developer corner

  1. Troubles compiling or linking programs using libvirt

    To simplify the process of reusing the library, libvirt comes with pkgconfig support, which can be used directly from autoconf support or via the pkg-config command line tool, like:

    pkg-config libvirt --libs

0707010002bb6a000041ed0000000000000000000000024ae194b300000000000000b600010006ffffffffffffffff0000002600000000reloc/usr/share/doc/libvirt/html/html0707010002bb6b000081a40000000000000002000000014ae1948e0000028e000000b600010006ffffffffffffffff0000002f00000000reloc/usr/share/doc/libvirt/html/html/home.pngPNG  IHDRw=bKGD pHYs  ~tIME1KvIDATxՕkq?rCp ~CnpCAAJ .B-\'G]:ܠC -(8 Ԁ!fDғklbRoyxwpðIJ<of_-@RHf֟t^ښ$Q|pgv;X^^&s(bwwZF9&3඙ ^IRZUE.0Z]]U PYM8HGIekqqҀ! $۬3n e{-/seeeÌXOͷ$8==USQRR'9-s+B^ Cەs+%<7W :2IENDB`0707010002bb71000081a40000000000000002000000014ae1948e00000196000000b600010006ffffffffffffffff0000002d00000000reloc/usr/share/doc/libvirt/html/html/up.pngPNG  IHDRw=bKGD pHYs  ~tIME2.E#IDATx=J@Fo] !+2[Z<@/9|t$D9nnBjBRIsI:H8UPN1fcsN95M㧖ɵ 束1~pEe$I 7nrDf!;`'ykI䲤sI_]y^^I>O>?YBIENDB`0707010002bb70000081a40000000000000002000000014ae1948e000001d8000000b600010006ffffffffffffffff0000003000000000reloc/usr/share/doc/libvirt/html/html/right.pngPNG  IHDRw=bKGD pHYs  ~tIME2 I%=eIDATx!o@.'**M0$$?1~vIeEuLl&4䝠Bݛ|>$ݶoc libvirt: Module virterror from libvirt

Module virterror from libvirt

Provides the interfaces of the libvirt library to handle errors raised while using the library.

Table of Contents

Types

typedef struct _virError virError
typedef enum virErrorDomain
typedef enum virErrorLevel
typedef enum virErrorNumber
typedef virError * virErrorPtr

Functions

int	virConnCopyLastError		(virConnectPtr conn, 
virErrorPtr to) virErrorPtr virConnGetLastError (virConnectPtr conn) void virConnResetLastError (virConnectPtr conn) void virConnSetErrorFunc (virConnectPtr conn,
void * userData,
virErrorFunc handler) int virCopyLastError (virErrorPtr to) void virDefaultErrorFunc (virErrorPtr err) typedef virErrorFunc void virErrorFunc (void * userData,
virErrorPtr error) void virFreeError (virErrorPtr err) virErrorPtr virGetLastError (void) void virResetError (virErrorPtr err) void virResetLastError (void) virErrorPtr virSaveLastError (void) void virSetErrorFunc (void * userData,
virErrorFunc handler)

Description

Types

virError

struct virError{
intcode : The error code, a virErrorNumber
intdomain : What part of the library raised this error
char *message : human-readable informative error message
virErrorLevellevel : how consequent is the error
virConnectPtrconn : connection if available, deprecated see note above
virDomainPtrdom : domain if available, deprecated see note above
char *str1 : extra string information
char *str2 : extra string information
char *str3 : extra string information
intint1 : extra number information
intint2 : extra number information
virNetworkPtrnet : network if available, deprecated see note above
}

virErrorDomain

enum virErrorDomain {
VIR_FROM_NONE = 0
VIR_FROM_XEN = 1 : Error at Xen hypervisor layer
VIR_FROM_XEND = 2 : Error at connection with xend daemon
VIR_FROM_XENSTORE = 3 : Error at connection with xen store
VIR_FROM_SEXPR = 4 : Error in the S-Expression code
VIR_FROM_XML = 5 : Error in the XML code
VIR_FROM_DOM = 6 : Error when operating on a domain
VIR_FROM_RPC = 7 : Error in the XML-RPC code
VIR_FROM_PROXY = 8 : Error in the proxy code
VIR_FROM_CONF = 9 : Error in the configuration file handling
VIR_FROM_QEMU = 10 : Error at the QEMU daemon
VIR_FROM_NET = 11 : Error when operating on a network
VIR_FROM_TEST = 12 : Error from test driver
VIR_FROM_REMOTE = 13 : Error from remote driver
VIR_FROM_OPENVZ = 14 : Error from OpenVZ driver
VIR_FROM_XENXM = 15 : Error at Xen XM layer
VIR_FROM_STATS_LINUX = 16 : Error in the Linux Stats code
VIR_FROM_LXC = 17 : Error from Linux Container driver
VIR_FROM_STORAGE = 18 : Error from storage driver
VIR_FROM_NETWORK = 19 : Error from network config
VIR_FROM_DOMAIN = 20 : Error from domain config
VIR_FROM_UML = 21 : Error at the UML driver
VIR_FROM_NODEDEV = 22 : Error from node device monitor
VIR_FROM_XEN_INOTIFY = 23 : Error from xen inotify layer
VIR_FROM_SECURITY = 24 : Error from security framework
VIR_FROM_VBOX = 25 : Error from VirtualBox driver
VIR_FROM_INTERFACE = 26 : Error when operating on an interface
VIR_FROM_ONE = 27 : Error from OpenNebula driver
VIR_FROM_ESX = 28 : Error from ESX driver
VIR_FROM_PHYP = 29 : Error from IBM power hypervisor
}

virErrorLevel

enum virErrorLevel {
VIR_ERR_NONE = 0
VIR_ERR_WARNING = 1 : A simple warning
VIR_ERR_ERROR = 2 : An error
}

virErrorNumber

enum virErrorNumber {
VIR_ERR_OK = 0
VIR_ERR_INTERNAL_ERROR = 1 : internal error
VIR_ERR_NO_MEMORY = 2 : memory allocation failure
VIR_ERR_NO_SUPPORT = 3 : no support for this function
VIR_ERR_UNKNOWN_HOST = 4 : could not resolve hostname
VIR_ERR_NO_CONNECT = 5 : can't connect to hypervisor
VIR_ERR_INVALID_CONN = 6 : invalid connection object
VIR_ERR_INVALID_DOMAIN = 7 : invalid domain object
VIR_ERR_INVALID_ARG = 8 : invalid function argument
VIR_ERR_OPERATION_FAILED = 9 : a command to hypervisor failed
VIR_ERR_GET_FAILED = 10 : a HTTP GET command to failed
VIR_ERR_POST_FAILED = 11 : a HTTP POST command to failed
VIR_ERR_HTTP_ERROR = 12 : unexpected HTTP error code
VIR_ERR_SEXPR_SERIAL = 13 : failure to serialize an S-Expr
VIR_ERR_NO_XEN = 14 : could not open Xen hypervisor control
VIR_ERR_XEN_CALL = 15 : failure doing an hypervisor call
VIR_ERR_OS_TYPE = 16 : unknown OS type
VIR_ERR_NO_KERNEL = 17 : missing kernel information
VIR_ERR_NO_ROOT = 18 : missing root device information
VIR_ERR_NO_SOURCE = 19 : missing source device information
VIR_ERR_NO_TARGET = 20 : missing target device information
VIR_ERR_NO_NAME = 21 : missing domain name information
VIR_ERR_NO_OS = 22 : missing domain OS information
VIR_ERR_NO_DEVICE = 23 : missing domain devices information
VIR_ERR_NO_XENSTORE = 24 : could not open Xen Store control
VIR_ERR_DRIVER_FULL = 25 : too many drivers registered
VIR_ERR_CALL_FAILED = 26 : not supported by the drivers (DEPRECATED)
VIR_ERR_XML_ERROR = 27 : an XML description is not well formed or broken
VIR_ERR_DOM_EXIST = 28 : the domain already exist
VIR_ERR_OPERATION_DENIED = 29 : operation forbidden on read-only connections
VIR_ERR_OPEN_FAILED = 30 : failed to open a conf file
VIR_ERR_READ_FAILED = 31 : failed to read a conf file
VIR_ERR_PARSE_FAILED = 32 : failed to parse a conf file
VIR_ERR_CONF_SYNTAX = 33 : failed to parse the syntax of a conf file
VIR_ERR_WRITE_FAILED