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