[PATCH 04/11] maint: fix comma style issues: qemu

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

 



Most of our code base uses space after comma but not before;
fix the remaining uses before adding a syntax check.

* src/qemu/qemu_cgroup.c: Consistently use commas.
* src/qemu/qemu_command.c: Likewise.
* src/qemu/qemu_conf.c: Likewise.
* src/qemu/qemu_driver.c: Likewise.
* src/qemu/qemu_monitor.c: Likewise.

Signed-off-by: Eric Blake <eblake@xxxxxxxxxx>
---
 src/qemu/qemu_cgroup.c  |  2 +-
 src/qemu/qemu_command.c |  4 ++--
 src/qemu/qemu_conf.c    |  3 ++-
 src/qemu/qemu_driver.c  |  2 +-
 src/qemu/qemu_monitor.c | 12 ++++++------
 5 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index ace7e35..f0cacd0 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -417,7 +417,7 @@ qemuSetupMemoryCgroup(virDomainObjPtr vm)
 {
     qemuDomainObjPrivatePtr priv = vm->privateData;

-    if (!virCgroupHasController(priv->cgroup,VIR_CGROUP_CONTROLLER_MEMORY)) {
+    if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_MEMORY)) {
         if (vm->def->mem.hard_limit != 0 ||
             vm->def->mem.soft_limit != 0 ||
             vm->def->mem.swap_hard_limit != 0) {
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 6668fed..bf325a9 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1149,7 +1149,7 @@ int qemuDomainCCWAddressAssign(virDomainDeviceInfoPtr dev,
         return 0;
     }

-    if (virHashAddEntry(addrs->defined,addr,addr) < 0)
+    if (virHashAddEntry(addrs->defined, addr, addr) < 0)
         goto cleanup;
     else
         addr = NULL; /* memory will be freed by hash table */
@@ -1179,7 +1179,7 @@ qemuDomainPrimeVirtioDeviceAddresses(virDomainDefPtr def,
     }

     for (i = 0; i < def->nnets; i++) {
-        if (STREQ(def->nets[i]->model,"virtio") &&
+        if (STREQ(def->nets[i]->model, "virtio") &&
             def->nets[i]->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
             def->nets[i]->info.type = type;
         }
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 03c9c7d..5803850 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -216,7 +216,8 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
     if (VIR_STRDUP(cfg->spiceListen, "127.0.0.1") < 0)
         goto error;

-    if (VIR_STRDUP(cfg->spiceTLSx509certdir , SYSCONFDIR "/pki/libvirt-spice") < 0)
+    if (VIR_STRDUP(cfg->spiceTLSx509certdir,
+                   SYSCONFDIR "/pki/libvirt-spice") < 0)
         goto error;

     cfg->remotePortMin = QEMU_REMOTE_PORT_MIN;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 378b542..795e72a 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1918,7 +1918,7 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags)
     int agentFlag = QEMU_AGENT_SHUTDOWN_REBOOT;

     virCheckFlags(VIR_DOMAIN_REBOOT_ACPI_POWER_BTN |
-                  VIR_DOMAIN_REBOOT_GUEST_AGENT , -1);
+                  VIR_DOMAIN_REBOOT_GUEST_AGENT, -1);

     /* At most one of these two flags should be set.  */
     if ((flags & VIR_DOMAIN_REBOOT_ACPI_POWER_BTN) &&
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index f7bf49a..1514715 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -239,8 +239,8 @@ static char * qemuMonitorEscapeNonPrintable(const char *text)
     for (i = 0; text[i] != '\0'; i++) {
         if (c_isprint(text[i]) ||
             text[i] == '\n' ||
-            (text[i] == '\r' && text[i+1] == '\n'))
-            virBufferAsprintf(&buf,"%c", text[i]);
+            (text[i] == '\r' && text[i + 1] == '\n'))
+            virBufferAddChar(&buf, text[i]);
         else
             virBufferAsprintf(&buf, "0x%02x", text[i]);
     }
@@ -3040,7 +3040,7 @@ int qemuMonitorCreateSnapshot(qemuMonitorPtr mon, const char *name)
 {
     int ret;

-    VIR_DEBUG("mon=%p, name=%s",mon,name);
+    VIR_DEBUG("mon=%p, name=%s", mon, name);

     if (!mon) {
         virReportError(VIR_ERR_INVALID_ARG, "%s",
@@ -3059,7 +3059,7 @@ int qemuMonitorLoadSnapshot(qemuMonitorPtr mon, const char *name)
 {
     int ret;

-    VIR_DEBUG("mon=%p, name=%s",mon,name);
+    VIR_DEBUG("mon=%p, name=%s", mon, name);

     if (!mon) {
         virReportError(VIR_ERR_INVALID_ARG, "%s",
@@ -3078,7 +3078,7 @@ int qemuMonitorDeleteSnapshot(qemuMonitorPtr mon, const char *name)
 {
     int ret;

-    VIR_DEBUG("mon=%p, name=%s",mon,name);
+    VIR_DEBUG("mon=%p, name=%s", mon, name);

     if (!mon) {
         virReportError(VIR_ERR_INVALID_ARG, "%s",
@@ -3276,7 +3276,7 @@ int qemuMonitorScreendump(qemuMonitorPtr mon,
     VIR_DEBUG("mon=%p, file=%s", mon, file);

     if (!mon) {
-        virReportError(VIR_ERR_INVALID_ARG,"%s",
+        virReportError(VIR_ERR_INVALID_ARG, "%s",
                        _("monitor must not be NULL"));
         return -1;
     }
-- 
1.8.3.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]