mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
storage: Create accessor API's for virStoragePoolObj
In preparation for making a private object, create accessor API's for consumer storage functions to use: virStoragePoolObjGetDef virStoragePoolObjSetDef virStoragePoolObjGetNewDef virStoragePoolObjDefUseNewDef virStoragePoolObjGetConfigFile virStoragePoolObjSetConfigFile virStoragePoolObjGetAutostartLink virStoragePoolObjIsActive virStoragePoolObjSetActive virStoragePoolObjIsAutostart virStoragePoolObjSetAutostart virStoragePoolObjGetAsyncjobs virStoragePoolObjIncrAsyncjobs virStoragePoolObjDecrAsyncjobs Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
b616ec65e2
commit
b31982868a
@ -37,6 +37,115 @@
|
|||||||
VIR_LOG_INIT("conf.virstorageobj");
|
VIR_LOG_INIT("conf.virstorageobj");
|
||||||
|
|
||||||
|
|
||||||
|
virStoragePoolDefPtr
|
||||||
|
virStoragePoolObjGetDef(virStoragePoolObjPtr obj)
|
||||||
|
{
|
||||||
|
return obj->def;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
virStoragePoolObjSetDef(virStoragePoolObjPtr obj,
|
||||||
|
virStoragePoolDefPtr def)
|
||||||
|
{
|
||||||
|
virStoragePoolDefFree(obj->def);
|
||||||
|
obj->def = def;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
virStoragePoolDefPtr
|
||||||
|
virStoragePoolObjGetNewDef(virStoragePoolObjPtr obj)
|
||||||
|
{
|
||||||
|
return obj->newDef;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
virStoragePoolObjDefUseNewDef(virStoragePoolObjPtr obj)
|
||||||
|
{
|
||||||
|
virStoragePoolDefFree(obj->def);
|
||||||
|
obj->def = obj->newDef;
|
||||||
|
obj->newDef = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
char *
|
||||||
|
virStoragePoolObjGetConfigFile(virStoragePoolObjPtr obj)
|
||||||
|
{
|
||||||
|
return obj->configFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
virStoragePoolObjSetConfigFile(virStoragePoolObjPtr obj,
|
||||||
|
char *configFile)
|
||||||
|
{
|
||||||
|
VIR_FREE(obj->configFile);
|
||||||
|
obj->configFile = configFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
char *
|
||||||
|
virStoragePoolObjGetAutostartLink(virStoragePoolObjPtr obj)
|
||||||
|
{
|
||||||
|
return obj->autostartLink;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
virStoragePoolObjIsActive(virStoragePoolObjPtr obj)
|
||||||
|
{
|
||||||
|
return obj->active;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
virStoragePoolObjSetActive(virStoragePoolObjPtr obj,
|
||||||
|
bool active)
|
||||||
|
{
|
||||||
|
obj->active = active;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
virStoragePoolObjIsAutostart(virStoragePoolObjPtr obj)
|
||||||
|
{
|
||||||
|
if (!obj->configFile)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return obj->autostart == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
virStoragePoolObjSetAutostart(virStoragePoolObjPtr obj,
|
||||||
|
int autostart)
|
||||||
|
{
|
||||||
|
obj->autostart = autostart;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
unsigned int
|
||||||
|
virStoragePoolObjGetAsyncjobs(virStoragePoolObjPtr obj)
|
||||||
|
{
|
||||||
|
return obj->asyncjobs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
virStoragePoolObjIncrAsyncjobs(virStoragePoolObjPtr obj)
|
||||||
|
{
|
||||||
|
obj->asyncjobs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
virStoragePoolObjDecrAsyncjobs(virStoragePoolObjPtr obj)
|
||||||
|
{
|
||||||
|
obj->asyncjobs--;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
virStoragePoolObjFree(virStoragePoolObjPtr obj)
|
virStoragePoolObjFree(virStoragePoolObjPtr obj)
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,51 @@ typedef bool
|
|||||||
(*virStoragePoolObjListFilter)(virConnectPtr conn,
|
(*virStoragePoolObjListFilter)(virConnectPtr conn,
|
||||||
virStoragePoolDefPtr def);
|
virStoragePoolDefPtr def);
|
||||||
|
|
||||||
static inline int
|
virStoragePoolDefPtr
|
||||||
virStoragePoolObjIsActive(virStoragePoolObjPtr obj)
|
virStoragePoolObjGetDef(virStoragePoolObjPtr obj);
|
||||||
{
|
|
||||||
return obj->active;
|
void
|
||||||
}
|
virStoragePoolObjSetDef(virStoragePoolObjPtr obj,
|
||||||
|
virStoragePoolDefPtr def);
|
||||||
|
|
||||||
|
virStoragePoolDefPtr
|
||||||
|
virStoragePoolObjGetNewDef(virStoragePoolObjPtr obj);
|
||||||
|
|
||||||
|
void
|
||||||
|
virStoragePoolObjDefUseNewDef(virStoragePoolObjPtr obj);
|
||||||
|
|
||||||
|
char *
|
||||||
|
virStoragePoolObjGetConfigFile(virStoragePoolObjPtr obj);
|
||||||
|
|
||||||
|
void
|
||||||
|
virStoragePoolObjSetConfigFile(virStoragePoolObjPtr obj,
|
||||||
|
char *configFile);
|
||||||
|
|
||||||
|
char *
|
||||||
|
virStoragePoolObjGetAutostartLink(virStoragePoolObjPtr obj);
|
||||||
|
|
||||||
|
bool
|
||||||
|
virStoragePoolObjIsActive(virStoragePoolObjPtr obj);
|
||||||
|
|
||||||
|
void
|
||||||
|
virStoragePoolObjSetActive(virStoragePoolObjPtr obj,
|
||||||
|
bool active);
|
||||||
|
|
||||||
|
bool
|
||||||
|
virStoragePoolObjIsAutostart(virStoragePoolObjPtr obj);
|
||||||
|
|
||||||
|
void
|
||||||
|
virStoragePoolObjSetAutostart(virStoragePoolObjPtr obj,
|
||||||
|
int autostart);
|
||||||
|
|
||||||
|
unsigned int
|
||||||
|
virStoragePoolObjGetAsyncjobs(virStoragePoolObjPtr obj);
|
||||||
|
|
||||||
|
void
|
||||||
|
virStoragePoolObjIncrAsyncjobs(virStoragePoolObjPtr obj);
|
||||||
|
|
||||||
|
void
|
||||||
|
virStoragePoolObjDecrAsyncjobs(virStoragePoolObjPtr obj);
|
||||||
|
|
||||||
int
|
int
|
||||||
virStoragePoolObjLoadAllConfigs(virStoragePoolObjListPtr pools,
|
virStoragePoolObjLoadAllConfigs(virStoragePoolObjListPtr pools,
|
||||||
|
@ -1055,10 +1055,20 @@ virSecretObjSetValueSize;
|
|||||||
# conf/virstorageobj.h
|
# conf/virstorageobj.h
|
||||||
virStoragePoolObjAssignDef;
|
virStoragePoolObjAssignDef;
|
||||||
virStoragePoolObjClearVols;
|
virStoragePoolObjClearVols;
|
||||||
|
virStoragePoolObjDecrAsyncjobs;
|
||||||
|
virStoragePoolObjDefUseNewDef;
|
||||||
virStoragePoolObjDeleteDef;
|
virStoragePoolObjDeleteDef;
|
||||||
virStoragePoolObjFindByName;
|
virStoragePoolObjFindByName;
|
||||||
virStoragePoolObjFindByUUID;
|
virStoragePoolObjFindByUUID;
|
||||||
|
virStoragePoolObjGetAsyncjobs;
|
||||||
|
virStoragePoolObjGetAutostartLink;
|
||||||
|
virStoragePoolObjGetConfigFile;
|
||||||
|
virStoragePoolObjGetDef;
|
||||||
virStoragePoolObjGetNames;
|
virStoragePoolObjGetNames;
|
||||||
|
virStoragePoolObjGetNewDef;
|
||||||
|
virStoragePoolObjIncrAsyncjobs;
|
||||||
|
virStoragePoolObjIsActive;
|
||||||
|
virStoragePoolObjIsAutostart;
|
||||||
virStoragePoolObjIsDuplicate;
|
virStoragePoolObjIsDuplicate;
|
||||||
virStoragePoolObjListExport;
|
virStoragePoolObjListExport;
|
||||||
virStoragePoolObjListFree;
|
virStoragePoolObjListFree;
|
||||||
@ -1069,6 +1079,10 @@ virStoragePoolObjNumOfStoragePools;
|
|||||||
virStoragePoolObjNumOfVolumes;
|
virStoragePoolObjNumOfVolumes;
|
||||||
virStoragePoolObjRemove;
|
virStoragePoolObjRemove;
|
||||||
virStoragePoolObjSaveDef;
|
virStoragePoolObjSaveDef;
|
||||||
|
virStoragePoolObjSetActive;
|
||||||
|
virStoragePoolObjSetAutostart;
|
||||||
|
virStoragePoolObjSetConfigFile;
|
||||||
|
virStoragePoolObjSetDef;
|
||||||
virStoragePoolObjSourceFindDuplicate;
|
virStoragePoolObjSourceFindDuplicate;
|
||||||
virStoragePoolObjUnlock;
|
virStoragePoolObjUnlock;
|
||||||
virStoragePoolObjVolumeGetNames;
|
virStoragePoolObjVolumeGetNames;
|
||||||
|
Loading…
Reference in New Issue
Block a user