[PATCH v3 01/10] conf: No need to check for usage fields during Format

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

 



Since the virSecretDefParseUsage ensures each of the fields is present,
no need to check during virSecretDefFormatUsage

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/conf/secret_conf.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/src/conf/secret_conf.c b/src/conf/secret_conf.c
index de9e6cf..d510645 100644
--- a/src/conf/secret_conf.c
+++ b/src/conf/secret_conf.c
@@ -286,23 +286,15 @@ virSecretDefFormatUsage(virBufferPtr buf,
         break;
 
     case VIR_SECRET_USAGE_TYPE_VOLUME:
-        if (def->usage.volume != NULL)
-            virBufferEscapeString(buf, "<volume>%s</volume>\n",
-                                  def->usage.volume);
+        virBufferEscapeString(buf, "<volume>%s</volume>\n", def->usage.volume);
         break;
 
     case VIR_SECRET_USAGE_TYPE_CEPH:
-        if (def->usage.ceph != NULL) {
-            virBufferEscapeString(buf, "<name>%s</name>\n",
-                                  def->usage.ceph);
-        }
+        virBufferEscapeString(buf, "<name>%s</name>\n", def->usage.ceph);
         break;
 
     case VIR_SECRET_USAGE_TYPE_ISCSI:
-        if (def->usage.target != NULL) {
-            virBufferEscapeString(buf, "<target>%s</target>\n",
-                                  def->usage.target);
-        }
+        virBufferEscapeString(buf, "<target>%s</target>\n", def->usage.target);
         break;
 
     default:
-- 
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]