]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: Provide error on undefined iothreadsched entry
authorJohn Ferlan <jferlan@redhat.com>
Mon, 15 Aug 2016 13:45:28 +0000 (09:45 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 16 Aug 2016 15:29:22 +0000 (11:29 -0400)
When commit id '6dfb4507' refactored where the iothreadsched data was
stored, the error message for when the virDomainIOThreadIDFind failed
to find an iothreadid ("iothreadsched attribute 'iothreads' uses
undefined iothread ids") was lost. This led to the possibility that
someone would try to use it, but receive the generic message "An error
occurred, but the cause is unknown".

This patch adds the error message back so that someone will know that
they have an invalid configuration.

Signed-off-by: John Ferlan <jferlan@redhat.com>
src/conf/domain_conf.c

index 82876f3a1e081cc71d374e0574cd357aeaf2bed4..90373040a877cdefc9c85e5b7dd9289e6aa4eb45 100644 (file)
@@ -15490,8 +15490,12 @@ virDomainDefGetIOThreadSched(virDomainDefPtr def,
 {
     virDomainIOThreadIDDefPtr iothrinfo;
 
-    if (!(iothrinfo = virDomainIOThreadIDFind(def, iothread)))
+    if (!(iothrinfo = virDomainIOThreadIDFind(def, iothread))) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                       _("Cannot find 'iothread' : %u"),
+                       iothread);
         return NULL;
+    }
 
     return &iothrinfo->sched;
 }