[PATCH v2 14/14] secret: Change virSecretDef variable names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/conf/secret_conf.c        | 12 ++++++------
 src/conf/secret_conf.h        |  4 ++--
 src/conf/virsecretobj.c       | 14 +++++++-------
 src/secret/secret_driver.c    | 10 +++++-----
 src/storage/storage_backend.c |  4 ++--
 5 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/conf/secret_conf.c b/src/conf/secret_conf.c
index 5c39f24..de9e6cf 100644
--- a/src/conf/secret_conf.c
+++ b/src/conf/secret_conf.c
@@ -183,9 +183,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'"));
@@ -197,9 +197,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'"));
@@ -325,8 +325,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 5ca4ecd..ca1afec 100644
--- a/src/conf/secret_conf.h
+++ b/src/conf/secret_conf.h
@@ -31,8 +31,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/conf/virsecretobj.c b/src/conf/virsecretobj.c
index 4f28392..721e0b4 100644
--- a/src/conf/virsecretobj.c
+++ b/src/conf/virsecretobj.c
@@ -369,7 +369,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;
@@ -517,17 +517,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;
@@ -660,7 +660,7 @@ virSecretObjListGetUUIDs(virSecretObjListPtr secrets,
 int
 virSecretObjDeleteConfig(virSecretObjPtr secret)
 {
-    if (!secret->def->ephemeral &&
+    if (!secret->def->isephemeral &&
         unlink(secret->configFile) < 0 && errno != ENOENT) {
         virReportSystemError(errno, _("cannot unlink '%s'"),
                              secret->configFile);
@@ -804,7 +804,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 */
diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c
index bbfb382..b5b0bea 100644
--- a/src/secret/secret_driver.c
+++ b/src/secret/secret_driver.c
@@ -231,23 +231,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;
 
@@ -358,7 +358,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 a8fff14..0e2fd10 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.5

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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]