diff --git a/ChangeLog b/ChangeLog index 14a4d1be21..4fd73d748e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Wed Jan 18 11:32:04 CET 2006 Daniel Veillard + + * include/libvir.h include/libvir.h.in src/libvir.c: more integration + of libxend capabilities, including checkpointing and restoring + in a file. + * docs//*: regenerated the docs + Tue Jan 17 17:53:43 CET 2006 Daniel Veillard * include/libvir.h[.in]: added VIR_DOMAIN_CRASHED status, small diff --git a/docs/APIchunk0.html b/docs/APIchunk0.html index be502808db..4da6eb5891 100644 --- a/docs/APIchunk0.html +++ b/docs/APIchunk0.html @@ -8,8 +8,8 @@ H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } API Alphabetic Index A-f for libvir
Red Hat Logo

Libvir the virtualization API

API Alphabetic Index A-f for libvir

Developer Menu
API Indexes
Related links

A-f -g-s -t-z +g-r +s-z

Letter A:

ABI
_virDomainInfo
API
virDomainCreateLinux
virDomainGetXMLDesc
@@ -51,6 +51,7 @@ A:link, A:visited, A:active { text-decoration: underline } virDomainSetMaxMemory
virGetVersion
Note
virDomainGetInfo
+virDomainShutdown

Letter O:

OUT
virConnectGetVersion
virGetVersion

Letter P:

Provide
virDomainGetXMLDesc
@@ -69,13 +70,16 @@ A:link, A:visited, A:active { text-decoration: underline } virConnectOpenReadOnly
virDomainCreateLinux
virDomainDestroy
+virDomainRestore
virDomainResume
+virDomainSave
virDomainSetMaxMemory
virDomainSuspend
Try
virDomainLookupByID
virDomainLookupByName

Letter U:

UTF-8
virDomainGetXMLDesc
-
Use
virDomainSuspend
+
Use
virDomainSave
+virDomainSuspend

Letter X:

XML
virDomainGetXMLDesc
Xen
virGetVersion

Letter a:

about
virDomainGetInfo
@@ -91,7 +95,8 @@ A:link, A:visited, A:active { text-decoration: underline } virDomainSuspend
add
_virDomainInfo
virDomainShutdown
-
after
virDomainShutdown
+
after
virDomainSave
+virDomainShutdown
against
virGetVersion
alive
virDomainFree
all
virDomainDestroy
@@ -122,6 +127,7 @@ A:link, A:visited, A:active { text-decoration: underline } virDomainLookupByName
being
virDomainShutdown
below
_virDomainInfo
+
block
_virDomainKernel
but
virDomainShutdown
virDomainSuspend

Letter c:

call
_virDomainInfo
@@ -143,7 +149,8 @@ A:link, A:visited, A:active { text-decoration: underline }
closes
virConnectClose
code
virGetVersion
collect
virConnectListDomains
-
command
virDomainCreateLinux
+
command
_virDomainKernel
+virDomainCreateLinux
compiled
virGetVersion
connection
_virDomainInfo
virConnectClose
@@ -157,6 +164,7 @@ A:link, A:visited, A:active { text-decoration: underline } virDomainGetInfo
virDomainLookupByID
virDomainLookupByName
+
contents
virDomainSave
currently
virConnectOpen
virConnectOpenReadOnly

Letter d:

data
virDomainDestroy
@@ -164,6 +172,9 @@ A:link, A:visited, A:active { text-decoration: underline }
deallocated
virDomainGetName
defined
virDomainCreateLinux
description
virDomainGetXMLDesc
+
device
_virDomainKernel
+
disk
virDomainRestore
+virDomainSave
doable
virDomainShutdown
does
virDomainDestroy
domains
virConnectListDomains
@@ -194,12 +205,16 @@ A:link, A:visited, A:active { text-decoration: underline } virDomainGetInfo
virDomainLookupByID
virDomainLookupByName
+virDomainRestore
virDomainResume
+virDomainSave
virDomainSetMaxMemory
virDomainShutdown
virDomainSuspend
virGetVersion
file
virDomainCreateLinux
+virDomainSave
+
filename
_virDomainKernel
find
virDomainLookupByID
first
virConnectOpen
virConnectOpenReadOnly
@@ -210,6 +225,7 @@ A:link, A:visited, A:active { text-decoration: underline } virDomainGetID
virDomainGetName
virDomainLookupByName
+virDomainSave
virDomainShutdown
virGetVersion
format
virGetVersion
@@ -234,6 +250,6 @@ A:link, A:visited, A:active { text-decoration: underline }
further
virConnectClose
virDomainSuspend

A-f -g-s -t-z +g-r +s-z

Daniel Veillard

diff --git a/docs/APIchunk1.html b/docs/APIchunk1.html index 1160e43ac3..5d131dcf46 100644 --- a/docs/APIchunk1.html +++ b/docs/APIchunk1.html @@ -7,9 +7,9 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -API Alphabetic Index g-s for libvir
Red Hat Logo

Libvir the virtualization API

API Alphabetic Index g-s for libvir

Developer Menu
API Indexes
Related links

A-f -g-s -t-z +API Alphabetic Index g-r for libvir
Red Hat Logo

Libvir the virtualization API

API Alphabetic Index g-r for libvir

Developer Menu
API Indexes
Related links

A-f +g-r +s-z

Letter g:

general
virDomainShutdown
get
virConnectOpen
virConnectOpenReadOnly
@@ -18,6 +18,7 @@ A:link, A:visited, A:active { text-decoration: underline }
given
virDomainDestroy
virDomainLookupByName
guest
virDomainCreateLinux
+virDomainShutdown

Letter h:

have
virGetVersion
hypervisor
_virDomainInfo
virConnectClose
@@ -32,14 +33,16 @@ A:link, A:visited, A:active { text-decoration: underline } virDomainGetID
virDomainLookupByID
virDomainLookupByName
-virDomainResume
virDomainSetMaxMemory
virDomainSuspend
virGetVersion
-

Letter i:

image
virDomainCreateLinux
+

Letter i:

ignore
virDomainShutdown
+
image
_virDomainKernel
+virDomainCreateLinux
information
virDomainGetInfo
virGetVersion
informations
virDomainGetInfo
+
init
_virDomainKernel
initrd
virDomainCreateLinux
instance
virDomainDestroy
virDomainFree
@@ -48,8 +51,10 @@ A:link, A:visited, A:active { text-decoration: underline }
interaction
virConnectClose
its
virDomainGetName
virDomainLookupByName
+virDomainSave

Letter k:

kept
virDomainFree
-
kernel
virDomainCreateLinux
+
kernel
_virDomainKernel
+virDomainCreateLinux
kilobytes
virDomainCreateLinux
virDomainGetMaxMemory
virDomainSetMaxMemory
@@ -62,7 +67,8 @@ A:link, A:visited, A:active { text-decoration: underline }
lifetime
virDomainGetName
limited
_virDomainInfo
virDomainGetInfo
-
line
virDomainCreateLinux
+
line
_virDomainKernel
+virDomainCreateLinux
list
virConnectListDomains
long
_virDomainInfo
lookup
virDomainLookupByName
@@ -72,12 +78,18 @@ A:link, A:visited, A:active { text-decoration: underline } virDomainGetMaxMemory
virDomainSetMaxMemory
may
virConnectGetVersion
+virDomainDestroy
+virDomainResume
virDomainShutdown
+virDomainSuspend
memory
_virDomainInfo
virDomainCreateLinux
virDomainGetMaxMemory
+virDomainSave
virDomainSetMaxMemory
virDomainSuspend
+
method
virDomainRestore
+virDomainSave
micro
LIBVIR_VERSION_NUMBER
minor
LIBVIR_VERSION_NUMBER
virConnectGetVersion
@@ -117,7 +129,9 @@ A:link, A:visited, A:active { text-decoration: underline } virDomainGetXMLDesc
virDomainLookupByID
virDomainLookupByName
+virDomainRestore
virDomainResume
+virDomainSave
virDomainSetMaxMemory
virDomainShutdown
virDomainSuspend
@@ -127,18 +141,23 @@ A:link, A:visited, A:active { text-decoration: underline } virDomainGetInfo
operation
virDomainGetOSType
option
virDomainShutdown
-
optional
virConnectOpen
+
optional
_virDomainKernel
+virConnectOpen
virConnectOpenReadOnly
virDomainCreateLinux
otherwise
virConnectGetType
virConnectGetVersion
virGetVersion
+
output
virDomainSave

Letter p:

padding
_virDomainInfo
-
parameters
virDomainCreateLinux
+
parameters
_virDomainKernel
+virDomainCreateLinux
partial
virDomainGetInfo
pass
virConnectOpen
virConnectOpenReadOnly
path
virDomainCreateLinux
+virDomainRestore
+virDomainSave
physical
virDomainGetMaxMemory
virDomainSetMaxMemory
pointer
virConnectClose
@@ -153,6 +172,7 @@ A:link, A:visited, A:active { text-decoration: underline } virDomainGetName
virDomainLookupByID
virDomainLookupByName
+
pointing
_virDomainKernel
private
_virDomainInfo
priviledged
virConnectGetVersion
virDomainCreateLinux
@@ -166,11 +186,13 @@ A:link, A:visited, A:active { text-decoration: underline }
providing
LIBVIR_VERSION_NUMBER
public
virDomainGetName
publicly
_virDomainInfo
-

Letter r:

reactivate
virDomainSuspend
+

Letter r:

ramdisk
_virDomainKernel
+
reactivate
virDomainSuspend
read-only
virConnectOpenReadOnly
reboot
virDomainShutdown
release
virConnectGetVersion
virGetVersion
+
request
virDomainShutdown
requires
virDomainCreateLinux
virDomainDestroy
virDomainResume
@@ -181,6 +203,8 @@ A:link, A:visited, A:active { text-decoration: underline }
resources
virDomainDestroy
virDomainSuspend
restarted
virDomainResume
+
restore
virDomainRestore
+virDomainSave
restricted
virConnectOpenReadOnly
return
virConnectGetVersion
virDomainDestroy
@@ -188,6 +212,7 @@ A:link, A:visited, A:active { text-decoration: underline }
returned
virDomainGetXMLDesc
virGetVersion
returns
virConnectGetVersion
+
root
_virDomainKernel
running
_virDomainInfo
virConnectClose
virConnectGetVersion
@@ -195,51 +220,7 @@ A:link, A:visited, A:active { text-decoration: underline } virDomainFree
runs
virDomainGetMaxMemory
virDomainSetMaxMemory
-

Letter s:

same
virDomainGetName
-
set
virConnectOpenReadOnly
-virDomainCreateLinux
-virDomainGetInfo
-virDomainGetXMLDesc
-
should
virConnectClose
-virConnectOpen
-virConnectOpenReadOnly
-virDomainDestroy
-virDomainFree
-virDomainShutdown
-
shutdown
virDomainDestroy
-
size
virConnectListDomains
-virDomainCreateLinux
-virDomainGetMaxMemory
-virDomainSetMaxMemory
-
software
virConnectGetType
-
state
_virDomainInfo
-virDomainResume
-
static
virConnectGetType
-
stay
virDomainSuspend
-
still
virDomainShutdown
-
stopped
virDomainShutdown
-
store
virConnectListDomains
-virConnectOpen
-virConnectOpenReadOnly
-
string
virConnectGetType
-virDomainGetName
-virDomainGetOSType
-
structure
_virDomainInfo
-virDomainDestroy
-virDomainFree
-virDomainGetInfo
-
subject
virDomainGetXMLDesc
-
success
virConnectClose
-virDomainDestroy
-virDomainFree
-virDomainGetInfo
-virDomainResume
-virDomainSetMaxMemory
-virDomainShutdown
-virDomainSuspend
-
suspended
virDomainResume
-
system
virDomainGetOSType

A-f -g-s -t-z +g-r +s-z

Daniel Veillard

diff --git a/docs/APIchunk2.html b/docs/APIchunk2.html index fdd4f86d15..6b9eb1dde5 100644 --- a/docs/APIchunk2.html +++ b/docs/APIchunk2.html @@ -7,14 +7,65 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -API Alphabetic Index t-z for libvir
Red Hat Logo

Libvir the virtualization API

API Alphabetic Index t-z for libvir

Developer Menu
API Indexes
Related links

A-f -g-s -t-z -

Letter t:

term
_virDomainInfo
+API Alphabetic Index s-z for libvir
Red Hat Logo

Libvir the virtualization API

API Alphabetic Index s-z for libvir

Developer Menu
API Indexes
Related links

A-f +g-r +s-z +

Letter s:

same
virDomainGetName
+
save
virDomainSave
+
saved
virDomainRestore
+
saving
virDomainSave
+
set
virConnectOpenReadOnly
+virDomainCreateLinux
+virDomainGetInfo
+virDomainGetXMLDesc
+
should
virConnectClose
+virConnectOpen
+virConnectOpenReadOnly
+virDomainDestroy
+virDomainFree
+virDomainShutdown
+
shutdown
virDomainDestroy
+
size
virConnectListDomains
+virDomainCreateLinux
+virDomainGetMaxMemory
+virDomainSetMaxMemory
+
software
virConnectGetType
+
state
_virDomainInfo
+virDomainResume
+
static
virConnectGetType
+
stay
virDomainSuspend
+
still
virDomainShutdown
+
stopped
virDomainShutdown
+
store
virConnectListDomains
+virConnectOpen
+virConnectOpenReadOnly
+
string
virConnectGetType
+virDomainGetName
+virDomainGetOSType
+
structure
_virDomainInfo
+virDomainDestroy
+virDomainFree
+virDomainGetInfo
+
subject
virDomainGetXMLDesc
+
success
virConnectClose
+virDomainDestroy
+virDomainFree
+virDomainGetInfo
+virDomainRestore
+virDomainResume
+virDomainSave
+virDomainSetMaxMemory
+virDomainShutdown
+virDomainSuspend
+
suspend
virDomainSave
+
suspended
virDomainResume
+
system
virDomainGetOSType
+

Letter t:

term
_virDomainInfo
terminated
virConnectGetType
virDomainGetXMLDesc
that
virDomainGetInfo
virDomainGetName
+virDomainShutdown
their
virConnectListDomains
then
virConnectOpenReadOnly
virDomainGetMaxMemory
@@ -55,7 +106,9 @@ A:link, A:visited, A:active { text-decoration: underline }
virDomainFlags
_virDomainInfo
virDomainCreateLinux
virDomainInfo
virDomainGetInfo
+
virDomainRestore
virDomainSave
virDomainResume
virDomainSuspend
+
virDomainSave
virDomainRestore
virSuspendDomain
virDomainResume

Letter w:

was
virDomainResume
virGetVersion
@@ -67,6 +120,8 @@ A:link, A:visited, A:active { text-decoration: underline } virGetVersion
while
virGetVersion
will
virDomainGetName
+virDomainRestore
+virDomainSave
virDomainSuspend
virGetVersion
with
_virDomainInfo
@@ -82,6 +137,6 @@ A:link, A:visited, A:active { text-decoration: underline } virDomainGetXMLDesc

Letter z:

zero
virConnectGetType

A-f -g-s -t-z +g-r +s-z

Daniel Veillard

diff --git a/docs/APIfiles.html b/docs/APIfiles.html index 6167b20711..f9c0157f22 100644 --- a/docs/APIfiles.html +++ b/docs/APIfiles.html @@ -8,14 +8,24 @@ H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } List of Symbols per Module for libvir
Red Hat Logo

Libvir the virtualization API

List of Symbols per Module for libvir

Developer Menu
API Indexes
Related links

Module libvir:

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
virConnect
virConnectClose
virConnectGetType
@@ -25,6 +35,7 @@ A:link, A:visited, A:active { text-decoration: underline } virConnectOpen
virConnectOpenReadOnly
virConnectPtr
+virDeviceMode
virDomain
virDomainCreateFlags
virDomainCreateLinux
@@ -38,10 +49,15 @@ A:link, A:visited, A:active { text-decoration: underline } virDomainGetXMLDesc
virDomainInfo
virDomainInfoPtr
+virDomainKernel
+virDomainKernelPtr
virDomainLookupByID
virDomainLookupByName
virDomainPtr
+virDomainRestart
+virDomainRestore
virDomainResume
+virDomainSave
virDomainSetMaxMemory
virDomainShutdown
virDomainState
diff --git a/docs/APIfunctions.html b/docs/APIfunctions.html index eac6ba5b71..5cd46f8e8e 100644 --- a/docs/APIfunctions.html +++ b/docs/APIfunctions.html @@ -30,7 +30,9 @@ A:link, A:visited, A:active { text-decoration: underline } virDomainGetName
virDomainGetOSType
virDomainGetXMLDesc
+virDomainRestore
virDomainResume
+virDomainSave
virDomainSetMaxMemory
virDomainShutdown
virDomainSuspend
diff --git a/docs/APIsymbols.html b/docs/APIsymbols.html index 2ae907445c..1bd734d450 100644 --- a/docs/APIsymbols.html +++ b/docs/APIsymbols.html @@ -8,14 +8,24 @@ H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } Alphabetic List of Symbols in libvir
Red Hat Logo

Libvir the virtualization API

Alphabetic List of Symbols in libvir

Developer Menu
API Indexes
Related links

Letter L:

LIBVIR_VERSION_NUMBER
-

Letter V:

VIR_DOMAIN_BLOCKED
+

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

Letter _:

_virDomainInfo
+_virDomainKernel

Letter v:

virConnect
virConnectClose
virConnectGetType
@@ -25,6 +35,7 @@ A:link, A:visited, A:active { text-decoration: underline } virConnectOpen
virConnectOpenReadOnly
virConnectPtr
+virDeviceMode
virDomain
virDomainCreateFlags
virDomainCreateLinux
@@ -38,10 +49,15 @@ A:link, A:visited, A:active { text-decoration: underline } virDomainGetXMLDesc
virDomainInfo
virDomainInfoPtr
+virDomainKernel
+virDomainKernelPtr
virDomainLookupByID
virDomainLookupByName
virDomainPtr
+virDomainRestart
+virDomainRestore
virDomainResume
+virDomainSave
virDomainSetMaxMemory
virDomainShutdown
virDomainState
diff --git a/docs/apibuild.py b/docs/apibuild.py index 2c3c158d27..1e484a78be 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -22,6 +22,10 @@ ignored_files = { "hash.c": "internal hash table stuff", "hash.h": "internal hash table stuff", "internal.h": "internal includes and defines", + "xend_internal.h": "internal includes and defines", + "xend_internal.c": "internal code", + "sexpr.h": "internal includes and defines", + "sexpr.c": "internal code", } ignored_words = { diff --git a/docs/html/libvir-libvir.html b/docs/html/libvir-libvir.html index 74e64bcb1f..1429e81618 100644 --- a/docs/html/libvir-libvir.html +++ b/docs/html/libvir-libvir.html @@ -13,12 +13,16 @@ A:link, A:visited, A:active { text-decoration: underline } Module libvir from libvir
Red Hat Logo

Module libvir from libvir

API Menu
API Indexes
Related links

Provides the interfaces of the libvir library to handle Xen domains from a process running in domain 0

Table of Contents

#define LIBVIR_VERSION_NUMBER
Structure virConnect
struct _virConnect The content of this structure is not made public by the API.
Typedef virConnect * virConnectPtr
+
Enum virDeviceMode
 
Structure virDomain
struct _virDomain The content of this structure is not made public by the API.
Enum virDomainCreateFlags
 
Structure virDomainInfo
struct _virDomainInfo
Typedef virDomainInfo * virDomainInfoPtr
+
Structure virDomainKernel
struct _virDomainKernel +
Typedef virDomainKernel * virDomainKernelPtr
 
Typedef virDomain * virDomainPtr
+
Enum virDomainRestart
 
Enum virDomainState
 
int	virConnectClose			(virConnectPtr conn)
const char *	virConnectGetType	(virConnectPtr conn)
@@ -38,7 +42,9 @@ The content of this structure is not made public by the API.
char *	virDomainGetXMLDesc		(virDomainPtr domain, 
int flags)
virDomainPtr	virDomainLookupByID	(virConnectPtr conn, 
int id)
virDomainPtr	virDomainLookupByName	(virConnectPtr conn, 
const char * name)
+
int	virDomainRestore		(virDomainPtr domain, 
const char * from)
int	virDomainResume			(virDomainPtr domain)
+
int	virDomainSave			(virDomainPtr domain, 
const char * to)
int	virDomainSetMaxMemory		(virDomainPtr domain, 
unsigned long memory)
int	virDomainShutdown		(virDomainPtr domain)
int	virDomainSuspend		(virDomainPtr domain)
@@ -49,7 +55,13 @@ The content of this structure is not made public by the API. The content of this structure is not made public by the API. } 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. -

Structure virDomain

Structure virDomain
struct _virDomain { +

Enum virDeviceMode

Enum virDeviceMode {
+    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
+}
+

Structure virDomain

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

Enum virDomainCreateFlags

Enum virDomainCreateFlags {
     VIR_DOMAIN_NONE = 0
@@ -62,15 +74,29 @@ The content of this structure is not made public by the API.
     unsigned long long	cpuTime	: * TODO: * - check what can be extracted
 }
a virDomainInfoPtr is a pointer to a virDomainInfo structure. +

Structure virDomainKernel

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

Enum virDomainState

Enum virDomainState {
+    

Enum virDomainRestart

Enum virDomainRestart {
+    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
+}
+

Enum virDomainState

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

Function: virConnectClose

int	virConnectClose			(virConnectPtr conn)

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

@@ -89,7 +115,7 @@ The content of this structure is not made public by the API.
name:optional argument currently unused, pass NULL
Returns:a pointer to the hypervisor connection or NULL in case of error

Function: virDomainCreateLinux

virDomainPtr	virDomainCreateLinux	(virConnectPtr conn, 
const char * kernel_path,
const char * initrd_path,
const char * cmdline,
unsigned long memory,
unsigned int flags)

Launch a new Linux guest domain, unimplemented yet, API to be defined. This would function requires priviledged access to the hypervisor.

conn:pointer to the hypervisor connection
kernel_path:the file path to the kernel image
initrd_path:an optional file path to an initrd
cmdline:optional command line parameters for the kernel
memory:the memory size in kilobytes
flags:an optional set of virDomainFlags
Returns:a new domain object or NULL in case of failure

Function: 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 requires priviledged access to the hypervisor.

+

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

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

Function: virDomainFree

int	virDomainFree			(virDomainPtr domain)

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

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

Function: virDomainGetID

unsigned int	virDomainGetID		(virDomainPtr domain)
@@ -108,14 +134,18 @@ The content of this structure is not made public by the API.

Try to find a domain based on the hypervisor ID number

conn:pointer to the hypervisor connection
id:the domain ID number
Returns:a new domain object or NULL in case of failure

Function: virDomainLookupByName

virDomainPtr	virDomainLookupByName	(virConnectPtr conn, 
const char * name)

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

-
conn:pointer to the hypervisor connection
name:name for the domain
Returns:a new domain object or NULL in case of failure

Function: virDomainResume

int	virDomainResume			(virDomainPtr domain)
-

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

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

Function: virDomainSetMaxMemory

int	virDomainSetMaxMemory		(virDomainPtr domain, 
unsigned long memory)
+
conn:pointer to the hypervisor connection
name:name for the domain
Returns:a new domain object or NULL in case of failure

Function: virDomainRestore

int	virDomainRestore		(virDomainPtr domain, 
const char * from)
+

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

+
domain:a domain object
from:path to the
Returns:0 in case of success and -1 in case of failure.

Function: virDomainResume

int	virDomainResume			(virDomainPtr domain)
+

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

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

Function: virDomainSave

int	virDomainSave			(virDomainPtr domain, 
const char * to)
+

This method will suspend a domain and save its memory contents to a file on disk. Use virDomainRestore() to restore a domain after saving.

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

Function: virDomainSetMaxMemory

int	virDomainSetMaxMemory		(virDomainPtr domain, 
unsigned long memory)

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

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

Function: virDomainShutdown

int	virDomainShutdown		(virDomainPtr domain)
-

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

+

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

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

Function: 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 requires priviledged access to the hypervisor.

+

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.

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.

Daniel Veillard

diff --git a/docs/libvir-api.xml b/docs/libvir-api.xml index e8503fa91e..7285acc9c3 100644 --- a/docs/libvir-api.xml +++ b/docs/libvir-api.xml @@ -7,26 +7,42 @@ Daniel Veillard <veillard@redhat.com> + + + + + + + + + + + + + + + + @@ -51,17 +67,27 @@ 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. + @@ -80,9 +106,19 @@ 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. + 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. @@ -133,7 +169,7 @@ - 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 requires priviledged access to the hypervisor. + 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 @@ -186,10 +222,22 @@ - - Resume an suspended domain, the process is restarted from the state where it was frozen by calling virSuspendDomain(). This function requires priviledged access to the hypervisor. + + 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. 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. @@ -198,12 +246,12 @@ - Shutdown a domain, the domain object is still usable there after but the domain OS is being stopped. TODO: should we add an option for reboot, knowing it may not be doable in the general case ? + 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 requires priviledged access to the hypervisor. + 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. diff --git a/docs/libvir-refs.xml b/docs/libvir-refs.xml index cbc43a9d13..9211090472 100644 --- a/docs/libvir-refs.xml +++ b/docs/libvir-refs.xml @@ -2,14 +2,24 @@ + + + + + + + + + + @@ -19,6 +29,7 @@ + @@ -32,10 +43,15 @@ + + + + + @@ -47,16 +63,26 @@ + + + + + + + + + + @@ -68,6 +94,7 @@ + @@ -81,10 +108,15 @@ + + + + + @@ -146,7 +178,9 @@ + + @@ -155,14 +189,24 @@ + + + + + + + + + + @@ -172,6 +216,7 @@ + @@ -185,10 +230,15 @@ + + + + + @@ -303,6 +353,7 @@ + @@ -351,7 +402,9 @@ + + @@ -365,6 +418,7 @@ + @@ -399,6 +453,7 @@ + @@ -469,6 +524,9 @@ + + + @@ -521,6 +579,7 @@ + @@ -540,6 +599,9 @@ + + + @@ -559,6 +621,13 @@ + + + + + + + @@ -612,7 +681,9 @@ + + @@ -620,6 +691,10 @@ + + + + @@ -638,6 +713,7 @@ + @@ -699,6 +775,7 @@ + @@ -719,14 +796,17 @@ - + + + + @@ -736,6 +816,9 @@ + + + @@ -753,6 +836,7 @@ + @@ -760,6 +844,7 @@ + @@ -791,6 +876,7 @@ + @@ -815,15 +901,23 @@ + + + + + + + + @@ -888,7 +982,9 @@ + + @@ -908,6 +1004,7 @@ + @@ -917,12 +1014,16 @@ + + + + @@ -934,6 +1035,8 @@ + + @@ -953,6 +1056,9 @@ + + + @@ -982,6 +1088,9 @@ + + + @@ -995,6 +1104,9 @@ + + + @@ -1013,6 +1125,10 @@ + + + + @@ -1028,6 +1144,9 @@ + + + @@ -1040,10 +1159,21 @@ + + + + + + + + + + + @@ -1110,11 +1240,16 @@ + + + + + @@ -1122,8 +1257,6 @@ - - @@ -1135,6 +1268,7 @@ + @@ -1218,9 +1352,15 @@ + + + + + + @@ -1247,6 +1387,8 @@ + + @@ -1288,8 +1430,8 @@ - - + + diff --git a/include/libvir.h b/include/libvir.h index a52e2f543c..07bc91e2b9 100644 --- a/include/libvir.h +++ b/include/libvir.h @@ -61,7 +61,7 @@ typedef enum { 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 */ + VIR_DOMAIN_CRASHED = 6 /* the domain is crashed */ } virDomainState; /** @@ -97,7 +97,7 @@ typedef enum { typedef struct _virDomainInfo virDomainInfo; struct _virDomainInfo { - unsigned char state; /* the running state, one of virDomainState */ + 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 */ @@ -219,6 +219,14 @@ int virDomainFree (virDomainPtr domain); int virDomainSuspend (virDomainPtr domain); int virDomainResume (virDomainPtr domain); +/* + * Domain save/restore + */ +int virDomainSave (virDomainPtr domain, + const char *to); +int virDomainRestore (virDomainPtr domain, + const char *from); + /* * Domain runtime informations */ diff --git a/include/libvir.h.in b/include/libvir.h.in index 4c6675e2b6..92bb6aa8d0 100644 --- a/include/libvir.h.in +++ b/include/libvir.h.in @@ -60,7 +60,8 @@ typedef enum { 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_SHUTOFF = 5, /* the domain is shut off */ + VIR_DOMAIN_CRASHED = 6 /* the domain is crashed */ } virDomainState; /** @@ -218,6 +219,14 @@ int virDomainFree (virDomainPtr domain); int virDomainSuspend (virDomainPtr domain); int virDomainResume (virDomainPtr domain); +/* + * Domain save/restore + */ +int virDomainSave (virDomainPtr domain, + const char *to); +int virDomainRestore (virDomainPtr domain, + const char *from); + /* * Domain runtime informations */ diff --git a/src/libvir.c b/src/libvir.c index 3f5e684d4b..f74df38af7 100644 --- a/src/libvir.c +++ b/src/libvir.c @@ -16,6 +16,9 @@ #include #include #include +#include +#include +#include #include #include "internal.h" #include "xend_internal.h" @@ -733,7 +736,7 @@ done: * 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 requires priviledged access to the hypervisor. + * This function may requires priviledged access * * Returns 0 in case of success and -1 in case of failure. */ @@ -743,11 +746,22 @@ virDomainDestroy(virDomainPtr domain) { if (!VIR_IS_CONNECTED_DOMAIN(domain)) return(-1); + + /* + * try first with the xend method + */ + ret = xend_destroy(domain->conn, domain->name); + if (ret == 0) { + virDomainFree(domain); + return(0); + } + ret = xenHypervisorDestroyDomain(domain->conn->handle, domain->handle); if (ret < 0) return(-1); - return(virDomainFree(domain)); + virDomainFree(domain); + return(0); } /** @@ -781,14 +795,22 @@ virDomainFree(virDomainPtr domain) { * 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 requires priviledged access to the hypervisor. + * This function may requires priviledged access. * * Returns 0 in case of success and -1 in case of failure. */ int virDomainSuspend(virDomainPtr domain) { + int ret; + if (!VIR_IS_CONNECTED_DOMAIN(domain)) return(-1); + /* first try though the Xen daemon */ + ret = xend_pause(domain->conn, domain->name); + if (ret == 0) + return(0); + + /* then try a direct hypervisor access */ return(xenHypervisorPauseDomain(domain->conn->handle, domain->handle)); } @@ -798,23 +820,78 @@ virDomainSuspend(virDomainPtr domain) { * * Resume an suspended domain, the process is restarted from the state where * it was frozen by calling virSuspendDomain(). - * This function requires priviledged access to the hypervisor. + * This function may requires priviledged access * * Returns 0 in case of success and -1 in case of failure. */ int virDomainResume(virDomainPtr domain) { + int ret; + if (!VIR_IS_CONNECTED_DOMAIN(domain)) return(-1); + /* first try though the Xen daemon */ + ret = xend_unpause(domain->conn, domain->name); + if (ret == 0) + return(0); + + /* then try a direct hypervisor access */ return(xenHypervisorResumeDomain(domain->conn->handle, domain->handle)); } +/** + * virDomainSave: + * @domain: a domain object + * @to: path for the output file + * + * This method will suspend a domain and save its memory contents to + * a file on disk. Use virDomainRestore() to restore a domain after + * saving. + * + * Returns 0 in case of success and -1 in case of failure. + */ +int +virDomainSave(virDomainPtr domain, const char *to) { + int ret; + + if (!VIR_IS_CONNECTED_DOMAIN(domain)) + return(-1); + if ((to == NULL) || (to[0] != '/')) + return(-1); + + ret = xend_save(domain->conn, domain->name, to); + return(ret); +} + +/** + * virDomainRestore: + * @domain: a domain object + * @from: path to the + * + * This method will restore a domain saved to disk by virDomainSave(). + * + * Returns 0 in case of success and -1 in case of failure. + */ +int +virDomainRestore(virDomainPtr domain, const char *from) { + int ret; + + if (!VIR_IS_CONNECTED_DOMAIN(domain)) + return(-1); + if ((from == NULL) || (from[0] != '/')) + return(-1); + + ret = xend_restore(domain->conn, from); + return(ret); +} + /** * virDomainShutdown: * @domain: a domain object * * Shutdown a domain, the domain object is still usable there after but - * the domain OS is being stopped. + * 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 ? @@ -828,6 +905,13 @@ virDomainShutdown(virDomainPtr domain) { if (!VIR_IS_CONNECTED_DOMAIN(domain)) return(-1); + /* + * try first with the xend daemon + */ + ret = xend_shutdown(domain->conn, domain->name); + if (ret == 0) + return(0); + /* * this is very hackish, the domU kernel probes for a special * node in the xenstore and launch the shutdown command if found. @@ -1041,7 +1125,7 @@ virDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) { /* * the API brings back the cpu time in nanoseconds, * convert to microseconds, same thing convert to - + * kilobytes from page counts */ info->cpuTime = dominfo.cpu_time; info->memory = dominfo.tot_pages * 4;