[libvirt PATCH v2 09/17] ch_monitor: fix indentation in ch_monitor.c

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

 



Signed-off-by: Praveen K Paladugu <prapal@xxxxxxxxxxxxxxxxxxx>
---
 src/ch/ch_monitor.c | 301 +++++++++++++++++++++++---------------------
 1 file changed, 161 insertions(+), 140 deletions(-)

diff --git a/src/ch/ch_monitor.c b/src/ch/ch_monitor.c
index 12c10da874..68fa5b30aa 100644
--- a/src/ch/ch_monitor.c
+++ b/src/ch/ch_monitor.c
@@ -42,7 +42,8 @@ VIR_LOG_INIT("ch.ch_monitor");
 static virClass *virCHMonitorClass;
 static void virCHMonitorDispose(void *obj);
 
-static int virCHMonitorOnceInit(void)
+static int
+virCHMonitorOnceInit(void)
 {
     if (!VIR_CLASS_NEW(virCHMonitor, virClassForObjectLockable()))
         return -1;
@@ -52,11 +53,11 @@ static int virCHMonitorOnceInit(void)
 
 VIR_ONCE_GLOBAL_INIT(virCHMonitor);
 
-int virCHMonitorShutdownVMM(virCHMonitor *mon);
-int virCHMonitorPutNoContent(virCHMonitor *mon, const char *endpoint);
+int virCHMonitorShutdownVMM(virCHMonitor * mon);
+int virCHMonitorPutNoContent(virCHMonitor * mon, const char *endpoint);
 
 static int
-virCHMonitorBuildCPUJson(virJSONValue *content, virDomainDef *vmdef)
+virCHMonitorBuildCPUJson(virJSONValue * content, virDomainDef * vmdef)
 {
     g_autoptr(virJSONValue) cpus = NULL;
     unsigned int maxvcpus = 0;
@@ -64,7 +65,7 @@ virCHMonitorBuildCPUJson(virJSONValue *content, virDomainDef *vmdef)
     virDomainVcpuDef *vcpu;
     size_t i;
 
-    /* count maximum allowed number vcpus and enabled vcpus when boot.*/
+    /* count maximum allowed number vcpus and enabled vcpus when boot. */
     maxvcpus = virDomainDefGetVcpusMax(vmdef);
     for (i = 0; i < maxvcpus; i++) {
         vcpu = virDomainDefGetVcpu(vmdef, i);
@@ -76,7 +77,8 @@ virCHMonitorBuildCPUJson(virJSONValue *content, virDomainDef *vmdef)
         cpus = virJSONValueNewObject();
         if (virJSONValueObjectAppendNumberInt(cpus, "boot_vcpus", nvcpus) < 0)
             return -1;
-        if (virJSONValueObjectAppendNumberInt(cpus, "max_vcpus", vmdef->maxvcpus) < 0)
+        if (virJSONValueObjectAppendNumberInt
+            (cpus, "max_vcpus", vmdef->maxvcpus) < 0)
             return -1;
         if (virJSONValueObjectAppend(content, "cpus", &cpus) < 0)
             return -1;
@@ -86,7 +88,7 @@ virCHMonitorBuildCPUJson(virJSONValue *content, virDomainDef *vmdef)
 }
 
 static int
-virCHMonitorBuildPTYJson(virJSONValue *content, virDomainDef *vmdef)
+virCHMonitorBuildPTYJson(virJSONValue * content, virDomainDef * vmdef)
 {
     if (vmdef->nconsoles) {
         g_autoptr(virJSONValue) pty = virJSONValueNewObject();
@@ -108,7 +110,7 @@ virCHMonitorBuildPTYJson(virJSONValue *content, virDomainDef *vmdef)
 }
 
 static int
-virCHMonitorBuildKernelRelatedJson(virJSONValue *content, virDomainDef *vmdef)
+virCHMonitorBuildKernelRelatedJson(virJSONValue * content, virDomainDef * vmdef)
 {
     g_autoptr(virJSONValue) kernel = virJSONValueNewObject();
     g_autoptr(virJSONValue) cmdline = virJSONValueNewObject();
@@ -119,21 +121,24 @@ virCHMonitorBuildKernelRelatedJson(virJSONValue *content, virDomainDef *vmdef)
                        _("Kernel image path in this domain is not defined"));
         return -1;
     } else {
-        if (virJSONValueObjectAppendString(kernel, "path", vmdef->os.kernel) < 0)
+        if (virJSONValueObjectAppendString(kernel, "path", vmdef->os.kernel) <
+            0)
             return -1;
         if (virJSONValueObjectAppend(content, "kernel", &kernel) < 0)
             return -1;
     }
 
     if (vmdef->os.cmdline) {
-        if (virJSONValueObjectAppendString(cmdline, "args", vmdef->os.cmdline) < 0)
+        if (virJSONValueObjectAppendString(cmdline, "args", vmdef->os.cmdline) <
+            0)
             return -1;
         if (virJSONValueObjectAppend(content, "cmdline", &cmdline) < 0)
             return -1;
     }
 
     if (vmdef->os.initrd != NULL) {
-        if (virJSONValueObjectAppendString(initramfs, "path", vmdef->os.initrd) < 0)
+        if (virJSONValueObjectAppendString(initramfs, "path", vmdef->os.initrd)
+            < 0)
             return -1;
         if (virJSONValueObjectAppend(content, "initramfs", &initramfs) < 0)
             return -1;
@@ -143,14 +148,16 @@ virCHMonitorBuildKernelRelatedJson(virJSONValue *content, virDomainDef *vmdef)
 }
 
 static int
-virCHMonitorBuildMemoryJson(virJSONValue *content, virDomainDef *vmdef)
+virCHMonitorBuildMemoryJson(virJSONValue * content, virDomainDef * vmdef)
 {
-    unsigned long long total_memory = virDomainDefGetMemoryInitial(vmdef) * 1024;
+    unsigned long long total_memory =
+        virDomainDefGetMemoryInitial(vmdef) * 1024;
 
     if (total_memory != 0) {
         g_autoptr(virJSONValue) memory = virJSONValueNewObject();
 
-        if (virJSONValueObjectAppendNumberUlong(memory, "size", total_memory) < 0)
+        if (virJSONValueObjectAppendNumberUlong(memory, "size", total_memory) <
+            0)
             return -1;
 
         if (virJSONValueObjectAppend(content, "memory", &memory) < 0)
@@ -161,7 +168,7 @@ virCHMonitorBuildMemoryJson(virJSONValue *content, virDomainDef *vmdef)
 }
 
 static int
-virCHMonitorBuildDiskJson(virJSONValue *disks, virDomainDiskDef *diskdef)
+virCHMonitorBuildDiskJson(virJSONValue * disks, virDomainDiskDef * diskdef)
 {
     g_autoptr(virJSONValue) disk = virJSONValueNewObject();
 
@@ -169,44 +176,47 @@ virCHMonitorBuildDiskJson(virJSONValue *disks, virDomainDiskDef *diskdef)
         return -1;
 
     switch (diskdef->src->type) {
-    case VIR_STORAGE_TYPE_FILE:
-        if (!diskdef->src->path) {
-            virReportError(VIR_ERR_INVALID_ARG, "%s",
-                           _("Missing disk file path in domain"));
-            return -1;
-        }
-        if (diskdef->bus != VIR_DOMAIN_DISK_BUS_VIRTIO) {
-            virReportError(VIR_ERR_INVALID_ARG,
-                           _("Only virtio bus types are supported for '%s'"), diskdef->src->path);
-            return -1;
-        }
-        if (virJSONValueObjectAppendString(disk, "path", diskdef->src->path) < 0)
-            return -1;
-        if (diskdef->src->readonly) {
-            if (virJSONValueObjectAppendBoolean(disk, "readonly", true) < 0)
+        case VIR_STORAGE_TYPE_FILE:
+            if (!diskdef->src->path) {
+                virReportError(VIR_ERR_INVALID_ARG, "%s",
+                               _("Missing disk file path in domain"));
+                return -1;
+            }
+            if (diskdef->bus != VIR_DOMAIN_DISK_BUS_VIRTIO) {
+                virReportError(VIR_ERR_INVALID_ARG,
+                               _
+                               ("Only virtio bus types are supported for '%s'"),
+                               diskdef->src->path);
+                return -1;
+            }
+            if (virJSONValueObjectAppendString(disk, "path", diskdef->src->path)
+                < 0)
+                return -1;
+            if (diskdef->src->readonly) {
+                if (virJSONValueObjectAppendBoolean(disk, "readonly", true) < 0)
+                    return -1;
+            }
+            if (virJSONValueArrayAppend(disks, &disk) < 0)
                 return -1;
-        }
-        if (virJSONValueArrayAppend(disks, &disk) < 0)
-            return -1;
 
-        break;
-    case VIR_STORAGE_TYPE_NONE:
-    case VIR_STORAGE_TYPE_BLOCK:
-    case VIR_STORAGE_TYPE_DIR:
-    case VIR_STORAGE_TYPE_NETWORK:
-    case VIR_STORAGE_TYPE_VOLUME:
-    case VIR_STORAGE_TYPE_NVME:
-    case VIR_STORAGE_TYPE_VHOST_USER:
-    default:
-        virReportEnumRangeError(virStorageType, diskdef->src->type);
-        return -1;
+            break;
+        case VIR_STORAGE_TYPE_NONE:
+        case VIR_STORAGE_TYPE_BLOCK:
+        case VIR_STORAGE_TYPE_DIR:
+        case VIR_STORAGE_TYPE_NETWORK:
+        case VIR_STORAGE_TYPE_VOLUME:
+        case VIR_STORAGE_TYPE_NVME:
+        case VIR_STORAGE_TYPE_VHOST_USER:
+        default:
+            virReportEnumRangeError(virStorageType, diskdef->src->type);
+            return -1;
     }
 
     return 0;
 }
 
 static int
-virCHMonitorBuildDisksJson(virJSONValue *content, virDomainDef *vmdef)
+virCHMonitorBuildDisksJson(virJSONValue * content, virDomainDef * vmdef)
 {
     g_autoptr(virJSONValue) disks = NULL;
     size_t i;
@@ -226,76 +236,86 @@ virCHMonitorBuildDisksJson(virJSONValue *content, virDomainDef *vmdef)
 }
 
 static int
-virCHMonitorBuildNetJson(virJSONValue *nets, virDomainNetDef *netdef)
+virCHMonitorBuildNetJson(virJSONValue * nets, virDomainNetDef * netdef)
 {
     virDomainNetType netType = virDomainNetGetActualType(netdef);
     char macaddr[VIR_MAC_STRING_BUFLEN];
+
     g_autoptr(virJSONValue) net = NULL;
 
     // check net type at first
     net = virJSONValueNewObject();
 
     switch (netType) {
-    case VIR_DOMAIN_NET_TYPE_ETHERNET:
-        if (netdef->guestIP.nips == 1) {
-            const virNetDevIPAddr *ip = netdef->guestIP.ips[0];
-            g_autofree char *addr = NULL;
-            virSocketAddr netmask;
-            g_autofree char *netmaskStr = NULL;
-            if (!(addr = virSocketAddrFormat(&ip->address)))
-                return -1;
-            if (virJSONValueObjectAppendString(net, "ip", addr) < 0)
-                return -1;
-
-            if (virSocketAddrPrefixToNetmask(ip->prefix, &netmask, AF_INET) < 0) {
-                virReportError(VIR_ERR_INTERNAL_ERROR,
-                               _("Failed to translate net prefix %d to netmask"),
-                               ip->prefix);
-                return -1;
+        case VIR_DOMAIN_NET_TYPE_ETHERNET:
+            if (netdef->guestIP.nips == 1) {
+                const virNetDevIPAddr *ip = netdef->guestIP.ips[0];
+                g_autofree char *addr = NULL;
+                virSocketAddr netmask;
+                g_autofree char *netmaskStr = NULL;
+
+                if (!(addr = virSocketAddrFormat(&ip->address)))
+                    return -1;
+                if (virJSONValueObjectAppendString(net, "ip", addr) < 0)
+                    return -1;
+
+                if (virSocketAddrPrefixToNetmask(ip->prefix, &netmask, AF_INET)
+                    < 0) {
+                    virReportError(VIR_ERR_INTERNAL_ERROR,
+                                   _
+                                   ("Failed to translate net prefix %d to netmask"),
+                                   ip->prefix);
+                    return -1;
+                }
+                if (!(netmaskStr = virSocketAddrFormat(&netmask)))
+                    return -1;
+                if (virJSONValueObjectAppendString(net, "mask", netmaskStr) < 0)
+                    return -1;
+            } else if (netdef->guestIP.nips > 1) {
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                               _("ethernet type supports a single guest ip"));
             }
-            if (!(netmaskStr = virSocketAddrFormat(&netmask)))
-                return -1;
-            if (virJSONValueObjectAppendString(net, "mask", netmaskStr) < 0)
+            break;
+        case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
+            if ((virDomainChrType) netdef->data.vhostuser->type !=
+                VIR_DOMAIN_CHR_TYPE_UNIX) {
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                               _
+                               ("vhost_user type support UNIX socket in this CH"));
                 return -1;
-        } else if (netdef->guestIP.nips > 1) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                           _("ethernet type supports a single guest ip"));
-        }
-        break;
-    case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
-        if ((virDomainChrType)netdef->data.vhostuser->type != VIR_DOMAIN_CHR_TYPE_UNIX) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                           _("vhost_user type support UNIX socket in this CH"));
+            } else {
+                if (virJSONValueObjectAppendString
+                    (net, "vhost_socket",
+                     netdef->data.vhostuser->data.nix.path) < 0)
+                    return -1;
+                if (virJSONValueObjectAppendBoolean(net, "vhost_user", true) <
+                    0)
+                    return -1;
+            }
+            break;
+        case VIR_DOMAIN_NET_TYPE_BRIDGE:
+        case VIR_DOMAIN_NET_TYPE_NETWORK:
+        case VIR_DOMAIN_NET_TYPE_DIRECT:
+        case VIR_DOMAIN_NET_TYPE_USER:
+        case VIR_DOMAIN_NET_TYPE_SERVER:
+        case VIR_DOMAIN_NET_TYPE_CLIENT:
+        case VIR_DOMAIN_NET_TYPE_MCAST:
+        case VIR_DOMAIN_NET_TYPE_INTERNAL:
+        case VIR_DOMAIN_NET_TYPE_HOSTDEV:
+        case VIR_DOMAIN_NET_TYPE_UDP:
+        case VIR_DOMAIN_NET_TYPE_VDPA:
+        case VIR_DOMAIN_NET_TYPE_LAST:
+        default:
+            virReportEnumRangeError(virDomainNetType, netType);
             return -1;
-        } else {
-            if (virJSONValueObjectAppendString(net, "vhost_socket", netdef->data.vhostuser->data.nix.path) < 0)
-                return -1;
-            if (virJSONValueObjectAppendBoolean(net, "vhost_user", true) < 0)
-                return -1;
-        }
-        break;
-    case VIR_DOMAIN_NET_TYPE_BRIDGE:
-    case VIR_DOMAIN_NET_TYPE_NETWORK:
-    case VIR_DOMAIN_NET_TYPE_DIRECT:
-    case VIR_DOMAIN_NET_TYPE_USER:
-    case VIR_DOMAIN_NET_TYPE_SERVER:
-    case VIR_DOMAIN_NET_TYPE_CLIENT:
-    case VIR_DOMAIN_NET_TYPE_MCAST:
-    case VIR_DOMAIN_NET_TYPE_INTERNAL:
-    case VIR_DOMAIN_NET_TYPE_HOSTDEV:
-    case VIR_DOMAIN_NET_TYPE_UDP:
-    case VIR_DOMAIN_NET_TYPE_VDPA:
-    case VIR_DOMAIN_NET_TYPE_LAST:
-    default:
-        virReportEnumRangeError(virDomainNetType, netType);
-        return -1;
     }
 
     if (netdef->ifname != NULL) {
         if (virJSONValueObjectAppendString(net, "tap", netdef->ifname) < 0)
             return -1;
     }
-    if (virJSONValueObjectAppendString(net, "mac", virMacAddrFormat(&netdef->mac, macaddr)) < 0)
+    if (virJSONValueObjectAppendString
+        (net, "mac", virMacAddrFormat(&netdef->mac, macaddr)) < 0)
         return -1;
 
 
@@ -306,19 +326,24 @@ virCHMonitorBuildNetJson(virJSONValue *nets, virDomainNetDef *netdef)
         }
     }
     if (netdef->driver.virtio.queues) {
-        if (virJSONValueObjectAppendNumberInt(net, "num_queues", netdef->driver.virtio.queues) < 0)
+        if (virJSONValueObjectAppendNumberInt
+            (net, "num_queues", netdef->driver.virtio.queues) < 0)
             return -1;
     }
 
-    if (netdef->driver.virtio.rx_queue_size || netdef->driver.virtio.tx_queue_size) {
-        if (netdef->driver.virtio.rx_queue_size != netdef->driver.virtio.tx_queue_size) {
+    if (netdef->driver.virtio.rx_queue_size
+        || netdef->driver.virtio.tx_queue_size) {
+        if (netdef->driver.virtio.rx_queue_size !=
+            netdef->driver.virtio.tx_queue_size) {
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-               _("virtio rx_queue_size option %d is not same with tx_queue_size %d"),
-               netdef->driver.virtio.rx_queue_size,
-               netdef->driver.virtio.tx_queue_size);
+                           _
+                           ("virtio rx_queue_size option %d is not same with tx_queue_size %d"),
+                           netdef->driver.virtio.rx_queue_size,
+                           netdef->driver.virtio.tx_queue_size);
             return -1;
         }
-        if (virJSONValueObjectAppendNumberInt(net, "queue_size", netdef->driver.virtio.rx_queue_size) < 0)
+        if (virJSONValueObjectAppendNumberInt
+            (net, "queue_size", netdef->driver.virtio.rx_queue_size) < 0)
             return -1;
     }
 
@@ -329,7 +354,7 @@ virCHMonitorBuildNetJson(virJSONValue *nets, virDomainNetDef *netdef)
 }
 
 static int
-virCHMonitorBuildNetsJson(virJSONValue *content, virDomainDef *vmdef)
+virCHMonitorBuildNetsJson(virJSONValue * content, virDomainDef * vmdef)
 {
     g_autoptr(virJSONValue) nets = NULL;
     size_t i;
@@ -349,13 +374,12 @@ virCHMonitorBuildNetsJson(virJSONValue *content, virDomainDef *vmdef)
 }
 
 static int
-virCHMonitorBuildVMJson(virDomainDef *vmdef, char **jsonstr)
+virCHMonitorBuildVMJson(virDomainDef * vmdef, char **jsonstr)
 {
     g_autoptr(virJSONValue) content = virJSONValueNewObject();
 
     if (vmdef == NULL) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("VM is not defined"));
+        virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("VM is not defined"));
         return -1;
     }
 
@@ -391,8 +415,7 @@ chMonitorCreateSocket(const char *socket_path)
     int fd;
 
     if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
-        virReportSystemError(errno, "%s",
-                             _("Unable to create UNIX socket"));
+        virReportSystemError(errno, "%s", _("Unable to create UNIX socket"));
         goto error;
     }
 
@@ -400,19 +423,16 @@ chMonitorCreateSocket(const char *socket_path)
     addr.sun_family = AF_UNIX;
     if (virStrcpyStatic(addr.sun_path, socket_path) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("UNIX socket path '%s' too long"),
-                       socket_path);
+                       _("UNIX socket path '%s' too long"), socket_path);
         goto error;
     }
 
     if (unlink(socket_path) < 0 && errno != ENOENT) {
-        virReportSystemError(errno,
-                             _("Unable to unlink %s"),
-                             socket_path);
+        virReportSystemError(errno, _("Unable to unlink %s"), socket_path);
         goto error;
     }
 
-    if (bind(fd, (struct sockaddr *)&addr, addrlen) < 0) {
+    if (bind(fd, (struct sockaddr *) &addr, addrlen) < 0) {
         virReportSystemError(errno,
                              _("Unable to bind to UNIX socket path '%s'"),
                              socket_path);
@@ -440,7 +460,7 @@ chMonitorCreateSocket(const char *socket_path)
 }
 
 virCHMonitor *
-virCHMonitorNew(virDomainObj *vm, const char *socketdir)
+virCHMonitorNew(virDomainObj * vm, const char *socketdir)
 {
     g_autoptr(virCHMonitor) mon = NULL;
     g_autoptr(virCommand) cmd = NULL;
@@ -453,8 +473,7 @@ virCHMonitorNew(virDomainObj *vm, const char *socketdir)
         return NULL;
 
     if (!vm->def) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("VM is not defined"));
+        virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("VM is not defined"));
         return NULL;
     }
 
@@ -472,8 +491,7 @@ virCHMonitorNew(virDomainObj *vm, const char *socketdir)
     socket_fd = chMonitorCreateSocket(mon->socketpath);
     if (socket_fd < 0) {
         virReportSystemError(errno,
-                             _("Cannot create socket '%s'"),
-                             mon->socketpath);
+                             _("Cannot create socket '%s'"), mon->socketpath);
         return NULL;
     }
 
@@ -494,7 +512,8 @@ virCHMonitorNew(virDomainObj *vm, const char *socketdir)
     return g_steal_pointer(&mon);
 }
 
-static void virCHMonitorDispose(void *opaque)
+static void
+virCHMonitorDispose(void *opaque)
 {
     virCHMonitor *mon = opaque;
 
@@ -502,7 +521,8 @@ static void virCHMonitorDispose(void *opaque)
     virObjectUnref(mon->vm);
 }
 
-void virCHMonitorClose(virCHMonitor *mon)
+void
+virCHMonitorClose(virCHMonitor * mon)
 {
     if (!mon)
         return;
@@ -518,8 +538,7 @@ void virCHMonitorClose(virCHMonitor *mon)
 
     if (mon->socketpath) {
         if (virFileRemove(mon->socketpath, -1, -1) < 0) {
-            VIR_WARN("Unable to remove CH socket file '%s'",
-                     mon->socketpath);
+            VIR_WARN("Unable to remove CH socket file '%s'", mon->socketpath);
         }
         g_free(mon->socketpath);
     }
@@ -528,7 +547,7 @@ void virCHMonitorClose(virCHMonitor *mon)
 }
 
 static int
-virCHMonitorCurlPerform(CURL *handle)
+virCHMonitorCurlPerform(CURL * handle)
 {
     CURLcode errorCode;
     long responseCode = 0;
@@ -547,8 +566,9 @@ virCHMonitorCurlPerform(CURL *handle)
 
     if (errorCode != CURLE_OK) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("curl_easy_getinfo(CURLINFO_RESPONSE_CODE) returned an "
-                         "error: %s (%d)"), curl_easy_strerror(errorCode),
+                       _
+                       ("curl_easy_getinfo(CURLINFO_RESPONSE_CODE) returned an "
+                        "error: %s (%d)"), curl_easy_strerror(errorCode),
                        errorCode);
         return -1;
     }
@@ -564,7 +584,7 @@ virCHMonitorCurlPerform(CURL *handle)
 }
 
 int
-virCHMonitorPutNoContent(virCHMonitor *mon, const char *endpoint)
+virCHMonitorPutNoContent(virCHMonitor * mon, const char *endpoint)
 {
     g_autofree char *url = NULL;
     int responseCode = 0;
@@ -615,13 +635,14 @@ curl_callback(void *contents, size_t size, size_t nmemb, void *userp)
 }
 
 static int
-virCHMonitorGet(virCHMonitor *mon, const char *endpoint, virJSONValue **response)
+virCHMonitorGet(virCHMonitor * mon, const char *endpoint,
+                virJSONValue ** response)
 {
     g_autofree char *url = NULL;
     int responseCode = 0;
     int ret = -1;
     struct curl_slist *headers = NULL;
-    struct curl_data data = {0};
+    struct curl_data data = { 0 };
 
     url = g_strdup_printf("%s/%s", URL_ROOT, endpoint);
 
@@ -638,7 +659,7 @@ virCHMonitorGet(virCHMonitor *mon, const char *endpoint, virJSONValue **response
         headers = curl_slist_append(headers, "Content-Type: application/json");
         curl_easy_setopt(mon->handle, CURLOPT_HTTPHEADER, headers);
         curl_easy_setopt(mon->handle, CURLOPT_WRITEFUNCTION, curl_callback);
-        curl_easy_setopt(mon->handle, CURLOPT_WRITEDATA, (void *)&data);
+        curl_easy_setopt(mon->handle, CURLOPT_WRITEDATA, (void *) &data);
     }
 
     responseCode = virCHMonitorCurlPerform(mon->handle);
@@ -665,13 +686,13 @@ virCHMonitorGet(virCHMonitor *mon, const char *endpoint, virJSONValue **response
 }
 
 int
-virCHMonitorShutdownVMM(virCHMonitor *mon)
+virCHMonitorShutdownVMM(virCHMonitor * mon)
 {
     return virCHMonitorPutNoContent(mon, URL_VMM_SHUTDOWN);
 }
 
 int
-virCHMonitorCreateVM(virCHMonitor *mon)
+virCHMonitorCreateVM(virCHMonitor * mon)
 {
     g_autofree char *url = NULL;
     int responseCode = 0;
@@ -709,31 +730,31 @@ virCHMonitorCreateVM(virCHMonitor *mon)
 }
 
 int
-virCHMonitorBootVM(virCHMonitor *mon)
+virCHMonitorBootVM(virCHMonitor * mon)
 {
     return virCHMonitorPutNoContent(mon, URL_VM_BOOT);
 }
 
 int
-virCHMonitorShutdownVM(virCHMonitor *mon)
+virCHMonitorShutdownVM(virCHMonitor * mon)
 {
     return virCHMonitorPutNoContent(mon, URL_VM_SHUTDOWN);
 }
 
 int
-virCHMonitorRebootVM(virCHMonitor *mon)
+virCHMonitorRebootVM(virCHMonitor * mon)
 {
     return virCHMonitorPutNoContent(mon, URL_VM_REBOOT);
 }
 
 int
-virCHMonitorSuspendVM(virCHMonitor *mon)
+virCHMonitorSuspendVM(virCHMonitor * mon)
 {
     return virCHMonitorPutNoContent(mon, URL_VM_Suspend);
 }
 
 int
-virCHMonitorResumeVM(virCHMonitor *mon)
+virCHMonitorResumeVM(virCHMonitor * mon)
 {
     return virCHMonitorPutNoContent(mon, URL_VM_RESUME);
 }
@@ -748,7 +769,7 @@ virCHMonitorResumeVM(virCHMonitor *mon)
  * Returns 0 on success.
  */
 int
-virCHMonitorGetInfo(virCHMonitor *mon, virJSONValue **info)
+virCHMonitorGetInfo(virCHMonitor * mon, virJSONValue ** info)
 {
     return virCHMonitorGet(mon, URL_VM_INFO, info);
 }
-- 
2.27.0





[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