[PATCH 4/4] qemu: change two-state int parameters to bool

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

 



---
 src/qemu/qemu_capabilities.c | 13 +++++++------
 src/qemu/qemu_capabilities.h |  2 +-
 src/qemu/qemu_hostdev.c      |  6 +++---
 tests/qemuhelptest.c         |  5 +++--
 4 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index d99bcc5..1091a07 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -917,7 +917,7 @@ error:
 static int
 virQEMUCapsComputeCmdFlags(const char *help,
                            unsigned int version,
-                           unsigned int is_kvm,
+                           bool is_kvm,
                            unsigned int kvm_version,
                            virQEMUCapsPtr qemuCaps,
                            bool check_yajl ATTRIBUTE_UNUSED)
@@ -1221,7 +1221,7 @@ int virQEMUCapsParseHelpStr(const char *qemu,
                             const char *help,
                             virQEMUCapsPtr qemuCaps,
                             unsigned int *version,
-                            unsigned int *is_kvm,
+                            bool *is_kvm,
                             unsigned int *kvm_version,
                             bool check_yajl)
 {
@@ -1229,7 +1229,8 @@ int virQEMUCapsParseHelpStr(const char *qemu,
     const char *p = help;
     char *strflags;
 
-    *version = *is_kvm = *kvm_version = 0;
+    *version = *kvm_version = 0;
+    *is_kvm = false;
 
     if (STRPREFIX(p, QEMU_VERSION_STR_1))
         p += strlen(QEMU_VERSION_STR_1);
@@ -1262,12 +1263,12 @@ int virQEMUCapsParseHelpStr(const char *qemu,
     SKIP_BLANKS(p);
 
     if (STRPREFIX(p, QEMU_KVM_VER_PREFIX)) {
-        *is_kvm = 1;
+        *is_kvm = true;
         p += strlen(QEMU_KVM_VER_PREFIX);
     } else if (STRPREFIX(p, KVM_VER_PREFIX)) {
         int ret;
 
-        *is_kvm = 1;
+        *is_kvm = true;
         p += strlen(KVM_VER_PREFIX);
 
         ret = virParseNumber(&p);
@@ -2282,7 +2283,7 @@ static int
 virQEMUCapsInitHelp(virQEMUCapsPtr qemuCaps, uid_t runUid, gid_t runGid)
 {
     virCommandPtr cmd = NULL;
-    unsigned int is_kvm;
+    bool is_kvm;
     char *help = NULL;
     int ret = -1;
     const char *tmp;
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 90d08c6..64a4b1d 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -261,7 +261,7 @@ int virQEMUCapsParseHelpStr(const char *qemu,
                             const char *str,
                             virQEMUCapsPtr qemuCaps,
                             unsigned int *version,
-                            unsigned int *is_kvm,
+                            bool *is_kvm,
                             unsigned int *kvm_version,
                             bool check_yajl);
 /* Only for use by test suite */
diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c
index 48750c3..0a04786 100644
--- a/src/qemu/qemu_hostdev.c
+++ b/src/qemu/qemu_hostdev.c
@@ -330,7 +330,7 @@ qemuDomainHostdevNetConfigVirtPortProfile(const char *linkdev, int vf,
                                           virNetDevVPortProfilePtr virtPort,
                                           const virMacAddrPtr macaddr,
                                           const unsigned char *uuid,
-                                          int associate)
+                                          bool associate)
 {
     int ret = -1;
 
@@ -375,7 +375,7 @@ qemuDomainHostdevNetConfigReplace(virDomainHostdevDefPtr hostdev,
     int ret = -1;
     int vf = -1;
     int vlanid = -1;
-    int port_profile_associate = 1;
+    bool port_profile_associate = true;
     int isvf;
 
     isvf = qemuDomainHostdevIsVirtualFunction(hostdev);
@@ -440,7 +440,7 @@ qemuDomainHostdevNetConfigRestore(virDomainHostdevDefPtr hostdev,
     virNetDevVPortProfilePtr virtPort;
     int ret = -1;
     int vf = -1;
-    int port_profile_associate = 0;
+    bool port_profile_associate = false;
     int isvf;
 
     isvf = qemuDomainHostdevIsVirtualFunction(hostdev);
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
index bc7004e..2a3b019 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -15,7 +15,7 @@ struct testInfo {
     const char *name;
     virQEMUCapsPtr flags;
     unsigned int version;
-    unsigned int is_kvm;
+    bool is_kvm;
     unsigned int kvm_version;
 };
 
@@ -39,7 +39,8 @@ static int testHelpStrParsing(const void *data)
     const struct testInfo *info = data;
     char *path = NULL;
     char *help = NULL;
-    unsigned int version, is_kvm, kvm_version;
+    unsigned int version, kvm_version;
+    bool is_kvm;
     virQEMUCapsPtr flags = NULL;
     int ret = -1;
     char *got = NULL;
-- 
1.8.1.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]