提交 f79bfd9b 编写于 作者: P Peter Krempa

qemu: Reuse virBitmapToDataBuf in qemuDomainGetEmulatorPinInfo

上级 b6d438e1
...@@ -5508,8 +5508,6 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom, ...@@ -5508,8 +5508,6 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom,
virBitmapPtr cpumask = NULL; virBitmapPtr cpumask = NULL;
virBitmapPtr bitmap = NULL; virBitmapPtr bitmap = NULL;
virCapsPtr caps = NULL; virCapsPtr caps = NULL;
unsigned char *tmpmap = NULL;
int tmpmaplen;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
VIR_DOMAIN_AFFECT_CONFIG, -1); VIR_DOMAIN_AFFECT_CONFIG, -1);
...@@ -5547,12 +5545,7 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom, ...@@ -5547,12 +5545,7 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom,
cpumask = bitmap; cpumask = bitmap;
} }
if (virBitmapToData(cpumask, &tmpmap, &tmpmaplen) < 0) virBitmapToDataBuf(cpumask, cpumaps, maplen);
goto cleanup;
if (tmpmaplen > maplen)
tmpmaplen = maplen;
memcpy(cpumaps, tmpmap, tmpmaplen);
VIR_FREE(tmpmap);
ret = 1; ret = 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册