[PATCH 17/22] vz: 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/vz/vz_driver.c | 14 +++++++-------
 src/vz/vz_sdk.c    | 26 ++++++++++++++------------
 src/vz/vz_utils.c  |  2 +-
 3 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index bedc631..0900ff3 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -1844,8 +1844,8 @@ vzDomainBlockStatsFlags(virDomainPtr domain,
 
 static int
 vzDomainInterfaceStats(virDomainPtr domain,
-                         const char *device,
-                         virDomainInterfaceStatsPtr stats)
+                       const char *device,
+                       virDomainInterfaceStatsPtr stats)
 {
     virDomainObjPtr dom = NULL;
     vzDomObjPtr privdom;
@@ -2157,8 +2157,8 @@ vzSnapObjFromSnapshot(virDomainSnapshotObjListPtr snapshots,
 
 static int
 vzCurrentSnapshotIterator(void *payload,
-                              const void *name ATTRIBUTE_UNUSED,
-                              void *data)
+                          const void *name ATTRIBUTE_UNUSED,
+                          void *data)
 {
     virDomainSnapshotObjPtr snapshot = payload;
     virDomainSnapshotObjPtr *current = data;
@@ -2569,7 +2569,7 @@ vzDomainSnapshotIsCurrent(virDomainSnapshotPtr snapshot, unsigned int flags)
 
 static int
 vzDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot,
-                              unsigned int flags)
+                            unsigned int flags)
 {
     virDomainObjPtr dom;
     int ret = -1;
@@ -2790,8 +2790,8 @@ vzBakeCookie(vzDriverPtr driver,
     if (flags & VZ_MIGRATION_COOKIE_DOMAIN_NAME) {
         /* if dom is NULL just pass some name for backward compat.
          * It is not used by peer */
-        virBufferAsprintf(&buf, "<name>%s</name>\n", dom ? dom->def->name :
-                                                           "__fakename__");
+        virBufferAsprintf(&buf, "<name>%s</name>\n",
+                          dom ? dom->def->name : "__fakename__");
     }
 
     virBufferAdjustIndent(&buf, -2);
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index 5ca906e..e73a750 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -1003,8 +1003,8 @@ prlsdkGetRoutes(PRL_HANDLE sdknet, virDomainNetDefPtr net)
     if (*gw != '\0') {
 
         if (!(route = virNetDevIPRouteCreate(_("Domain interface"),
-                                               "ipv4", VIR_SOCKET_ADDR_IPV4_ALL,
-                                               NULL, gw, 0, true, 0, false)))
+                                             "ipv4", VIR_SOCKET_ADDR_IPV4_ALL,
+                                             NULL, gw, 0, true, 0, false)))
             goto cleanup;
 
         if (VIR_APPEND_ELEMENT(net->guestIP.routes, net->guestIP.nroutes, route) < 0)
@@ -1013,8 +1013,8 @@ prlsdkGetRoutes(PRL_HANDLE sdknet, virDomainNetDefPtr net)
 
     if (*gw6 != '\0') {
         if (!(route = virNetDevIPRouteCreate(_("Domain interface"),
-                                               "ipv6", VIR_SOCKET_ADDR_IPV6_ALL,
-                                               NULL, gw6, 0, true, 0, false)))
+                                             "ipv6", VIR_SOCKET_ADDR_IPV6_ALL,
+                                             NULL, gw6, 0, true, 0, false)))
             goto cleanup;
 
         if (VIR_APPEND_ELEMENT(net->guestIP.routes, net->guestIP.nroutes, route) < 0)
@@ -2897,7 +2897,7 @@ static int prlsdkCheckSerialUnsupportedParams(virDomainChrDefPtr chr)
     }
 
    if (chr->source->type == VIR_DOMAIN_CHR_TYPE_TCP &&
-        chr->source->data.tcp.protocol != VIR_DOMAIN_CHR_TCP_PROTOCOL_RAW) {
+       chr->source->data.tcp.protocol != VIR_DOMAIN_CHR_TCP_PROTOCOL_RAW) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                        _("Protocol '%s' is not supported for "
                          "tcp character device."),
@@ -3078,8 +3078,9 @@ static int prlsdkApplyGraphicsParams(PRL_HANDLE sdkdom,
     }
 
     glisten = virDomainGraphicsGetListen(gr, 0);
-    pret = PrlVmCfg_SetVNCHostName(sdkdom, glisten && glisten->address ?
-                                           glisten->address : VIR_LOOPBACK_IPV4_ADDR);
+    pret = PrlVmCfg_SetVNCHostName(sdkdom,
+                                   glisten && glisten->address ?
+                                   glisten->address : VIR_LOOPBACK_IPV4_ADDR);
     prlsdkCheckRetGoto(pret, cleanup);
 
     ret = 0;
@@ -3219,10 +3220,10 @@ static int prlsdkConfigureGateways(PRL_HANDLE sdknet, virDomainNetDefPtr net)
         gateway = virNetDevIPRouteGetGateway(net->guestIP.routes[i]);
 
         ignore_value(virSocketAddrParse(&zero,
-                                (VIR_SOCKET_ADDR_IS_FAMILY(addrdst, AF_INET)
-                                 ? VIR_SOCKET_ADDR_IPV4_ALL
-                                 : VIR_SOCKET_ADDR_IPV6_ALL),
-                                VIR_SOCKET_ADDR_FAMILY(addrdst)));
+                                        (VIR_SOCKET_ADDR_IS_FAMILY(addrdst, AF_INET)
+                                         ? VIR_SOCKET_ADDR_IPV4_ALL
+                                         : VIR_SOCKET_ADDR_IPV6_ALL),
+                                        VIR_SOCKET_ADDR_FAMILY(addrdst)));
         /* virSocketAddrParse raises an error
          * and we are not going to report it, reset it expicitly*/
         virResetLastError();
@@ -3419,7 +3420,8 @@ static int prlsdkConfigureNet(vzDriverPtr driver ATTRIBUTE_UNUSED,
     }
 
     pret = PrlVmDevNet_SetPktFilterPreventMacSpoof(sdknet,
-                net->trustGuestRxFilters == VIR_TRISTATE_BOOL_YES);
+                                                   (net->trustGuestRxFilters ==
+                                                    VIR_TRISTATE_BOOL_YES));
     prlsdkCheckRetGoto(pret, cleanup);
 
     ret = 0;
diff --git a/src/vz/vz_utils.c b/src/vz/vz_utils.c
index 13f5dee..384badd 100644
--- a/src/vz/vz_utils.c
+++ b/src/vz/vz_utils.c
@@ -481,7 +481,7 @@ int vzGetDefaultSCSIModel(vzDriverPtr driver,
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Unknown SCSI controller model %s"),
                        virDomainControllerModelSCSITypeToString(
-                           driver->vzCaps.scsiControllerModel));
+                        driver->vzCaps.scsiControllerModel));
         return -1;
     }
     return 0;
-- 
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