]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: Provide error on undefined vcpusched entry
authorJohn Ferlan <jferlan@redhat.com>
Mon, 15 Aug 2016 14:37:34 +0000 (10:37 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 17 Aug 2016 10:42:54 +0000 (06:42 -0400)
Modify virDomainDefGetVcpuSched to emit an error message if
virDomainDefGetVcpu returns NULL meaning the vcpu could not
be found. Prior to commit id '9cc931f0b' the error message
would have been issued in virDomainDefGetVcpu.

src/conf/domain_conf.c

index 90373040a877cdefc9c85e5b7dd9289e6aa4eb45..14d4f7df9c54ee9545f33c0eb2578df28063c91b 100644 (file)
@@ -1480,8 +1480,12 @@ virDomainDefGetVcpuSched(virDomainDefPtr def,
 {
     virDomainVcpuDefPtr vcpuinfo;
 
-    if (!(vcpuinfo = virDomainDefGetVcpu(def, vcpu)))
+    if (!(vcpuinfo = virDomainDefGetVcpu(def, vcpu))) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                       _("vCPU '%u' is not present in domain definition"),
+                       vcpu);
         return NULL;
+    }
 
     return &vcpuinfo->sched;
 }