]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Use bool instead of int in qemuMonitorSetCPU APIs
authorPeter Krempa <pkrempa@redhat.com>
Mon, 27 May 2013 13:35:35 +0000 (15:35 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 7 Jun 2013 13:57:03 +0000 (15:57 +0200)
The 'online' parameter has only two possible values. Use a bool for it.

src/qemu/qemu_driver.c
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h
src/qemu/qemu_monitor_json.c
src/qemu/qemu_monitor_json.h
src/qemu/qemu_monitor_text.c
src/qemu/qemu_monitor_text.h

index 3bad629cfefab9f80beedcb2b7372540aa592ba9..b353c3e101e62a0cf174d196303b1526c337df21 100644 (file)
@@ -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)
index a4297d212a12d669982d04721189500ab383e6e1..091e23986dc20d9efaa85728b7436eb731961611 100644 (file)
@@ -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);
index a607712dc5f8deaf4cf729fce595172ad618db36..3d9afa315c96b1576789d634b4cbd06791228d55 100644 (file)
@@ -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
index 8b9db7f524bab825dff42e0f430062929b7960b1..02a4c51e853715861f8f464d88aa57d284acf0bf 100644 (file)
@@ -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");
index 74e2476b7259c3be812156d8e3a89f4181a33467..d79b86b2496e2ac8ab996e5412f89c09310925a8 100644 (file)
@@ -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,
index ef093b58bed3b27c13a5dd1ed7e6fc221d54ec79..15fbcb7e8cf4f6e890cbdde50504efceb2604a49 100644 (file)
@@ -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;
index fb8e9047eca98a9d37625aaa41e0575187dc05f9..5218a8bf94bafef922cf2a32882fa95c9eebef92 100644 (file)
@@ -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,