Change 'ephemeral' to 'isephemeral' and 'private' to 'isprivate' since
both are bools.

Signed-off-by: John Ferlan <jfer...@redhat.com>
---
 src/conf/secret_conf.c        | 26 +++++++++++++-------------
 src/conf/secret_conf.h        |  4 ++--
 src/secret/secret_driver.c    | 10 +++++-----
 src/storage/storage_backend.c |  4 ++--
 4 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/conf/secret_conf.c b/src/conf/secret_conf.c
index 4d0cb9c..6d4de7c 100644
--- a/src/conf/secret_conf.c
+++ b/src/conf/secret_conf.c
@@ -403,7 +403,7 @@ virSecretObjListAddLocked(virSecretObjListPtr secrets,
             goto cleanup;
         }
 
-        if (secret->def->private && !def->private) {
+        if (secret->def->isprivate && !def->isprivate) {
             virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                            _("cannot change private flag on existing secret"));
             goto cleanup;
@@ -553,17 +553,17 @@ virSecretObjMatchFlags(virSecretObjPtr secret,
     /* filter by whether it's ephemeral */
     if (MATCH(VIR_CONNECT_LIST_SECRETS_FILTERS_EPHEMERAL) &&
         !((MATCH(VIR_CONNECT_LIST_SECRETS_EPHEMERAL) &&
-           secret->def->ephemeral) ||
+           secret->def->isephemeral) ||
           (MATCH(VIR_CONNECT_LIST_SECRETS_NO_EPHEMERAL) &&
-           !secret->def->ephemeral)))
+           !secret->def->isephemeral)))
         return false;
 
     /* filter by whether it's private */
     if (MATCH(VIR_CONNECT_LIST_SECRETS_FILTERS_PRIVATE) &&
         !((MATCH(VIR_CONNECT_LIST_SECRETS_PRIVATE) &&
-           secret->def->private) ||
+           secret->def->isprivate) ||
           (MATCH(VIR_CONNECT_LIST_SECRETS_NO_PRIVATE) &&
-           !secret->def->private)))
+           !secret->def->isprivate)))
         return false;
 
     return true;
@@ -699,7 +699,7 @@ virSecretObjDeleteConfig(virSecretObjPtr secret)
     /* When the XML is missing, we'll still allow the attempt to
      * delete the secret data. Without a configFile, the secret
        won't be loaded again, so we have succeeded already. */
-    if (!secret->def->ephemeral &&
+    if (!secret->def->isephemeral &&
         unlink(secret->configFile) < 0 && errno != ENOENT)
         return -1;
 
@@ -838,7 +838,7 @@ virSecretObjSetValue(virSecretObjPtr secret,
     secret->value = new_value;
     secret->value_size = value_size;
 
-    if (!secret->def->ephemeral && virSecretObjSaveData(secret) < 0)
+    if (!secret->def->isephemeral && virSecretObjSaveData(secret) < 0)
         goto error;
 
     /* Saved successfully - drop old value */
@@ -995,9 +995,9 @@ secretXMLParseNode(xmlDocPtr xml, xmlNodePtr root)
     prop = virXPathString("string(./@ephemeral)", ctxt);
     if (prop != NULL) {
         if (STREQ(prop, "yes")) {
-            def->ephemeral = true;
+            def->isephemeral = true;
         } else if (STREQ(prop, "no")) {
-            def->ephemeral = false;
+            def->isephemeral = false;
         } else {
             virReportError(VIR_ERR_XML_ERROR, "%s",
                            _("invalid value of 'ephemeral'"));
@@ -1009,9 +1009,9 @@ secretXMLParseNode(xmlDocPtr xml, xmlNodePtr root)
     prop = virXPathString("string(./@private)", ctxt);
     if (prop != NULL) {
         if (STREQ(prop, "yes")) {
-            def->private = true;
+            def->isprivate = true;
         } else if (STREQ(prop, "no")) {
-            def->private = false;
+            def->isprivate = false;
         } else {
             virReportError(VIR_ERR_XML_ERROR, "%s",
                            _("invalid value of 'private'"));
@@ -1137,8 +1137,8 @@ virSecretDefFormat(const virSecretDef *def)
     char uuidstr[VIR_UUID_STRING_BUFLEN];
 
     virBufferAsprintf(&buf, "<secret ephemeral='%s' private='%s'>\n",
-                      def->ephemeral ? "yes" : "no",
-                      def->private ? "yes" : "no");
+                      def->isephemeral ? "yes" : "no",
+                      def->isprivate ? "yes" : "no");
 
     uuid = def->uuid;
     virUUIDFormat(uuid, uuidstr);
diff --git a/src/conf/secret_conf.h b/src/conf/secret_conf.h
index be3bff9..a64a4d9 100644
--- a/src/conf/secret_conf.h
+++ b/src/conf/secret_conf.h
@@ -32,8 +32,8 @@ VIR_ENUM_DECL(virSecretUsage)
 typedef struct _virSecretDef virSecretDef;
 typedef virSecretDef *virSecretDefPtr;
 struct _virSecretDef {
-    bool ephemeral;
-    bool private;
+    bool isephemeral;
+    bool isprivate;
     unsigned char uuid[VIR_UUID_BUFLEN];
     char *description;          /* May be NULL */
     int usage_type;
diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c
index ab58115..cdf8d80 100644
--- a/src/secret/secret_driver.c
+++ b/src/secret/secret_driver.c
@@ -230,23 +230,23 @@ secretDefineXML(virConnectPtr conn,
                                        driver->configDir, &backup)))
         goto cleanup;
 
-    if (!new_attrs->ephemeral) {
+    if (!new_attrs->isephemeral) {
         if (secretEnsureDirectory() < 0)
             goto cleanup;
 
-        if (backup && backup->ephemeral) {
+        if (backup && backup->isephemeral) {
             if (virSecretObjSaveData(secret) < 0)
                 goto restore_backup;
         }
 
         if (virSecretObjSaveConfig(secret) < 0) {
-            if (backup && backup->ephemeral) {
+            if (backup && backup->isephemeral) {
                 /* Undo the virSecretObjSaveData() above; ignore errors */
                 virSecretObjDeleteData(secret);
             }
             goto restore_backup;
         }
-    } else if (backup && !backup->ephemeral) {
+    } else if (backup && !backup->isephemeral) {
         if (virSecretObjDeleteConfig(secret) < 0)
             goto restore_backup;
 
@@ -357,7 +357,7 @@ secretGetValue(virSecretPtr obj,
         goto cleanup;
 
     if ((internalFlags & VIR_SECRET_GET_VALUE_INTERNAL_CALL) == 0 &&
-        def->private) {
+        def->isprivate) {
         virReportError(VIR_ERR_INVALID_SECRET, "%s",
                        _("secret is private"));
         goto cleanup;
diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
index 231eccf..0a8469a 100644
--- a/src/storage/storage_backend.c
+++ b/src/storage/storage_backend.c
@@ -626,8 +626,8 @@ virStorageGenerateQcowEncryption(virConnectPtr conn,
         VIR_ALLOC(def) < 0)
         goto cleanup;
 
-    def->ephemeral = false;
-    def->private = false;
+    def->isephemeral = false;
+    def->isprivate = false;
     if (virStorageGenerateSecretUUID(conn, def->uuid) < 0)
         goto cleanup;
 
-- 
2.5.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to