From: Osier Yang Date: Thu, 11 Apr 2013 03:54:37 +0000 (+0800) Subject: cleanup: Change datatype of secret->private to boolean X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=f4279c53208771c013c8f5c215fd37c8df433224;p=people%2Fliuw%2Flibxenctrl-split%2Flibvirt.git cleanup: Change datatype of secret->private to boolean --- diff --git a/src/conf/secret_conf.c b/src/conf/secret_conf.c index 0c6132ab5..a81a91b6c 100644 --- a/src/conf/secret_conf.c +++ b/src/conf/secret_conf.c @@ -175,9 +175,9 @@ secretXMLParseNode(xmlDocPtr xml, xmlNodePtr root) prop = virXPathString("string(./@private)", ctxt); if (prop != NULL) { if (STREQ(prop, "yes")) - def->private = 1; + def->private = true; else if (STREQ(prop, "no")) - def->private = 0; + def->private = false; else { virReportError(VIR_ERR_XML_ERROR, "%s", _("invalid value of 'private'")); diff --git a/src/conf/secret_conf.h b/src/conf/secret_conf.h index 936635e05..a2ae0bc47 100644 --- a/src/conf/secret_conf.h +++ b/src/conf/secret_conf.h @@ -32,7 +32,7 @@ typedef struct _virSecretDef virSecretDef; typedef virSecretDef *virSecretDefPtr; struct _virSecretDef { bool ephemeral; - unsigned private : 1; + bool private; unsigned char uuid[VIR_UUID_BUFLEN]; char *description; /* May be NULL */ int usage_type; diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index ba51ff2a2..aa3f14770 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -481,7 +481,7 @@ virStorageGenerateQcowEncryption(virConnectPtr conn, } def->ephemeral = false; - def->private = 0; + def->private = false; if (virStorageGenerateSecretUUID(conn, def->uuid) < 0) goto cleanup;