mirror of https://gitee.com/openkylin/libvirt.git
cleanup: Change datatype of secret->ephemeral to boolean
This commit is contained in:
parent
ba474c7844
commit
4258a548d2
|
@ -161,9 +161,9 @@ secretXMLParseNode(xmlDocPtr xml, xmlNodePtr root)
|
||||||
prop = virXPathString("string(./@ephemeral)", ctxt);
|
prop = virXPathString("string(./@ephemeral)", ctxt);
|
||||||
if (prop != NULL) {
|
if (prop != NULL) {
|
||||||
if (STREQ(prop, "yes"))
|
if (STREQ(prop, "yes"))
|
||||||
def->ephemeral = 1;
|
def->ephemeral = true;
|
||||||
else if (STREQ(prop, "no"))
|
else if (STREQ(prop, "no"))
|
||||||
def->ephemeral = 0;
|
def->ephemeral = false;
|
||||||
else {
|
else {
|
||||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||||
_("invalid value of 'ephemeral'"));
|
_("invalid value of 'ephemeral'"));
|
||||||
|
|
|
@ -31,7 +31,7 @@ VIR_ENUM_DECL(virSecretUsageType)
|
||||||
typedef struct _virSecretDef virSecretDef;
|
typedef struct _virSecretDef virSecretDef;
|
||||||
typedef virSecretDef *virSecretDefPtr;
|
typedef virSecretDef *virSecretDefPtr;
|
||||||
struct _virSecretDef {
|
struct _virSecretDef {
|
||||||
unsigned ephemeral : 1;
|
bool ephemeral;
|
||||||
unsigned private : 1;
|
unsigned private : 1;
|
||||||
unsigned char uuid[VIR_UUID_BUFLEN];
|
unsigned char uuid[VIR_UUID_BUFLEN];
|
||||||
char *description; /* May be NULL */
|
char *description; /* May be NULL */
|
||||||
|
|
|
@ -480,7 +480,7 @@ virStorageGenerateQcowEncryption(virConnectPtr conn,
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
def->ephemeral = 0;
|
def->ephemeral = false;
|
||||||
def->private = 0;
|
def->private = 0;
|
||||||
if (virStorageGenerateSecretUUID(conn, def->uuid) < 0)
|
if (virStorageGenerateSecretUUID(conn, def->uuid) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
Loading…
Reference in New Issue