提交 ab228c81 编写于 作者: E Eric Blake

build: avoid compiler failure

GCC complained about a C99 for-loop declaration outside of C99 mode
when compiling on RHEL 5.

* src/qemu/qemu_driver.c (qemudDomainPinVcpuFlags): Avoid C99 for
loop, since gcc 4.1.2 hates it.
上级 93d6fd1d
...@@ -2952,6 +2952,7 @@ qemudDomainPinVcpuFlags(virDomainPtr dom, ...@@ -2952,6 +2952,7 @@ qemudDomainPinVcpuFlags(virDomainPtr dom,
bool isActive; bool isActive;
qemuDomainObjPrivatePtr priv; qemuDomainObjPrivatePtr priv;
bool canResetting = true; bool canResetting = true;
int pcpu;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
VIR_DOMAIN_AFFECT_CONFIG, -1); VIR_DOMAIN_AFFECT_CONFIG, -1);
...@@ -3011,7 +3012,7 @@ qemudDomainPinVcpuFlags(virDomainPtr dom, ...@@ -3011,7 +3012,7 @@ qemudDomainPinVcpuFlags(virDomainPtr dom,
/* pinning to all physical cpus means resetting, /* pinning to all physical cpus means resetting,
* so check if we can reset setting. * so check if we can reset setting.
*/ */
for (int pcpu = 0; pcpu < hostcpus; pcpu++) { for (pcpu = 0; pcpu < hostcpus; pcpu++) {
if ((cpumap[pcpu/8] & (1 << (pcpu % 8))) == 0) { if ((cpumap[pcpu/8] & (1 << (pcpu % 8))) == 0) {
canResetting = false; canResetting = false;
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册