From: John Ferlan Date: Mon, 15 Aug 2016 14:37:34 +0000 (-0400) Subject: conf: Provide error on undefined vcpusched entry X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4b15fd0d1f3b63c0feb847b1bfe93cee46813601;p=libvirt.git conf: Provide error on undefined vcpusched entry 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. --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 90373040a8..14d4f7df9c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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; }