From: Daniel Veillard Date: Tue, 13 Jun 2006 16:31:44 +0000 (+0000) Subject: * docs//*: rebuilt the documentation X-Git-Tag: LIBVIRT_0_1_1~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7efa1c11b56a467e61f5e79c9353ebd5cba44822;p=thirdparty%2Flibvirt.git * docs//*: rebuilt the documentation * src/driver.h src/libvirt.c src/test.c src/xen_internal.c src/xend_internal.c src/xs_internal.c: started to fix some of the driver related problem raised by Daniel Berrange, added a ver version field to drivers. Daniel --- diff --git a/ChangeLog b/ChangeLog index 0474e13430..73365f95e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Tue Jun 13 16:37:27 EDT 2006 Daniel Veillard + + * docs//*: rebuilt the documentation + * src/driver.h src/libvirt.c src/test.c src/xen_internal.c + src/xend_internal.c src/xs_internal.c: started to fix some of + the driver related problem raised by Daniel Berrange, added a + ver version field to drivers. + Mon Jun 12 17:22:24 EDT 2006 Daniel P. Berrange * src/xend_internal.c: Call 'xenDomainGetVersion' when trying diff --git a/docs/APIchunk0.html b/docs/APIchunk0.html index e649960755..48c48ec087 100644 --- a/docs/APIchunk0.html +++ b/docs/APIchunk0.html @@ -1,9 +1,9 @@ API Alphabetic Index A-c for libvirt

API Alphabetic Index A-c for libvirt

A-c -d-m -n-s -t-z +d-l +m-r +s-z

Letter A:

APIs
virConnectOpenReadOnly
After
virDomainSave

Letter C:

CPU
_virDomainInfo
@@ -23,13 +23,15 @@ virDomainSetMemory

Letter E:

Extract
virDomainGetInfo
virNodeGetInfo
-

Letter F:

Free
virDomainFree
+

Letter F:

For
virDomainGetUUIDString
+
Free
virDomainFree

Letter G:

Get
virConnectGetType
virConnectGetVersion
virDomainGetID
virDomainGetName
virDomainGetOSType
virDomainGetUUID
+virDomainGetUUIDString

Letter H:

Hypervisor
virConnectClose
virConnectGetType
virConnectGetVersion
@@ -54,6 +56,7 @@ virDomainLookupByID
virDomainLookupByName
virDomainLookupByUUID
+virDomainLookupByUUIDString
virDomainSetMaxMemory
virDomainSetMemory
virGetLastError
@@ -72,7 +75,8 @@ virGetLastError
Provides
virConnectNumOfDomains
virGetVersion
-

Letter R:

Read-Only
virConnectGetVersion
+

Letter R:

RFC4122
virDomainGetUUIDString
+
Read-Only
virConnectGetVersion
Reboot
virDomainReboot
Reset
virConnResetLastError
virResetError
@@ -102,10 +106,13 @@
Try
virDomainLookupByID
virDomainLookupByName
virDomainLookupByUUID
+virDomainLookupByUUIDString

Letter U:

UTF-8
virDomainDefineXML
virDomainGetXMLDesc
UUID
virDomainGetUUID
+virDomainGetUUIDString
virDomainLookupByUUID
+virDomainLookupByUUIDString
Use
virDomainSave
virDomainSuspend

Letter W:

What
_virError
@@ -114,6 +121,7 @@ virDomainGetXMLDesc
Xen
virGetVersion

Letter a:

about
virDomainGetInfo
+virDomainGetUUIDString
virNodeGetInfo
access
_virNodeInfo
virConnectGetVersion
@@ -162,6 +170,7 @@
array
virConnectListDefinedDomains
virConnectListDomains
virDomainGetUUID
+virDomainGetUUIDString
assumed
virGetVersion
available
_virError
virConnectOpenReadOnly
@@ -174,6 +183,7 @@ virDomainLookupByID
virDomainLookupByName
virDomainLookupByUUID
+virDomainLookupByUUIDString
being
virDomainReboot
virDomainShutdown
virErrorFunc
@@ -188,6 +198,7 @@ virDomainUndefine
virGetLastError
bytes
virDomainGetUUID
+virDomainGetUUIDString

Letter c:

call
virConnectGetVersion
virDomainCreate
virDomainDestroy
@@ -226,28 +237,6 @@
collect
virConnectListDomains
command
_virDomainKernel
compiled
virGetVersion
-
connection
_virError
-virConnCopyLastError
-virConnGetLastError
-virConnResetLastError
-virConnSetErrorFunc
-virConnectClose
-virConnectGetType
-virConnectGetVersion
-virConnectListDefinedDomains
-virConnectListDomains
-virConnectNumOfDomains
-virConnectOpen
-virConnectOpenReadOnly
-virDomainCreateLinux
-virDomainDefineXML
-virDomainGetInfo
-virDomainLookupByID
-virDomainLookupByName
-virDomainLookupByUUID
-virDomainRestore
-virNodeGetInfo
-virSetErrorFunc
consequent
_virError
content
virConnCopyLastError
virCopyLastError
@@ -260,7 +249,7 @@
currently
virConnectOpen
virConnectOpenReadOnly

A-c -d-m -n-s -t-z +d-l +m-r +s-z

diff --git a/docs/APIchunk1.html b/docs/APIchunk1.html index 9aae230920..19e64d6e37 100644 --- a/docs/APIchunk1.html +++ b/docs/APIchunk1.html @@ -1,9 +1,9 @@ -API Alphabetic Index d-m for libvirt

API Alphabetic Index d-m for libvirt

A-c -d-m -n-s -t-z +API Alphabetic Index d-l for libvirt

API Alphabetic Index d-l for libvirt

A-c +d-l +m-r +s-z

Letter d:

data
virConnSetErrorFunc
virDomainDestroy
virDomainFree
@@ -32,6 +32,7 @@ virConnectOpenReadOnly
virDomainCreate
down
virDomainDestroy
+
driver
virGetVersion

Letter e:

encoded
virDomainGetXMLDesc
especially
virConnectClose
expected
_virNodeInfo
@@ -47,6 +48,7 @@ virDomainLookupByID
virDomainLookupByName
virDomainLookupByUUID
+virDomainLookupByUUIDString
virDomainReboot
virDomainRestore
virDomainResume
@@ -72,8 +74,10 @@ virDomainGetID
virDomainGetName
virDomainGetUUID
+virDomainGetUUIDString
virDomainLookupByName
virDomainLookupByUUID
+virDomainLookupByUUIDString
virDomainReboot
virDomainSave
virDomainShutdown
@@ -122,6 +126,7 @@
given
virDomainDestroy
virDomainLookupByName
virDomainLookupByUUID
+virDomainLookupByUUIDString
global
virConnSetErrorFunc
virSetErrorFunc
guest
virDomainCreateLinux
@@ -141,6 +146,7 @@
indicating
_virNodeInfo
information
_virError
virDomainGetInfo
+virDomainGetUUIDString
virGetVersion
virNodeGetInfo
informations
virDomainGetInfo
@@ -155,6 +161,7 @@
its
virDomainGetName
virDomainLookupByName
virDomainLookupByUUID
+virDomainLookupByUUIDString
virDomainSave

Letter k:

kept
virDomainFree
kernel
_virDomainKernel
@@ -195,51 +202,12 @@
list
virConnectListDefinedDomains
virConnectListDomains
listed
virDomainSave
+
looked
virGetVersion
lookup
virDomainLookupByName
virDomainLookupByUUID
-

Letter m:

major
virConnectGetVersion
-virGetVersion
-
maximum
_virDomainInfo
-virDomainGetMaxMemory
-virDomainSetMaxMemory
-
may
virConnGetLastError
-virConnectGetVersion
-virDomainCreateLinux
-virDomainDestroy
-virDomainGetXMLDesc
-virDomainReboot
-virDomainResume
-virDomainSave
-virDomainSetMemory
-virDomainShutdown
-virDomainSuspend
-virGetLastError
-
mem
_virNodeInfo
-
memory
_virDomainInfo
-_virNodeInfo
-virDomainGetMaxMemory
-virDomainSave
-virDomainSetMaxMemory
-virDomainSetMemory
-virDomainSuspend
-
message
_virError
-
method
virDomainRestore
-virDomainSave
-
methods
virConnectOpenReadOnly
-
micro
LIBVIR_VERSION_NUMBER
-
minor
LIBVIR_VERSION_NUMBER
-virConnectGetVersion
-virGetVersion
-
model
_virNodeInfo
-
monitoring
virConnectClose
-
moves
virDomainCreate
-
multithreaded
virConnGetLastError
-virGetLastError
-virInitialize
-
must
virDomainGetOSType
-virDomainGetXMLDesc
+virDomainLookupByUUIDString

A-c -d-m -n-s -t-z +d-l +m-r +s-z

diff --git a/docs/APIchunk2.html b/docs/APIchunk2.html index 8f0dcb8f97..14c1619ac6 100644 --- a/docs/APIchunk2.html +++ b/docs/APIchunk2.html @@ -1,10 +1,52 @@ -API Alphabetic Index n-s for libvirt

API Alphabetic Index n-s for libvirt

A-c -d-m -n-s -t-z -

Letter n:

name
virConnectGetType
+API Alphabetic Index m-r for libvirt

API Alphabetic Index m-r for libvirt

A-c +d-l +m-r +s-z +

Letter m:

major
virConnectGetVersion
+virGetVersion
+
maximum
_virDomainInfo
+virDomainGetMaxMemory
+virDomainSetMaxMemory
+
may
virConnGetLastError
+virConnectGetVersion
+virDomainCreateLinux
+virDomainDestroy
+virDomainGetXMLDesc
+virDomainReboot
+virDomainResume
+virDomainSave
+virDomainSetMemory
+virDomainShutdown
+virDomainSuspend
+virGetLastError
+
mem
_virNodeInfo
+
memory
_virDomainInfo
+_virNodeInfo
+virDomainGetMaxMemory
+virDomainSave
+virDomainSetMaxMemory
+virDomainSetMemory
+virDomainSuspend
+
message
_virError
+
method
virDomainRestore
+virDomainSave
+
methods
virConnectOpenReadOnly
+
micro
LIBVIR_VERSION_NUMBER
+
minor
LIBVIR_VERSION_NUMBER
+virConnectGetVersion
+virGetVersion
+
model
_virNodeInfo
+
monitoring
virConnectClose
+
more
virDomainGetUUIDString
+
moves
virDomainCreate
+
multithreaded
virConnGetLastError
+virGetLastError
+virInitialize
+
must
virDomainGetOSType
+virDomainGetXMLDesc
+

Letter n:

name
virConnectGetType
virDomainGetName
virDomainLookupByName
names
virConnectListDefinedDomains
@@ -19,6 +61,7 @@ virDomainLookupByID
virDomainLookupByName
virDomainLookupByUUID
+virDomainLookupByUUIDString
node
_virNodeInfo
virNodeGetInfo
none
virConnGetLastError
@@ -54,10 +97,12 @@ virDomainGetName
virDomainGetOSType
virDomainGetUUID
+virDomainGetUUIDString
virDomainGetXMLDesc
virDomainLookupByID
virDomainLookupByName
virDomainLookupByUUID
+virDomainLookupByUUIDString
virDomainReboot
virDomainResume
virDomainSave
@@ -127,6 +172,7 @@ virErrorFunc
virSetErrorFunc
ramdisk
_virDomainKernel
+
raw
virDomainLookupByUUID
reactivate
virDomainSuspend
reboot
virDomainReboot
virDomainShutdown
@@ -180,83 +226,8 @@
runs
virDomainGetMaxMemory
virDomainSetMaxMemory
virDomainSetMemory
-

Letter s:

same
virDomainGetName
-
save
virDomainSave
-
saved
virDomainRestore
-
saving
virDomainSave
-
set
virConnectOpenReadOnly
-virDomainCreateLinux
-virDomainGetInfo
-virDomainGetXMLDesc
-
should
virConnectClose
-virConnectOpen
-virConnectOpenReadOnly
-virDomainDestroy
-virDomainFree
-virDomainShutdown
-
shutdown
virDomainDestroy
-
similar
virDomainCreateLinux
-
size
_virNodeInfo
-virConnectListDefinedDomains
-virConnectListDomains
-virDomainGetMaxMemory
-virDomainSetMaxMemory
-virDomainSetMemory
-
socket
_virNodeInfo
-
software
virConnectGetType
-
start
virDomainDefineXML
-
startup
virInitialize
-
state
_virDomainInfo
-virDomainResume
-
static
virConnectGetType
-
stay
virDomainSuspend
-
stderr
virDefaultErrorFunc
-virSetErrorFunc
-
still
virDomainReboot
-virDomainShutdown
-
stop
virDomainUndefine
-
stopped
virDomainReboot
-virDomainShutdown
-
store
virConnectListDefinedDomains
-virConnectListDomains
-virConnectOpen
-
stores
virConnectListDefinedDomains
-
string
_virError
-_virNodeInfo
-virConnectGetType
-virDomainGetName
-virDomainGetOSType
-virDomainLookupByUUID
-
structure
virDomainDestroy
-virDomainFree
-virDomainGetInfo
-virNodeGetInfo
-
succeed
virDomainCreate
-
success
virConnectClose
-virDomainCreate
-virDomainDestroy
-virDomainFree
-virDomainGetInfo
-virDomainGetUUID
-virDomainReboot
-virDomainRestore
-virDomainResume
-virDomainSave
-virDomainSetMaxMemory
-virDomainSetMemory
-virDomainShutdown
-virDomainSuspend
-virDomainUndefine
-virInitialize
-virNodeGetInfo
-
successful
virDomainSave
-
suitable
virConnGetLastError
-virGetLastError
-
suspend
virDomainSave
-
suspended
virDomainResume
-
system
virDomainGetOSType

A-c -d-m -n-s -t-z +d-l +m-r +s-z

diff --git a/docs/APIchunk3.html b/docs/APIchunk3.html index 31eccf3660..25aa8670f0 100644 --- a/docs/APIchunk3.html +++ b/docs/APIchunk3.html @@ -1,10 +1,88 @@ -API Alphabetic Index t-z for libvirt

API Alphabetic Index t-z for libvirt

A-c -d-m -n-s -t-z -

Letter t:

target
virConnCopyLastError
+API Alphabetic Index s-z for libvirt

API Alphabetic Index s-z for libvirt

A-c +d-l +m-r +s-z +

Letter s:

same
virDomainGetName
+
save
virDomainSave
+
saved
virDomainRestore
+
saving
virDomainSave
+
see
virDomainGetUUIDString
+
set
virConnectOpenReadOnly
+virDomainCreateLinux
+virDomainGetInfo
+virDomainGetXMLDesc
+
should
virConnectClose
+virConnectOpen
+virConnectOpenReadOnly
+virDomainDestroy
+virDomainFree
+virDomainShutdown
+
shutdown
virDomainDestroy
+
similar
virDomainCreateLinux
+
size
_virNodeInfo
+virConnectListDefinedDomains
+virConnectListDomains
+virDomainGetMaxMemory
+virDomainSetMaxMemory
+virDomainSetMemory
+
socket
_virNodeInfo
+
software
virConnectGetType
+
start
virDomainDefineXML
+
startup
virInitialize
+
state
_virDomainInfo
+virDomainResume
+
static
virConnectGetType
+
stay
virDomainSuspend
+
stderr
virDefaultErrorFunc
+virSetErrorFunc
+
still
virDomainReboot
+virDomainShutdown
+
stop
virDomainUndefine
+
stopped
virDomainReboot
+virDomainShutdown
+
store
virConnectListDefinedDomains
+virConnectListDomains
+virConnectOpen
+
stores
virConnectListDefinedDomains
+
string
_virError
+_virNodeInfo
+virConnectGetType
+virDomainGetName
+virDomainGetOSType
+virDomainGetUUIDString
+virDomainLookupByUUIDString
+
structure
virDomainDestroy
+virDomainFree
+virDomainGetInfo
+virNodeGetInfo
+
succeed
virDomainCreate
+
success
virConnectClose
+virDomainCreate
+virDomainDestroy
+virDomainFree
+virDomainGetInfo
+virDomainGetUUID
+virDomainGetUUIDString
+virDomainReboot
+virDomainRestore
+virDomainResume
+virDomainSave
+virDomainSetMaxMemory
+virDomainSetMemory
+virDomainShutdown
+virDomainSuspend
+virDomainUndefine
+virInitialize
+virNodeGetInfo
+
successful
virDomainSave
+
suitable
virConnGetLastError
+virGetLastError
+
suspend
virDomainSave
+
suspended
virDomainResume
+
system
virDomainGetOSType
+

Letter t:

target
virConnCopyLastError
virCopyLastError
virDomainSetMemory
terminated
virConnectGetType
@@ -127,7 +205,7 @@ virDomainReboot

Letter z:

zero
virConnectGetType

A-c -d-m -n-s -t-z +d-l +m-r +s-z

diff --git a/docs/APIconstructors.html b/docs/APIconstructors.html index 8b2fadb448..3349078b76 100644 --- a/docs/APIconstructors.html +++ b/docs/APIconstructors.html @@ -9,6 +9,7 @@ virDomainLookupByID
virDomainLookupByName
virDomainLookupByUUID
+virDomainLookupByUUIDString

Type virErrorPtr:

virConnGetLastError
virGetLastError

diff --git a/docs/APIfiles.html b/docs/APIfiles.html index 316850c421..a82dd119e8 100644 --- a/docs/APIfiles.html +++ b/docs/APIfiles.html @@ -44,6 +44,7 @@ virDomainGetName
virDomainGetOSType
virDomainGetUUID
+virDomainGetUUIDString
virDomainGetXMLDesc
virDomainInfo
virDomainInfoPtr
@@ -52,6 +53,7 @@ virDomainLookupByID
virDomainLookupByName
virDomainLookupByUUID
+virDomainLookupByUUIDString
virDomainPtr
virDomainReboot
virDomainRestart
@@ -103,6 +105,7 @@ VIR_ERR_XML_ERROR
VIR_FROM_DOM
VIR_FROM_NONE
+VIR_FROM_RPC
VIR_FROM_SEXPR
VIR_FROM_XEN
VIR_FROM_XEND
diff --git a/docs/APIfunctions.html b/docs/APIfunctions.html index d6e4d28227..0bebb89495 100644 --- a/docs/APIfunctions.html +++ b/docs/APIfunctions.html @@ -25,6 +25,7 @@ virDomainLookupByID
virDomainLookupByName
virDomainLookupByUUID
+virDomainLookupByUUIDString
virDomainRestore
virNodeGetInfo

Type virDomainInfoPtr:

virDomainGetInfo
@@ -37,6 +38,7 @@ virDomainGetName
virDomainGetOSType
virDomainGetUUID
+virDomainGetUUIDString
virDomainGetXMLDesc
virDomainReboot
virDomainResume
diff --git a/docs/APIsymbols.html b/docs/APIsymbols.html index 70523c73b0..bac3ad2df5 100644 --- a/docs/APIsymbols.html +++ b/docs/APIsymbols.html @@ -51,6 +51,7 @@ VIR_ERR_XML_ERROR
VIR_FROM_DOM
VIR_FROM_NONE
+VIR_FROM_RPC
VIR_FROM_SEXPR
VIR_FROM_XEN
VIR_FROM_XEND
@@ -90,6 +91,7 @@ virDomainGetName
virDomainGetOSType
virDomainGetUUID
+virDomainGetUUIDString
virDomainGetXMLDesc
virDomainInfo
virDomainInfoPtr
@@ -98,6 +100,7 @@ virDomainLookupByID
virDomainLookupByName
virDomainLookupByUUID
+virDomainLookupByUUIDString
virDomainPtr
virDomainReboot
virDomainRestart
diff --git a/docs/apibuild.py b/docs/apibuild.py index 6e38f680e7..5d173023a6 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -35,6 +35,8 @@ ignored_files = { "xml.c": "internal code", "xmlrpc.h": "internal include", "xmlrpc.c": "internal code", + "test.h": "test driver", + "test.c": "test driver", } ignored_words = { diff --git a/docs/devhelp/libvirt-libvirt.html b/docs/devhelp/libvirt-libvirt.html index 1cbede21d7..1b65597d7b 100644 --- a/docs/devhelp/libvirt-libvirt.html +++ b/docs/devhelp/libvirt-libvirt.html @@ -54,22 +54,28 @@ typedef struct _virConnect virConnect; typedef enum virDomainCreateFlags; typedef struct _virDomainInfo virDomainInfo; int virDomainGetInfo (virDomainPtr domain,
virDomainInfoPtr info); +int virDomainUndefine (virDomainPtr domain); +virDomainPtr virDomainDefineXML (virConnectPtr conn,
const char * xml); int virDomainShutdown (virDomainPtr domain); int virGetVersion (unsigned long * libVer,
const char * type,
unsigned long * typeVer); +int virConnectListDefinedDomains (virConnectPtr conn,
const char ** names,
int maxnames); virDomainPtr virDomainLookupByName (virConnectPtr conn,
const char * name); int virDomainRestore (virConnectPtr conn,
const char * from); const char * virConnectGetType (virConnectPtr conn); int virDomainSave (virDomainPtr domain,
const char * to); +int virDomainCreate (virDomainPtr domain); int virConnectListDomains (virConnectPtr conn,
int * ids,
int maxids); virDomainPtr virDomainLookupByUUID (virConnectPtr conn,
const unsigned char * uuid); +virDomainPtr virDomainLookupByUUIDString (virConnectPtr conn,
const char * uuidstr); virDomainPtr virDomainLookupByID (virConnectPtr conn,
int id); char * virDomainGetOSType (virDomainPtr domain); int virNodeGetInfo (virConnectPtr conn,
virNodeInfoPtr info); int virDomainGetUUID (virDomainPtr domain,
unsigned char * uuid); int virConnectNumOfDomains (virConnectPtr conn); -int virDomainSetMaxMemory (virDomainPtr domain,
unsigned long memory); +int virDomainGetUUIDString (virDomainPtr domain,
char * buf); unsigned long virDomainGetMaxMemory (virDomainPtr domain); int virConnectGetVersion (virConnectPtr conn,
unsigned long * hvVer); +int virDomainSetMaxMemory (virDomainPtr domain,
unsigned long memory); int virDomainFree (virDomainPtr domain); virConnectPtr virConnectOpen (const char * name); int virDomainSuspend (virDomainPtr domain); @@ -207,6 +213,10 @@ The content of this structure is not made public by the API.

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 priviledged 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, 
const char ** names,
int maxnames)
+

list the defined 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

virConnectListDomains ()

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

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

@@ -223,10 +233,18 @@ The content of this structure is not made public by the API.

virConnectOpenReadOnly ()

virConnectPtr	virConnectOpenReadOnly	(const char * name)

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.

name:optional argument currently unused, pass NULL
Returns:a pointer to the hypervisor connection or NULL in case of error
+
+

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)

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.

conn:pointer to the hypervisor connection
xmlDesc:an XML description of the domain
flags:an optional set of virDomainFlags
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

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

@@ -259,6 +277,10 @@ The content of this structure is not made public by the API.

virDomainGetUUID ()

int	virDomainGetUUID		(virDomainPtr domain, 
unsigned char * uuid)

Get the UUID for a domain

domain:a domain object
uuid:pointer to a 16 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 37 bytes array
Returns:-1 in case of error, 0 in case of success

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 virDomainCreateLinux().

@@ -274,7 +296,11 @@ The content of this structure is not made public by the API.

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 UUID string for the domain
Returns:a new domain object or NULL in case of failure
+
conn:pointer to the hypervisor connection
uuid:the raw UUID for the domain
Returns:a new domain object or NULL in case of failure
+
+

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

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.

@@ -307,10 +333,14 @@ The content of this structure is not made public by the API.

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 priviledged 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

+
libVer:return value for the library version (OUT)
type:the type of connection/driver looked at
typeVer:return value for the version of the hypervisor (OUT)
Returns:-1 in case of failure, 0 otherwise, and values for @libVer and @typeVer have the format major * 1,000,000 + minor * 1,000 + release.

@@ -125,7 +126,9 @@ void virConnResetLastError (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 */ + VIR_ERR_CALL_FAILED = 26 /* not supported by the drivers */ + VIR_ERR_XML_ERROR = 27 /* an XML description is not well formed or broken */ + VIR_ERR_DOM_EXIST = 28 /* the domain already exist */ };

diff --git a/docs/html/libvirt-libvirt.html b/docs/html/libvirt-libvirt.html index 3250753d72..276bec7a32 100644 --- a/docs/html/libvirt-libvirt.html +++ b/docs/html/libvirt-libvirt.html @@ -35,10 +35,12 @@ The content of this structure is not made public by the API.
const char *	virDomainGetName	(virDomainPtr domain)
char *	virDomainGetOSType		(virDomainPtr domain)
int	virDomainGetUUID		(virDomainPtr domain, 
unsigned char * uuid)
+
int	virDomainGetUUIDString		(virDomainPtr domain, 
char * buf)
char *	virDomainGetXMLDesc		(virDomainPtr domain, 
int flags)
virDomainPtr	virDomainLookupByID	(virConnectPtr conn, 
int id)
virDomainPtr	virDomainLookupByName	(virConnectPtr conn, 
const char * name)
virDomainPtr	virDomainLookupByUUID	(virConnectPtr conn, 
const unsigned char * uuid)
+
virDomainPtr	virDomainLookupByUUIDString	(virConnectPtr conn, 
const char * uuidstr)
int	virDomainReboot			(virDomainPtr domain, 
unsigned int flags)
int	virDomainRestore		(virConnectPtr conn, 
const char * from)
int	virDomainResume			(virDomainPtr domain)
@@ -149,7 +151,9 @@ The content of this structure is not made public by the API.

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.

Function: virDomainGetUUID

int	virDomainGetUUID		(virDomainPtr domain, 
unsigned char * uuid)

Get the UUID for a domain

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

Function: virDomainGetXMLDesc

char *	virDomainGetXMLDesc		(virDomainPtr domain, 
int flags)
+
domain:a domain object
uuid:pointer to a 16 bytes array
Returns:-1 in case of error, 0 in case of success

Function: 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 37 bytes array
Returns:-1 in case of error, 0 in case of success

Function: 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 virDomainCreateLinux().

domain:a domain 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.

Function: virDomainLookupByID

virDomainPtr	virDomainLookupByID	(virConnectPtr conn, 
int id)

Try to find a domain based on the hypervisor ID number

@@ -157,7 +161,9 @@ The content of this structure is not made public by the API.

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

Function: 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 UUID string for the domain
Returns:a new domain object or NULL in case of failure

Function: virDomainReboot

int	virDomainReboot			(virDomainPtr domain, 
unsigned int flags)
+
conn:pointer to the hypervisor connection
uuid:the raw UUID for the domain
Returns:a new domain object or NULL in case of failure

Function: 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

Function: 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.

Function: virDomainRestore

int	virDomainRestore		(virConnectPtr conn, 
const char * from)

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

@@ -177,7 +183,7 @@ The content of this structure is not made public by the API.

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

Function: virGetVersion

int	virGetVersion			(unsigned long * libVer, 
const char * type,
unsigned long * typeVer)

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.

-
libVer:return value for the library version (OUT)
type:hypervisor type
typeVer:return value for the version of the hypervisor (OUT)
Returns:-1 in case of failure, 0 otherwise, and values for @libVer and @typeVer have the format major * 1,000,000 + minor * 1,000 + release.

Function: virInitialize

int	virInitialize			(void)
+
libVer:return value for the library version (OUT)
type:the type of connection/driver looked at
typeVer:return value for the version of the hypervisor (OUT)
Returns:-1 in case of failure, 0 otherwise, and values for @libVer and @typeVer have the format major * 1,000,000 + minor * 1,000 + release.

Function: virInitialize

int	virInitialize			(void)

Initialize the library. It's better to call this routine at startup in multithreaded applications to avoid potential race when initializing the library.

Returns:0 in case of success, -1 in case of error

Function: virNodeGetInfo

int	virNodeGetInfo			(virConnectPtr conn, 
virNodeInfoPtr info)

Extract hardware information about the node.

diff --git a/docs/html/libvirt-virterror.html b/docs/html/libvirt-virterror.html index 37c5e5a21c..e8adf9a4c6 100644 --- a/docs/html/libvirt-virterror.html +++ b/docs/html/libvirt-virterror.html @@ -39,6 +39,7 @@ void virErrorFunc (void * userData,
VIR_FROM_SEXPR = 4 : Error in the S-Epression 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 }

Enum virErrorLevel

Enum virErrorLevel {
     VIR_ERR_NONE = 0
diff --git a/docs/libvirt-api.xml b/docs/libvirt-api.xml
index 450834739f..70e598f437 100644
--- a/docs/libvirt-api.xml
+++ b/docs/libvirt-api.xml
@@ -52,14 +52,16 @@
      
      
      
+     
      
      
      
      
      
-     
+     
      
      
+     
      
      
      
@@ -87,6 +89,7 @@
      
      
      
+     
      
      
      
@@ -189,8 +192,9 @@
     
     
     
-    
+    
     
+    
     
     
     
@@ -395,6 +399,12 @@
       
       
     
+    
+      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().
       
@@ -417,7 +427,13 @@
       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.
@@ -483,7 +499,7 @@
       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.
       
       
-      
+      
       
     
     
diff --git a/docs/libvirt-refs.xml b/docs/libvirt-refs.xml
index a377694a51..571976854e 100644
--- a/docs/libvirt-refs.xml
+++ b/docs/libvirt-refs.xml
@@ -52,6 +52,7 @@
     
     
     
+    
     
     
     
@@ -91,6 +92,7 @@
     
     
     
+    
     
     
     
@@ -99,6 +101,7 @@
     
     
     
+    
     
     
     
@@ -182,6 +185,7 @@
       
       
       
+      
       
       
       
@@ -225,6 +229,7 @@
       
       
       
+      
       
       
       
@@ -233,6 +238,7 @@
       
       
       
+      
       
       
       
@@ -279,6 +285,7 @@
       
       
       
+      
     
     
       
@@ -326,6 +333,7 @@
       
       
       
+      
       
       
     
@@ -342,6 +350,7 @@
       
       
       
+      
       
       
       
@@ -418,6 +427,7 @@
       
       
       
+      
       
       
       
@@ -426,6 +436,7 @@
       
       
       
+      
       
       
       
@@ -479,6 +490,7 @@
       
       
       
+      
       
       
       
@@ -555,6 +567,9 @@
         
       
       
+        
+          
+        
         
           
         
@@ -567,6 +582,7 @@
           
           
           
+          
         
       
       
@@ -619,6 +635,7 @@
           
           
           
+          
           
           
           
@@ -656,6 +673,9 @@
         
       
       
+        
+          
+        
         
           
         
@@ -715,6 +735,7 @@
           
           
           
+          
         
       
       
@@ -724,7 +745,9 @@
         
         
           
+          
           
+          
         
         
           
@@ -749,6 +772,7 @@
       
         
           
+          
           
         
         
@@ -833,6 +857,7 @@
           
           
           
+          
         
         
           
@@ -859,6 +884,7 @@
           
           
           
+          
         
         
           
@@ -883,6 +909,7 @@
         
         
           
+          
         
       
       
@@ -956,30 +983,6 @@
         
           
         
-        
-          
-          
-          
-          
-          
-          
-          
-          
-          
-          
-          
-          
-          
-          
-          
-          
-          
-          
-          
-          
-          
-          
-        
         
           
         
@@ -1063,6 +1066,9 @@
         
           
         
+        
+          
+        
       
       
         
@@ -1095,6 +1101,7 @@
           
           
           
+          
           
           
           
@@ -1132,8 +1139,10 @@
           
           
           
+          
           
           
+          
           
           
           
@@ -1210,6 +1219,7 @@
           
           
           
+          
         
         
           
@@ -1257,6 +1267,7 @@
         
           
           
+          
           
           
         
@@ -1287,6 +1298,7 @@
           
           
           
+          
           
         
       
@@ -1364,11 +1376,17 @@
         
           
         
+        
+          
+        
         
           
           
+          
         
       
+    
+    
       
         
           
@@ -1429,6 +1447,9 @@
         
           
         
+        
+          
+        
         
           
         
@@ -1442,8 +1463,6 @@
           
         
       
-    
-    
       
         
           
@@ -1471,6 +1490,7 @@
           
           
           
+          
         
         
           
@@ -1518,10 +1538,12 @@
           
           
           
+          
           
           
           
           
+          
           
           
           
@@ -1660,6 +1682,9 @@
         
           
         
+        
+          
+        
         
           
         
@@ -1762,6 +1787,8 @@
           
         
       
+    
+    
       
         
           
@@ -1775,6 +1802,9 @@
         
           
         
+        
+          
+        
         
           
           
@@ -1854,7 +1884,8 @@
           
           
           
-          
+          
+          
         
         
           
@@ -1872,6 +1903,7 @@
           
           
           
+          
           
           
           
@@ -1901,8 +1933,6 @@
           
         
       
-    
-    
       
         
           
@@ -2146,9 +2176,9 @@
     
     
       
-      
-      
-      
+      
+      
+      
     
   
 
diff --git a/src/driver.h b/src/driver.h
index 17c8cec318..4449c0d4eb 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -104,6 +104,7 @@ typedef virDriver *virDriverPtr;
  */
 struct _virDriver {
 	const char *name;
+	unsigned long ver;
 	virDrvInit			init;
 	virDrvOpen			open;
 	virDrvClose			close;
diff --git a/src/libvirt.c b/src/libvirt.c
index f03a244c1f..dd0cd4a50a 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -161,7 +161,7 @@ virRegisterDriver(virDriverPtr driver)
 /**
  * virGetVersion:
  * @libVer: return value for the library version (OUT)
- * @type: hypervisor type
+ * @type: the type of connection/driver looked at
  * @typeVer: return value for the version of the hypervisor (OUT)
  *
  * Provides two information back, @libVer is the version of the library
@@ -177,6 +177,8 @@ int
 virGetVersion(unsigned long *libVer, const char *type,
               unsigned long *typeVer)
 {
+    int i;
+
     if (!initialized)
         virInitialize();
 
@@ -185,20 +187,18 @@ virGetVersion(unsigned long *libVer, const char *type,
     *libVer = LIBVIR_VERSION_NUMBER;
 
     if (typeVer != NULL) {
-        if ((type == NULL) || (!strcasecmp(type, "Xen"))) {
-            if ((DOM0_INTERFACE_VERSION & 0xFFFF0000) == (0xAAAA0000)) {
-                /* one time glitch hopefully ! */
-                *typeVer = 2 * 1000000 +
-                    ((DOM0_INTERFACE_VERSION >> 8) & 0xFF) * 1000 +
-                    (DOM0_INTERFACE_VERSION & 0xFF);
-            } else {
-                *typeVer = (DOM0_INTERFACE_VERSION >> 24) * 1000000 +
-                    ((DOM0_INTERFACE_VERSION >> 16) & 0xFF) * 1000 +
-                    (DOM0_INTERFACE_VERSION & 0xFFFF);
-            }
-        } else {
+        if (type == NULL)
+	    type = "Xen";
+	for (i = 0;i < MAX_DRIVERS;i++) {
+	    if ((virDriverTab[i] != NULL) &&
+	        (!strcmp(virDriverTab[i]->name, type))) {
+		*typeVer = virDriverTab[i]->ver;
+		break;
+	    }
+	}
+        if (i >= MAX_DRIVERS) {
             *typeVer = 0;
-            virLibConnError(NULL, VIR_ERR_NO_SUPPORT, "type");
+            virLibConnError(NULL, VIR_ERR_NO_SUPPORT, type);
             return (-1);
         }
     }
@@ -237,7 +237,7 @@ virConnectOpen(const char *name)
 	     * all related drivers.
 	     */
 	    if ((res < 0) && (name == NULL) &&
-	        (!strcmp(virDriverTab[i]->name, "Xen")))
+	        (!strncmp(virDriverTab[i]->name, "Xen", 3)))
 		goto failed;
 	    if (res == 0)
 	        ret->drivers[ret->nb_drivers++] = virDriverTab[i];
@@ -353,11 +353,19 @@ virConnectClose(virConnectPtr conn)
 const char *
 virConnectGetType(virConnectPtr conn)
 {
+    int i;
+
     if (!VIR_IS_CONNECT(conn)) {
         virLibConnError(conn, VIR_ERR_INVALID_CONN, __FUNCTION__);
         return (NULL);
     }
-    return ("Xen");
+    for (i = 0;i < conn->nb_drivers;i++) {
+	if ((conn->drivers[i] != NULL) &&
+	    (conn->drivers[i]->name != NULL)) {
+	    return(conn->drivers[i]->name);
+	}
+    }
+    return(NULL);
 }
 
 /**
@@ -376,7 +384,7 @@ virConnectGetType(virConnectPtr conn)
 int
 virConnectGetVersion(virConnectPtr conn, unsigned long *hvVer)
 {
-    unsigned long ver;
+    int ret, i;
 
     if (!VIR_IS_CONNECT(conn)) {
         virLibConnError(conn, VIR_ERR_INVALID_CONN, __FUNCTION__);
@@ -388,14 +396,17 @@ virConnectGetVersion(virConnectPtr conn, unsigned long *hvVer)
         return (-1);
     }
 
-    /* this can't be extracted from the Xenstore */
-    if (conn->handle < 0) {
-        *hvVer = 0;
-        return (0);
-    }
+    *hvVer = 0;
 
-    ver = xenHypervisorGetVersion(conn, hvVer);
-    return (0);
+    for (i = 0;i < conn->nb_drivers;i++) {
+	if ((conn->drivers[i] != NULL) &&
+	    (conn->drivers[i]->version != NULL)) {
+	    ret = conn->drivers[i]->version(conn, hvVer);
+	    if (ret == 0)
+	        return(0);
+	}
+    }
+    return (-1);
 }
 
 /**
diff --git a/src/test.c b/src/test.c
index ab161a911c..ae46108a7b 100644
--- a/src/test.c
+++ b/src/test.c
@@ -18,6 +18,7 @@
 
 static virDriver testDriver = {
   "Test",
+  LIBVIR_VERSION_NUMBER,
   NULL, /* init */
   testOpen, /* open */
   testClose, /* close */
diff --git a/src/xen_internal.c b/src/xen_internal.c
index cfcd2ecb68..11473fd6ee 100644
--- a/src/xen_internal.c
+++ b/src/xen_internal.c
@@ -42,6 +42,9 @@ typedef struct hypercall_struct {
 
 static virDriver xenHypervisorDriver = {
     "Xen",
+    (DOM0_INTERFACE_VERSION >> 24) * 1000000 +
+    ((DOM0_INTERFACE_VERSION >> 16) & 0xFF) * 1000 +
+    (DOM0_INTERFACE_VERSION & 0xFFFF),
     NULL, /* init */
     xenHypervisorOpen, /* open */
     xenHypervisorClose, /* close */
diff --git a/src/xend_internal.c b/src/xend_internal.c
index 33f3ff41d1..cb1ae7fde3 100644
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -34,12 +34,16 @@
 #include "sexpr.h"
 #include "xml.h"
 #include "xend_internal.h"
+#include "xen_internal.h" /* for DOM0_INTERFACE_VERSION */
 
 static int xenDaemonNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info);
 static int xenDaemonGetVersion(virConnectPtr conn, unsigned long *hvVer);
 
 static virDriver xenDaemonDriver = {
     "XenDaemon",
+    (DOM0_INTERFACE_VERSION >> 24) * 1000000 +
+    ((DOM0_INTERFACE_VERSION >> 16) & 0xFF) * 1000 +
+    (DOM0_INTERFACE_VERSION & 0xFFFF),
     NULL, /* init */
     xenDaemonOpen, /* open */
     xenDaemonClose, /* close */
@@ -1662,6 +1666,10 @@ xenDaemonOpen(virConnectPtr conn, const char *name, int flags)
 	    virXendError(conn, VIR_ERR_NO_SUPPORT, name);
 	return(-1);
     }
+    if ((uri->scheme != NULL) && (strncasecmp(uri->scheme, "xen", 3))) {
+        xmlFreeURI(uri);
+	return(-1);
+    }
 
     xmlFreeURI(uri);
 
diff --git a/src/xs_internal.c b/src/xs_internal.c
index b31f91d287..69989e2560 100644
--- a/src/xs_internal.c
+++ b/src/xs_internal.c
@@ -32,6 +32,9 @@
 
 static virDriver xenStoreDriver = {
     "XenStore",
+    (DOM0_INTERFACE_VERSION >> 24) * 1000000 +
+    ((DOM0_INTERFACE_VERSION >> 16) & 0xFF) * 1000 +
+    (DOM0_INTERFACE_VERSION & 0xFFFF),
     NULL, /* init */
     xenStoreOpen, /* open */
     xenStoreClose, /* close */