cleanup: Change datatype of secret->ephemeral to boolean

This commit is contained in:
Osier Yang 2013-04-11 11:50:23 +08:00
parent ba474c7844
commit 4258a548d2
3 changed files with 4 additions and 4 deletions

View File

@ -161,9 +161,9 @@ secretXMLParseNode(xmlDocPtr xml, xmlNodePtr root)
prop = virXPathString("string(./@ephemeral)", ctxt);
if (prop != NULL) {
if (STREQ(prop, "yes"))
def->ephemeral = 1;
def->ephemeral = true;
else if (STREQ(prop, "no"))
def->ephemeral = 0;
def->ephemeral = false;
else {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("invalid value of 'ephemeral'"));

View File

@ -31,7 +31,7 @@ VIR_ENUM_DECL(virSecretUsageType)
typedef struct _virSecretDef virSecretDef;
typedef virSecretDef *virSecretDefPtr;
struct _virSecretDef {
unsigned ephemeral : 1;
bool ephemeral;
unsigned private : 1;
unsigned char uuid[VIR_UUID_BUFLEN];
char *description; /* May be NULL */

View File

@ -480,7 +480,7 @@ virStorageGenerateQcowEncryption(virConnectPtr conn,
goto cleanup;
}
def->ephemeral = 0;
def->ephemeral = false;
def->private = 0;
if (virStorageGenerateSecretUUID(conn, def->uuid) < 0)
goto cleanup;