[libvirt PATCH 4/4] tools: use VIR_ELSIF more

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

 



Nobody pronounces the 'e' anyway.

Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 tools/virsh-checkpoint.c          |   4 +-
 tools/virsh-completer-domain.c    |   2 +-
 tools/virsh-domain-monitor.c      |  10 +--
 tools/virsh-domain.c              | 144 +++++++++++++++---------------
 tools/virsh-host.c                |   8 +-
 tools/virsh-interface.c           |   2 +-
 tools/virsh-network.c             |  12 +--
 tools/virsh-pool.c                |   6 +-
 tools/virsh-secret.c              |   4 +-
 tools/virsh-snapshot.c            |  18 ++--
 tools/virsh.c                     |   6 +-
 tools/virt-admin.c                |   6 +-
 tools/virt-host-validate-bhyve.c  |   6 +-
 tools/virt-host-validate-ch.c     |   2 +-
 tools/virt-host-validate-common.c |  12 +--
 tools/virt-host-validate-qemu.c   |   2 +-
 tools/vsh-table.c                 |   2 +-
 tools/vsh.c                       |  28 +++---
 18 files changed, 137 insertions(+), 137 deletions(-)

diff --git a/tools/virsh-checkpoint.c b/tools/virsh-checkpoint.c
index fd8cd8827f..9a2e11c7d6 100644
--- a/tools/virsh-checkpoint.c
+++ b/tools/virsh-checkpoint.c
@@ -166,7 +166,7 @@ virshParseCheckpointDiskspec(vshControl *ctl,
     for (i = 1; i < narray; i++) {
         if (!checkpoint && STRPREFIX(array[i], "checkpoint="))
             checkpoint = array[i] + strlen("checkpoint=");
-        else if (!bitmap && STRPREFIX(array[i], "bitmap="))
+        VIR_ELSIF (!bitmap && STRPREFIX(array[i], "bitmap="))
             bitmap = array[i] + strlen("bitmap=");
         else
             goto cleanup;
@@ -409,7 +409,7 @@ virshGetCheckpointParent(vshControl *ctl,
         /* API works, and virDomainCheckpointGetName will succeed */
         *parent_name = g_strdup(virDomainCheckpointGetName(parent));
         ret = 0;
-    } else if (last_error->code == VIR_ERR_NO_DOMAIN_CHECKPOINT) {
+    } VIR_ELSIF (last_error->code == VIR_ERR_NO_DOMAIN_CHECKPOINT) {
         /* API works, and we found a root with no parent */
         ret = 0;
     }
diff --git a/tools/virsh-completer-domain.c b/tools/virsh-completer-domain.c
index 620a3a8ddb..852f1729bb 100644
--- a/tools/virsh-completer-domain.c
+++ b/tools/virsh-completer-domain.c
@@ -759,7 +759,7 @@ virshDomainVcpulistViaAgentCompleter(vshControl *ctl,
 
                 cpulist[i] = g_strdup_printf("%zu", j++);
             }
-        } else if (disable) {
+        } VIR_ELSIF (disable) {
             lastcpu = virBitmapLastSetBit(onlineVcpus);
             cpulist = g_new0(char *, virBitmapCountBits(onlineVcpus) + 1);
             for (i = 0; i < virBitmapCountBits(onlineVcpus); i++) {
diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
index e66383af05..ef8e6c8aa1 100644
--- a/tools/virsh-domain-monitor.c
+++ b/tools/virsh-domain-monitor.c
@@ -418,7 +418,7 @@ cmdDomblkinfoGet(const virDomainBlockInfo *info,
         *cap = g_strdup("-");
         *alloc = g_strdup("-");
         *phy = g_strdup("-");
-    } else if (!human) {
+    } VIR_ELSIF (!human) {
         *cap = g_strdup_printf("%llu", info->capacity);
         *alloc = g_strdup_printf("%llu", info->allocation);
         *phy = g_strdup_printf("%llu", info->physical);
@@ -815,7 +815,7 @@ cmdDomIfGetLink(vshControl *ctl, const vshCmd *cmd)
             vshError(ctl, _("Interface (dev: %s) not found."), iface);
 
         return false;
-    } else if (ninterfaces > 1) {
+    } VIR_ELSIF (ninterfaces > 1) {
         vshError(ctl, _("multiple matching interfaces found"));
         return false;
     }
@@ -865,7 +865,7 @@ cmdDomControl(vshControl *ctl, const vshCmd *cmd)
         vshPrint(ctl, "%s (%0.3fs)\n",
                  virshDomainControlStateToString(info.state),
                  info.stateTime / 1000.0);
-    } else if (info.state == VIR_DOMAIN_CONTROL_ERROR && info.details > 0) {
+    } VIR_ELSIF (info.state == VIR_DOMAIN_CONTROL_ERROR && info.details > 0) {
         vshPrint(ctl, "%s: %s\n",
                  virshDomainControlStateToString(info.state),
                  virshDomainControlErrorReasonToString(info.details));
@@ -1436,7 +1436,7 @@ cmdDomTime(vshControl *ctl, const vshCmd *cmd)
     if (rv < 0) {
         /* invalid integer format */
         return false;
-    } else if (rv > 0) {
+    } VIR_ELSIF (rv > 0) {
         /* valid integer to set */
         doSet = true;
     }
@@ -1511,7 +1511,7 @@ virshDomainSorter(const void *a, const void *b)
     if (ida != inactive && idb != inactive) {
         if (ida > idb)
             return 1;
-        else if (ida < idb)
+        VIR_ELSIF (ida < idb)
             return -1;
     }
 
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index bbebd8fd72..58d2cdb703 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -561,7 +561,7 @@ cmdAttachDiskFormatAddress(vshControl *ctl,
                      _("expecting a pci:0000.00.00.00 or ccw:00.0.0000 address."));
             return -1;
         }
-    } else if (STRPREFIX((const char *)target, "sd")) {
+    } VIR_ELSIF (STRPREFIX((const char *)target, "sd")) {
         if (diskAddr.type != VIRSH_ADDRESS_TYPE_SCSI &&
             diskAddr.type != VIRSH_ADDRESS_TYPE_USB &&
             diskAddr.type != VIRSH_ADDRESS_TYPE_SATA) {
@@ -569,7 +569,7 @@ cmdAttachDiskFormatAddress(vshControl *ctl,
                      _("expecting a scsi:00.00.00 or usb:00.00 or sata:00.00.00 address."));
             return -1;
         }
-    } else if (STRPREFIX((const char *)target, "hd")) {
+    } VIR_ELSIF (STRPREFIX((const char *)target, "hd")) {
         if (diskAddr.type != VIRSH_ADDRESS_TYPE_IDE) {
             vshError(ctl, "%s", _("expecting an ide:00.00.00 address."));
             return -1;
@@ -1422,7 +1422,7 @@ cmdBlkdeviotune(vshControl *ctl, const vshCmd *cmd)
     if ((rv = vshCommandOptScaledInt(ctl, cmd, #PARAM, &value, \
                                      1, ULLONG_MAX)) < 0) { \
         goto interror; \
-    } else if (rv > 0) { \
+    } VIR_ELSIF (rv > 0) { \
         if (virTypedParamsAddULLong(&params, &nparams, &maxparams, \
                                     VIR_DOMAIN_BLOCK_IOTUNE_##CONST, \
                                     value) < 0) \
@@ -1440,7 +1440,7 @@ cmdBlkdeviotune(vshControl *ctl, const vshCmd *cmd)
 #define VSH_ADD_IOTUNE(PARAM, CONST) \
     if ((rv = vshCommandOptULongLong(ctl, cmd, #PARAM, &value)) < 0) { \
         goto interror; \
-    } else if (rv > 0) { \
+    } VIR_ELSIF (rv > 0) { \
         if (virTypedParamsAddULLong(&params, &nparams, &maxparams, \
                                     VIR_DOMAIN_BLOCK_IOTUNE_##CONST, \
                                     value) < 0) \
@@ -1609,7 +1609,7 @@ cmdBlkiotune(vshControl * ctl, const vshCmd * cmd)
 
     if ((rv = vshCommandOptInt(ctl, cmd, "weight", &weight)) < 0) {
         goto cleanup;
-    } else if (rv > 0) {
+    } VIR_ELSIF (rv > 0) {
         if (weight <= 0) {
             vshError(ctl, _("Invalid value of %d for I/O weight"), weight);
             goto cleanup;
@@ -1623,7 +1623,7 @@ cmdBlkiotune(vshControl * ctl, const vshCmd * cmd)
     if (rv < 0) {
         vshError(ctl, "%s", _("Unable to parse string parameter"));
         goto cleanup;
-    } else if (rv > 0) {
+    } VIR_ELSIF (rv > 0) {
         if (virTypedParamsAddString(&params, &nparams, &maxparams,
                                     VIR_DOMAIN_BLKIO_DEVICE_WEIGHT,
                                     device_weight) < 0)
@@ -1634,7 +1634,7 @@ cmdBlkiotune(vshControl * ctl, const vshCmd * cmd)
     if (rv < 0) {
         vshError(ctl, "%s", _("Unable to parse string parameter"));
         goto cleanup;
-    } else if (rv > 0) {
+    } VIR_ELSIF (rv > 0) {
         if (virTypedParamsAddString(&params, &nparams, &maxparams,
                                     VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS,
                                     device_riops) < 0)
@@ -1645,7 +1645,7 @@ cmdBlkiotune(vshControl * ctl, const vshCmd * cmd)
     if (rv < 0) {
         vshError(ctl, "%s", _("Unable to parse string parameter"));
         goto cleanup;
-    } else if (rv > 0) {
+    } VIR_ELSIF (rv > 0) {
         if (virTypedParamsAddString(&params, &nparams, &maxparams,
                                     VIR_DOMAIN_BLKIO_DEVICE_WRITE_IOPS,
                                     device_wiops) < 0)
@@ -1656,7 +1656,7 @@ cmdBlkiotune(vshControl * ctl, const vshCmd * cmd)
     if (rv < 0) {
         vshError(ctl, "%s", _("Unable to parse string parameter"));
         goto cleanup;
-    } else if (rv > 0) {
+    } VIR_ELSIF (rv > 0) {
         if (virTypedParamsAddString(&params, &nparams, &maxparams,
                                     VIR_DOMAIN_BLKIO_DEVICE_READ_BPS,
                                     device_rbps) < 0)
@@ -1667,7 +1667,7 @@ cmdBlkiotune(vshControl * ctl, const vshCmd * cmd)
     if (rv < 0) {
         vshError(ctl, "%s", _("Unable to parse string parameter"));
         goto cleanup;
-    } else if (rv > 0) {
+    } VIR_ELSIF (rv > 0) {
         if (virTypedParamsAddString(&params, &nparams, &maxparams,
                                    VIR_DOMAIN_BLKIO_DEVICE_WRITE_BPS,
                                    device_wbps) < 0)
@@ -2211,7 +2211,7 @@ cmdBlockcommit(vshControl *ctl, const vshCmd *cmd)
             }
 
             vshPrintExtra(ctl, "\n%s", _("Successfully pivoted"));
-        } else if (finish) {
+        } VIR_ELSIF (finish) {
             if (virDomainBlockJobAbort(dom, path, abort_flags) < 0) {
                 vshError(ctl, _("failed to finish job for disk %s"), path);
                 goto cleanup;
@@ -2542,7 +2542,7 @@ cmdBlockcopy(vshControl *ctl, const vshCmd *cmd)
         }
 
         vshPrintExtra(ctl, "\n%s", _("Successfully pivoted"));
-    } else if (finish) {
+    } VIR_ELSIF (finish) {
         if (virDomainBlockJobAbort(dom, path, abort_flags) < 0) {
             vshError(ctl, _("failed to finish job for disk %s"), path);
             goto cleanup;
@@ -4106,7 +4106,7 @@ cmdStart(vshControl *ctl, const vshCmd *cmd)
         if (rc < 0) {
             /* No managed save image to remove */
             vshResetLibvirtError();
-        } else if (rc > 0) {
+        } VIR_ELSIF (rc > 0) {
             if (virDomainManagedSaveRemove(dom, 0) < 0) {
                 vshReportError(ctl);
                 return false;
@@ -4118,7 +4118,7 @@ cmdStart(vshControl *ctl, const vshCmd *cmd)
     /* Prefer older API unless we have to pass a flag.  */
     if (nfds > 0) {
         rc = virDomainCreateWithFiles(dom, nfds, fds, flags);
-    } else if (flags != 0) {
+    } VIR_ELSIF (flags != 0) {
         rc = virDomainCreateWithFlags(dom, flags);
     } else {
         rc = virDomainCreate(dom);
@@ -5555,7 +5555,7 @@ virshGenFileName(vshControl *ctl, virDomainPtr dom, const char *mime)
 
     if (STREQ(mime, "image/x-portable-pixmap"))
         ext = ".ppm";
-    else if (STREQ(mime, "image/png"))
+    VIR_ELSIF (STREQ(mime, "image/png"))
         ext = ".png";
     /* add mime type here */
 
@@ -5886,13 +5886,13 @@ cmdShutdown(vshControl *ctl, const vshCmd *cmd)
         mode = *tmp;
         if (STREQ(mode, "acpi")) {
             flags |= VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN;
-        } else if (STREQ(mode, "agent")) {
+        } VIR_ELSIF (STREQ(mode, "agent")) {
             flags |= VIR_DOMAIN_SHUTDOWN_GUEST_AGENT;
-        } else if (STREQ(mode, "initctl")) {
+        } VIR_ELSIF (STREQ(mode, "initctl")) {
             flags |= VIR_DOMAIN_SHUTDOWN_INITCTL;
-        } else if (STREQ(mode, "signal")) {
+        } VIR_ELSIF (STREQ(mode, "signal")) {
             flags |= VIR_DOMAIN_SHUTDOWN_SIGNAL;
-        } else if (STREQ(mode, "paravirt")) {
+        } VIR_ELSIF (STREQ(mode, "paravirt")) {
             flags |= VIR_DOMAIN_SHUTDOWN_PARAVIRT;
         } else {
             vshError(ctl, _("Unknown mode %s value, expecting "
@@ -5966,13 +5966,13 @@ cmdReboot(vshControl *ctl, const vshCmd *cmd)
         mode = *tmp;
         if (STREQ(mode, "acpi")) {
             flags |= VIR_DOMAIN_REBOOT_ACPI_POWER_BTN;
-        } else if (STREQ(mode, "agent")) {
+        } VIR_ELSIF (STREQ(mode, "agent")) {
             flags |= VIR_DOMAIN_REBOOT_GUEST_AGENT;
-        } else if (STREQ(mode, "initctl")) {
+        } VIR_ELSIF (STREQ(mode, "initctl")) {
             flags |= VIR_DOMAIN_REBOOT_INITCTL;
-        } else if (STREQ(mode, "signal")) {
+        } VIR_ELSIF (STREQ(mode, "signal")) {
             flags |= VIR_DOMAIN_REBOOT_SIGNAL;
-        } else if (STREQ(mode, "paravirt")) {
+        } VIR_ELSIF (STREQ(mode, "paravirt")) {
             flags |= VIR_DOMAIN_REBOOT_PARAVIRT;
         } else {
             vshError(ctl, _("Unknown mode %s value, expecting "
@@ -6176,7 +6176,7 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
     if (rc == 0) {
         if (virshDomainJobStatsToDomainJobInfo(params, nparams, &info) < 0)
             goto cleanup;
-    } else if (last_error->code == VIR_ERR_NO_SUPPORT) {
+    } VIR_ELSIF (last_error->code == VIR_ERR_NO_SUPPORT) {
         if (flags != 0 || rawstats) {
             vshError(ctl, "%s",
                      _("Optional flags or --rawstats are not supported by the daemon"));
@@ -6231,7 +6231,7 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
                                       VIR_DOMAIN_JOB_TIME_ELAPSED_NET,
                                       &value)) < 0) {
         goto save_error;
-    } else if (rc) {
+    } VIR_ELSIF (rc) {
         vshPrint(ctl, "%-17s %-12llu ms\n", _("Time elapsed w/o network:"),
                  value);
     }
@@ -6261,7 +6261,7 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
                                           VIR_DOMAIN_JOB_MEMORY_BPS,
                                           &value)) < 0) {
             goto save_error;
-        } else if (rc && value) {
+        } VIR_ELSIF (rc && value) {
             val = vshPrettyCapacity(value, &unit);
             vshPrint(ctl, "%-17s %-.3lf %s/s\n",
                      _("Memory bandwidth:"), val, unit);
@@ -6271,7 +6271,7 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
                                           VIR_DOMAIN_JOB_MEMORY_DIRTY_RATE,
                                           &value)) < 0) {
             goto save_error;
-        } else if (rc) {
+        } VIR_ELSIF (rc) {
             vshPrint(ctl, "%-17s %-12llu pages/s\n", _("Dirty rate:"), value);
         }
 
@@ -6279,7 +6279,7 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
                                           VIR_DOMAIN_JOB_MEMORY_PAGE_SIZE,
                                           &value)) < 0) {
             goto save_error;
-        } else if (rc) {
+        } VIR_ELSIF (rc) {
             vshPrint(ctl, "%-17s %-12llu bytes\n", _("Page size:"), value);
         }
 
@@ -6287,7 +6287,7 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
                                           VIR_DOMAIN_JOB_MEMORY_ITERATION,
                                           &value)) < 0) {
             goto save_error;
-        } else if (rc) {
+        } VIR_ELSIF (rc) {
             vshPrint(ctl, "%-17s %-12llu\n", _("Iteration:"), value);
         }
 
@@ -6295,7 +6295,7 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
                                           VIR_DOMAIN_JOB_MEMORY_POSTCOPY_REQS,
                                           &value)) < 0) {
             goto save_error;
-        } else if (rc) {
+        } VIR_ELSIF (rc) {
             vshPrint(ctl, "%-17s %-12llu\n", _("Postcopy requests:"), value);
         }
     }
@@ -6312,7 +6312,7 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
                                           VIR_DOMAIN_JOB_DISK_BPS,
                                           &value)) < 0) {
             goto save_error;
-        } else if (rc && value) {
+        } VIR_ELSIF (rc && value) {
             val = vshPrettyCapacity(value, &unit);
             vshPrint(ctl, "%-17s %-.3lf %s/s\n",
                      _("File bandwidth:"), val, unit);
@@ -6323,21 +6323,21 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
                                       VIR_DOMAIN_JOB_MEMORY_CONSTANT,
                                       &value)) < 0) {
         goto save_error;
-    } else if (rc) {
+    } VIR_ELSIF (rc) {
         vshPrint(ctl, "%-17s %-12llu\n", _("Constant pages:"), value);
     }
     if ((rc = virTypedParamsGetULLong(params, nparams,
                                       VIR_DOMAIN_JOB_MEMORY_NORMAL,
                                       &value)) < 0) {
         goto save_error;
-    } else if (rc) {
+    } VIR_ELSIF (rc) {
         vshPrint(ctl, "%-17s %-12llu\n", _("Normal pages:"), value);
     }
     if ((rc = virTypedParamsGetULLong(params, nparams,
                                       VIR_DOMAIN_JOB_MEMORY_NORMAL_BYTES,
                                       &value)) < 0) {
         goto save_error;
-    } else if (rc) {
+    } VIR_ELSIF (rc) {
         val = vshPrettyCapacity(value, &unit);
         vshPrint(ctl, "%-17s %-.3lf %s\n", _("Normal data:"), val, unit);
     }
@@ -6346,7 +6346,7 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
                                       VIR_DOMAIN_JOB_DOWNTIME,
                                       &value)) < 0) {
         goto save_error;
-    } else if (rc) {
+    } VIR_ELSIF (rc) {
         if (info.type == VIR_DOMAIN_JOB_COMPLETED) {
             vshPrint(ctl, "%-17s %-12llu ms\n",
                      _("Total downtime:"), value);
@@ -6360,21 +6360,21 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
                                       VIR_DOMAIN_JOB_DOWNTIME_NET,
                                       &value)) < 0)
         goto save_error;
-    else if (rc)
+    VIR_ELSIF (rc)
         vshPrint(ctl, "%-17s %-12llu ms\n", _("Downtime w/o network:"), value);
 
     if ((rc = virTypedParamsGetULLong(params, nparams,
                                       VIR_DOMAIN_JOB_SETUP_TIME,
                                       &value)) < 0)
         goto save_error;
-    else if (rc)
+    VIR_ELSIF (rc)
         vshPrint(ctl, "%-17s %-12llu ms\n", _("Setup time:"), value);
 
     if ((rc = virTypedParamsGetULLong(params, nparams,
                                       VIR_DOMAIN_JOB_COMPRESSION_CACHE,
                                       &value)) < 0) {
         goto save_error;
-    } else if (rc) {
+    } VIR_ELSIF (rc) {
         val = vshPrettyCapacity(value, &unit);
         vshPrint(ctl, "%-17s %-.3lf %s\n", _("Compression cache:"), val, unit);
     }
@@ -6382,7 +6382,7 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
                                       VIR_DOMAIN_JOB_COMPRESSION_BYTES,
                                       &value)) < 0) {
         goto save_error;
-    } else if (rc) {
+    } VIR_ELSIF (rc) {
         val = vshPrettyCapacity(value, &unit);
         vshPrint(ctl, "%-17s %-.3lf %s\n", _("Compressed data:"), val, unit);
     }
@@ -6390,21 +6390,21 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
                                       VIR_DOMAIN_JOB_COMPRESSION_PAGES,
                                       &value)) < 0) {
         goto save_error;
-    } else if (rc) {
+    } VIR_ELSIF (rc) {
         vshPrint(ctl, "%-17s %-13llu\n", _("Compressed pages:"), value);
     }
     if ((rc = virTypedParamsGetULLong(params, nparams,
                                       VIR_DOMAIN_JOB_COMPRESSION_CACHE_MISSES,
                                       &value)) < 0) {
         goto save_error;
-    } else if (rc) {
+    } VIR_ELSIF (rc) {
         vshPrint(ctl, "%-17s %-13llu\n", _("Compression cache misses:"), value);
     }
     if ((rc = virTypedParamsGetULLong(params, nparams,
                                       VIR_DOMAIN_JOB_COMPRESSION_OVERFLOW,
                                       &value)) < 0) {
         goto save_error;
-    } else if (rc) {
+    } VIR_ELSIF (rc) {
         vshPrint(ctl, "%-17s %-13llu\n", _("Compression overflows:"), value);
     }
 
@@ -6412,7 +6412,7 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
                                    VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE,
                                    &ivalue)) < 0) {
         goto save_error;
-    } else if (rc) {
+    } VIR_ELSIF (rc) {
         vshPrint(ctl, "%-17s %-13d\n", _("Auto converge throttle:"), ivalue);
     }
 
@@ -6420,7 +6420,7 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
                                       VIR_DOMAIN_JOB_DISK_TEMP_USED,
                                       &value)) < 0) {
         goto save_error;
-    } else if (rc) {
+    } VIR_ELSIF (rc) {
         val = vshPrettyCapacity(value, &unit);
         vshPrint(ctl, "%-17s %-.3lf %s\n", _("Temporary disk space use:"), val, unit);
     }
@@ -6429,7 +6429,7 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
                                       VIR_DOMAIN_JOB_DISK_TEMP_TOTAL,
                                       &value)) < 0) {
         goto save_error;
-    } else if (rc) {
+    } VIR_ELSIF (rc) {
         val = vshPrettyCapacity(value, &unit);
         vshPrint(ctl, "%-17s %-.3lf %s\n", _("Temporary disk space total:"), val, unit);
     }
@@ -6437,7 +6437,7 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
     if ((rc = virTypedParamsGetString(params, nparams, VIR_DOMAIN_JOB_ERRMSG,
                                       &svalue)) < 0) {
         goto save_error;
-    } else if (rc == 1) {
+    } VIR_ELSIF (rc == 1) {
         vshPrint(ctl, "%-17s %s\n", _("Error message:"), svalue);
     }
 
@@ -7972,7 +7972,7 @@ cmdCPUStats(vshControl *ctl, const vshCmd *cmd)
 
     if ((rv = vshCommandOptInt(ctl, cmd, "start", &cpu)) < 0) {
         goto cleanup;
-    } else if (rv > 0) {
+    } VIR_ELSIF (rv > 0) {
         if (cpu < 0) {
             vshError(ctl, "%s", _("Invalid value for start CPU"));
             goto cleanup;
@@ -7982,7 +7982,7 @@ cmdCPUStats(vshControl *ctl, const vshCmd *cmd)
 
     if ((rv = vshCommandOptInt(ctl, cmd, "count", &show_count)) < 0) {
         goto cleanup;
-    } else if (rv > 0) {
+    } VIR_ELSIF (rv > 0) {
         if (show_count < 0) {
             vshError(ctl, "%s", _("Invalid value for number of CPUs to show"));
             goto cleanup;
@@ -8561,7 +8561,7 @@ cmdMetadata(vshControl *ctl, const vshCmd *cmd)
             vshPrintExtra(ctl, "%s\n", _("Metadata removed"));
         else
             vshPrintExtra(ctl, "%s\n", _("Metadata modified"));
-    } else if (edit) {
+    } VIR_ELSIF (edit) {
 #define EDIT_GET_XML \
         virshDomainGetEditMetadata(ctl, dom, uri, flags)
 #define EDIT_NOT_CHANGED \
@@ -8787,7 +8787,7 @@ static int getSignalNumber(const char *signame)
 
     if (STRPREFIX(p, "sig_"))
         p += 4;
-    else if (STRPREFIX(p, "sig"))
+    VIR_ELSIF (STRPREFIX(p, "sig"))
         p += 3;
 
     return virshDomainProcessSignalTypeFromString(p);
@@ -9036,7 +9036,7 @@ virshGetUpdatedMemoryXML(char **updatedMemoryXML,
 
     if (nodeOpt) {
         xpath = g_strdup_printf("/domain/devices/memory[./target/node='%u']", node);
-    } else if (alias) {
+    } VIR_ELSIF (alias) {
         xpath = g_strdup_printf("/domain/devices/memory[./alias/@name='%s']", alias);
     } else {
         xpath = g_strdup("/domain/devices/memory");
@@ -9046,10 +9046,10 @@ virshGetUpdatedMemoryXML(char **updatedMemoryXML,
     if (nmems < 0) {
         vshSaveLibvirtError();
         return -1;
-    } else if (nmems == 0) {
+    } VIR_ELSIF (nmems == 0) {
         vshError(ctl, _("no memory device found"));
         return -1;
-    } else if (nmems > 1) {
+    } VIR_ELSIF (nmems > 1) {
         vshError(ctl, _("multiple memory devices found, use --alias or --node to select one"));
         return -1;
     }
@@ -9696,7 +9696,7 @@ cmdDomSetLaunchSecState(vshControl * ctl, const vshCmd * cmd)
 
     if ((rv = vshCommandOptULongLong(ctl, cmd, "set-address", &setaddr)) < 0) {
         return false;
-    } else if (rv > 0) {
+    } VIR_ELSIF (rv > 0) {
         if (virTypedParamsAddULLong(&params, &nparams, &maxparams,
                                     VIR_DOMAIN_LAUNCH_SECURITY_SEV_SECRET_SET_ADDRESS,
                                     setaddr) < 0)
@@ -10183,7 +10183,7 @@ cmdQemuAgentCommand(vshControl *ctl, const vshCmd *cmd)
     judge = vshCommandOptInt(ctl, cmd, "timeout", &timeout);
     if (judge < 0)
         goto cleanup;
-    else if (judge > 0)
+    VIR_ELSIF (judge > 0)
         judge = 1;
     if (judge && timeout < 1) {
         vshError(ctl, "%s", _("timeout must be positive"));
@@ -10514,7 +10514,7 @@ cmdDomXMLToNative(vshControl *ctl, const vshCmd *cmd)
 
     if (dom) {
         xmlData = virDomainGetXMLDesc(dom, flags);
-    } else if (xmlFile) {
+    } VIR_ELSIF (xmlFile) {
         if (virFileReadAll(xmlFile, VSH_MAX_XML_FILE, &xmlData) < 0)
             return false;
     } else {
@@ -11018,7 +11018,7 @@ doMigrate(void *opaque)
 
     if ((rv = vshCommandOptInt(ctl, cmd, "comp-mt-level", &intOpt)) < 0) {
         goto out;
-    } else if (rv > 0) {
+    } VIR_ELSIF (rv > 0) {
         if (virTypedParamsAddInt(&params, &nparams, &maxparams,
                                  VIR_MIGRATE_PARAM_COMPRESSION_MT_LEVEL,
                                  intOpt) < 0)
@@ -11027,7 +11027,7 @@ doMigrate(void *opaque)
 
     if ((rv = vshCommandOptInt(ctl, cmd, "comp-mt-threads", &intOpt)) < 0) {
         goto out;
-    } else if (rv > 0) {
+    } VIR_ELSIF (rv > 0) {
         if (virTypedParamsAddInt(&params, &nparams, &maxparams,
                                  VIR_MIGRATE_PARAM_COMPRESSION_MT_THREADS,
                                  intOpt) < 0)
@@ -11036,7 +11036,7 @@ doMigrate(void *opaque)
 
     if ((rv = vshCommandOptInt(ctl, cmd, "comp-mt-dthreads", &intOpt)) < 0) {
         goto out;
-    } else if (rv > 0) {
+    } VIR_ELSIF (rv > 0) {
         if (virTypedParamsAddInt(&params, &nparams, &maxparams,
                                  VIR_MIGRATE_PARAM_COMPRESSION_MT_DTHREADS,
                                  intOpt) < 0)
@@ -11045,7 +11045,7 @@ doMigrate(void *opaque)
 
     if ((rv = vshCommandOptULongLong(ctl, cmd, "comp-xbzrle-cache", &ullOpt)) < 0) {
         goto out;
-    } else if (rv > 0) {
+    } VIR_ELSIF (rv > 0) {
         if (virTypedParamsAddULLong(&params, &nparams, &maxparams,
                                     VIR_MIGRATE_PARAM_COMPRESSION_XBZRLE_CACHE,
                                     ullOpt) < 0)
@@ -11090,7 +11090,7 @@ doMigrate(void *opaque)
 
     if ((rv = vshCommandOptInt(ctl, cmd, "auto-converge-initial", &intOpt)) < 0) {
         goto out;
-    } else if (rv > 0) {
+    } VIR_ELSIF (rv > 0) {
         if (virTypedParamsAddInt(&params, &nparams, &maxparams,
                                  VIR_MIGRATE_PARAM_AUTO_CONVERGE_INITIAL,
                                  intOpt) < 0)
@@ -11099,7 +11099,7 @@ doMigrate(void *opaque)
 
     if ((rv = vshCommandOptInt(ctl, cmd, "auto-converge-increment", &intOpt)) < 0) {
         goto out;
-    } else if (rv > 0) {
+    } VIR_ELSIF (rv > 0) {
         if (virTypedParamsAddInt(&params, &nparams, &maxparams,
                                  VIR_MIGRATE_PARAM_AUTO_CONVERGE_INCREMENT,
                                  intOpt) < 0)
@@ -11108,7 +11108,7 @@ doMigrate(void *opaque)
 
     if ((rv = vshCommandOptULongLong(ctl, cmd, "postcopy-bandwidth", &ullOpt)) < 0) {
         goto out;
-    } else if (rv > 0) {
+    } VIR_ELSIF (rv > 0) {
         if (virTypedParamsAddULLong(&params, &nparams, &maxparams,
                                     VIR_MIGRATE_PARAM_BANDWIDTH_POSTCOPY,
                                     ullOpt) < 0)
@@ -11117,7 +11117,7 @@ doMigrate(void *opaque)
 
     if ((rv = vshCommandOptInt(ctl, cmd, "parallel-connections", &intOpt)) < 0) {
         goto out;
-    } else if (rv > 0) {
+    } VIR_ELSIF (rv > 0) {
         if (virTypedParamsAddInt(&params, &nparams, &maxparams,
                                  VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS,
                                  intOpt) < 0)
@@ -11126,7 +11126,7 @@ doMigrate(void *opaque)
 
     if ((rv = vshCommandOptULongLong(ctl, cmd, "bandwidth", &ullOpt)) < 0) {
         goto out;
-    } else if (rv > 0) {
+    } VIR_ELSIF (rv > 0) {
         if (virTypedParamsAddULLong(&params, &nparams, &maxparams,
                                     VIR_MIGRATE_PARAM_BANDWIDTH,
                                     ullOpt) < 0)
@@ -11312,7 +11312,7 @@ cmdMigrate(vshControl *ctl, const vshCmd *cmd)
         live_flag = true;
     if (vshCommandOptUInt(ctl, cmd, "timeout", &timeout) < 0) {
         goto cleanup;
-    } else if (timeout > 0 && !live_flag) {
+    } VIR_ELSIF (timeout > 0 && !live_flag) {
         vshError(ctl, "%s",
                  _("migrate: Unexpected timeout for offline migration"));
         goto cleanup;
@@ -11325,7 +11325,7 @@ cmdMigrate(vshControl *ctl, const vshCmd *cmd)
     if (timeout > 0) {
         if (timeoutAction == VIRSH_MIGRATE_TIMEOUT_DEFAULT)
             timeoutAction = VIRSH_MIGRATE_TIMEOUT_SUSPEND;
-    } else if (timeoutAction) {
+    } VIR_ELSIF (timeoutAction) {
         vshError(ctl, "%s",
                  _("migrate: Unexpected --timeout-* option without --timeout"));
         goto cleanup;
@@ -11771,9 +11771,9 @@ virshGetOneDisplay(vshControl *ctl,
     /* Then host name or IP */
     if (!listen_addr && !sockpath)
         virBufferAddLit(&buf, "localhost");
-    else if (!sockpath && strchr(listen_addr, ':'))
+    VIR_ELSIF (!sockpath && strchr(listen_addr, ':'))
         virBufferAsprintf(&buf, "[%s]", listen_addr);
-    else if (sockpath)
+    VIR_ELSIF (sockpath)
         virBufferAsprintf(&buf, "%s", sockpath);
     else
         virBufferAsprintf(&buf, "%s", listen_addr);
@@ -12524,7 +12524,7 @@ virshFindDisk(const char *doc,
                         (tmp = virXMLPropString(cur, "dir")) ||
                         (tmp = virXMLPropString(cur, "name"))) {
                     }
-                } else if (virXMLNodeNameEqual(cur, "target")) {
+                } VIR_ELSIF (virXMLNodeNameEqual(cur, "target")) {
                     tmp = virXMLPropString(cur, "dev");
                 }
 
@@ -12600,7 +12600,7 @@ virshUpdateDiskXML(xmlNodePtr disk_node,
 
         if (!source && virXMLNodeNameEqual(tmp, "source"))
             source = tmp;
-        else if (!target_node && virXMLNodeNameEqual(tmp, "target"))
+        VIR_ELSIF (!target_node && virXMLNodeNameEqual(tmp, "target"))
             target_node = tmp;
 
         /*
@@ -12619,7 +12619,7 @@ virshUpdateDiskXML(xmlNodePtr disk_node,
         /* forcibly switch to empty file cdrom */
         source_block = false;
         new_source = NULL;
-    } else if (!new_source) {
+    } VIR_ELSIF (!new_source) {
         vshError(NULL, _("New disk media source was not specified"));
         return NULL;
     }
diff --git a/tools/virsh-host.c b/tools/virsh-host.c
index c537db1516..bccfb8ecf3 100644
--- a/tools/virsh-host.c
+++ b/tools/virsh-host.c
@@ -785,7 +785,7 @@ cmdNodeCpuStats(vshControl *ctl, const vshCmd *cmd)
             if (i == 0) {
                 cpu_stats[field] = params[j].value;
                 present[field] = true;
-            } else if (present[field]) {
+            } VIR_ELSIF (present[field]) {
                 cpu_stats[field] = params[j].value - cpu_stats[field];
             }
         }
@@ -1488,7 +1488,7 @@ cmdNodeMemoryTune(vshControl *ctl, const vshCmd *cmd)
 
     if ((rc = vshCommandOptUInt(ctl, cmd, "shm-pages-to-scan", &value)) < 0) {
         goto cleanup;
-    } else if (rc > 0) {
+    } VIR_ELSIF (rc > 0) {
         if (virTypedParamsAddUInt(&params, &nparams, &maxparams,
                                   VIR_NODE_MEMORY_SHARED_PAGES_TO_SCAN,
                                   value) < 0)
@@ -1497,7 +1497,7 @@ cmdNodeMemoryTune(vshControl *ctl, const vshCmd *cmd)
 
     if ((rc = vshCommandOptUInt(ctl, cmd, "shm-sleep-millisecs", &value)) < 0) {
         goto cleanup;
-    } else if (rc > 0) {
+    } VIR_ELSIF (rc > 0) {
         if (virTypedParamsAddUInt(&params, &nparams, &maxparams,
                                   VIR_NODE_MEMORY_SHARED_SLEEP_MILLISECS,
                                   value) < 0)
@@ -1506,7 +1506,7 @@ cmdNodeMemoryTune(vshControl *ctl, const vshCmd *cmd)
 
     if ((rc = vshCommandOptUInt(ctl, cmd, "shm-merge-across-nodes", &value)) < 0) {
         goto cleanup;
-    } else if (rc > 0) {
+    } VIR_ELSIF (rc > 0) {
         if (virTypedParamsAddUInt(&params, &nparams, &maxparams,
                                   VIR_NODE_MEMORY_SHARED_MERGE_ACROSS_NODES,
                                   value) < 0)
diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c
index 2d65425a0d..3e13fcf85d 100644
--- a/tools/virsh-interface.c
+++ b/tools/virsh-interface.c
@@ -76,7 +76,7 @@ virshCommandOptInterfaceBy(vshControl *ctl, const vshCmd *cmd,
         iface = virInterfaceLookupByName(priv->conn, n);
 
     /* try it by MAC */
-    } else if (is_mac && (flags & VIRSH_BYMAC)) {
+    } VIR_ELSIF (is_mac && (flags & VIRSH_BYMAC)) {
         vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as interface MAC\n",
                  cmd->def->name, optname);
         iface = virInterfaceLookupByMACString(priv->conn, n);
diff --git a/tools/virsh-network.c b/tools/virsh-network.c
index a87c7b599e..fa8cde1c1e 100644
--- a/tools/virsh-network.c
+++ b/tools/virsh-network.c
@@ -768,13 +768,13 @@ cmdNetworkList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
                                   _("yes") : _("no"),
                                   NULL) < 0)
                 goto cleanup;
-        } else if (optUUID) {
+        } VIR_ELSIF (optUUID) {
             if (virNetworkGetUUIDString(network, uuid) < 0) {
                 vshError(ctl, "%s", _("Failed to get network's UUID"));
                 goto cleanup;
             }
             vshPrint(ctl, "%s\n", uuid);
-        } else if (optName) {
+        } VIR_ELSIF (optName) {
             vshPrint(ctl, "%s\n", virNetworkGetName(network));
         }
     }
@@ -1044,10 +1044,10 @@ cmdNetworkUpdate(vshControl *ctl, const vshCmd *cmd)
         else
             vshPrintExtra(ctl, _("Updated network %s persistent config"),
                           virNetworkGetName(network));
-    } else if (live) {
+    } VIR_ELSIF (live) {
         vshPrintExtra(ctl, _("Updated network %s live state"),
                       virNetworkGetName(network));
-    } else if (virNetworkIsActive(network)) {
+    } VIR_ELSIF (virNetworkIsActive(network)) {
         vshPrintExtra(ctl, _("Updated network %s live state"),
                       virNetworkGetName(network));
     } else {
@@ -1429,7 +1429,7 @@ cmdNetworkDHCPLeases(vshControl *ctl, const vshCmd *cmd)
 
         if (lease->type == VIR_IP_ADDR_TYPE_IPV4)
             typestr = "ipv4";
-        else if (lease->type == VIR_IP_ADDR_TYPE_IPV6)
+        VIR_ELSIF (lease->type == VIR_IP_ADDR_TYPE_IPV6)
             typestr = "ipv6";
 
         cidr_format = g_strdup_printf("%s/%d", lease->ipaddr, lease->prefix);
@@ -1769,7 +1769,7 @@ cmdNetworkPortList(vshControl *ctl, const vshCmd *cmd)
         if (optTable) {
             if (vshTableRowAppend(table, uuid, NULL) < 0)
                 goto cleanup;
-        } else if (optUUID) {
+        } VIR_ELSIF (optUUID) {
             vshPrint(ctl, "%s\n", uuid);
         }
     }
diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c
index 4026f9beb3..0273445ae9 100644
--- a/tools/virsh-pool.c
+++ b/tools/virsh-pool.c
@@ -386,15 +386,15 @@ virshBuildPoolXML(vshControl *ctl,
             virBufferAddLit(&buf, "<adapter type='fc_host'");
             if (adapterParent)
                 virBufferAsprintf(&buf, " parent='%s'", adapterParent);
-            else if (adapterParentWwnn && adapterParentWwpn)
+            VIR_ELSIF (adapterParentWwnn && adapterParentWwpn)
                 virBufferAsprintf(&buf, " parent_wwnn='%s' parent_wwpn='%s'",
                                   adapterParentWwnn, adapterParentWwpn);
-            else if (adapterParentFabricWwn)
+            VIR_ELSIF (adapterParentFabricWwn)
                 virBufferAsprintf(&buf, " parent_fabric_wwn='%s'",
                                   adapterParentFabricWwn);
             virBufferAsprintf(&buf, " wwnn='%s' wwpn='%s'/>\n",
                               adapterWwnn, adapterWwpn);
-        } else if (adapterName) {
+        } VIR_ELSIF (adapterName) {
             virBufferAsprintf(&buf, "<adapter type='scsi_host' name='%s'/>\n",
                               adapterName);
         }
diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c
index 0347a2e894..c5db56a90d 100644
--- a/tools/virsh-secret.c
+++ b/tools/virsh-secret.c
@@ -237,7 +237,7 @@ cmdSecretSetValue(vshControl *ctl, const vshCmd *cmd)
         vshError(ctl, _("Passing secret value as command-line argument is insecure!"));
         secret_val = g_strdup(base64);
         secret_len = strlen(secret_val);
-    } else if (filename) {
+    } VIR_ELSIF (filename) {
         ssize_t read_ret;
         if ((read_ret = virFileReadAll(filename, 1024, &secret_val)) < 0) {
             vshSaveLibvirtError();
@@ -245,7 +245,7 @@ cmdSecretSetValue(vshControl *ctl, const vshCmd *cmd)
         }
 
         secret_len = read_ret;
-    } else if (interactive) {
+    } VIR_ELSIF (interactive) {
         vshPrint(ctl, "%s", _("Enter new value for secret:"));
         fflush(stdout);
 
diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c
index 3c0294ad68..2e4cdebda1 100644
--- a/tools/virsh-snapshot.c
+++ b/tools/virsh-snapshot.c
@@ -224,9 +224,9 @@ virshParseSnapshotMemspec(vshControl *ctl, virBuffer *buf, const char *str)
     for (i = 0; i < narray; i++) {
         if (!snapshot && STRPREFIX(array[i], "snapshot="))
             snapshot = array[i] + strlen("snapshot=");
-        else if (!file && STRPREFIX(array[i], "file="))
+        VIR_ELSIF (!file && STRPREFIX(array[i], "file="))
             file = array[i] + strlen("file=");
-        else if (!file && *array[i] == '/')
+        VIR_ELSIF (!file && *array[i] == '/')
             file = array[i];
         else
             goto cleanup;
@@ -265,11 +265,11 @@ virshParseSnapshotDiskspec(vshControl *ctl, virBuffer *buf, const char *str)
     for (i = 1; i < narray; i++) {
         if (!snapshot && STRPREFIX(array[i], "snapshot="))
             snapshot = array[i] + strlen("snapshot=");
-        else if (!driver && STRPREFIX(array[i], "driver="))
+        VIR_ELSIF (!driver && STRPREFIX(array[i], "driver="))
             driver = array[i] + strlen("driver=");
-        else if (!stype && STRPREFIX(array[i], "stype="))
+        VIR_ELSIF (!stype && STRPREFIX(array[i], "stype="))
             stype = array[i] + strlen("stype=");
-        else if (!file && STRPREFIX(array[i], "file="))
+        VIR_ELSIF (!file && STRPREFIX(array[i], "file="))
             file = array[i] + strlen("file=");
         else
             goto cleanup;
@@ -281,7 +281,7 @@ virshParseSnapshotDiskspec(vshControl *ctl, virBuffer *buf, const char *str)
     if (stype) {
         if (STREQ(stype, "block")) {
             isFile = false;
-        } else if (STRNEQ(stype, "file")) {
+        } VIR_ELSIF (STRNEQ(stype, "file")) {
             vshError(ctl, _("Unknown storage type: '%s'"), stype);
             goto cleanup;
         }
@@ -469,7 +469,7 @@ virshLookupSnapshot(vshControl *ctl, const vshCmd *cmd,
 
     if (snapname) {
         *snap = virDomainSnapshotLookupByName(dom, snapname, 0);
-    } else if (current) {
+    } VIR_ELSIF (current) {
         *snap = virDomainSnapshotCurrent(dom, 0);
     } else {
         vshError(ctl, _("--%s or --current is required"), arg);
@@ -565,7 +565,7 @@ cmdSnapshotEdit(vshControl *ctl, const vshCmd *cmd)
     edited_name = virDomainSnapshotGetName(edited);
     if (STREQ(name, edited_name)) {
         vshPrintExtra(ctl, _("Snapshot %s edited.\n"), name);
-    } else if (clone_okay) {
+    } VIR_ELSIF (clone_okay) {
         vshPrintExtra(ctl, _("Snapshot %s cloned to %s.\n"), name,
                       edited_name);
     } else {
@@ -1245,7 +1245,7 @@ virshSnapshotListCollect(vshControl *ctl, virDomainPtr dom,
                                 virshDomainSnapshotFree);
                 VIR_FREE(snaplist->snaps[i].parent);
                 deleted++;
-            } else if (STREQ(snaplist->snaps[i].parent, fromname)) {
+            } VIR_ELSIF (STREQ(snaplist->snaps[i].parent, fromname)) {
                 VIR_FREE(snaplist->snaps[i].parent);
                 changed = true;
             } else {
diff --git a/tools/virsh.c b/tools/virsh.c
index bb80a1eb75..cc5e9d5a94 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -154,7 +154,7 @@ virshConnect(vshControl *ctl, const char *uri, bool readonly)
             err->code == VIR_ERR_AUTH_UNAVAILABLE) {
             VIR_UNLESS ((pkagent = virPolkitAgentCreate()))
                 goto cleanup;
-        } else if (err && err->domain == VIR_FROM_POLKIT &&
+        } VIR_ELSIF (err && err->domain == VIR_FROM_POLKIT &&
                    err->code == VIR_ERR_AUTH_FAILED) {
             authfail++;
         } else {
@@ -215,7 +215,7 @@ virshReconnect(vshControl *ctl, const char *name, bool readonly, bool force)
         ret = virConnectClose(priv->conn);
         if (ret < 0)
             vshError(ctl, "%s", _("Failed to disconnect from the hypervisor"));
-        else if (ret > 0)
+        VIR_ELSIF (ret > 0)
             vshError(ctl, "%s", _("One or more references were leaked after "
                                   "disconnect from the hypervisor"));
     }
@@ -406,7 +406,7 @@ virshDeinit(vshControl *ctl)
         ret = virConnectClose(priv->conn);
         if (ret < 0)
             vshError(ctl, "%s", _("Failed to disconnect from the hypervisor"));
-        else if (ret > 0)
+        VIR_ELSIF (ret > 0)
             vshError(ctl, "%s", _("One or more references were leaked after "
                                   "disconnect from the hypervisor"));
     }
diff --git a/tools/virt-admin.c b/tools/virt-admin.c
index d162be0155..2f6b82a6fe 100644
--- a/tools/virt-admin.c
+++ b/tools/virt-admin.c
@@ -141,7 +141,7 @@ vshAdmDisconnect(vshControl *ctl)
     ret = virAdmConnectClose(priv->conn);
     if (ret < 0)
         vshError(ctl, "%s", _("Failed to disconnect from the admin server"));
-    else if (ret > 0)
+    VIR_ELSIF (ret > 0)
         vshError(ctl, "%s", _("One or more references were leaked after "
                               "disconnect from the hypervisor"));
     priv->conn = NULL;
@@ -491,7 +491,7 @@ cmdSrvThreadpoolSet(vshControl *ctl, const vshCmd *cmd)
     if ((rv = vshCommandOptUInt(ctl, cmd, NAME, &val)) < 0) { \
         vshError(ctl, _("Unable to parse integer parameter '%s'"), NAME); \
         goto cleanup; \
-    } else if (rv > 0) { \
+    } VIR_ELSIF (rv > 0) { \
         if (virTypedParamsAddUInt(&params, &nparams, &maxparams, \
                                   FIELD, val) < 0) \
         goto save_error; \
@@ -899,7 +899,7 @@ cmdSrvClientsSet(vshControl *ctl, const vshCmd *cmd)
     if ((rv = vshCommandOptUInt(ctl, cmd, NAME, &val)) < 0) { \
         vshError(ctl, _("Unable to parse integer parameter '%s'"), NAME); \
         goto cleanup; \
-    } else if (rv > 0) { \
+    } VIR_ELSIF (rv > 0) { \
         if (virTypedParamsAddUInt(&params, &nparams, &maxparams, \
                                   FIELD, val) < 0) \
         goto save_error; \
diff --git a/tools/virt-host-validate-bhyve.c b/tools/virt-host-validate-bhyve.c
index 2f0ec1e36c..16f345b3ed 100644
--- a/tools/virt-host-validate-bhyve.c
+++ b/tools/virt-host-validate-bhyve.c
@@ -60,11 +60,11 @@ int virHostValidateBhyve(void)
 
         if (STREQ(stat.name, "vmm.ko"))
             vmm_loaded = true;
-        else if (STREQ(stat.name, "if_tap.ko"))
+        VIR_ELSIF (STREQ(stat.name, "if_tap.ko"))
             if_tap_loaded = true;
-        else if (STREQ(stat.name, "if_bridge.ko"))
+        VIR_ELSIF (STREQ(stat.name, "if_bridge.ko"))
             if_bridge_loaded = true;
-        else if (STREQ(stat.name, "nmdm.ko"))
+        VIR_ELSIF (STREQ(stat.name, "nmdm.ko"))
             nmdm_loaded = true;
     }
 
diff --git a/tools/virt-host-validate-ch.c b/tools/virt-host-validate-ch.c
index 8b4bb88061..42a6e9110a 100644
--- a/tools/virt-host-validate-ch.c
+++ b/tools/virt-host-validate-ch.c
@@ -74,7 +74,7 @@ int virHostValidateCh(void)
         if (virHostValidateDeviceExists("CH", "/dev/kvm", VIR_HOST_VALIDATE_FAIL,
                                         kvmhint) < 0)
             ret = -1;
-        else if (virHostValidateDeviceAccessible("CH", "/dev/kvm", VIR_HOST_VALIDATE_FAIL,
+        VIR_ELSIF (virHostValidateDeviceAccessible("CH", "/dev/kvm", VIR_HOST_VALIDATE_FAIL,
                                                  _("Check /dev/kvm is world writable or you are in "
                                                    "a group that is allowed to access it")) < 0)
             ret = -1;
diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-common.c
index 25cd60888a..cb0a152ce9 100644
--- a/tools/virt-host-validate-common.c
+++ b/tools/virt-host-validate-common.c
@@ -344,7 +344,7 @@ int virHostValidateIOMMU(const char *hvname,
 
     if (flags && virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_VMX))
         isIntel = true;
-    else if (flags && virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_SVM))
+    VIR_ELSIF (flags && virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_SVM))
         isAMD = true;
 
     if (isIntel) {
@@ -358,7 +358,7 @@ int virHostValidateIOMMU(const char *hvname,
                            "hardware platform");
             return VIR_HOST_VALIDATE_FAILURE(level);
         }
-    } else if (isAMD) {
+    } VIR_ELSIF (isAMD) {
         if (access("/sys/firmware/acpi/tables/IVRS", F_OK) == 0) {
             virHostMsgPass();
             bootarg = "iommu=pt iommu=1";
@@ -369,9 +369,9 @@ int virHostValidateIOMMU(const char *hvname,
                            "hardware platform");
             return VIR_HOST_VALIDATE_FAILURE(level);
         }
-    } else if (ARCH_IS_PPC64(arch)) {
+    } VIR_ELSIF (ARCH_IS_PPC64(arch)) {
         virHostMsgPass();
-    } else if (ARCH_IS_S390(arch)) {
+    } VIR_ELSIF (ARCH_IS_S390(arch)) {
         g_autoptr(DIR) dir = NULL;
 
         /* On s390x, we skip the IOMMU check if there are no PCI
@@ -461,7 +461,7 @@ int virHostValidateSecureGuests(const char *hvname,
 
     if (flags && virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_FACILITY_158))
         hasFac158 = true;
-    else if (flags && virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_SEV))
+    VIR_ELSIF (flags && virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_SEV))
         hasAMDSev = true;
 
     virHostMsgCheck(hvname, "%s", _("for secure guest support"));
@@ -496,7 +496,7 @@ int virHostValidateSecureGuests(const char *hvname,
                                   "support for IBM Secure Execution");
             return VIR_HOST_VALIDATE_FAILURE(level);
         }
-    } else if (hasAMDSev) {
+    } VIR_ELSIF (hasAMDSev) {
         if (virFileReadValueString(&mod_value, "/sys/module/kvm_amd/parameters/sev") < 0) {
             virHostMsgFail(level, "AMD Secure Encrypted Virtualization not "
                                   "supported by the currently used kernel");
diff --git a/tools/virt-host-validate-qemu.c b/tools/virt-host-validate-qemu.c
index b79c941153..a68e9564ab 100644
--- a/tools/virt-host-validate-qemu.c
+++ b/tools/virt-host-validate-qemu.c
@@ -81,7 +81,7 @@ int virHostValidateQEMU(void)
                                         VIR_HOST_VALIDATE_FAIL,
                                         kvmhint) <0)
             ret = -1;
-        else if (virHostValidateDeviceAccessible("QEMU", "/dev/kvm",
+        VIR_ELSIF (virHostValidateDeviceAccessible("QEMU", "/dev/kvm",
                                                  VIR_HOST_VALIDATE_FAIL,
                                                  _("Check /dev/kvm is world writable or you are in "
                                                    "a group that is allowed to access it")) < 0)
diff --git a/tools/vsh-table.c b/tools/vsh-table.c
index 67f5d24071..f60bba5810 100644
--- a/tools/vsh-table.c
+++ b/tools/vsh-table.c
@@ -242,7 +242,7 @@ vshTableSafeEncode(const char *s, size_t *width)
                     *buf++ = *p;
                     (*width)++;
                 }
-            } else if (!iswprint(wc)) {
+            } VIR_ELSIF (!iswprint(wc)) {
                 size_t i;
                 for (i = 0; i < len; i++) {
                     g_snprintf(buf, HEX_ENCODE_LENGTH + 1, "\\x%02x", p[i]);
diff --git a/tools/vsh.c b/tools/vsh.c
index ecd9d3fcb1..b3d74e32d2 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -1051,7 +1051,7 @@ vshCommandOptStringReq(vshControl *ctl,
     /* this should not be propagated here, just to be sure */
     if (ret == -1)
         error = N_("Mandatory option not present");
-    else if (arg && !*arg->data && !(arg->def->flags & VSH_OFLAG_EMPTY_OK))
+    VIR_ELSIF (arg && !*arg->data && !(arg->def->flags & VSH_OFLAG_EMPTY_OK))
         error = N_("Option argument is empty");
 
     if (error) {
@@ -1431,9 +1431,9 @@ vshCommandParse(vshControl *ctl, vshCommandParser *parser, vshCmd **partial)
 
                 vshCmddefOptParse(cmd, &opts_need_arg, &opts_required);
                 VIR_FREE(tkdata);
-            } else if (data_only) {
+            } VIR_ELSIF (data_only) {
                 goto get_data;
-            } else if (tkdata[0] == '-' && tkdata[1] == '-' &&
+            } VIR_ELSIF (tkdata[0] == '-' && tkdata[1] == '-' &&
                        g_ascii_isalnum(tkdata[2])) {
                 char *optstr = strchr(tkdata + 2, '=');
                 size_t opt_index = 0;
@@ -1497,7 +1497,7 @@ vshCommandParse(vshControl *ctl, vshCommandParser *parser, vshCmd **partial)
                         goto syntaxError;
                     }
                 }
-            } else if (tkdata[0] == '-' && tkdata[1] == '-' &&
+            } VIR_ELSIF (tkdata[0] == '-' && tkdata[1] == '-' &&
                        tkdata[2] == '\0') {
                 VIR_FREE(tkdata);
                 data_only = true;
@@ -1686,7 +1686,7 @@ vshCommandStringGetArg(vshControl *ctl, vshCommandParser *parser, char **res,
             single_quote = !single_quote;
             p++;
             continue;
-        } else if (!single_quote && *p == '\\') { /* escape */
+        } VIR_ELSIF (!single_quote && *p == '\\') { /* escape */
             /*
              * The same as in shell, a \ in "" is an escaper,
              * but a \ in '' is not an escaper.
@@ -1696,12 +1696,12 @@ vshCommandStringGetArg(vshControl *ctl, vshCommandParser *parser, char **res,
                 if (report)
                     vshError(ctl, "%s", _("dangling \\"));
                 return VSH_TK_ERROR;
-            } else if (*p == '\n') {
+            } VIR_ELSIF (*p == '\n') {
                 /* Elide backslash-newline entirely */
                 p++;
                 continue;
             }
-        } else if (!single_quote && *p == '"') { /* double quote */
+        } VIR_ELSIF (!single_quote && *p == '"') { /* double quote */
             double_quote = !double_quote;
             p++;
             continue;
@@ -2357,7 +2357,7 @@ vshAskReedit(vshControl *ctl, const char *msg, bool relax_avail)
                         _("? - print this help"),
                         NULL);
             continue;
-        } else if (c == 'y' || c == 'n' || c == 'f' ||
+        } VIR_ELSIF (c == 'y' || c == 'n' || c == 'f' ||
                    (relax_avail && c == 'i')) {
             break;
         }
@@ -2770,9 +2770,9 @@ vshReadlineParse(const char *text, int state)
 
         VIR_UNLESS (cmd) {
             list = vshReadlineCommandGenerator();
-        } else if (!opt || opt->type == VSH_OT_BOOL) {
+        } VIR_ELSIF (!opt || opt->type == VSH_OT_BOOL) {
             list = vshReadlineOptionsGenerator(cmd, partial);
-        } else if (opt && opt->completer) {
+        } VIR_ELSIF (opt && opt->completer) {
             list = opt->completer(autoCompleteOpaque,
                                   partial,
                                   opt->completer_flags);
@@ -2866,7 +2866,7 @@ vshReadlineInit(vshControl *ctl)
         if (virStrToLong_i(histsize_str, NULL, 10, &max_history) < 0) {
             vshError(ctl, _("Bad $%s value."), histsize_env);
             return -1;
-        } else if (max_history > HISTSIZE_MAX || max_history < 0) {
+        } VIR_ELSIF (max_history > HISTSIZE_MAX || max_history < 0) {
             vshError(ctl, _("$%s value should be between 0 "
                             "and %d"),
                      histsize_env, HISTSIZE_MAX);
@@ -3123,7 +3123,7 @@ cmdHelp(vshControl *ctl, const vshCmd *cmd)
         if (def->flags & VSH_CMD_FLAG_ALIAS)
             def = vshCmddefSearch(def->alias);
         return vshCmddefHelp(def);
-    } else if ((grp = vshCmdGrpSearch(name))) {
+    } VIR_ELSIF ((grp = vshCmdGrpSearch(name))) {
         return vshCmdGrpHelp(ctl, grp);
     } else {
         vshError(ctl, _("command or command group '%s' doesn't exist"), name);
@@ -3239,9 +3239,9 @@ cmdEcho(vshControl *ctl, const vshCmd *cmd)
 
         if (xml) {
             virBufferEscapeString(&buf, "%s", curr);
-        } else if (shell) {
+        } VIR_ELSIF (shell) {
             virBufferEscapeShell(&buf, curr);
-        } else if (split) {
+        } VIR_ELSIF (split) {
             g_auto(GStrv) spl = NULL;
             GStrv n;
 
-- 
2.34.1




[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