[libvirt] [PATCH] conf: Revert changes to add new secret type "passphrase"

John Ferlan jferlan at redhat.com
Thu Jul 14 17:49:19 UTC 2016


Revert the remainder of commit id 'c84380106'

Signed-off-by: John Ferlan <jferlan at redhat.com>
---

 This "replaces" patch 3 of my other series - essentially removing all
 traces of the 'passphrase' changes - as requested via code review.

 docs/aclpolkit.html.in                     |  4 ----
 docs/schemas/secret.rng                    | 10 ----------
 include/libvirt/libvirt-secret.h           |  1 -
 src/access/viraccessdriverpolkit.c         | 13 -------------
 src/conf/secret_conf.c                     | 22 +---------------------
 src/conf/secret_conf.h                     |  1 -
 src/conf/virsecretobj.c                    |  5 -----
 tests/secretxml2xmlin/usage-passphrase.xml |  7 -------
 tests/secretxml2xmltest.c                  |  1 -
 9 files changed, 1 insertion(+), 63 deletions(-)
 delete mode 100644 tests/secretxml2xmlin/usage-passphrase.xml

diff --git a/docs/aclpolkit.html.in b/docs/aclpolkit.html.in
index 4d0307d..dae0814 100644
--- a/docs/aclpolkit.html.in
+++ b/docs/aclpolkit.html.in
@@ -224,10 +224,6 @@
           <td>secret_usage_target</td>
           <td>Name of the associated iSCSI target, if any</td>
         </tr>
-        <tr>
-          <td>secret_usage_name</td>
-          <td>Name of be associated passphrase secret, if any</td>
-        </tr>
       </tbody>
     </table>
 
diff --git a/docs/schemas/secret.rng b/docs/schemas/secret.rng
index cac8560..e21e700 100644
--- a/docs/schemas/secret.rng
+++ b/docs/schemas/secret.rng
@@ -36,7 +36,6 @@
               <ref name='usagevolume'/>
               <ref name='usageceph'/>
               <ref name='usageiscsi'/>
-              <ref name='usagepassphrase'/>
               <!-- More choices later -->
             </choice>
           </element>
@@ -72,13 +71,4 @@
     </element>
   </define>
 
-  <define name='usagepassphrase'>
-    <attribute name='type'>
-      <value>passphrase</value>
-    </attribute>
-    <element name='name'>
-      <ref name='genericName'/>
-    </element>
-  </define>
-
 </grammar>
diff --git a/include/libvirt/libvirt-secret.h b/include/libvirt/libvirt-secret.h
index 55b11e0..02728ba 100644
--- a/include/libvirt/libvirt-secret.h
+++ b/include/libvirt/libvirt-secret.h
@@ -43,7 +43,6 @@ typedef enum {
     VIR_SECRET_USAGE_TYPE_VOLUME = 1,
     VIR_SECRET_USAGE_TYPE_CEPH = 2,
     VIR_SECRET_USAGE_TYPE_ISCSI = 3,
-    VIR_SECRET_USAGE_TYPE_PASSPHRASE = 4,
 
 # ifdef VIR_ENUM_SENTINELS
     VIR_SECRET_USAGE_TYPE_LAST
diff --git a/src/access/viraccessdriverpolkit.c b/src/access/viraccessdriverpolkit.c
index 99b867f..89bc890 100644
--- a/src/access/viraccessdriverpolkit.c
+++ b/src/access/viraccessdriverpolkit.c
@@ -338,19 +338,6 @@ virAccessDriverPolkitCheckSecret(virAccessManagerPtr manager,
                                           virAccessPermSecretTypeToString(perm),
                                           attrs);
     }   break;
-    case VIR_SECRET_USAGE_TYPE_PASSPHRASE: {
-        const char *attrs[] = {
-            "connect_driver", driverName,
-            "secret_uuid", uuidstr,
-            "secret_usage_name", secret->usage.name,
-            NULL,
-        };
-
-        return virAccessDriverPolkitCheck(manager,
-                                          "secret",
-                                          virAccessPermSecretTypeToString(perm),
-                                          attrs);
-    }   break;
     }
 }
 
diff --git a/src/conf/secret_conf.c b/src/conf/secret_conf.c
index a973aa9..d510645 100644
--- a/src/conf/secret_conf.c
+++ b/src/conf/secret_conf.c
@@ -29,7 +29,6 @@
 #include "viralloc.h"
 #include "secret_conf.h"
 #include "virsecretobj.h"
-#include "virstring.h"
 #include "virerror.h"
 #include "virxml.h"
 #include "viruuid.h"
@@ -39,7 +38,7 @@
 VIR_LOG_INIT("conf.secret_conf");
 
 VIR_ENUM_IMPL(virSecretUsage, VIR_SECRET_USAGE_TYPE_LAST,
-              "none", "volume", "ceph", "iscsi", "passphrase")
+              "none", "volume", "ceph", "iscsi")
 
 const char *
 virSecretUsageIDForDef(virSecretDefPtr def)
@@ -57,9 +56,6 @@ virSecretUsageIDForDef(virSecretDefPtr def)
     case VIR_SECRET_USAGE_TYPE_ISCSI:
         return def->usage.target;
 
-    case VIR_SECRET_USAGE_TYPE_PASSPHRASE:
-        return def->usage.name;
-
     default:
         return NULL;
     }
@@ -89,10 +85,6 @@ virSecretDefFree(virSecretDefPtr def)
         VIR_FREE(def->usage.target);
         break;
 
-    case VIR_SECRET_USAGE_TYPE_PASSPHRASE:
-        VIR_FREE(def->usage.name);
-        break;
-
     default:
         VIR_ERROR(_("unexpected secret usage type %d"), def->usage_type);
         break;
@@ -153,14 +145,6 @@ virSecretDefParseUsage(xmlXPathContextPtr ctxt,
         }
         break;
 
-    case VIR_SECRET_USAGE_TYPE_PASSPHRASE:
-        if (!(def->usage.name = virXPathString("string(./usage/name)", ctxt))) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                           _("passphrase usage specified, but name is missing"));
-            return -1;
-        }
-        break;
-
     default:
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("unexpected secret usage type %d"),
@@ -313,10 +297,6 @@ virSecretDefFormatUsage(virBufferPtr buf,
         virBufferEscapeString(buf, "<target>%s</target>\n", def->usage.target);
         break;
 
-    case VIR_SECRET_USAGE_TYPE_PASSPHRASE:
-        virBufferEscapeString(buf, "<name>%s</name>\n", def->usage.name);
-        break;
-
     default:
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("unexpected secret usage type %d"),
diff --git a/src/conf/secret_conf.h b/src/conf/secret_conf.h
index c34880f..4584403 100644
--- a/src/conf/secret_conf.h
+++ b/src/conf/secret_conf.h
@@ -40,7 +40,6 @@ struct _virSecretDef {
         char *volume;               /* May be NULL */
         char *ceph;
         char *target;
-        char *name;
     } usage;
 };
 
diff --git a/src/conf/virsecretobj.c b/src/conf/virsecretobj.c
index 6714a00..30a5e80 100644
--- a/src/conf/virsecretobj.c
+++ b/src/conf/virsecretobj.c
@@ -237,11 +237,6 @@ virSecretObjSearchName(const void *payload,
         if (STREQ(secret->def->usage.target, data->usageID))
             found = 1;
         break;
-
-    case VIR_SECRET_USAGE_TYPE_PASSPHRASE:
-        if (STREQ(secret->def->usage.name, data->usageID))
-            found = 1;
-        break;
     }
 
  cleanup:
diff --git a/tests/secretxml2xmlin/usage-passphrase.xml b/tests/secretxml2xmlin/usage-passphrase.xml
deleted file mode 100644
index 2b94b80..0000000
--- a/tests/secretxml2xmlin/usage-passphrase.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<secret ephemeral='no' private='no'>
-  <uuid>f52a81b2-424e-490c-823d-6bd4235bc572</uuid>
-  <description>Sample Passphrase Secret</description>
-  <usage type='passphrase'>
-    <name>mumblyfratz</name>
-  </usage>
-</secret>
diff --git a/tests/secretxml2xmltest.c b/tests/secretxml2xmltest.c
index c444e4d..8dcbb40 100644
--- a/tests/secretxml2xmltest.c
+++ b/tests/secretxml2xmltest.c
@@ -80,7 +80,6 @@ mymain(void)
     DO_TEST("usage-volume");
     DO_TEST("usage-ceph");
     DO_TEST("usage-iscsi");
-    DO_TEST("usage-passphrase");
 
     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
 }
-- 
2.5.5




More information about the libvir-list mailing list