The 'online' parameter has only two possible values. Use a bool for it.
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)
} 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)
}
-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);
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
* 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");
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,
* 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;
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,