mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +03:00
libvirt: Introduce virConnectGetStoragePoolCapabilities
Introduce the API to expose the storage pool capabilities along with all the remote munglement required to hook up the client. Signed-off-by: John Ferlan <jferlan@redhat.com> ACKed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
784cd46fb8
commit
6696155ae6
@ -193,6 +193,10 @@ typedef enum {
|
|||||||
*/
|
*/
|
||||||
virConnectPtr virStoragePoolGetConnect (virStoragePoolPtr pool);
|
virConnectPtr virStoragePoolGetConnect (virStoragePoolPtr pool);
|
||||||
|
|
||||||
|
/* Storage Pool capabilities */
|
||||||
|
char *virConnectGetStoragePoolCapabilities(virConnectPtr conn,
|
||||||
|
unsigned int flags);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* List active storage pools
|
* List active storage pools
|
||||||
*/
|
*/
|
||||||
|
@ -52,6 +52,10 @@ typedef char *
|
|||||||
const char *srcSpec,
|
const char *srcSpec,
|
||||||
unsigned int flags);
|
unsigned int flags);
|
||||||
|
|
||||||
|
typedef char *
|
||||||
|
(*virDrvConnectGetStoragePoolCapabilities)(virConnectPtr conn,
|
||||||
|
unsigned int flags);
|
||||||
|
|
||||||
typedef virStoragePoolPtr
|
typedef virStoragePoolPtr
|
||||||
(*virDrvStoragePoolLookupByName)(virConnectPtr conn,
|
(*virDrvStoragePoolLookupByName)(virConnectPtr conn,
|
||||||
const char *name);
|
const char *name);
|
||||||
@ -237,6 +241,7 @@ struct _virStorageDriver {
|
|||||||
virDrvConnectFindStoragePoolSources connectFindStoragePoolSources;
|
virDrvConnectFindStoragePoolSources connectFindStoragePoolSources;
|
||||||
virDrvConnectStoragePoolEventRegisterAny connectStoragePoolEventRegisterAny;
|
virDrvConnectStoragePoolEventRegisterAny connectStoragePoolEventRegisterAny;
|
||||||
virDrvConnectStoragePoolEventDeregisterAny connectStoragePoolEventDeregisterAny;
|
virDrvConnectStoragePoolEventDeregisterAny connectStoragePoolEventDeregisterAny;
|
||||||
|
virDrvConnectGetStoragePoolCapabilities connectGetStoragePoolCapabilities;
|
||||||
virDrvStoragePoolLookupByName storagePoolLookupByName;
|
virDrvStoragePoolLookupByName storagePoolLookupByName;
|
||||||
virDrvStoragePoolLookupByUUID storagePoolLookupByUUID;
|
virDrvStoragePoolLookupByUUID storagePoolLookupByUUID;
|
||||||
virDrvStoragePoolLookupByVolume storagePoolLookupByVolume;
|
virDrvStoragePoolLookupByVolume storagePoolLookupByVolume;
|
||||||
|
@ -2351,3 +2351,43 @@ virConnectStoragePoolEventDeregisterAny(virConnectPtr conn,
|
|||||||
virDispatchError(conn);
|
virDispatchError(conn);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* virConnectGetStoragePoolCapabilities:
|
||||||
|
* @conn: pointer to the hypervisor connection
|
||||||
|
* @flags: extra flags; not used yet, so callers should always pass 0
|
||||||
|
*
|
||||||
|
* Prior creating a storage pool (for instance via virStoragePoolCreateXML
|
||||||
|
* or virStoragePoolDefineXML) it may be suitable to know what pool types
|
||||||
|
* are supported along with the file/disk formats for each pool.
|
||||||
|
*
|
||||||
|
* Returns NULL in case of error or an XML string defining the capabilities.
|
||||||
|
*/
|
||||||
|
char *
|
||||||
|
virConnectGetStoragePoolCapabilities(virConnectPtr conn,
|
||||||
|
unsigned int flags)
|
||||||
|
{
|
||||||
|
VIR_DEBUG("conn=%p, flags=0x%x", conn, flags);
|
||||||
|
|
||||||
|
virResetLastError();
|
||||||
|
|
||||||
|
virCheckConnectReturn(conn, NULL);
|
||||||
|
|
||||||
|
if (conn->storageDriver &&
|
||||||
|
conn->storageDriver->connectGetStoragePoolCapabilities) {
|
||||||
|
char *ret;
|
||||||
|
ret = conn->storageDriver->connectGetStoragePoolCapabilities(conn,
|
||||||
|
flags);
|
||||||
|
if (!ret)
|
||||||
|
goto error;
|
||||||
|
VIR_DEBUG("conn=%p, ret=%s", conn, ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
virReportUnsupportedError();
|
||||||
|
|
||||||
|
error:
|
||||||
|
virDispatchError(conn);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
@ -814,4 +814,9 @@ LIBVIRT_4.10.0 {
|
|||||||
virDomainSetIOThreadParams;
|
virDomainSetIOThreadParams;
|
||||||
} LIBVIRT_4.5.0;
|
} LIBVIRT_4.5.0;
|
||||||
|
|
||||||
|
LIBVIRT_5.2.0 {
|
||||||
|
global:
|
||||||
|
virConnectGetStoragePoolCapabilities;
|
||||||
|
} LIBVIRT_4.10.0;
|
||||||
|
|
||||||
# .... define new API here using predicted next version number ....
|
# .... define new API here using predicted next version number ....
|
||||||
|
@ -8572,6 +8572,7 @@ static virStorageDriver storage_driver = {
|
|||||||
.connectFindStoragePoolSources = remoteConnectFindStoragePoolSources, /* 0.4.5 */
|
.connectFindStoragePoolSources = remoteConnectFindStoragePoolSources, /* 0.4.5 */
|
||||||
.connectStoragePoolEventDeregisterAny = remoteConnectStoragePoolEventDeregisterAny, /* 2.0.0 */
|
.connectStoragePoolEventDeregisterAny = remoteConnectStoragePoolEventDeregisterAny, /* 2.0.0 */
|
||||||
.connectStoragePoolEventRegisterAny = remoteConnectStoragePoolEventRegisterAny, /* 2.0.0 */
|
.connectStoragePoolEventRegisterAny = remoteConnectStoragePoolEventRegisterAny, /* 2.0.0 */
|
||||||
|
.connectGetStoragePoolCapabilities = remoteConnectGetStoragePoolCapabilities, /* 5.2.0 */
|
||||||
.storagePoolLookupByName = remoteStoragePoolLookupByName, /* 0.4.1 */
|
.storagePoolLookupByName = remoteStoragePoolLookupByName, /* 0.4.1 */
|
||||||
.storagePoolLookupByUUID = remoteStoragePoolLookupByUUID, /* 0.4.1 */
|
.storagePoolLookupByUUID = remoteStoragePoolLookupByUUID, /* 0.4.1 */
|
||||||
.storagePoolLookupByVolume = remoteStoragePoolLookupByVolume, /* 0.4.1 */
|
.storagePoolLookupByVolume = remoteStoragePoolLookupByVolume, /* 0.4.1 */
|
||||||
|
@ -3565,6 +3565,14 @@ struct remote_connect_list_all_nwfilter_bindings_ret { /* insert@1 */
|
|||||||
unsigned int ret;
|
unsigned int ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct remote_connect_get_storage_pool_capabilities_args {
|
||||||
|
unsigned int flags;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct remote_connect_get_storage_pool_capabilities_ret {
|
||||||
|
remote_nonnull_string capabilities;
|
||||||
|
};
|
||||||
|
|
||||||
/*----- Protocol. -----*/
|
/*----- Protocol. -----*/
|
||||||
|
|
||||||
/* Define the program number, protocol version and procedure numbers here. */
|
/* Define the program number, protocol version and procedure numbers here. */
|
||||||
@ -6328,6 +6336,11 @@ enum remote_procedure {
|
|||||||
* @acl: domain:save:!VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
|
* @acl: domain:save:!VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
|
||||||
* @acl: domain:save:VIR_DOMAIN_AFFECT_CONFIG
|
* @acl: domain:save:VIR_DOMAIN_AFFECT_CONFIG
|
||||||
*/
|
*/
|
||||||
REMOTE_PROC_DOMAIN_SET_IOTHREAD_PARAMS = 402
|
REMOTE_PROC_DOMAIN_SET_IOTHREAD_PARAMS = 402,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @generate: both
|
||||||
|
* @acl: connect:read
|
||||||
|
*/
|
||||||
|
REMOTE_PROC_CONNECT_GET_STORAGE_POOL_CAPABILITIES = 403
|
||||||
};
|
};
|
||||||
|
@ -2975,6 +2975,12 @@ struct remote_connect_list_all_nwfilter_bindings_ret {
|
|||||||
} bindings;
|
} bindings;
|
||||||
u_int ret;
|
u_int ret;
|
||||||
};
|
};
|
||||||
|
struct remote_connect_get_storage_pool_capabilities_args {
|
||||||
|
u_int flags;
|
||||||
|
};
|
||||||
|
struct remote_connect_get_storage_pool_capabilities_ret {
|
||||||
|
remote_nonnull_string capabilities;
|
||||||
|
};
|
||||||
enum remote_procedure {
|
enum remote_procedure {
|
||||||
REMOTE_PROC_CONNECT_OPEN = 1,
|
REMOTE_PROC_CONNECT_OPEN = 1,
|
||||||
REMOTE_PROC_CONNECT_CLOSE = 2,
|
REMOTE_PROC_CONNECT_CLOSE = 2,
|
||||||
@ -3378,4 +3384,5 @@ enum remote_procedure {
|
|||||||
REMOTE_PROC_NWFILTER_BINDING_DELETE = 400,
|
REMOTE_PROC_NWFILTER_BINDING_DELETE = 400,
|
||||||
REMOTE_PROC_CONNECT_LIST_ALL_NWFILTER_BINDINGS = 401,
|
REMOTE_PROC_CONNECT_LIST_ALL_NWFILTER_BINDINGS = 401,
|
||||||
REMOTE_PROC_DOMAIN_SET_IOTHREAD_PARAMS = 402,
|
REMOTE_PROC_DOMAIN_SET_IOTHREAD_PARAMS = 402,
|
||||||
|
REMOTE_PROC_CONNECT_GET_STORAGE_POOL_CAPABILITIES = 403,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user