]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virconf: Report an error in when virConfSetValue() fails
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 14 Jan 2022 09:35:17 +0000 (10:35 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 17 Jan 2022 08:53:45 +0000 (09:53 +0100)
Callers of virConfSetValue() don't report any error, they just
pass the error blindly. Therefore, report an error when
virConfSetValue() is about to fail.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virconf.c

index 07ecfc7b57539dd4509099bf34b3e5add47cf772..29b36227911300aef7d11e72c0271fe247990b1d 100644 (file)
@@ -1329,6 +1329,9 @@ virConfSetValue(virConf *conf,
     virConfEntry *prev = NULL;
 
     if (value && value->type == VIR_CONF_STRING && value->str == NULL) {
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                       _("expecting a value for value of type %s"),
+                       virConfTypeToString(VIR_CONF_STRING));
         virConfFreeValue(value);
         return -1;
     }