提交 82e119f5 编写于 作者: P Peter Krempa

qemu: Use bool instead of int in qemuMonitorSetCPU APIs

The 'online' parameter has only two possible values. Use a bool for it.
上级 36e073ad
......@@ -3538,7 +3538,7 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver,
if (nvcpus > vcpus) {
for (i = vcpus; i < nvcpus; i++) {
/* Online new CPU */
rc = qemuMonitorSetCPU(priv->mon, i, 1);
rc = qemuMonitorSetCPU(priv->mon, i, true);
if (rc == 0)
goto unsupported;
if (rc < 0)
......@@ -3549,7 +3549,7 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver,
} else {
for (i = vcpus - 1; i >= nvcpus; i--) {
/* Offline old CPU */
rc = qemuMonitorSetCPU(priv->mon, i, 0);
rc = qemuMonitorSetCPU(priv->mon, i, false);
if (rc == 0)
goto unsupported;
if (rc < 0)
......
......@@ -1670,7 +1670,7 @@ int qemuMonitorSetBalloon(qemuMonitorPtr mon,
}
int qemuMonitorSetCPU(qemuMonitorPtr mon, int cpu, int online)
int qemuMonitorSetCPU(qemuMonitorPtr mon, int cpu, bool online)
{
int ret;
VIR_DEBUG("mon=%p cpu=%d online=%d", mon, cpu, online);
......
......@@ -299,7 +299,7 @@ int qemuMonitorExpirePassword(qemuMonitorPtr mon,
const char *expire_time);
int qemuMonitorSetBalloon(qemuMonitorPtr mon,
unsigned long newmem);
int qemuMonitorSetCPU(qemuMonitorPtr mon, int cpu, int online);
int qemuMonitorSetCPU(qemuMonitorPtr mon, int cpu, bool online);
/* XXX should we pass the virDomainDiskDefPtr instead
......
......@@ -2076,7 +2076,7 @@ cleanup:
* or -1 on failure
*/
int qemuMonitorJSONSetCPU(qemuMonitorPtr mon,
int cpu, int online)
int cpu, bool online)
{
/* XXX Update to use QMP, if QMP ever adds support for cpu hotplug */
VIR_DEBUG("no QMP support for cpu_set, trying HMP");
......
......@@ -94,7 +94,7 @@ int qemuMonitorJSONExpirePassword(qemuMonitorPtr mon,
const char *expire_time);
int qemuMonitorJSONSetBalloon(qemuMonitorPtr mon,
unsigned long newmem);
int qemuMonitorJSONSetCPU(qemuMonitorPtr mon, int cpu, int online);
int qemuMonitorJSONSetCPU(qemuMonitorPtr mon, int cpu, bool online);
int qemuMonitorJSONEjectMedia(qemuMonitorPtr mon,
const char *dev_name,
......
......@@ -1231,7 +1231,7 @@ int qemuMonitorTextSetBalloon(qemuMonitorPtr mon,
* Returns: 0 if CPU hotplug not supported, +1 if CPU hotplug worked
* or -1 on failure
*/
int qemuMonitorTextSetCPU(qemuMonitorPtr mon, int cpu, int online)
int qemuMonitorTextSetCPU(qemuMonitorPtr mon, int cpu, bool online)
{
char *cmd;
char *reply = NULL;
......
......@@ -90,7 +90,7 @@ int qemuMonitorTextExpirePassword(qemuMonitorPtr mon,
const char *expire_time);
int qemuMonitorTextSetBalloon(qemuMonitorPtr mon,
unsigned long newmem);
int qemuMonitorTextSetCPU(qemuMonitorPtr mon, int cpu, int online);
int qemuMonitorTextSetCPU(qemuMonitorPtr mon, int cpu, bool online);
int qemuMonitorTextEjectMedia(qemuMonitorPtr mon,
const char *dev_name,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册