[libvirt] [PATCH v1 5/8] use virBitmap to store cpumask info.
Eric Blake
eblake at redhat.com
Fri Aug 31 00:37:31 UTC 2012
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 at redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 617 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120830/8dfb1c1c/attachment-0001.sig>
More information about the libvir-list
mailing list