memset(&host, 0, sizeof(host));
- switch ((virStorageType)src->type) {
+ switch (src->type) {
case VIR_STORAGE_TYPE_FILE:
src->path = virXMLPropString(node, "file");
break;
startupPolicy = virDomainStartupPolicyTypeToString(policy);
if (src->path || src->nhosts > 0 || src->srcpool || startupPolicy) {
- switch ((virStorageType)src->type) {
+ switch (src->type) {
case VIR_STORAGE_TYPE_FILE:
virBufferAddLit(buf, "<source");
virBufferEscapeString(buf, " file='%s'", src->path);
goto error;
break;
+ case VIR_STORAGE_NET_PROTOCOL_HTTP:
+ case VIR_STORAGE_NET_PROTOCOL_HTTPS:
+ case VIR_STORAGE_NET_PROTOCOL_FTP:
+ case VIR_STORAGE_NET_PROTOCOL_FTPS:
+ case VIR_STORAGE_NET_PROTOCOL_TFTP:
+ case VIR_STORAGE_NET_PROTOCOL_LAST:
+ /* ignored for now */
+ break;
}
}
return 0;
case VIR_STORAGE_TYPE_NETWORK:
- switch ((virStorageNetProtocol) disk->src.protocol) {
+ switch (disk->src.protocol) {
case VIR_STORAGE_NET_PROTOCOL_NBD:
case VIR_STORAGE_NET_PROTOCOL_RBD:
case VIR_STORAGE_NET_PROTOCOL_SHEEPDOG:
return 0;
case VIR_STORAGE_TYPE_NETWORK:
- switch ((virStorageNetProtocol) disk->src.protocol) {
+ switch (disk->src.protocol) {
case VIR_STORAGE_NET_PROTOCOL_GLUSTER:
return 0;
return 0;
case VIR_STORAGE_TYPE_NETWORK:
- switch ((virStorageNetProtocol) disk->src.protocol) {
+ switch (disk->src.protocol) {
case VIR_STORAGE_NET_PROTOCOL_NBD:
case VIR_STORAGE_NET_PROTOCOL_RBD:
case VIR_STORAGE_NET_PROTOCOL_SHEEPDOG:
VIR_STRDUP(persistSource, snap->src.path) < 0)
goto cleanup;
- switch ((virStorageType)snap->src.type) {
+ switch (snap->src.type) {
case VIR_STORAGE_TYPE_BLOCK:
reuse = true;
/* fallthrough */
struct _virStorageNetHostDef {
char *name;
char *port;
- int transport; /* virStorageNetHostTransport */
+ virStorageNetHostTransport transport;
char *socket; /* path to unix socket */
};
struct _virStorageSourcePoolDef {
char *pool; /* pool name */
char *volume; /* volume name */
- int voltype; /* virStorageVolType, internal only */
- int pooltype; /* virStoragePoolType, internal only */
- int actualtype; /* virStorageType, internal only */
- int mode; /* virStorageSourcePoolMode */
+ virStorageVolType voltype; /* internal only */
+ int pooltype; /* virStoragePoolType from storage_conf.h, internal only */
+ virStorageType actualtype; /* internal only */
+ virStorageSourcePoolMode mode;
};
typedef virStorageSourcePoolDef *virStorageSourcePoolDefPtr;
* backing chains, multiple source disks join to form a single guest
* view. */
struct _virStorageSource {
- int type; /* virStorageType */
+ virStorageType type;
char *path;
- int protocol; /* virStorageNetProtocol */
+ virStorageNetProtocol protocol;
size_t nhosts;
virStorageNetHostDefPtr hosts;
virStorageSourcePoolDefPtr srcpool;
struct {
char *username;
- int secretType; /* virStorageSecretType */
+ virStorageSecretType secretType;
union {
unsigned char uuid[VIR_UUID_BUFLEN];
char *usage;
virStorageEncryptionPtr encryption;
char *driverName;
- int format; /* virStorageFileFormat */
+ int format; /* virStorageFileFormat in domain backing chains, but
+ * pool-specific enum for storage volumes */
virBitmapPtr features;
char *compat;