"ignore",
"enospace")
-VIR_ENUM_IMPL(virDomainDiskSecretType, VIR_DOMAIN_DISK_SECRET_TYPE_LAST,
- "none",
- "uuid",
- "usage")
-
VIR_ENUM_IMPL(virDomainDiskIo, VIR_DOMAIN_DISK_IO_LAST,
"default",
"native",
{
VIR_FREE(def->auth.username);
- if (def->auth.secretType == VIR_DOMAIN_DISK_SECRET_TYPE_USAGE)
+ if (def->auth.secretType == VIR_STORAGE_SECRET_TYPE_USAGE)
VIR_FREE(def->auth.secret.usage);
- def->auth.secretType = VIR_DOMAIN_DISK_SECRET_TYPE_NONE;
+ def->auth.secretType = VIR_STORAGE_SECRET_TYPE_NONE;
}
goto error;
}
- def->src.auth.secretType = VIR_DOMAIN_DISK_SECRET_TYPE_NONE;
+ def->src.auth.secretType = VIR_STORAGE_SECRET_TYPE_NONE;
child = cur->children;
while (child != NULL) {
if (child->type == XML_ELEMENT_NODE &&
}
if (authUUID != NULL) {
- def->src.auth.secretType = VIR_DOMAIN_DISK_SECRET_TYPE_UUID;
+ def->src.auth.secretType = VIR_STORAGE_SECRET_TYPE_UUID;
if (virUUIDParse(authUUID,
def->src.auth.secret.uuid) < 0) {
virReportError(VIR_ERR_XML_ERROR,
goto error;
}
} else if (authUsage != NULL) {
- def->src.auth.secretType = VIR_DOMAIN_DISK_SECRET_TYPE_USAGE;
+ def->src.auth.secretType = VIR_STORAGE_SECRET_TYPE_USAGE;
def->src.auth.secret.usage = authUsage;
authUsage = NULL;
}
virBufferAddLit(buf, "<secret type='ceph'");
}
- if (def->src.auth.secretType == VIR_DOMAIN_DISK_SECRET_TYPE_UUID) {
+ if (def->src.auth.secretType == VIR_STORAGE_SECRET_TYPE_UUID) {
virUUIDFormat(def->src.auth.secret.uuid, uuidstr);
virBufferAsprintf(buf, " uuid='%s'/>\n", uuidstr);
}
- if (def->src.auth.secretType == VIR_DOMAIN_DISK_SECRET_TYPE_USAGE) {
+ if (def->src.auth.secretType == VIR_STORAGE_SECRET_TYPE_USAGE) {
virBufferEscapeString(buf, " usage='%s'/>\n",
def->src.auth.secret.usage);
}
VIR_DOMAIN_STARTUP_POLICY_LAST
};
-enum virDomainDiskSecretType {
- VIR_DOMAIN_DISK_SECRET_TYPE_NONE,
- VIR_DOMAIN_DISK_SECRET_TYPE_UUID,
- VIR_DOMAIN_DISK_SECRET_TYPE_USAGE,
-
- VIR_DOMAIN_DISK_SECRET_TYPE_LAST
-};
enum virDomainDeviceSGIO {
VIR_DOMAIN_DEVICE_SGIO_DEFAULT = 0,
virStorageSourcePoolDefPtr srcpool;
struct {
char *username;
- int secretType; /* enum virDomainDiskSecretType */
+ int secretType; /* enum virStorageSecretType */
union {
unsigned char uuid[VIR_UUID_BUFLEN];
char *usage;
VIR_ENUM_DECL(virDomainDiskCache)
VIR_ENUM_DECL(virDomainDiskErrorPolicy)
VIR_ENUM_DECL(virDomainDiskIo)
-VIR_ENUM_DECL(virDomainDiskSecretType)
VIR_ENUM_DECL(virDomainDeviceSGIO)
VIR_ENUM_DECL(virDomainDiskTray)
VIR_ENUM_DECL(virDomainDiskDiscard)
/* look up secret */
switch (diskSecretType) {
- case VIR_DOMAIN_DISK_SECRET_TYPE_UUID:
+ case VIR_STORAGE_SECRET_TYPE_UUID:
sec = virSecretLookupByUUID(conn, uuid);
virUUIDFormat(uuid, uuidStr);
break;
- case VIR_DOMAIN_DISK_SECRET_TYPE_USAGE:
+ case VIR_STORAGE_SECRET_TYPE_USAGE:
sec = virSecretLookupByUsage(conn, secretUsageType, usage);
break;
}
if (!sec) {
- if (diskSecretType == VIR_DOMAIN_DISK_SECRET_TYPE_UUID) {
+ if (diskSecretType == VIR_STORAGE_SECRET_TYPE_UUID) {
virReportError(VIR_ERR_NO_SECRET,
_("%s no secret matches uuid '%s'"),
scheme, uuidStr);
secret = (char *)conn->secretDriver->secretGetValue(sec, &secret_size, 0,
VIR_SECRET_GET_VALUE_INTERNAL_CALL);
if (!secret) {
- if (diskSecretType == VIR_DOMAIN_DISK_SECRET_TYPE_UUID) {
+ if (diskSecretType == VIR_STORAGE_SECRET_TYPE_UUID) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("could not get value of the secret for "
"username '%s' using uuid '%s'"),
pooldef->source.auth.chap.username) < 0)
goto cleanup;
if (pooldef->source.auth.chap.secret.uuidUsable) {
- def->src.auth.secretType = VIR_DOMAIN_DISK_SECRET_TYPE_UUID;
+ def->src.auth.secretType = VIR_STORAGE_SECRET_TYPE_UUID;
memcpy(def->src.auth.secret.uuid,
pooldef->source.auth.chap.secret.uuid,
VIR_UUID_BUFLEN);
if (VIR_STRDUP(def->src.auth.secret.usage,
pooldef->source.auth.chap.secret.usage) < 0)
goto cleanup;
- def->src.auth.secretType = VIR_DOMAIN_DISK_SECRET_TYPE_USAGE;
+ def->src.auth.secretType = VIR_STORAGE_SECRET_TYPE_USAGE;
}
} else if (pooldef->source.authType == VIR_STORAGE_POOL_AUTH_CEPHX) {
if (VIR_STRDUP(def->src.auth.username,
pooldef->source.auth.cephx.username) < 0)
goto cleanup;
if (pooldef->source.auth.cephx.secret.uuidUsable) {
- def->src.auth.secretType = VIR_DOMAIN_DISK_SECRET_TYPE_UUID;
+ def->src.auth.secretType = VIR_STORAGE_SECRET_TYPE_UUID;
memcpy(def->src.auth.secret.uuid,
pooldef->source.auth.cephx.secret.uuid,
VIR_UUID_BUFLEN);
if (VIR_STRDUP(def->src.auth.secret.usage,
pooldef->source.auth.cephx.secret.usage) < 0)
goto cleanup;
- def->src.auth.secretType = VIR_DOMAIN_DISK_SECRET_TYPE_USAGE;
+ def->src.auth.secretType = VIR_STORAGE_SECRET_TYPE_USAGE;
}
}
ret = 0;
typedef virStorageSourcePoolDef *virStorageSourcePoolDefPtr;
+enum virStorageSecretType {
+ VIR_STORAGE_SECRET_TYPE_NONE,
+ VIR_STORAGE_SECRET_TYPE_UUID,
+ VIR_STORAGE_SECRET_TYPE_USAGE,
+
+ VIR_STORAGE_SECRET_TYPE_LAST
+};
+
+
# ifndef DEV_BSIZE
# define DEV_BSIZE 512
# endif