From 5b31c7d08a96fab4b23e664b7ad232db14d00ba7 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 12 May 2009 20:10:50 +0000 Subject: [PATCH] Add public API stubs for virStorageVolCreateXMLFrom Also checkin regenerated docs due to API change. --- ChangeLog | 11 ++++++ docs/devhelp/libvirt-libvirt.html | 5 +++ docs/devhelp/libvirt-virterror.html | 3 +- docs/html/libvirt-libvirt.html | 4 +- docs/html/libvirt-virterror.html | 2 +- docs/libvirt-api.xml | 17 ++++++-- docs/libvirt-refs.xml | 38 ++++++++++++++++++ include/libvirt/libvirt.h | 4 ++ include/libvirt/libvirt.h.in | 4 ++ src/driver.h | 6 +++ src/libvirt.c | 61 ++++++++++++++++++++++++++++- src/libvirt_public.syms | 5 +++ 12 files changed, 152 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index f1f249bf3b..6338b0ae69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Tue May 12 16:00:49 EDT 2009 Cole Robinson + + * include/libvirt/libvirt.h include/libvirt/libvirt.c + src/driver.h src/libvirt.c src/libvirt_public.syms: + Public API definition for virStorageVolCreateXMLFrom + * docs/devhelp/libvirt-libvirt.html + docs/devhelp/libvirt-virterror.html + docs/html/libvirt-libvirt.html docs/html/libvirt-virterror.html + docs/libvirt-api.xml docs/libvirt-refs.xml: + Regenerate API documentation. + Tue May 12 15:58:28 EDT 2009 Cole Robinson * src/storage_backend.c: Document a function diff --git a/docs/devhelp/libvirt-libvirt.html b/docs/devhelp/libvirt-libvirt.html index b749b53af5..59717ef0ef 100644 --- a/docs/devhelp/libvirt-libvirt.html +++ b/docs/devhelp/libvirt-libvirt.html @@ -245,6 +245,7 @@ typedef int virEventAddHandleFunc (int fd, int virNetworkUndefine (virNetworkPtr network); int virConnectListDefinedStoragePools (virConnectPtr conn,
char ** const names,
int maxnames); typedef void virEventTimeoutCallback (int timer,
void * opaque); +virStorageVolPtr virStorageVolCreateXMLFrom (virStoragePoolPtr pool,
const char * xmldesc,
virStorageVolPtr clonevol,
unsigned int flags); int virNodeDeviceNumOfCaps (virNodeDevicePtr dev); virConnectPtr virNetworkGetConnect (virNetworkPtr net); unsigned long long virNodeGetFreeMemory (virConnectPtr conn); @@ -1333,6 +1334,10 @@ The content of this structure is not made public by the API.

virStorageVolCreateXML ()

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

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

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

virStorageVolCreateXMLFrom ()

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

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

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

virStorageVolDelete ()

int	virStorageVolDelete		(virStorageVolPtr vol, 
unsigned int flags)

Delete the storage volume from the pool

diff --git a/docs/devhelp/libvirt-virterror.html b/docs/devhelp/libvirt-virterror.html index 6e9c3a2e59..b2055832c0 100644 --- a/docs/devhelp/libvirt-virterror.html +++ b/docs/devhelp/libvirt-virterror.html @@ -175,7 +175,8 @@ void virConnResetLastError (VIR_WAR_NO_NODE = 51 /* failed to start node driver */ VIR_ERR_INVALID_NODE_DEVICE = 52 /* invalid node device object */ VIR_ERR_NO_NODE_DEVICE = 53 /* node device not found */ - VIR_ERR_NO_SECURITY_MODEL = 54 /* security model not found */ + VIR_ERR_NO_SECURITY_MODEL = 54 /* security model not found */ + VIR_ERR_OPERATION_INVALID = 55 /* operation is not applicable at this time */ };

diff --git a/docs/html/libvirt-libvirt.html b/docs/html/libvirt-libvirt.html index 48dc7c7871..4a12696739 100644 --- a/docs/html/libvirt-libvirt.html +++ b/docs/html/libvirt-libvirt.html @@ -246,6 +246,7 @@ int virStoragePoolRefresh (virStoragePoolSetAutostart (virStoragePoolPtr pool,
int autostart) int virStoragePoolUndefine (virStoragePoolPtr pool) virStorageVolPtr virStorageVolCreateXML (virStoragePoolPtr pool,
const char * xmldesc,
unsigned int flags) +virStorageVolPtr virStorageVolCreateXMLFrom (virStoragePoolPtr pool,
const char * xmldesc,
virStorageVolPtr clonevol,
unsigned int flags) int virStorageVolDelete (virStorageVolPtr vol,
unsigned int flags) int virStorageVolFree (virStorageVolPtr vol) virConnectPtr virStorageVolGetConnect (virStorageVolPtr vol) @@ -505,7 +506,8 @@ int virStorageVolRef (
pool:pointer to storage pool
flags:flags to control refresh behaviour (currently unused, use 0)
Returns:0 if the volume list was refreshed, -1 on failure

virStoragePoolSetAutostart

int	virStoragePoolSetAutostart	(virStoragePoolPtr pool, 
int autostart)

Sets the autostart flag

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

virStoragePoolUndefine

int	virStoragePoolUndefine		(virStoragePoolPtr pool)

Undefine an inactive storage pool

pool:pointer to storage pool
Returns:a virStoragePoolPtr object, or NULL if creation failed

virStorageVolCreateXML

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

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

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

virStorageVolDelete

int	virStorageVolDelete		(virStorageVolPtr vol, 
unsigned int flags)
+

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

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

virStorageVolCreateXMLFrom

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

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

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

virStorageVolDelete

int	virStorageVolDelete		(virStorageVolPtr vol, 
unsigned int flags)

Delete the storage volume from the pool

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

virStorageVolFree

int	virStorageVolFree		(virStorageVolPtr vol)

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

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

virStorageVolGetConnect

virConnectPtr	virStorageVolGetConnect	(virStorageVolPtr vol)

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

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

virStorageVolGetInfo

int	virStorageVolGetInfo		(virStorageVolPtr vol, 
virStorageVolInfoPtr info)
diff --git a/docs/html/libvirt-virterror.html b/docs/html/libvirt-virterror.html index 3003444bf5..bf757196f6 100644 --- a/docs/html/libvirt-virterror.html +++ b/docs/html/libvirt-virterror.html @@ -31,7 +31,7 @@ void virSetErrorFunc (void * userData,

virErrorLevel

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

virErrorNumber

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

Functions

virConnCopyLastError

int	virConnCopyLastError		(virConnectPtr conn, 
virErrorPtr to)

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

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

virConnGetLastError

virErrorPtr	virConnGetLastError	(virConnectPtr conn)

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

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

virConnResetLastError

void	virConnResetLastError		(virConnectPtr conn)
diff --git a/docs/libvirt-api.xml b/docs/libvirt-api.xml index deed7fa18b..c1121ebb69 100644 --- a/docs/libvirt-api.xml +++ b/docs/libvirt-api.xml @@ -295,6 +295,7 @@ + @@ -365,15 +366,16 @@ - + + - + @@ -569,7 +571,7 @@ - + @@ -581,6 +583,7 @@ + @@ -1776,6 +1779,14 @@ see note above'/> + + Create a storage volume in the parent pool, using the 'clonevol' volume as input. Information for the new volume (name, perms) are passed via a typical volume XML description. + + + + + + Delete the storage volume from the pool diff --git a/docs/libvirt-refs.xml b/docs/libvirt-refs.xml index ac9682d4d0..abb9f7aeca 100644 --- a/docs/libvirt-refs.xml +++ b/docs/libvirt-refs.xml @@ -96,6 +96,7 @@ + @@ -400,6 +401,7 @@ + @@ -520,6 +522,7 @@ + @@ -828,6 +831,7 @@ + @@ -905,6 +909,7 @@ + @@ -969,6 +974,7 @@ + @@ -1213,6 +1219,7 @@ + @@ -1220,6 +1227,7 @@ + @@ -1547,6 +1555,7 @@ + @@ -1611,6 +1620,7 @@ + @@ -1796,6 +1806,7 @@ + @@ -1998,6 +2009,9 @@ + + + @@ -2662,6 +2676,7 @@ + @@ -3047,6 +3062,9 @@ + + + @@ -3229,6 +3247,7 @@ + @@ -3238,6 +3257,7 @@ + @@ -3350,6 +3370,7 @@ + @@ -3762,6 +3783,7 @@ + @@ -4174,6 +4196,9 @@ + + + @@ -5016,6 +5041,7 @@ + @@ -5043,11 +5069,13 @@ + + @@ -5085,6 +5113,9 @@ + + + @@ -6111,6 +6142,9 @@ + + + @@ -6188,6 +6222,7 @@ + @@ -6238,6 +6273,7 @@ + @@ -6312,6 +6348,7 @@ + @@ -6364,6 +6401,7 @@ + diff --git a/include/libvirt/libvirt.h b/include/libvirt/libvirt.h index 30f559ddb2..3de3688a25 100644 --- a/include/libvirt/libvirt.h +++ b/include/libvirt/libvirt.h @@ -1047,6 +1047,10 @@ const char* virStorageVolGetKey (virStorageVolPtr vol); virStorageVolPtr virStorageVolCreateXML (virStoragePoolPtr pool, const char *xmldesc, unsigned int flags); +virStorageVolPtr virStorageVolCreateXMLFrom (virStoragePoolPtr pool, + const char *xmldesc, + virStorageVolPtr clonevol, + unsigned int flags); int virStorageVolDelete (virStorageVolPtr vol, unsigned int flags); int virStorageVolRef (virStorageVolPtr vol); diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in index 2f7076fed4..6b0c1d8e70 100644 --- a/include/libvirt/libvirt.h.in +++ b/include/libvirt/libvirt.h.in @@ -1047,6 +1047,10 @@ const char* virStorageVolGetKey (virStorageVolPtr vol); virStorageVolPtr virStorageVolCreateXML (virStoragePoolPtr pool, const char *xmldesc, unsigned int flags); +virStorageVolPtr virStorageVolCreateXMLFrom (virStoragePoolPtr pool, + const char *xmldesc, + virStorageVolPtr clonevol, + unsigned int flags); int virStorageVolDelete (virStorageVolPtr vol, unsigned int flags); int virStorageVolRef (virStorageVolPtr vol); diff --git a/src/driver.h b/src/driver.h index c357b76321..b8e0a04ed6 100644 --- a/src/driver.h +++ b/src/driver.h @@ -586,6 +586,11 @@ typedef char * typedef char * (*virDrvStorageVolGetPath) (virStorageVolPtr vol); +typedef virStorageVolPtr + (*virDrvStorageVolCreateXMLFrom) (virStoragePoolPtr pool, + const char *xmldesc, + virStorageVolPtr clone, + unsigned int flags); typedef struct _virStorageDriver virStorageDriver; @@ -633,6 +638,7 @@ struct _virStorageDriver { virDrvStorageVolLookupByKey volLookupByKey; virDrvStorageVolLookupByPath volLookupByPath; virDrvStorageVolCreateXML volCreateXML; + virDrvStorageVolCreateXMLFrom volCreateXMLFrom; virDrvStorageVolDelete volDelete; virDrvStorageVolGetInfo volGetInfo; virDrvStorageVolGetXMLDesc volGetXMLDesc; diff --git a/src/libvirt.c b/src/libvirt.c index ded18a7870..f1f81b3ff7 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -6766,6 +6766,65 @@ error: } +/** + * virStorageVolCreateXMLFrom: + * @pool: pointer to parent pool for the new volume + * @xmldesc: description of volume to create + * @clonevol: storage volume to use as input + * @flags: flags for creation (unused, pass 0) + * + * Create a storage volume in the parent pool, using the + * 'clonevol' volume as input. Information for the new + * volume (name, perms) are passed via a typical volume + * XML description. + * + * return the storage volume, or NULL on error + */ +virStorageVolPtr +virStorageVolCreateXMLFrom(virStoragePoolPtr pool, + const char *xmldesc, + virStorageVolPtr clonevol, + unsigned int flags) +{ + DEBUG("pool=%p, flags=%u, clonevol=%p", pool, flags, clonevol); + + virResetLastError(); + + if (!VIR_IS_STORAGE_POOL(pool)) { + virLibConnError(NULL, VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__); + return (NULL); + } + + if (!VIR_IS_STORAGE_VOL(clonevol)) { + virLibConnError(NULL, VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__); + return (NULL); + } + + if (pool->conn->flags & VIR_CONNECT_RO || + clonevol->conn->flags & VIR_CONNECT_RO) { + virLibConnError(pool->conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__); + goto error; + } + + if (pool->conn->storageDriver && + pool->conn->storageDriver->volCreateXMLFrom) { + virStorageVolPtr ret; + ret = pool->conn->storageDriver->volCreateXMLFrom (pool, xmldesc, + clonevol, flags); + if (!ret) + goto error; + return ret; + } + + virLibConnError (pool->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__); + +error: + /* Copy to connection error object for back compatability */ + virSetConnError(pool->conn); + return NULL; +} + + /** * virStorageVolDelete: * @vol: pointer to storage volume @@ -7009,8 +7068,6 @@ error: } - - /** * virNodeNumOfDevices: * @conn: pointer to the hypervisor connection diff --git a/src/libvirt_public.syms b/src/libvirt_public.syms index b8f9128a93..0ea130ff95 100644 --- a/src/libvirt_public.syms +++ b/src/libvirt_public.syms @@ -265,3 +265,8 @@ LIBVIRT_0.6.3 { } LIBVIRT_0.6.1; # .... define new API here using predicted next version number .... + +LIBVIRT_0.6.4 { + global: + virStorageVolCreateXMLFrom; +} LIBVIRT_0.6.3;