On 08/30/2012 02:55 AM, Hu Tao wrote:
---
+++ b/src/conf/domain_conf.c
@@ -8303,14 +8303,12 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
if (def->placement_mode != VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO) {
tmp = virXPathString("string(./vcpu[1]/@cpuset)", ctxt);
if (tmp) {
- char *set = tmp;
- def->cpumasklen = VIR_DOMAIN_CPUMASK_LEN;
- if (VIR_ALLOC_N(def->cpumask, def->cpumasklen) < 0) {
- goto no_memory;
- }
- if (virDomainCpuSetParse(set, 0, def->cpumask,
- def->cpumasklen) < 0)
+ if (virBitmapParse(tmp, 0, &def->cpumask,
+ VIR_DOMAIN_CPUMASK_LEN) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("topology cpuset syntax
error"));
Internal error is the wrong category; this fits better as VIR_ERR_XML_ERROR.
--
Eric Blake eblake(a)redhat.com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org