vz: Use virBitmapToDataBuf instead of virBitmapToData in vzDomainGetVcpus

This commit is contained in:
Peter Krempa 2015-07-02 16:26:59 +02:00
parent cba7f34504
commit 9777419c81
1 changed files with 4 additions and 13 deletions

View File

@ -807,7 +807,6 @@ vzDomainGetVcpus(virDomainPtr domain,
{
virDomainObjPtr privdom = NULL;
size_t i;
int v;
int ret = -1;
if (!(privdom = vzDomObjFromDomainRef(domain)))
@ -831,19 +830,11 @@ vzDomainGetVcpus(virDomainPtr domain,
}
}
if (cpumaps != NULL) {
unsigned char *tmpmap = NULL;
int tmpmapLen = 0;
memset(cpumaps, 0, maplen * maxinfo);
virBitmapToData(privdom->def->cpumask, &tmpmap, &tmpmapLen);
if (tmpmapLen > maplen)
tmpmapLen = maplen;
for (v = 0; v < maxinfo; v++) {
unsigned char *cpumap = VIR_GET_CPUMAP(cpumaps, maplen, v);
memcpy(cpumap, tmpmap, tmpmapLen);
}
VIR_FREE(tmpmap);
for (i = 0; i < maxinfo; i++)
virBitmapToDataBuf(privdom->def->cpumask,
VIR_GET_CPUMAP(cpumaps, maplen, i),
maplen);
}
}
ret = maxinfo;