mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
storage: Introduce storageConnectGetStoragePoolCapabilities
https://bugzilla.redhat.com/show_bug.cgi?id=1581670 Create the storage driver code to generate the output for the storage pool capabilities XML. Signed-off-by: John Ferlan <jferlan@redhat.com> ACKed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
6696155ae6
commit
d9bf6cef32
@ -35,6 +35,7 @@
|
||||
#include "datatypes.h"
|
||||
#include "driver.h"
|
||||
#include "storage_driver.h"
|
||||
#include "storage_capabilities.h"
|
||||
#include "storage_conf.h"
|
||||
#include "storage_event.h"
|
||||
#include "viralloc.h"
|
||||
@ -638,6 +639,28 @@ storageConnectFindStoragePoolSources(virConnectPtr conn,
|
||||
}
|
||||
|
||||
|
||||
static char *
|
||||
storageConnectGetStoragePoolCapabilities(virConnectPtr conn,
|
||||
unsigned int flags)
|
||||
{
|
||||
virStoragePoolCapsPtr caps = NULL;
|
||||
char *ret;
|
||||
|
||||
virCheckFlags(0, NULL);
|
||||
|
||||
if (virConnectGetStoragePoolCapabilitiesEnsureACL(conn) < 0)
|
||||
return NULL;
|
||||
|
||||
if (!(caps = virStoragePoolCapsNew(driver->caps)))
|
||||
return NULL;
|
||||
|
||||
ret = virStoragePoolCapsFormat(caps);
|
||||
|
||||
virObjectUnref(caps);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
storagePoolIsActive(virStoragePoolPtr pool)
|
||||
{
|
||||
@ -2776,6 +2799,7 @@ static virStorageDriver storageDriver = {
|
||||
.connectStoragePoolEventRegisterAny = storageConnectStoragePoolEventRegisterAny, /* 2.0.0 */
|
||||
.connectStoragePoolEventDeregisterAny = storageConnectStoragePoolEventDeregisterAny, /* 2.0.0 */
|
||||
.connectFindStoragePoolSources = storageConnectFindStoragePoolSources, /* 0.4.0 */
|
||||
.connectGetStoragePoolCapabilities = storageConnectGetStoragePoolCapabilities, /* 5.2.0 */
|
||||
.storagePoolLookupByName = storagePoolLookupByName, /* 0.4.0 */
|
||||
.storagePoolLookupByUUID = storagePoolLookupByUUID, /* 0.4.0 */
|
||||
.storagePoolLookupByVolume = storagePoolLookupByVolume, /* 0.4.0 */
|
||||
|
Loading…
Reference in New Issue
Block a user