From b62cdc14054288c65e24d62b1304e7d6f7d44a5d Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Mon, 26 Jun 2006 15:02:18 +0000 Subject: [PATCH] * configure.in libvirt.spec.in docs/examples/* include/Makefile.am include/libvirt/virterror.h python/generator.py python/libvir.c python/libvirt_wrap.h src/driver.h src/internal.h src/test.h src/virsh.c src/virterror.c src/xend_internal.c src/xend_internal.h src/xml.c src/xml.h: moved the includes from include/ to include/libvirt to reflect the installed include tree. This avoid using "" in the includes themselves. Daniel --- ChangeLog | 10 + configure.in | 3 +- docs/APIconstructors.html | 14 +- docs/APIfiles.html | 130 +-- docs/APIfunctions.html | 61 +- docs/APIsymbols.html | 130 +-- docs/Makefile.am | 2 +- docs/devhelp/general.html | 7 +- docs/examples/.cvsignore | 2 +- docs/examples/Makefile.am | 14 +- docs/examples/examples.xml | 68 +- docs/examples/info1.c | 2 +- docs/examples/suspend.c | 2 +- docs/html/book1.html | 2 +- docs/html/index.html | 2 +- docs/html/libvirt-lib.html | 2 +- docs/libvirt-api.xml | 524 --------- docs/libvirt-refs.xml | 2169 ----------------------------------- include/Makefile.am | 11 +- include/libvirt.h | 297 ----- include/libvirt.h.in | 297 ----- include/libvirt/virterror.h | 2 +- include/virterror.h | 145 --- libvirt.spec.in | 2 +- python/generator.py | 2 +- python/libvir.c | 4 +- python/libvirt_wrap.h | 4 +- src/driver.h | 4 +- src/internal.h | 4 +- src/libvirt.c | 2 +- src/test.h | 65 +- src/virsh.c | 4 +- src/virterror.c | 4 +- src/xend_internal.c | 2 +- src/xend_internal.h | 2 +- src/xml.c | 2 +- src/xml.h | 2 +- tests/xmlrpctest.c | 2 +- 38 files changed, 120 insertions(+), 3881 deletions(-) delete mode 100644 include/libvirt.h delete mode 100644 include/libvirt.h.in delete mode 100644 include/virterror.h diff --git a/ChangeLog b/ChangeLog index 1c8d46eefb..9daaeb1f8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Mon Jun 26 16:05:27 CEST 2006 Daniel Veillard + + * configure.in libvirt.spec.in docs/examples/* include/Makefile.am + include/libvirt/virterror.h python/generator.py python/libvir.c + python/libvirt_wrap.h src/driver.h src/internal.h src/test.h + src/virsh.c src/virterror.c src/xend_internal.c src/xend_internal.h + src/xml.c src/xml.h: moved the includes from include/ to + include/libvirt to reflect the installed include tree. This + avoid using "" in the includes themselves. + Wed Jun 21 14:41:04 CEST 2006 Daniel Veillard * NEWS libvirt.spec.in docs/*: preparing release of 0.1.1 diff --git a/configure.in b/configure.in index 588cd8d9c6..97957388b9 100644 --- a/configure.in +++ b/configure.in @@ -253,6 +253,7 @@ cp COPYING.LIB COPYING AC_OUTPUT(Makefile src/Makefile include/Makefile docs/Makefile \ docs/examples/Makefile docs/devhelp/Makefile \ docs/examples/python/Makefile \ - libvirt.pc libvirt.spec include/libvirt.h \ + libvirt.pc libvirt.spec \ + include/libvirt/Makefile include/libvirt/libvirt.h \ python/Makefile python/tests/Makefile \ tests/Makefile) diff --git a/docs/APIconstructors.html b/docs/APIconstructors.html index 3349078b76..4a06dee9bc 100644 --- a/docs/APIconstructors.html +++ b/docs/APIconstructors.html @@ -1,15 +1,3 @@ -List of constructors for libvirt +List of constructors for libvirt

List of constructors for libvirt

diff --git a/docs/APIfiles.html b/docs/APIfiles.html index a82dd119e8..46bbda4081 100644 --- a/docs/APIfiles.html +++ b/docs/APIfiles.html @@ -1,131 +1,3 @@ -List of Symbols per Module for libvirt

List of Symbols per Module for libvirt

Module libvirt:

LIBVIR_VERSION_NUMBER
-VIR_DEVICE_DEFAULT
-VIR_DEVICE_RO
-VIR_DEVICE_RW
-VIR_DEVICE_RW_FORCE
-VIR_DOMAIN_BLOCKED
-VIR_DOMAIN_CRASHED
-VIR_DOMAIN_DESTROY
-VIR_DOMAIN_NONE
-VIR_DOMAIN_NOSTATE
-VIR_DOMAIN_PAUSED
-VIR_DOMAIN_PRESERVE
-VIR_DOMAIN_RENAME_RESTART
-VIR_DOMAIN_RESTART
-VIR_DOMAIN_RUNNING
-VIR_DOMAIN_SHUTDOWN
-VIR_DOMAIN_SHUTOFF
-_virDomainInfo
-_virDomainKernel
-_virNodeInfo
-virConnect
-virConnectClose
-virConnectGetType
-virConnectGetVersion
-virConnectListDefinedDomains
-virConnectListDomains
-virConnectNumOfDomains
-virConnectOpen
-virConnectOpenReadOnly
-virConnectPtr
-virDeviceMode
-virDomain
-virDomainCreate
-virDomainCreateFlags
-virDomainCreateLinux
-virDomainDefineXML
-virDomainDestroy
-virDomainFree
-virDomainGetID
-virDomainGetInfo
-virDomainGetMaxMemory
-virDomainGetName
-virDomainGetOSType
-virDomainGetUUID
-virDomainGetUUIDString
-virDomainGetXMLDesc
-virDomainInfo
-virDomainInfoPtr
-virDomainKernel
-virDomainKernelPtr
-virDomainLookupByID
-virDomainLookupByName
-virDomainLookupByUUID
-virDomainLookupByUUIDString
-virDomainPtr
-virDomainReboot
-virDomainRestart
-virDomainRestore
-virDomainResume
-virDomainSave
-virDomainSetMaxMemory
-virDomainSetMemory
-virDomainShutdown
-virDomainState
-virDomainSuspend
-virDomainUndefine
-virGetVersion
-virInitialize
-virNodeGetInfo
-virNodeInfo
-virNodeInfoPtr
-

Module virterror:

VIR_ERR_CALL_FAILED
-VIR_ERR_DOM_EXIST
-VIR_ERR_DRIVER_FULL
-VIR_ERR_ERROR
-VIR_ERR_GET_FAILED
-VIR_ERR_HTTP_ERROR
-VIR_ERR_INTERNAL_ERROR
-VIR_ERR_INVALID_ARG
-VIR_ERR_INVALID_CONN
-VIR_ERR_INVALID_DOMAIN
-VIR_ERR_NONE
-VIR_ERR_NO_CONNECT
-VIR_ERR_NO_DEVICE
-VIR_ERR_NO_KERNEL
-VIR_ERR_NO_MEMORY
-VIR_ERR_NO_NAME
-VIR_ERR_NO_OS
-VIR_ERR_NO_ROOT
-VIR_ERR_NO_SOURCE
-VIR_ERR_NO_SUPPORT
-VIR_ERR_NO_TARGET
-VIR_ERR_NO_XEN
-VIR_ERR_NO_XENSTORE
-VIR_ERR_OK
-VIR_ERR_OPERATION_FAILED
-VIR_ERR_OS_TYPE
-VIR_ERR_POST_FAILED
-VIR_ERR_SEXPR_SERIAL
-VIR_ERR_UNKNOWN_HOST
-VIR_ERR_WARNING
-VIR_ERR_XEN_CALL
-VIR_ERR_XML_ERROR
-VIR_FROM_DOM
-VIR_FROM_NONE
-VIR_FROM_RPC
-VIR_FROM_SEXPR
-VIR_FROM_XEN
-VIR_FROM_XEND
-VIR_FROM_XENSTORE
-VIR_FROM_XML
-_virError
-virConnCopyLastError
-virConnGetLastError
-virConnResetLastError
-virConnSetErrorFunc
-virCopyLastError
-virDefaultErrorFunc
-virError
-virErrorDomain
-virErrorFunc
-virErrorLevel
-virErrorNumber
-virErrorPtr
-virGetLastError
-virResetError
-virResetLastError
-virSetErrorFunc
-

+List of Symbols per Module for libvirt

List of Symbols per Module for libvirt

diff --git a/docs/APIfunctions.html b/docs/APIfunctions.html index 0bebb89495..d933072ee2 100644 --- a/docs/APIfunctions.html +++ b/docs/APIfunctions.html @@ -1,62 +1,3 @@ -List of function manipulating types in libvirt

+List of function manipulating types in libvirt

List of function manipulating types in libvirt

diff --git a/docs/APIsymbols.html b/docs/APIsymbols.html index bac3ad2df5..3742cd669b 100644 --- a/docs/APIsymbols.html +++ b/docs/APIsymbols.html @@ -1,131 +1,3 @@ -Alphabetic List of Symbols in libvirt

Alphabetic List of Symbols in libvirt

Letter L:

LIBVIR_VERSION_NUMBER
-

Letter V:

VIR_DEVICE_DEFAULT
-VIR_DEVICE_RO
-VIR_DEVICE_RW
-VIR_DEVICE_RW_FORCE
-VIR_DOMAIN_BLOCKED
-VIR_DOMAIN_CRASHED
-VIR_DOMAIN_DESTROY
-VIR_DOMAIN_NONE
-VIR_DOMAIN_NOSTATE
-VIR_DOMAIN_PAUSED
-VIR_DOMAIN_PRESERVE
-VIR_DOMAIN_RENAME_RESTART
-VIR_DOMAIN_RESTART
-VIR_DOMAIN_RUNNING
-VIR_DOMAIN_SHUTDOWN
-VIR_DOMAIN_SHUTOFF
-VIR_ERR_CALL_FAILED
-VIR_ERR_DOM_EXIST
-VIR_ERR_DRIVER_FULL
-VIR_ERR_ERROR
-VIR_ERR_GET_FAILED
-VIR_ERR_HTTP_ERROR
-VIR_ERR_INTERNAL_ERROR
-VIR_ERR_INVALID_ARG
-VIR_ERR_INVALID_CONN
-VIR_ERR_INVALID_DOMAIN
-VIR_ERR_NONE
-VIR_ERR_NO_CONNECT
-VIR_ERR_NO_DEVICE
-VIR_ERR_NO_KERNEL
-VIR_ERR_NO_MEMORY
-VIR_ERR_NO_NAME
-VIR_ERR_NO_OS
-VIR_ERR_NO_ROOT
-VIR_ERR_NO_SOURCE
-VIR_ERR_NO_SUPPORT
-VIR_ERR_NO_TARGET
-VIR_ERR_NO_XEN
-VIR_ERR_NO_XENSTORE
-VIR_ERR_OK
-VIR_ERR_OPERATION_FAILED
-VIR_ERR_OS_TYPE
-VIR_ERR_POST_FAILED
-VIR_ERR_SEXPR_SERIAL
-VIR_ERR_UNKNOWN_HOST
-VIR_ERR_WARNING
-VIR_ERR_XEN_CALL
-VIR_ERR_XML_ERROR
-VIR_FROM_DOM
-VIR_FROM_NONE
-VIR_FROM_RPC
-VIR_FROM_SEXPR
-VIR_FROM_XEN
-VIR_FROM_XEND
-VIR_FROM_XENSTORE
-VIR_FROM_XML
-

Letter _:

_virDomainInfo
-_virDomainKernel
-_virError
-_virNodeInfo
-

Letter v:

virConnCopyLastError
-virConnGetLastError
-virConnResetLastError
-virConnSetErrorFunc
-virConnect
-virConnectClose
-virConnectGetType
-virConnectGetVersion
-virConnectListDefinedDomains
-virConnectListDomains
-virConnectNumOfDomains
-virConnectOpen
-virConnectOpenReadOnly
-virConnectPtr
-virCopyLastError
-virDefaultErrorFunc
-virDeviceMode
-virDomain
-virDomainCreate
-virDomainCreateFlags
-virDomainCreateLinux
-virDomainDefineXML
-virDomainDestroy
-virDomainFree
-virDomainGetID
-virDomainGetInfo
-virDomainGetMaxMemory
-virDomainGetName
-virDomainGetOSType
-virDomainGetUUID
-virDomainGetUUIDString
-virDomainGetXMLDesc
-virDomainInfo
-virDomainInfoPtr
-virDomainKernel
-virDomainKernelPtr
-virDomainLookupByID
-virDomainLookupByName
-virDomainLookupByUUID
-virDomainLookupByUUIDString
-virDomainPtr
-virDomainReboot
-virDomainRestart
-virDomainRestore
-virDomainResume
-virDomainSave
-virDomainSetMaxMemory
-virDomainSetMemory
-virDomainShutdown
-virDomainState
-virDomainSuspend
-virDomainUndefine
-virError
-virErrorDomain
-virErrorFunc
-virErrorLevel
-virErrorNumber
-virErrorPtr
-virGetLastError
-virGetVersion
-virInitialize
-virNodeGetInfo
-virNodeInfo
-virNodeInfoPtr
-virResetError
-virResetLastError
-virSetErrorFunc
-

+Alphabetic List of Symbols in libvirt

Alphabetic List of Symbols in libvirt

diff --git a/docs/Makefile.am b/docs/Makefile.am index e488ba0e1a..a9996526d6 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -46,7 +46,7 @@ $(srcdir)/html/index.html: libvirt-api.xml $(srcdir)/newapi.xsl echo "Validating the resulting XHTML pages" ; \ $(XMLLINT) --nonet --valid --noout html/*.html ; fi ); -libvirt-api.xml libvirt-refs.xml: apibuild.py ../include/*.h ../src/*.h ../src/*.c +libvirt-api.xml libvirt-refs.xml: apibuild.py ../include/libvirt/*.h ../src/*.h ../src/*.c -(./apibuild.py) $(top_builddir)/NEWS: $(top_srcdir)/docs/news.xsl $(top_srcdir)/docs/news.html diff --git a/docs/devhelp/general.html b/docs/devhelp/general.html index 998f2b18a6..62aedf69bc 100644 --- a/docs/devhelp/general.html +++ b/docs/devhelp/general.html @@ -22,17 +22,12 @@ Home - - - Next - - libvirt Reference Manual

libvirt API Modules

-

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

+

diff --git a/docs/examples/.cvsignore b/docs/examples/.cvsignore index eca76badc6..5f28847a8a 100644 --- a/docs/examples/.cvsignore +++ b/docs/examples/.cvsignore @@ -1,5 +1,5 @@ .memdump Makefile.in Makefile -suspend info1 +suspend diff --git a/docs/examples/Makefile.am b/docs/examples/Makefile.am index b6d7689365..18e1b134dd 100644 --- a/docs/examples/Makefile.am +++ b/docs/examples/Makefile.am @@ -18,24 +18,24 @@ install-data-local: EXTRA_DIST=examples.xsl index.py examples.xml -noinst_PROGRAMS=suspend info1 - -suspend_SOURCES=suspend.c -suspend_LDFLAGS= -suspend_DEPENDENCIES= $(DEPS) -suspend_LDADD= $(LDADDS) +noinst_PROGRAMS=info1 suspend info1_SOURCES=info1.c info1_LDFLAGS= info1_DEPENDENCIES= $(DEPS) info1_LDADD= $(LDADDS) +suspend_SOURCES=suspend.c +suspend_LDFLAGS= +suspend_DEPENDENCIES= $(DEPS) +suspend_LDADD= $(LDADDS) + valgrind: $(MAKE) CHECKER='valgrind' tests tests: $(noinst_PROGRAMS) @(echo '## examples regression tests') - @($(CHECKER) ./suspend) @($(CHECKER) ./info1) + @($(CHECKER) ./suspend) diff --git a/docs/examples/examples.xml b/docs/examples/examples.xml index af7d4b9fbb..bceeda331e 100644 --- a/docs/examples/examples.xml +++ b/docs/examples/examples.xml @@ -1,26 +1,4 @@ - - Suspend a domain and then resume its execution - Demonstrate the basic use of the library to suspend and resume a domain. If no id is given on the command line this script will suspend and resume the first domain found which is not Domain 0. - suspend [id] - suspend - Daniel Veillard - see Copyright for the status of this software. -

Scheduling
- - - - - - - - - - - - - - Extract informations about Xen domain 0 Demonstrate the basic use of the library to connect to the hypervisor and extract domain informations. @@ -32,41 +10,63 @@ - - - - - - + + + + + + + + + + Suspend a domain and then resume its execution + Demonstrate the basic use of the library to suspend and resume a domain. If no id is given on the command line this script will suspend and resume the first domain found which is not Domain 0. + suspend [id] + suspend + Daniel Veillard + see Copyright for the status of this software. +
Scheduling
+ + + + + + + + + + + +
- + - + - + - + - + - + diff --git a/docs/examples/info1.c b/docs/examples/info1.c index 0a192f334b..427f91f519 100644 --- a/docs/examples/info1.c +++ b/docs/examples/info1.c @@ -10,7 +10,7 @@ */ #include -#include +#include /** * getDomainInfo: diff --git a/docs/examples/suspend.c b/docs/examples/suspend.c index 0c56786467..80e4da7b3a 100644 --- a/docs/examples/suspend.c +++ b/docs/examples/suspend.c @@ -13,7 +13,7 @@ #include #include -#include +#include virConnectPtr conn = NULL; /* the hypervisor connection */ diff --git a/docs/html/book1.html b/docs/html/book1.html index 28b5113721..3fe8028099 100644 --- a/docs/html/book1.html +++ b/docs/html/book1.html @@ -1,3 +1,3 @@ -Reference Manual for libvirt

Reference Manual for libvirt

Table of Contents

  • libvirt: core interfaces for the libvirt library
  • virterror: error handling interfaces for the libvirt library

+Reference Manual for libvirt

Reference Manual for libvirt

Table of Contents

    diff --git a/docs/html/index.html b/docs/html/index.html index 28b5113721..3fe8028099 100644 --- a/docs/html/index.html +++ b/docs/html/index.html @@ -1,3 +1,3 @@ -Reference Manual for libvirt

    Reference Manual for libvirt

    Table of Contents

    • libvirt: core interfaces for the libvirt library
    • virterror: error handling interfaces for the libvirt library

    +Reference Manual for libvirt

    Reference Manual for libvirt

    Table of Contents

      diff --git a/docs/html/libvirt-lib.html b/docs/html/libvirt-lib.html index 28b5113721..3fe8028099 100644 --- a/docs/html/libvirt-lib.html +++ b/docs/html/libvirt-lib.html @@ -1,3 +1,3 @@ -Reference Manual for libvirt

      Reference Manual for libvirt

      Table of Contents

      • libvirt: core interfaces for the libvirt library
      • virterror: error handling interfaces for the libvirt library

      +Reference Manual for libvirt

      Reference Manual for libvirt

      Table of Contents

        diff --git a/docs/libvirt-api.xml b/docs/libvirt-api.xml index 70e598f437..1e7563fc59 100644 --- a/docs/libvirt-api.xml +++ b/docs/libvirt-api.xml @@ -1,531 +1,7 @@ - - core interfaces for the libvirt library - Provides the interfaces of the libvirt library to handle Xen domains from a process running in domain 0 - Daniel Veillard <veillard@redhat.com> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error handling interfaces for the libvirt library - Provides the interfaces of the libvirt library to handle errors raised while using the library. - Daniel Veillard <veillard@redhat.com> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Macro providing the version of the library as version * 1,000,000 + minor * 1000 + micro - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - a virConnectPtr is pointer to a virConnect private structure, this is the type used to reference a connection to the Xen Hypervisor in the API. - - - - - - - - - - - - - a virDomainInfoPtr is a pointer to a virDomainInfo structure. - - - - - - - - - a virDomainKernelPtr is a pointer to a virDomainKernel structure. - - - a virDomainPtr is pointer to a virDomain private structure, this is the type used to reference a Xen domain in the API. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - a virNodeInfoPtr is a pointer to a virNodeInfo structure. - - - Copy the content of the last error caught on that connection One will need to free the result with virResetError() - - - - - - Provide a pointer to the last error caught on that connection Simpler but may not be suitable for multithreaded accesses, in which case use virConnCopyLastError() - - - - - Reset the last error caught on that connection - - - - - 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. - - - - - - - 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. - - - - - Get the name of the Hypervisor software used. - - - - - Get the version level of the Hypervisor running. This may work only with hypervisor call, i.e. with priviledged access to the hypervisor, not with a Read-Only connection. - - - - - - list the defined domains, stores the pointers to the names in @names - - - - - - - Collect the list of active domains, and store their ID in @maxids - - - - - - - Provides the number of active domains. - - - - - This function should be called first to get a connection to the Hypervisor and xen store - - - - - This function should be called first to get a restricted connection to the libbrary functionalities. The set of APIs usable are then restricted on the available methods to control the domains. - - - - - Copy the content of the last error caught at the library level One will need to free the result with virResetError() - - - - - Default routine reporting an error to stderr. - - - - - launch a defined domain. If the call succeed the domain moves from the defined to the running domains pools. - - - - - Launch a new Linux guest domain, based on an XML description similar to the one returned by virDomainGetXMLDesc() This function may requires priviledged access to the hypervisor. - - - - - - - define a domain, but does not start it - - - - - - 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. The data structure is freed and should not be used thereafter if the call does not return an error. This function may requires priviledged access - - - - - Free the domain object. The running instance is kept alive. The data structure is freed and should not be used thereafter. - - - - - Get the hypervisor ID number for the domain - - - - - Extract information about a domain. Note that if the connection used to get the domain is limited only a partial set of the informations can be extracted. - - - - - - 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. - - - - - Get the public name for that domain - - - - - Get the type of domain operation system. - - - - - Get the UUID for a domain - - - - - - Get the UUID for a domain as string. For more information about UUID see RFC4122. - - - - - - Provide an XML description of the domain. The description may be reused later to relaunch the domain with virDomainCreateLinux(). - - - - - - Try to find a domain based on the hypervisor ID number - - - - - - Try to lookup a domain on the given hypervisor based on its name. - - - - - - Try to lookup a domain on the given hypervisor based on its UUID. - - - - - - Try to lookup a domain on the given hypervisor based on its UUID. - - - - - - 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. - - - - - - This method will restore a domain saved to disk by virDomainSave(). - - - - - - Resume an suspended domain, the process is restarted from the state where it was frozen by calling virSuspendDomain(). This function may requires priviledged access - - - - - 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. - - - - - - 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 priviledged access to the hypervisor. - - - - - - 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 priviledged access to the hypervisor. - - - - - - 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 ? - - - - - 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 priviledged access. - - - - - undefine a domain but does not stop it if it is running - - - - - Signature of a function to use when there is an error raised by the library. - - - - - - Provide a pointer to the last error caught at the library level Simpler but may not be suitable for multithreaded accesses, in which case use virCopyLastError() - - - - Provides two information back, @libVer is the version of the library while @typeVer will be the version of the hypervisor type @type against which the library was compiled. If @type is NULL, "Xen" is assumed, if @type is unknown or not availble, an error code will be returned and @typeVer will be 0. - - - - - - - Initialize the library. It's better to call this routine at startup in multithreaded applications to avoid potential race when initializing the library. - - - - Extract hardware information about the node. - - - - - - Reset the error being pointed to - - - - - Reset the last error caught at the library level. - - - - 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. - - - - diff --git a/docs/libvirt-refs.xml b/docs/libvirt-refs.xml index 571976854e..532865ea36 100644 --- a/docs/libvirt-refs.xml +++ b/docs/libvirt-refs.xml @@ -1,2184 +1,15 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/include/Makefile.am b/include/Makefile.am index 8589dc56f0..d075971d2d 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,11 +1,2 @@ ## Process this file with automake to produce Makefile.in - -virincdir = $(includedir)/libvirt - -virinc_HEADERS = libvirt.h \ - virterror.h - -install-exec-hook: - $(mkinstalldirs) $(DESTDIR)$(virincdir) - -EXTRA_DIST = libvirt.h.in +SUBDIRS=libvirt diff --git a/include/libvirt.h b/include/libvirt.h deleted file mode 100644 index ecd3efe76d..0000000000 --- a/include/libvirt.h +++ /dev/null @@ -1,297 +0,0 @@ -/* - * libvirt.h: - * Summary: core interfaces for the libvirt library - * Description: Provides the interfaces of the libvirt library to handle - * Xen domains from a process running in domain 0 - * - * Copy: Copyright (C) 2005,2006 Red Hat, Inc. - * - * See COPYING.LIB for the License of this software - * - * Author: Daniel Veillard - */ - -#ifndef __VIR_VIRLIB_H__ -#define __VIR_VIRLIB_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * virConnect: - * - * a virConnect is a private structure representing a connection to - * the Xen 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 Xen Hypervisor in the API. - */ -typedef virConnect *virConnectPtr; - -/** - * virDomain: - * - * a virDomain is a private structure representing a Xen domain. - */ -typedef struct _virDomain virDomain; - -/** - * virDomainPtr: - * - * a virDomainPtr is pointer to a virDomain private structure, this is the - * type used to reference a Xen 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; - -/** - * virDomainRestart: - * - * Flags that determine the action to take on a shutdown or crash of a domain - */ -typedef enum { - VIR_DOMAIN_DESTROY = 1, /* destroy the domain */ - VIR_DOMAIN_RESTART = 2, /* restart the domain */ - VIR_DOMAIN_PRESERVE= 3, /* keep as is, need manual destroy, for debug */ - VIR_DOMAIN_RENAME_RESTART= 4/* restart under an new unique name */ -} virDomainRestart; - -/** - * virDeviceMode: - * - * Flags that determine permission to expose a device to the guest - */ -typedef enum { - VIR_DEVICE_DEFAULT = 0, /* Default mode */ - VIR_DEVICE_RO = 1, /* Access read-only */ - VIR_DEVICE_RW = 2, /* Access read-write */ - VIR_DEVICE_RW_FORCE= 3 /* Forced read-write even if already used */ -} virDeviceMode; - -/** - * virDomainInfoPtr: - * - * a virDomainInfo is a structure filled by virDomainGetInfo() and extracting - * runtime informations for a given active Domain - */ - -typedef struct _virDomainInfo virDomainInfo; - -struct _virDomainInfo { - unsigned char state; /* the running state, one of virDomainFlags */ - 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; - -/** - * virDomainKernel: - * - * a virDomainImage is the set of kernel related informations associated - * to a domain - */ - -typedef struct _virDomainKernel virDomainKernel; - -struct _virDomainKernel { - const char *kernel; /* filename pointing to the kernel image */ - const char *ramdisk; /* an optional init ramdisk */ - const char *root; /* an optional root block device */ - const char *extra; /* optional kernel command line parameters */ -}; - -/** - * virDomainKernelPtr: - * - * a virDomainKernelPtr is a pointer to a virDomainKernel structure. - */ - -typedef virDomainKernel *virDomainKernelPtr; - -/** - * virDomainCreateFlags: - * - * Flags OR'ed together to provide specific behaviour when creating a - * Domain. - */ -typedef enum { - VIR_DOMAIN_NONE = 0 -} virDomainCreateFlags; - -/** - * virNodeInfoPtr: - * - * a virNodeInfo is a structure filled by virNodeGetInfo() and providing - * the informations 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 */ -}; - -/** - * virNodeInfoPtr: - * - * a virNodeInfoPtr is a pointer to a virNodeInfo structure. - */ - -typedef virNodeInfo *virNodeInfoPtr; - -/* library versionning */ - -/** - * LIBVIR_VERSION_NUMBER: - * - * Macro providing the version of the library as - * version * 1,000,000 + minor * 1000 + micro - */ - -#define LIBVIR_VERSION_NUMBER 1001 - -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); -int virConnectClose (virConnectPtr conn); -const char * virConnectGetType (virConnectPtr conn); -int virConnectGetVersion (virConnectPtr conn, - unsigned long *hvVer); -int virNodeGetInfo (virConnectPtr conn, - virNodeInfoPtr info); - -/* - * Gather list of running domains - */ -int virConnectListDomains (virConnectPtr conn, - int *ids, - int maxids); - -/* - * Number of domains - */ -int virConnectNumOfDomains (virConnectPtr conn); - - -/* - * Domain creation and destruction - */ -virDomainPtr virDomainCreateLinux (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 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 runtime informations - */ -int virDomainGetInfo (virDomainPtr domain, - virDomainInfoPtr info); - -/* - * 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); -/* - * XML domain description - */ -char * virDomainGetXMLDesc (virDomainPtr domain, - int flags); - -/* - * defined but not running domains - */ -virDomainPtr virDomainDefineXML (virConnectPtr conn, - const char *xml); -int virDomainUndefine (virDomainPtr domain); -int virConnectListDefinedDomains(virConnectPtr conn, - const char **names, - int maxnames); -int virDomainCreate (virDomainPtr domain); - -#ifdef __cplusplus -} -#endif - -#endif /* __VIR_VIRLIB_H__ */ diff --git a/include/libvirt.h.in b/include/libvirt.h.in deleted file mode 100644 index 2668eaafcd..0000000000 --- a/include/libvirt.h.in +++ /dev/null @@ -1,297 +0,0 @@ -/* - * libvirt.h: - * Summary: core interfaces for the libvirt library - * Description: Provides the interfaces of the libvirt library to handle - * Xen domains from a process running in domain 0 - * - * Copy: Copyright (C) 2005,2006 Red Hat, Inc. - * - * See COPYING.LIB for the License of this software - * - * Author: Daniel Veillard - */ - -#ifndef __VIR_VIRLIB_H__ -#define __VIR_VIRLIB_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * virConnect: - * - * a virConnect is a private structure representing a connection to - * the Xen 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 Xen Hypervisor in the API. - */ -typedef virConnect *virConnectPtr; - -/** - * virDomain: - * - * a virDomain is a private structure representing a Xen domain. - */ -typedef struct _virDomain virDomain; - -/** - * virDomainPtr: - * - * a virDomainPtr is pointer to a virDomain private structure, this is the - * type used to reference a Xen 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; - -/** - * virDomainRestart: - * - * Flags that determine the action to take on a shutdown or crash of a domain - */ -typedef enum { - VIR_DOMAIN_DESTROY = 1, /* destroy the domain */ - VIR_DOMAIN_RESTART = 2, /* restart the domain */ - VIR_DOMAIN_PRESERVE= 3, /* keep as is, need manual destroy, for debug */ - VIR_DOMAIN_RENAME_RESTART= 4/* restart under an new unique name */ -} virDomainRestart; - -/** - * virDeviceMode: - * - * Flags that determine permission to expose a device to the guest - */ -typedef enum { - VIR_DEVICE_DEFAULT = 0, /* Default mode */ - VIR_DEVICE_RO = 1, /* Access read-only */ - VIR_DEVICE_RW = 2, /* Access read-write */ - VIR_DEVICE_RW_FORCE= 3 /* Forced read-write even if already used */ -} virDeviceMode; - -/** - * virDomainInfoPtr: - * - * a virDomainInfo is a structure filled by virDomainGetInfo() and extracting - * runtime informations for a given active Domain - */ - -typedef struct _virDomainInfo virDomainInfo; - -struct _virDomainInfo { - unsigned char state; /* the running state, one of virDomainFlags */ - 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; - -/** - * virDomainKernel: - * - * a virDomainImage is the set of kernel related informations associated - * to a domain - */ - -typedef struct _virDomainKernel virDomainKernel; - -struct _virDomainKernel { - const char *kernel; /* filename pointing to the kernel image */ - const char *ramdisk; /* an optional init ramdisk */ - const char *root; /* an optional root block device */ - const char *extra; /* optional kernel command line parameters */ -}; - -/** - * virDomainKernelPtr: - * - * a virDomainKernelPtr is a pointer to a virDomainKernel structure. - */ - -typedef virDomainKernel *virDomainKernelPtr; - -/** - * virDomainCreateFlags: - * - * Flags OR'ed together to provide specific behaviour when creating a - * Domain. - */ -typedef enum { - VIR_DOMAIN_NONE = 0 -} virDomainCreateFlags; - -/** - * virNodeInfoPtr: - * - * a virNodeInfo is a structure filled by virNodeGetInfo() and providing - * the informations 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 */ -}; - -/** - * virNodeInfoPtr: - * - * a virNodeInfoPtr is a pointer to a virNodeInfo structure. - */ - -typedef virNodeInfo *virNodeInfoPtr; - -/* library versionning */ - -/** - * LIBVIR_VERSION_NUMBER: - * - * Macro providing the version of the library as - * version * 1,000,000 + minor * 1000 + micro - */ - -#define LIBVIR_VERSION_NUMBER @LIBVIRT_VERSION_NUMBER@ - -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); -int virConnectClose (virConnectPtr conn); -const char * virConnectGetType (virConnectPtr conn); -int virConnectGetVersion (virConnectPtr conn, - unsigned long *hvVer); -int virNodeGetInfo (virConnectPtr conn, - virNodeInfoPtr info); - -/* - * Gather list of running domains - */ -int virConnectListDomains (virConnectPtr conn, - int *ids, - int maxids); - -/* - * Number of domains - */ -int virConnectNumOfDomains (virConnectPtr conn); - - -/* - * Domain creation and destruction - */ -virDomainPtr virDomainCreateLinux (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 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 runtime informations - */ -int virDomainGetInfo (virDomainPtr domain, - virDomainInfoPtr info); - -/* - * 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); -/* - * XML domain description - */ -char * virDomainGetXMLDesc (virDomainPtr domain, - int flags); - -/* - * defined but not running domains - */ -virDomainPtr virDomainDefineXML (virConnectPtr conn, - const char *xml); -int virDomainUndefine (virDomainPtr domain); -int virConnectListDefinedDomains(virConnectPtr conn, - const char **names, - int maxnames); -int virDomainCreate (virDomainPtr domain); - -#ifdef __cplusplus -} -#endif - -#endif /* __VIR_VIRLIB_H__ */ diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h index 992cac3298..eca500b32d 100644 --- a/include/libvirt/virterror.h +++ b/include/libvirt/virterror.h @@ -14,7 +14,7 @@ #ifndef __VIR_VIRERR_H__ #define __VIR_VIRERR_H__ -#include "libvirt.h" +#include #ifdef __cplusplus extern "C" { diff --git a/include/virterror.h b/include/virterror.h deleted file mode 100644 index 992cac3298..0000000000 --- a/include/virterror.h +++ /dev/null @@ -1,145 +0,0 @@ -/* - * 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 "libvirt.h" - -#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-Epression 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 */ -} virErrorDomain; - - -/** - * virError: - * - * A libvirt Error instance. - */ - -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; /* the connection if available */ - virDomainPtr dom; /* the domain if available */ - 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 */ -}; - -/** - * 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 connection */ - 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 */ - VIR_ERR_XML_ERROR, /* an XML description is not well formed or broken */ - VIR_ERR_DOM_EXIST /* the domain already exist */ -} 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); -void virResetLastError (void); -void virResetError (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__ */ diff --git a/libvirt.spec.in b/libvirt.spec.in index 9e866b50ee..3233464f65 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -14,7 +14,7 @@ Requires: readline BuildRequires: libxml2-devel BuildRequires: readline-devel Obsoletes: libvir -ExclusiveArch: i386 x86_64 +ExclusiveArch: i386 x86_64 ia64 %description This C library provides an API to use the Xen virtualization framework, diff --git a/python/generator.py b/python/generator.py index 497f3b48a0..3345ac84ca 100755 --- a/python/generator.py +++ b/python/generator.py @@ -480,7 +480,7 @@ def buildStubs(): wrapper = open("libvirt-py.c", "w") wrapper.write("/* Generated */\n\n") wrapper.write("#include \n") - wrapper.write("#include \n") + wrapper.write("#include \n") wrapper.write("#include \"libvirt_wrap.h\"\n") wrapper.write("#include \"libvirt-py.h\"\n\n") for function in functions.keys(): diff --git a/python/libvir.c b/python/libvir.c index 786d47a60e..17fb4a17d2 100644 --- a/python/libvir.c +++ b/python/libvir.c @@ -10,8 +10,8 @@ */ #include -#include -#include +#include +#include #include "libvirt_wrap.h" #include "libvirt-py.h" diff --git a/python/libvirt_wrap.h b/python/libvirt_wrap.h index 29b27eeed8..e7452159e7 100644 --- a/python/libvirt_wrap.h +++ b/python/libvirt_wrap.h @@ -7,8 +7,8 @@ */ #include -#include -#include +#include +#include #ifdef __GNUC__ #ifdef ATTRIBUTE_UNUSED diff --git a/src/driver.h b/src/driver.h index 90519faa8c..173bae19ff 100644 --- a/src/driver.h +++ b/src/driver.h @@ -6,8 +6,8 @@ #ifndef __VIR_DRIVER_H__ #define __VIR_DRIVER_H__ -#include "libvirt.h" -#include "virterror.h" +#include "libvirt/libvirt.h" +#include "libvirt/virterror.h" #ifdef __cplusplus extern "C" { diff --git a/src/internal.h b/src/internal.h index 669831c792..811136cec6 100644 --- a/src/internal.h +++ b/src/internal.h @@ -13,8 +13,8 @@ #include #include "hash.h" -#include "libvirt.h" -#include "virterror.h" +#include "libvirt/libvirt.h" +#include "libvirt/virterror.h" #include "driver.h" #ifdef __cplusplus diff --git a/src/libvirt.c b/src/libvirt.c index 60e49f18aa..70b46be427 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -9,7 +9,7 @@ * Daniel Veillard */ -#include "libvirt.h" +#include "libvirt/libvirt.h" #include #include diff --git a/src/test.h b/src/test.h index 757b1e4ea4..ff5d55b9bd 100644 --- a/src/test.h +++ b/src/test.h @@ -11,42 +11,43 @@ #ifndef __VIR_TEST_SIMPLE_INTERNAL_H__ #define __VIR_TEST_SIMPLE_INTERNAL_H__ +#include + #ifdef __cplusplus extern "C" { #endif -#include - - void testRegister(void); - int testOpen(virConnectPtr conn, - const char *name, - int flags); - int testClose (virConnectPtr conn); - int testGetVersion(virConnectPtr conn, - unsigned long *hvVer); - int testNodeGetInfo(virConnectPtr conn, - virNodeInfoPtr info); - int testNumOfDomains(virConnectPtr conn); - int testListDomains(virConnectPtr conn, - int *ids, - int maxids); - virDomainPtr testLookupDomainByID(virConnectPtr conn, - int id); - virDomainPtr testLookupDomainByUUID(virConnectPtr conn, - const unsigned char *uuid); - virDomainPtr testLookupDomainByName(virConnectPtr conn, - const char *name); - int testDestroyDomain(virDomainPtr domain); - int testResumeDomain(virDomainPtr domain); - int testPauseDomain(virDomainPtr domain); - int testShutdownDomain (virDomainPtr domain); - int testRebootDomain (virDomainPtr domain, virDomainRestart action); - int testGetDomainInfo(virDomainPtr domain, - virDomainInfoPtr info); - int testGetDomainID(virDomainPtr domain); - const char*testGetDomainName(virDomainPtr domain); - int testSetMaxMemory(virDomainPtr domain, - unsigned long memory); +void testRegister(void); +int testOpen(virConnectPtr conn, + const char *name, + int flags); +int testClose (virConnectPtr conn); +int testGetVersion(virConnectPtr conn, + unsigned long *hvVer); +int testNodeGetInfo(virConnectPtr conn, + virNodeInfoPtr info); +int testNumOfDomains(virConnectPtr conn); +int testListDomains(virConnectPtr conn, + int *ids, + int maxids); +virDomainPtr testLookupDomainByID(virConnectPtr conn, + int id); +virDomainPtr testLookupDomainByUUID(virConnectPtr conn, + const unsigned char *uuid); +virDomainPtr testLookupDomainByName(virConnectPtr conn, + const char *name); +int testDestroyDomain(virDomainPtr domain); +int testResumeDomain(virDomainPtr domain); +int testPauseDomain(virDomainPtr domain); +int testShutdownDomain (virDomainPtr domain); +int testRebootDomain (virDomainPtr domain, + virDomainRestart action); +int testGetDomainInfo(virDomainPtr domain, + virDomainInfoPtr info); +int testGetDomainID(virDomainPtr domain); +const char*testGetDomainName(virDomainPtr domain); +int testSetMaxMemory(virDomainPtr domain, + unsigned long memory); #ifdef __cplusplus } diff --git a/src/virsh.c b/src/virsh.c index 3b5e242c7b..92307da8aa 100644 --- a/src/virsh.c +++ b/src/virsh.c @@ -15,8 +15,8 @@ #define _GNU_SOURCE /* isblank() */ -#include "libvirt.h" -#include "virterror.h" +#include "libvirt/libvirt.h" +#include "libvirt/virterror.h" #include #include #include diff --git a/src/virterror.c b/src/virterror.c index 4958f84a02..3688549ae0 100644 --- a/src/virterror.c +++ b/src/virterror.c @@ -12,8 +12,8 @@ #include #include #include -#include "libvirt.h" -#include "virterror.h" +#include "libvirt/libvirt.h" +#include "libvirt/virterror.h" #include "internal.h" static virError lastErr = /* the last error */ diff --git a/src/xend_internal.c b/src/xend_internal.c index 0879951d20..0a97a85ff1 100644 --- a/src/xend_internal.c +++ b/src/xend_internal.c @@ -28,7 +28,7 @@ #include #include -#include "libvirt.h" +#include "libvirt/libvirt.h" #include "driver.h" #include "internal.h" #include "sexpr.h" diff --git a/src/xend_internal.h b/src/xend_internal.h index 258b26d373..692ba8c239 100644 --- a/src/xend_internal.h +++ b/src/xend_internal.h @@ -18,7 +18,7 @@ #include #include -#include "libvirt.h" +#include "libvirt/libvirt.h" #ifdef __cplusplus extern "C" { diff --git a/src/xml.c b/src/xml.c index b7b6cf89e1..01619b8504 100644 --- a/src/xml.c +++ b/src/xml.c @@ -8,7 +8,7 @@ * Daniel Veillard */ -#include "libvirt.h" +#include "libvirt/libvirt.h" #include #include diff --git a/src/xml.h b/src/xml.h index fbd5895ea4..bda52411c9 100644 --- a/src/xml.h +++ b/src/xml.h @@ -5,7 +5,7 @@ #ifndef __VIR_XML_H__ #define __VIR_XML_H__ -#include "libvirt.h" +#include "libvirt/libvirt.h" #ifdef __cplusplus extern "C" { diff --git a/tests/xmlrpctest.c b/tests/xmlrpctest.c index 9540bffaf9..2c180680af 100644 --- a/tests/xmlrpctest.c +++ b/tests/xmlrpctest.c @@ -19,7 +19,7 @@ #include #include -#include "libvirt.h" +#include "libvirt/libvirt.h" #include "xml.h" #include "xmlrpc.h"