2008-02-20 15:34:52 +00:00
|
|
|
/*
|
|
|
|
* storage_conf.h: config handling for storage driver
|
|
|
|
*
|
2016-01-07 11:57:28 +00:00
|
|
|
* Copyright (C) 2006-2008, 2010-2016 Red Hat, Inc.
|
2008-02-20 15:34:52 +00:00
|
|
|
* Copyright (C) 2006-2008 Daniel P. Berrange
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-09-20 22:30:55 +00:00
|
|
|
* License along with this library. If not, see
|
2012-07-21 10:06:23 +00:00
|
|
|
* <http://www.gnu.org/licenses/>.
|
2008-02-20 15:34:52 +00:00
|
|
|
*/
|
|
|
|
|
2018-12-13 14:53:50 +00:00
|
|
|
#ifndef LIBVIRT_STORAGE_CONF_H
|
|
|
|
# define LIBVIRT_STORAGE_CONF_H
|
2008-02-20 15:34:52 +00:00
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# include "internal.h"
|
2014-03-28 03:26:44 +00:00
|
|
|
# include "virstorageencryption.h"
|
2014-03-30 03:21:06 +00:00
|
|
|
# include "virstoragefile.h"
|
2013-05-16 10:38:26 +00:00
|
|
|
# include "virbitmap.h"
|
2012-12-13 15:49:48 +00:00
|
|
|
# include "virthread.h"
|
2014-03-04 03:15:13 +00:00
|
|
|
# include "device_conf.h"
|
2016-06-15 18:48:30 +00:00
|
|
|
# include "object_event.h"
|
2017-02-28 12:38:12 +00:00
|
|
|
# include "storage_adapter_conf.h"
|
2019-04-01 13:14:30 +00:00
|
|
|
# include "virautoclean.h"
|
2019-04-01 10:14:26 +00:00
|
|
|
# include "virenum.h"
|
2008-02-20 15:34:52 +00:00
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# include <libxml/tree.h>
|
2009-06-22 16:41:34 +00:00
|
|
|
|
2019-01-03 16:47:48 +00:00
|
|
|
/* Various callbacks needed to parse/create Storage Pool XML's using
|
|
|
|
* a private namespace */
|
|
|
|
typedef int (*virStoragePoolDefNamespaceParse)(xmlXPathContextPtr, void **);
|
|
|
|
typedef void (*virStoragePoolDefNamespaceFree)(void *);
|
|
|
|
typedef int (*virStoragePoolDefNamespaceXMLFormat)(virBufferPtr, void *);
|
|
|
|
typedef const char *(*virStoragePoolDefNamespaceHref)(void);
|
|
|
|
|
|
|
|
typedef struct _virStoragePoolXMLNamespace virStoragePoolXMLNamespace;
|
|
|
|
typedef virStoragePoolXMLNamespace *virStoragePoolXMLNamespacePtr;
|
|
|
|
struct _virStoragePoolXMLNamespace {
|
|
|
|
virStoragePoolDefNamespaceParse parse;
|
|
|
|
virStoragePoolDefNamespaceFree free;
|
|
|
|
virStoragePoolDefNamespaceXMLFormat format;
|
|
|
|
virStoragePoolDefNamespaceHref href;
|
|
|
|
};
|
|
|
|
|
|
|
|
int
|
|
|
|
virStoragePoolOptionsPoolTypeSetXMLNamespace(int type,
|
|
|
|
virStoragePoolXMLNamespacePtr ns);
|
|
|
|
|
2019-02-07 17:29:43 +00:00
|
|
|
int
|
|
|
|
virStoragePoolOptionsFormatPool(virBufferPtr buf,
|
|
|
|
int type);
|
|
|
|
|
|
|
|
int
|
|
|
|
virStoragePoolOptionsFormatVolume(virBufferPtr buf,
|
|
|
|
int type);
|
2008-02-20 15:34:52 +00:00
|
|
|
/*
|
|
|
|
* How the volume's data is stored on underlying
|
|
|
|
* physical devices - can potentially span many
|
|
|
|
* devices in LVM case.
|
|
|
|
*/
|
|
|
|
typedef struct _virStorageVolSourceExtent virStorageVolSourceExtent;
|
|
|
|
typedef virStorageVolSourceExtent *virStorageVolSourceExtentPtr;
|
|
|
|
struct _virStorageVolSourceExtent {
|
|
|
|
char *path;
|
|
|
|
unsigned long long start;
|
|
|
|
unsigned long long end;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _virStorageVolSource virStorageVolSource;
|
|
|
|
typedef virStorageVolSource *virStorageVolSourcePtr;
|
|
|
|
struct _virStorageVolSource {
|
2016-02-01 14:39:00 +00:00
|
|
|
size_t nextent;
|
2008-02-20 15:34:52 +00:00
|
|
|
virStorageVolSourceExtentPtr extents;
|
2014-03-30 02:27:44 +00:00
|
|
|
|
2014-05-11 15:08:50 +00:00
|
|
|
int partType; /* virStorageVolTypeDisk, only used by disk
|
2014-03-30 02:27:44 +00:00
|
|
|
* backend for partition type creation */
|
2008-02-20 15:34:52 +00:00
|
|
|
};
|
|
|
|
|
2019-03-19 13:42:17 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_STORAGE_VOL_DEF_REFRESH_ALLOCATION_DEFAULT, /* compute actual allocation */
|
|
|
|
VIR_STORAGE_VOL_DEF_REFRESH_ALLOCATION_CAPACITY, /* use logical capacity */
|
|
|
|
VIR_STORAGE_VOL_DEF_REFRESH_ALLOCATION_LAST,
|
|
|
|
} virStorageVolDefRefreshAllocation;
|
|
|
|
|
|
|
|
VIR_ENUM_DECL(virStorageVolDefRefreshAllocation);
|
2008-02-20 15:34:52 +00:00
|
|
|
|
|
|
|
typedef struct _virStorageVolDef virStorageVolDef;
|
|
|
|
typedef virStorageVolDef *virStorageVolDefPtr;
|
|
|
|
struct _virStorageVolDef {
|
|
|
|
char *name;
|
|
|
|
char *key;
|
2014-05-11 15:08:50 +00:00
|
|
|
int type; /* virStorageVolType */
|
2008-02-20 15:34:52 +00:00
|
|
|
|
2014-07-17 16:41:21 +00:00
|
|
|
bool building;
|
2014-04-16 13:16:20 +00:00
|
|
|
unsigned int in_use;
|
2009-04-17 19:12:37 +00:00
|
|
|
|
2008-02-20 15:34:52 +00:00
|
|
|
virStorageVolSource source;
|
2014-04-01 21:11:30 +00:00
|
|
|
virStorageSource target;
|
2008-02-20 15:34:52 +00:00
|
|
|
};
|
|
|
|
|
2008-10-10 15:13:28 +00:00
|
|
|
typedef struct _virStorageVolDefList virStorageVolDefList;
|
|
|
|
typedef virStorageVolDefList *virStorageVolDefListPtr;
|
2008-02-20 15:34:52 +00:00
|
|
|
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virStorageVol);
|
2008-02-20 15:34:52 +00:00
|
|
|
|
2014-05-11 15:08:50 +00:00
|
|
|
typedef enum {
|
2008-11-17 11:19:33 +00:00
|
|
|
VIR_STORAGE_POOL_DIR, /* Local directory */
|
2008-02-20 15:34:52 +00:00
|
|
|
VIR_STORAGE_POOL_FS, /* Local filesystem */
|
|
|
|
VIR_STORAGE_POOL_NETFS, /* Networked filesystem - eg NFS, GFS, etc */
|
|
|
|
VIR_STORAGE_POOL_LOGICAL, /* Logical volume groups / volumes */
|
|
|
|
VIR_STORAGE_POOL_DISK, /* Disk partitions */
|
|
|
|
VIR_STORAGE_POOL_ISCSI, /* iSCSI targets */
|
2018-07-31 08:44:21 +00:00
|
|
|
VIR_STORAGE_POOL_ISCSI_DIRECT, /* iSCSI targets using libiscsi */
|
2008-02-20 15:34:52 +00:00
|
|
|
VIR_STORAGE_POOL_SCSI, /* SCSI HBA */
|
2009-09-08 13:47:45 +00:00
|
|
|
VIR_STORAGE_POOL_MPATH, /* Multipath devices */
|
2012-05-14 09:06:42 +00:00
|
|
|
VIR_STORAGE_POOL_RBD, /* RADOS Block Device */
|
2012-07-18 19:06:58 +00:00
|
|
|
VIR_STORAGE_POOL_SHEEPDOG, /* Sheepdog device */
|
2013-11-19 23:26:05 +00:00
|
|
|
VIR_STORAGE_POOL_GLUSTER, /* Gluster device */
|
2014-07-21 14:38:42 +00:00
|
|
|
VIR_STORAGE_POOL_ZFS, /* ZFS */
|
2017-01-17 14:10:55 +00:00
|
|
|
VIR_STORAGE_POOL_VSTORAGE, /* Virtuozzo Storage */
|
2008-11-17 11:19:33 +00:00
|
|
|
|
|
|
|
VIR_STORAGE_POOL_LAST,
|
2014-05-11 15:08:50 +00:00
|
|
|
} virStoragePoolType;
|
2008-02-20 15:34:52 +00:00
|
|
|
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virStoragePool);
|
2008-11-17 11:19:33 +00:00
|
|
|
|
2014-05-11 15:08:50 +00:00
|
|
|
typedef enum {
|
2009-04-01 16:03:22 +00:00
|
|
|
VIR_STORAGE_DEVICE_TYPE_DISK = 0x00,
|
|
|
|
VIR_STORAGE_DEVICE_TYPE_ROM = 0x05,
|
|
|
|
|
|
|
|
VIR_STORAGE_DEVICE_TYPE_LAST,
|
2014-05-11 15:08:50 +00:00
|
|
|
} virStoragePoolDeviceType;
|
2009-04-01 16:03:22 +00:00
|
|
|
|
2008-02-20 15:34:52 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* For remote pools, info on how to reach the host
|
|
|
|
*/
|
|
|
|
typedef struct _virStoragePoolSourceHost virStoragePoolSourceHost;
|
|
|
|
typedef virStoragePoolSourceHost *virStoragePoolSourceHostPtr;
|
|
|
|
struct _virStoragePoolSourceHost {
|
|
|
|
char *name;
|
|
|
|
int port;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-06-26 16:18:59 +00:00
|
|
|
/*
|
2013-05-16 12:40:54 +00:00
|
|
|
* For MSDOS partitions, the free area is important when
|
|
|
|
* creating logical partitions
|
2009-06-26 16:18:59 +00:00
|
|
|
*/
|
2014-05-11 15:08:50 +00:00
|
|
|
typedef enum {
|
2009-06-26 16:18:59 +00:00
|
|
|
VIR_STORAGE_FREE_NONE = 0,
|
|
|
|
VIR_STORAGE_FREE_NORMAL,
|
|
|
|
VIR_STORAGE_FREE_LOGICAL,
|
|
|
|
VIR_STORAGE_FREE_LAST
|
2014-05-11 15:08:50 +00:00
|
|
|
} virStorageFreeType;
|
2009-06-26 16:18:59 +00:00
|
|
|
|
2008-02-20 15:34:52 +00:00
|
|
|
/*
|
|
|
|
* Available extents on the underlying storage
|
|
|
|
*/
|
|
|
|
typedef struct _virStoragePoolSourceDeviceExtent virStoragePoolSourceDeviceExtent;
|
|
|
|
typedef virStoragePoolSourceDeviceExtent *virStoragePoolSourceDeviceExtentPtr;
|
|
|
|
struct _virStoragePoolSourceDeviceExtent {
|
|
|
|
unsigned long long start;
|
|
|
|
unsigned long long end;
|
2014-05-11 15:08:50 +00:00
|
|
|
int type; /* virStorageFreeType */
|
2008-02-20 15:34:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Pools can be backed by one or more devices, and some
|
|
|
|
* allow us to track free space on underlying devices.
|
|
|
|
*/
|
|
|
|
typedef struct _virStoragePoolSourceDevice virStoragePoolSourceDevice;
|
|
|
|
typedef virStoragePoolSourceDevice *virStoragePoolSourceDevicePtr;
|
|
|
|
struct _virStoragePoolSourceDevice {
|
|
|
|
int nfreeExtent;
|
|
|
|
virStoragePoolSourceDeviceExtentPtr freeExtents;
|
|
|
|
char *path;
|
2013-05-16 12:40:54 +00:00
|
|
|
int format; /* Pool specific source format */
|
2016-01-07 11:57:28 +00:00
|
|
|
int part_separator; /* enum virTristateSwitch */
|
2013-05-16 12:40:54 +00:00
|
|
|
|
2009-06-26 16:18:59 +00:00
|
|
|
/* When the source device is a physical disk,
|
2013-05-16 12:40:54 +00:00
|
|
|
* the geometry data is needed
|
|
|
|
*/
|
2009-06-26 16:18:59 +00:00
|
|
|
struct _geometry {
|
2013-11-14 16:14:26 +00:00
|
|
|
int cylinders;
|
2009-06-26 16:18:59 +00:00
|
|
|
int heads;
|
|
|
|
int sectors;
|
|
|
|
} geometry;
|
2008-02-20 15:34:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _virStoragePoolSource virStoragePoolSource;
|
|
|
|
typedef virStoragePoolSource *virStoragePoolSourcePtr;
|
|
|
|
struct _virStoragePoolSource {
|
2012-04-25 10:43:09 +00:00
|
|
|
/* An optional (maybe multiple) host(s) */
|
|
|
|
size_t nhost;
|
|
|
|
virStoragePoolSourceHostPtr hosts;
|
2008-02-20 15:34:52 +00:00
|
|
|
|
|
|
|
/* And either one or more devices ... */
|
2014-03-11 08:13:15 +00:00
|
|
|
size_t ndevice;
|
2008-02-20 15:34:52 +00:00
|
|
|
virStoragePoolSourceDevicePtr devices;
|
|
|
|
|
|
|
|
/* Or a directory */
|
|
|
|
char *dir;
|
|
|
|
|
|
|
|
/* Or an adapter */
|
2017-02-28 12:38:12 +00:00
|
|
|
virStorageAdapter adapter;
|
2008-02-20 15:34:52 +00:00
|
|
|
|
2008-09-02 14:15:42 +00:00
|
|
|
/* Or a name */
|
|
|
|
char *name;
|
|
|
|
|
2010-01-21 11:50:52 +00:00
|
|
|
/* Initiator IQN */
|
2018-08-07 11:25:21 +00:00
|
|
|
virStorageSourceInitiatorDef initiator;
|
2010-01-21 11:50:52 +00:00
|
|
|
|
2014-06-26 12:18:09 +00:00
|
|
|
/* Authentication information */
|
|
|
|
virStorageAuthDefPtr auth;
|
2008-02-20 15:34:52 +00:00
|
|
|
|
2010-08-17 17:44:27 +00:00
|
|
|
/* Vendor of the source */
|
|
|
|
char *vendor;
|
|
|
|
|
|
|
|
/* Product name of the source*/
|
|
|
|
char *product;
|
|
|
|
|
2013-05-16 12:40:54 +00:00
|
|
|
/* Pool type specific format such as filesystem type,
|
|
|
|
* or lvm version, etc.
|
|
|
|
*/
|
|
|
|
int format;
|
2019-01-11 00:23:27 +00:00
|
|
|
|
|
|
|
/* Protocol version value for netfs */
|
|
|
|
unsigned int protocolVer;
|
2008-02-20 15:34:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _virStoragePoolTarget virStoragePoolTarget;
|
|
|
|
typedef virStoragePoolTarget *virStoragePoolTargetPtr;
|
|
|
|
struct _virStoragePoolTarget {
|
2013-05-16 12:40:54 +00:00
|
|
|
char *path; /* Optional local filesystem mapping */
|
|
|
|
virStoragePerms perms; /* Default permissions for volumes */
|
2008-02-20 15:34:52 +00:00
|
|
|
};
|
|
|
|
|
2019-03-19 13:42:17 +00:00
|
|
|
|
|
|
|
typedef struct _virStorageVolDefRefresh virStorageVolDefRefresh;
|
|
|
|
typedef virStorageVolDefRefresh *virStorageVolDefRefreshPtr;
|
|
|
|
struct _virStorageVolDefRefresh {
|
|
|
|
int allocation; /* virStorageVolDefRefreshAllocation */
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _virStoragePoolDefRefresh virStoragePoolDefRefresh;
|
|
|
|
typedef virStoragePoolDefRefresh *virStoragePoolDefRefreshPtr;
|
|
|
|
struct _virStoragePoolDefRefresh {
|
|
|
|
virStorageVolDefRefresh volume;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-02-20 15:34:52 +00:00
|
|
|
typedef struct _virStoragePoolDef virStoragePoolDef;
|
|
|
|
typedef virStoragePoolDef *virStoragePoolDefPtr;
|
|
|
|
struct _virStoragePoolDef {
|
|
|
|
char *name;
|
|
|
|
unsigned char uuid[VIR_UUID_BUFLEN];
|
2014-05-11 15:08:50 +00:00
|
|
|
int type; /* virStoragePoolType */
|
2008-02-20 15:34:52 +00:00
|
|
|
|
2019-03-19 13:42:17 +00:00
|
|
|
virStoragePoolDefRefreshPtr refresh;
|
|
|
|
|
2012-02-23 00:48:38 +00:00
|
|
|
unsigned long long allocation; /* bytes */
|
|
|
|
unsigned long long capacity; /* bytes */
|
|
|
|
unsigned long long available; /* bytes */
|
2008-02-20 15:34:52 +00:00
|
|
|
|
|
|
|
virStoragePoolSource source;
|
|
|
|
virStoragePoolTarget target;
|
2019-01-03 16:47:48 +00:00
|
|
|
|
|
|
|
/* Pool backend specific XML namespace data */
|
|
|
|
void *namespaceData;
|
|
|
|
virStoragePoolXMLNamespace ns;
|
2008-02-20 15:34:52 +00:00
|
|
|
};
|
|
|
|
|
2008-10-23 11:39:53 +00:00
|
|
|
typedef struct _virStoragePoolSourceList virStoragePoolSourceList;
|
|
|
|
typedef virStoragePoolSourceList *virStoragePoolSourceListPtr;
|
|
|
|
struct _virStoragePoolSourceList {
|
2008-11-04 21:54:21 +00:00
|
|
|
int type;
|
2008-10-23 11:39:53 +00:00
|
|
|
unsigned int nsources;
|
|
|
|
virStoragePoolSourcePtr sources;
|
|
|
|
};
|
2008-02-20 15:34:52 +00:00
|
|
|
|
2017-03-07 20:44:41 +00:00
|
|
|
virStoragePoolDefPtr
|
|
|
|
virStoragePoolDefParseXML(xmlXPathContextPtr ctxt);
|
|
|
|
|
|
|
|
virStoragePoolDefPtr
|
|
|
|
virStoragePoolDefParseString(const char *xml);
|
|
|
|
|
|
|
|
virStoragePoolDefPtr
|
|
|
|
virStoragePoolDefParseFile(const char *filename);
|
|
|
|
|
|
|
|
virStoragePoolDefPtr
|
|
|
|
virStoragePoolDefParseNode(xmlDocPtr xml,
|
|
|
|
xmlNodePtr root);
|
|
|
|
|
|
|
|
char *
|
|
|
|
virStoragePoolDefFormat(virStoragePoolDefPtr def);
|
2008-02-20 15:34:52 +00:00
|
|
|
|
2015-02-17 15:47:04 +00:00
|
|
|
typedef enum {
|
|
|
|
/* do not require volume capacity at all */
|
|
|
|
VIR_VOL_XML_PARSE_NO_CAPACITY = 1 << 0,
|
2015-02-17 15:55:59 +00:00
|
|
|
/* do not require volume capacity if the volume has a backing store */
|
|
|
|
VIR_VOL_XML_PARSE_OPT_CAPACITY = 1 << 1,
|
2015-02-17 15:47:04 +00:00
|
|
|
} virStorageVolDefParseFlags;
|
2017-03-07 20:44:41 +00:00
|
|
|
|
2013-05-16 12:40:54 +00:00
|
|
|
virStorageVolDefPtr
|
|
|
|
virStorageVolDefParseString(virStoragePoolDefPtr pool,
|
2015-02-05 15:20:17 +00:00
|
|
|
const char *xml,
|
|
|
|
unsigned int flags);
|
2017-03-07 20:44:41 +00:00
|
|
|
|
2013-05-16 12:40:54 +00:00
|
|
|
virStorageVolDefPtr
|
|
|
|
virStorageVolDefParseFile(virStoragePoolDefPtr pool,
|
2015-02-05 15:20:17 +00:00
|
|
|
const char *filename,
|
|
|
|
unsigned int flags);
|
2017-03-07 20:44:41 +00:00
|
|
|
|
2013-05-16 12:40:54 +00:00
|
|
|
virStorageVolDefPtr
|
|
|
|
virStorageVolDefParseNode(virStoragePoolDefPtr pool,
|
|
|
|
xmlDocPtr xml,
|
2015-02-05 15:20:17 +00:00
|
|
|
xmlNodePtr root,
|
|
|
|
unsigned int flags);
|
2017-03-07 20:44:41 +00:00
|
|
|
|
|
|
|
char *
|
|
|
|
virStorageVolDefFormat(virStoragePoolDefPtr pool,
|
|
|
|
virStorageVolDefPtr def);
|
|
|
|
|
|
|
|
int
|
|
|
|
virStoragePoolSaveState(const char *stateFile,
|
|
|
|
virStoragePoolDefPtr def);
|
|
|
|
|
|
|
|
int
|
|
|
|
virStoragePoolSaveConfig(const char *configFile,
|
|
|
|
virStoragePoolDefPtr def);
|
|
|
|
|
|
|
|
void
|
|
|
|
virStorageVolDefFree(virStorageVolDefPtr def);
|
|
|
|
|
|
|
|
void
|
|
|
|
virStoragePoolSourceClear(virStoragePoolSourcePtr source);
|
|
|
|
|
|
|
|
void
|
|
|
|
virStoragePoolSourceDeviceClear(virStoragePoolSourceDevicePtr dev);
|
|
|
|
|
|
|
|
void
|
|
|
|
virStoragePoolSourceFree(virStoragePoolSourcePtr source);
|
|
|
|
|
|
|
|
void
|
|
|
|
virStoragePoolDefFree(virStoragePoolDefPtr def);
|
2008-02-20 15:34:52 +00:00
|
|
|
|
2009-10-15 15:41:53 +00:00
|
|
|
virStoragePoolSourcePtr
|
2010-02-10 11:42:56 +00:00
|
|
|
virStoragePoolDefParseSourceString(const char *srcSpec,
|
2009-10-15 15:58:35 +00:00
|
|
|
int pool_type);
|
2017-03-07 20:44:41 +00:00
|
|
|
|
2009-10-15 15:58:35 +00:00
|
|
|
virStoragePoolSourcePtr
|
2010-02-10 11:42:56 +00:00
|
|
|
virStoragePoolSourceListNewSource(virStoragePoolSourceListPtr list);
|
2017-03-07 20:44:41 +00:00
|
|
|
|
|
|
|
char *
|
|
|
|
virStoragePoolSourceListFormat(virStoragePoolSourceListPtr def);
|
2008-11-17 11:19:33 +00:00
|
|
|
|
2014-05-11 15:08:50 +00:00
|
|
|
typedef enum {
|
2008-11-17 11:19:33 +00:00
|
|
|
VIR_STORAGE_POOL_FS_AUTO = 0,
|
|
|
|
VIR_STORAGE_POOL_FS_EXT2,
|
|
|
|
VIR_STORAGE_POOL_FS_EXT3,
|
|
|
|
VIR_STORAGE_POOL_FS_EXT4,
|
|
|
|
VIR_STORAGE_POOL_FS_UFS,
|
|
|
|
VIR_STORAGE_POOL_FS_ISO,
|
|
|
|
VIR_STORAGE_POOL_FS_UDF,
|
|
|
|
VIR_STORAGE_POOL_FS_GFS,
|
|
|
|
VIR_STORAGE_POOL_FS_GFS2,
|
|
|
|
VIR_STORAGE_POOL_FS_VFAT,
|
|
|
|
VIR_STORAGE_POOL_FS_HFSPLUS,
|
|
|
|
VIR_STORAGE_POOL_FS_XFS,
|
2009-10-14 15:03:22 +00:00
|
|
|
VIR_STORAGE_POOL_FS_OCFS2,
|
2008-11-17 11:19:33 +00:00
|
|
|
VIR_STORAGE_POOL_FS_LAST,
|
2014-05-11 15:08:50 +00:00
|
|
|
} virStoragePoolFormatFileSystem;
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virStoragePoolFormatFileSystem);
|
2008-11-17 11:19:33 +00:00
|
|
|
|
2014-05-11 15:08:50 +00:00
|
|
|
typedef enum {
|
2008-11-17 11:19:33 +00:00
|
|
|
VIR_STORAGE_POOL_NETFS_AUTO = 0,
|
|
|
|
VIR_STORAGE_POOL_NETFS_NFS,
|
2009-07-08 09:46:25 +00:00
|
|
|
VIR_STORAGE_POOL_NETFS_GLUSTERFS,
|
2010-05-17 23:24:32 +00:00
|
|
|
VIR_STORAGE_POOL_NETFS_CIFS,
|
2008-11-17 11:19:33 +00:00
|
|
|
VIR_STORAGE_POOL_NETFS_LAST,
|
2014-05-11 15:08:50 +00:00
|
|
|
} virStoragePoolFormatFileSystemNet;
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virStoragePoolFormatFileSystemNet);
|
2008-11-17 11:19:33 +00:00
|
|
|
|
2014-05-11 15:08:50 +00:00
|
|
|
typedef enum {
|
2008-11-17 11:19:33 +00:00
|
|
|
VIR_STORAGE_POOL_DISK_UNKNOWN = 0,
|
|
|
|
VIR_STORAGE_POOL_DISK_DOS = 1,
|
|
|
|
VIR_STORAGE_POOL_DISK_DVH,
|
|
|
|
VIR_STORAGE_POOL_DISK_GPT,
|
|
|
|
VIR_STORAGE_POOL_DISK_MAC,
|
|
|
|
VIR_STORAGE_POOL_DISK_BSD,
|
|
|
|
VIR_STORAGE_POOL_DISK_PC98,
|
|
|
|
VIR_STORAGE_POOL_DISK_SUN,
|
|
|
|
VIR_STORAGE_POOL_DISK_LVM2,
|
|
|
|
VIR_STORAGE_POOL_DISK_LAST,
|
2014-05-11 15:08:50 +00:00
|
|
|
} virStoragePoolFormatDisk;
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virStoragePoolFormatDisk);
|
2008-11-17 11:19:33 +00:00
|
|
|
|
2014-05-11 15:08:50 +00:00
|
|
|
typedef enum {
|
2008-11-17 11:19:33 +00:00
|
|
|
VIR_STORAGE_POOL_LOGICAL_UNKNOWN = 0,
|
|
|
|
VIR_STORAGE_POOL_LOGICAL_LVM2 = 1,
|
|
|
|
VIR_STORAGE_POOL_LOGICAL_LAST,
|
2014-05-11 15:08:50 +00:00
|
|
|
} virStoragePoolFormatLogical;
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virStoragePoolFormatLogical);
|
2008-11-17 11:19:33 +00:00
|
|
|
|
|
|
|
/*
|
2013-05-16 12:40:54 +00:00
|
|
|
* XXX: these are basically partition types.
|
2008-11-17 11:19:33 +00:00
|
|
|
*
|
2013-05-16 12:40:54 +00:00
|
|
|
* fdisk has a bazillion partition ID types parted has
|
|
|
|
* practically none, and splits the * info across 3
|
|
|
|
* different attributes.
|
2008-11-17 11:19:33 +00:00
|
|
|
*
|
|
|
|
* So this is a semi-generic set
|
|
|
|
*/
|
2014-05-11 15:08:50 +00:00
|
|
|
typedef enum {
|
2008-11-17 11:19:33 +00:00
|
|
|
VIR_STORAGE_VOL_DISK_NONE = 0,
|
|
|
|
VIR_STORAGE_VOL_DISK_LINUX,
|
|
|
|
VIR_STORAGE_VOL_DISK_FAT16,
|
|
|
|
VIR_STORAGE_VOL_DISK_FAT32,
|
|
|
|
VIR_STORAGE_VOL_DISK_LINUX_SWAP,
|
|
|
|
VIR_STORAGE_VOL_DISK_LINUX_LVM,
|
|
|
|
VIR_STORAGE_VOL_DISK_LINUX_RAID,
|
|
|
|
VIR_STORAGE_VOL_DISK_EXTENDED,
|
|
|
|
VIR_STORAGE_VOL_DISK_LAST,
|
2014-05-11 15:08:50 +00:00
|
|
|
} virStorageVolFormatDisk;
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virStorageVolFormatDisk);
|
2008-11-17 11:19:33 +00:00
|
|
|
|
2014-05-11 15:08:50 +00:00
|
|
|
typedef enum {
|
2009-06-26 16:18:59 +00:00
|
|
|
VIR_STORAGE_VOL_DISK_TYPE_NONE = 0,
|
|
|
|
VIR_STORAGE_VOL_DISK_TYPE_PRIMARY,
|
|
|
|
VIR_STORAGE_VOL_DISK_TYPE_LOGICAL,
|
|
|
|
VIR_STORAGE_VOL_DISK_TYPE_EXTENDED,
|
|
|
|
VIR_STORAGE_VOL_DISK_TYPE_LAST,
|
2014-05-11 15:08:50 +00:00
|
|
|
} virStorageVolTypeDisk;
|
2008-11-17 11:19:33 +00:00
|
|
|
|
2009-06-26 16:18:59 +00:00
|
|
|
/*
|
2013-05-16 12:40:54 +00:00
|
|
|
* Mapping of Parted fs-types MUST be kept in the
|
|
|
|
* same order as virStorageVolFormatDisk
|
2009-06-26 16:18:59 +00:00
|
|
|
*/
|
2014-05-11 15:08:50 +00:00
|
|
|
typedef enum {
|
2009-06-26 16:18:59 +00:00
|
|
|
VIR_STORAGE_PARTED_FS_TYPE_NONE = 0,
|
|
|
|
VIR_STORAGE_PARTED_FS_TYPE_LINUX,
|
|
|
|
VIR_STORAGE_PARTED_FS_TYPE_FAT16,
|
|
|
|
VIR_STORAGE_PARTED_FS_TYPE_FAT32,
|
|
|
|
VIR_STORAGE_PARTED_FS_TYPE_LINUX_SWAP,
|
|
|
|
VIR_STORAGE_PARTED_FS_TYPE_LINUX_LVM,
|
|
|
|
VIR_STORAGE_PARTED_FS_TYPE_LINUX_RAID,
|
|
|
|
VIR_STORAGE_PARTED_FS_TYPE_EXTENDED,
|
|
|
|
VIR_STORAGE_PARTED_FS_TYPE_LAST,
|
2014-05-11 15:08:50 +00:00
|
|
|
} virStoragePartedFsType;
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virStoragePartedFs);
|
2008-11-17 11:19:33 +00:00
|
|
|
|
2017-11-03 12:09:47 +00:00
|
|
|
# define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_ACTIVE \
|
2012-09-04 15:16:25 +00:00
|
|
|
(VIR_CONNECT_LIST_STORAGE_POOLS_ACTIVE | \
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_INACTIVE)
|
|
|
|
|
2017-11-03 12:09:47 +00:00
|
|
|
# define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_PERSISTENT \
|
2012-09-04 15:16:25 +00:00
|
|
|
(VIR_CONNECT_LIST_STORAGE_POOLS_PERSISTENT | \
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_TRANSIENT)
|
|
|
|
|
2017-11-03 12:09:47 +00:00
|
|
|
# define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_AUTOSTART \
|
|
|
|
(VIR_CONNECT_LIST_STORAGE_POOLS_AUTOSTART | \
|
2012-09-04 15:16:25 +00:00
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_NO_AUTOSTART)
|
|
|
|
|
2017-11-03 12:09:47 +00:00
|
|
|
# define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_POOL_TYPE \
|
2012-09-04 15:16:25 +00:00
|
|
|
(VIR_CONNECT_LIST_STORAGE_POOLS_DIR | \
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_FS | \
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_NETFS | \
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_LOGICAL | \
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_DISK | \
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_ISCSI | \
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_SCSI | \
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_MPATH | \
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_RBD | \
|
2014-02-06 15:12:14 +00:00
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_SHEEPDOG | \
|
2014-07-21 14:38:42 +00:00
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_GLUSTER | \
|
2017-03-13 08:20:35 +00:00
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_ZFS | \
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_VSTORAGE)
|
2012-09-04 15:16:25 +00:00
|
|
|
|
2017-11-03 12:09:47 +00:00
|
|
|
# define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_ALL \
|
2012-09-04 15:16:25 +00:00
|
|
|
(VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_ACTIVE | \
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_PERSISTENT | \
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_AUTOSTART | \
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_POOL_TYPE)
|
|
|
|
|
2019-01-31 13:48:11 +00:00
|
|
|
VIR_DEFINE_AUTOPTR_FUNC(virStoragePoolSource, virStoragePoolSourceFree);
|
2019-01-31 15:21:47 +00:00
|
|
|
VIR_DEFINE_AUTOPTR_FUNC(virStoragePoolDef, virStoragePoolDefFree);
|
2019-01-31 14:44:54 +00:00
|
|
|
VIR_DEFINE_AUTOPTR_FUNC(virStorageVolDef, virStorageVolDefFree);
|
2019-01-31 13:48:11 +00:00
|
|
|
|
2018-12-13 14:53:50 +00:00
|
|
|
#endif /* LIBVIRT_STORAGE_CONF_H */
|