[PATCH 19/22] xenconfig: Fix misaligned arguments and misaligned conditions

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

 



This patch fixes misaligned arguments and misaligned conditions.

Signed-off-by: Shi Lei <shi_lei@xxxxxxxxxxxxxx>
---
 src/xenconfig/xen_common.c | 21 +++++++++++++--------
 src/xenconfig/xen_xl.c     | 23 +++++++++++------------
 src/xenconfig/xen_xm.c     |  8 ++++----
 3 files changed, 28 insertions(+), 24 deletions(-)

diff --git a/src/xenconfig/xen_common.c b/src/xenconfig/xen_common.c
index 0a99587..d1d5b9a 100644
--- a/src/xenconfig/xen_common.c
+++ b/src/xenconfig/xen_common.c
@@ -295,11 +295,11 @@ xenParseMem(virConfPtr conf, virDomainDefPtr def)
     unsigned long long memory;
 
     if (xenConfigGetULongLong(conf, "memory", &def->mem.cur_balloon,
-                                MIN_XEN_GUEST_SIZE * 2) < 0)
+                              MIN_XEN_GUEST_SIZE * 2) < 0)
         return -1;
 
     if (xenConfigGetULongLong(conf, "maxmem", &memory,
-                                def->mem.cur_balloon) < 0)
+                              def->mem.cur_balloon) < 0)
         return -1;
 
     def->mem.cur_balloon *= 1024;
@@ -1104,8 +1104,12 @@ xenParseGeneralMeta(virConfPtr conf, virDomainDefPtr def, virCapsPtr caps)
 
     def->os.type = (hvm ? VIR_DOMAIN_OSTYPE_HVM : VIR_DOMAIN_OSTYPE_XEN);
 
-    if (!(capsdata = virCapabilitiesDomainDataLookup(caps, def->os.type,
-            VIR_ARCH_NONE, def->virtType, NULL, NULL)))
+    if (!(capsdata = virCapabilitiesDomainDataLookup(caps,
+                                                     def->os.type,
+                                                     VIR_ARCH_NONE,
+                                                     def->virtType,
+                                                     NULL,
+                                                     NULL)))
         goto out;
 
     def->os.arch = capsdata->arch;
@@ -1680,17 +1684,17 @@ xenFormatCPUFeatures(virConfPtr conf, virDomainDefPtr def)
     if (hvm) {
         if (xenConfigSetInt(conf, "pae",
                             (def->features[VIR_DOMAIN_FEATURE_PAE] ==
-                            VIR_TRISTATE_SWITCH_ON) ? 1 : 0) < 0)
+                             VIR_TRISTATE_SWITCH_ON) ? 1 : 0) < 0)
             return -1;
 
         if (xenConfigSetInt(conf, "acpi",
                             (def->features[VIR_DOMAIN_FEATURE_ACPI] ==
-                            VIR_TRISTATE_SWITCH_ON) ? 1 : 0) < 0)
+                             VIR_TRISTATE_SWITCH_ON) ? 1 : 0) < 0)
             return -1;
 
         if (xenConfigSetInt(conf, "apic",
                             (def->features[VIR_DOMAIN_FEATURE_APIC] ==
-                            VIR_TRISTATE_SWITCH_ON) ? 1 : 0) < 0)
+                             VIR_TRISTATE_SWITCH_ON) ? 1 : 0) < 0)
             return -1;
 
         if (def->features[VIR_DOMAIN_FEATURE_HAP] == VIR_TRISTATE_SWITCH_OFF) {
@@ -1805,7 +1809,8 @@ xenFormatVfb(virConfPtr conf, virDomainDefPtr def)
                     return -1;
 
                 if (xenConfigSetInt(conf, "vncunused",
-                              def->graphics[0]->data.vnc.autoport ? 1 : 0) < 0)
+                                    (def->graphics[0]->data.vnc.autoport ?
+                                     1 : 0)) < 0)
                     return -1;
 
                 if (!def->graphics[0]->data.vnc.autoport &&
diff --git a/src/xenconfig/xen_xl.c b/src/xenconfig/xen_xl.c
index 7250e57..2afaa25 100644
--- a/src/xenconfig/xen_xl.c
+++ b/src/xenconfig/xen_xl.c
@@ -467,8 +467,7 @@ xenParseXLVnuma(virConfPtr conf,
                 const char *data;
                 const char *str = vnode->str;
 
-                if (!str ||
-                   !(data = strrchr(str, '='))) {
+                if (!str || !(data = strrchr(str, '='))) {
                     virReportError(VIR_ERR_INTERNAL_ERROR,
                                    _("vnuma vnode invalid format '%s'"),
                                    str);
@@ -545,8 +544,9 @@ xenParseXLVnuma(virConfPtr conf,
 
                         if (ndistances != nr_nodes) {
                             virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                                       _("vnuma pnode %d configured '%s' (count %zu) doesn't fit the number of specified vnodes %zu"),
-                                       pnode, str, ndistances, nr_nodes);
+                                           _("vnuma pnode %d configured '%s' (count %zu)"
+                                             " doesn't fit the number of specified vnodes %zu"),
+                                           pnode, str, ndistances, nr_nodes);
                             goto cleanup;
                         }
 
@@ -844,9 +844,9 @@ xenParseXLInputDevs(virConfPtr conf, virDomainDefPtr def)
             str = val->str;
 
             if (str &&
-                    (STREQ(str, "tablet") ||
-                     STREQ(str, "mouse") ||
-                     STREQ(str, "keyboard"))) {
+                (STREQ(str, "tablet") ||
+                 STREQ(str, "mouse") ||
+                 STREQ(str, "keyboard"))) {
                 virDomainInputDefPtr input;
                 if (VIR_ALLOC(input) < 0)
                     return -1;
@@ -1288,7 +1288,7 @@ xenFormatXLOS(virConfPtr conf, virDomainDefPtr def)
         /* XXX floppy disks */
     } else {
         if (def->os.bootloader &&
-             xenConfigSetString(conf, "bootloader", def->os.bootloader) < 0)
+            xenConfigSetString(conf, "bootloader", def->os.bootloader) < 0)
             return -1;
 
          if (def->os.bootloaderArgs &&
@@ -1337,9 +1337,8 @@ xenFormatXLCPUID(virConfPtr conf, virDomainDefPtr def)
 
     j = 1;
     for (i = 0; i < def->cpu->nfeatures; i++) {
-        const char *feature_name = xenTranslateCPUFeature(
-                def->cpu->features[i].name,
-                false);
+        const char *feature_name = xenTranslateCPUFeature(def->cpu->features[i].name,
+                                                          false);
         const char *policy = NULL;
 
         if (STREQ(feature_name, "vmx") || STREQ(feature_name, "svm"))
@@ -1453,7 +1452,7 @@ xenFormatXLVnuma(virConfValuePtr list,
     virBufferAddLit(&buf, "vdistances=");
     for (i = 0; i < nr_nodes; i++) {
         virBufferAsprintf(&buf, "%zu",
-            virDomainNumaGetNodeDistance(numa, node, i));
+                          virDomainNumaGetNodeDistance(numa, node, i));
         if ((nr_nodes - i) > 1)
             virBufferAddLit(&buf, ",");
     }
diff --git a/src/xenconfig/xen_xm.c b/src/xenconfig/xen_xm.c
index 909e8fa..96f046b 100644
--- a/src/xenconfig/xen_xm.c
+++ b/src/xenconfig/xen_xm.c
@@ -424,9 +424,9 @@ xenParseXMInputDevs(virConfPtr conf, virDomainDefPtr def)
         if (xenConfigGetString(conf, "usbdevice", &str, NULL) < 0)
             return -1;
         if (str &&
-                (STREQ(str, "tablet") ||
-                 STREQ(str, "mouse") ||
-                 STREQ(str, "keyboard"))) {
+            (STREQ(str, "tablet") ||
+             STREQ(str, "mouse") ||
+             STREQ(str, "keyboard"))) {
             virDomainInputDefPtr input;
             if (VIR_ALLOC(input) < 0)
                 return -1;
@@ -532,7 +532,7 @@ xenFormatXMOS(virConfPtr conf, virDomainDefPtr def)
         /* XXX floppy disks */
     } else {
         if (def->os.bootloader &&
-             xenConfigSetString(conf, "bootloader", def->os.bootloader) < 0)
+            xenConfigSetString(conf, "bootloader", def->os.bootloader) < 0)
             return -1;
 
          if (def->os.bootloaderArgs &&
-- 
2.17.1


--
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]

  Powered by Linux