mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
vz: Use virBitmapToDataBuf instead of virBitmapToData in vzDomainGetVcpus
This commit is contained in:
parent
cba7f34504
commit
9777419c81
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user