[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 02/11] qemu: Use bool instead of int in qemuMonitorSetCPU APIs



The 'online' parameter has only two possible values. Use a bool for it.
---
 src/qemu/qemu_driver.c       | 4 ++--
 src/qemu/qemu_monitor.c      | 2 +-
 src/qemu/qemu_monitor.h      | 2 +-
 src/qemu/qemu_monitor_json.c | 2 +-
 src/qemu/qemu_monitor_json.h | 2 +-
 src/qemu/qemu_monitor_text.c | 2 +-
 src/qemu/qemu_monitor_text.h | 2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 4a76f14..4a4f8d3 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3534,7 +3534,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)
@@ -3545,7 +3545,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)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 4e35f79..af85c29 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -1669,7 +1669,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);
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index a607712..3d9afa3 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -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
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 2b73884..26bf09b 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -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");
diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
index 74e2476..d79b86b 100644
--- a/src/qemu/qemu_monitor_json.h
+++ b/src/qemu/qemu_monitor_json.h
@@ -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,
diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index d4ee93d..aa4145e 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -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;
diff --git a/src/qemu/qemu_monitor_text.h b/src/qemu/qemu_monitor_text.h
index fb8e904..5218a8b 100644
--- a/src/qemu/qemu_monitor_text.h
+++ b/src/qemu/qemu_monitor_text.h
@@ -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,
-- 
1.8.2.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]