In some places we separate functions with only one line, in others with three lines and the rest uses two lines. Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx> --- src/hyperv/hyperv_driver.c | 50 +++++++++----------------------------- src/hyperv/hyperv_util.c | 1 - src/hyperv/hyperv_wmi.c | 20 +++++++++++++-- 3 files changed, 30 insertions(+), 41 deletions(-) diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index d08b6cff2e..b8cd213758 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -86,6 +86,7 @@ hypervGetProcessorsByName(hypervPrivate *priv, const char *name, return 0; } + static int hypervGetActiveVirtualSystemList(hypervPrivate *priv, Msvm_ComputerSystem **computerSystemList) @@ -106,6 +107,7 @@ hypervGetActiveVirtualSystemList(hypervPrivate *priv, return 0; } + /* gets all the vms including the ones that are marked inactive. */ static int hypervGetInactiveVirtualSystemList(hypervPrivate *priv, @@ -127,6 +129,7 @@ hypervGetInactiveVirtualSystemList(hypervPrivate *priv, return 0; } + static int hypervGetPhysicalSystemList(hypervPrivate *priv, Win32_ComputerSystem **computerSystemList) @@ -145,6 +148,7 @@ hypervGetPhysicalSystemList(hypervPrivate *priv, return 0; } + static int hypervGetVirtualSystemByID(hypervPrivate *priv, int id, Msvm_ComputerSystem **computerSystemList) @@ -167,6 +171,7 @@ hypervGetVirtualSystemByID(hypervPrivate *priv, int id, return 0; } + static int hypervGetVirtualSystemByUUID(hypervPrivate *priv, const char *uuid, Msvm_ComputerSystem **computerSystemList) @@ -214,6 +219,7 @@ hypervGetVirtualSystemByName(hypervPrivate *priv, const char *name, return 0; } + static int hypervGetVSSDFromUUID(hypervPrivate *priv, const char *uuid, Msvm_VirtualSystemSettingData **data) @@ -238,6 +244,7 @@ hypervGetVSSDFromUUID(hypervPrivate *priv, const char *uuid, return 0; } + static int hypervGetProcSDByVSSDInstanceId(hypervPrivate *priv, const char *id, Msvm_ProcessorSettingData **data) @@ -262,6 +269,7 @@ hypervGetProcSDByVSSDInstanceId(hypervPrivate *priv, const char *id, return 0; } + static int hypervGetMemSDByVSSDInstanceId(hypervPrivate *priv, const char *id, Msvm_MemorySettingData **data) @@ -333,6 +341,7 @@ hypervParseVersionString(const char *str, unsigned int *major, return 0; } + static int hypervLookupHostSystemBiosUuid(hypervPrivate *priv, unsigned char *uuid) { @@ -358,6 +367,7 @@ hypervLookupHostSystemBiosUuid(hypervPrivate *priv, unsigned char *uuid) return result; } + static virCapsPtr hypervCapsInit(hypervPrivate *priv) { @@ -397,8 +407,6 @@ hypervCapsInit(hypervPrivate *priv) return NULL; } - - /* * Driver functions */ @@ -419,6 +427,7 @@ hypervFreePrivate(hypervPrivate **priv) VIR_FREE(*priv); } + static int hypervInitConnection(virConnectPtr conn, hypervPrivate *priv, char *username, char *password) @@ -478,6 +487,7 @@ hypervInitConnection(virConnectPtr conn, hypervPrivate *priv, return ret; } + static virDrvOpenStatus hypervConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, virConfPtr conf G_GNUC_UNUSED, @@ -543,7 +553,6 @@ hypervConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, } - static int hypervConnectClose(virConnectPtr conn) { @@ -557,7 +566,6 @@ hypervConnectClose(virConnectPtr conn) } - static const char * hypervConnectGetType(virConnectPtr conn G_GNUC_UNUSED) { @@ -565,7 +573,6 @@ hypervConnectGetType(virConnectPtr conn G_GNUC_UNUSED) } - static int hypervConnectGetVersion(virConnectPtr conn, unsigned long *version) { @@ -628,7 +635,6 @@ hypervConnectGetVersion(virConnectPtr conn, unsigned long *version) } - static char * hypervConnectGetHostname(virConnectPtr conn) { @@ -648,7 +654,6 @@ hypervConnectGetHostname(virConnectPtr conn) } - static char* hypervConnectGetCapabilities(virConnectPtr conn) { @@ -658,7 +663,6 @@ hypervConnectGetCapabilities(virConnectPtr conn) } - static int hypervConnectGetMaxVcpus(virConnectPtr conn, const char *type G_GNUC_UNUSED) { @@ -691,7 +695,6 @@ hypervConnectGetMaxVcpus(virConnectPtr conn, const char *type G_GNUC_UNUSED) } - static int hypervNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info) { @@ -766,7 +769,6 @@ hypervNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info) } - static int hypervConnectListDomains(virConnectPtr conn, int *ids, int maxids) { @@ -799,7 +801,6 @@ hypervConnectListDomains(virConnectPtr conn, int *ids, int maxids) } - static int hypervConnectNumOfDomains(virConnectPtr conn) { @@ -826,7 +827,6 @@ hypervConnectNumOfDomains(virConnectPtr conn) } - static virDomainPtr hypervDomainLookupByID(virConnectPtr conn, int id) { @@ -846,7 +846,6 @@ hypervDomainLookupByID(virConnectPtr conn, int id) } - static virDomainPtr hypervDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid) { @@ -869,7 +868,6 @@ hypervDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid) } - static virDomainPtr hypervDomainLookupByName(virConnectPtr conn, const char *name) { @@ -889,7 +887,6 @@ hypervDomainLookupByName(virConnectPtr conn, const char *name) } - static int hypervDomainSuspend(virDomainPtr domain) { @@ -909,7 +906,6 @@ hypervDomainSuspend(virDomainPtr domain) } - static int hypervDomainResume(virDomainPtr domain) { @@ -1019,7 +1015,6 @@ hypervDomainShutdown(virDomainPtr domain) } - static int hypervDomainReboot(virDomainPtr domain, unsigned int flags) { @@ -1028,7 +1023,6 @@ hypervDomainReboot(virDomainPtr domain, unsigned int flags) } - static int hypervDomainReset(virDomainPtr domain, unsigned int flags) { @@ -1037,7 +1031,6 @@ hypervDomainReset(virDomainPtr domain, unsigned int flags) } - static int hypervDomainDestroyFlags(virDomainPtr domain, unsigned int flags) { @@ -1068,7 +1061,6 @@ hypervDomainDestroyFlags(virDomainPtr domain, unsigned int flags) } - static int hypervDomainDestroy(virDomainPtr domain) { @@ -1076,7 +1068,6 @@ hypervDomainDestroy(virDomainPtr domain) } - static char * hypervDomainGetOSType(virDomainPtr domain G_GNUC_UNUSED) { @@ -1087,7 +1078,6 @@ hypervDomainGetOSType(virDomainPtr domain G_GNUC_UNUSED) } - static int hypervDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) { @@ -1143,7 +1133,6 @@ hypervDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) } - static int hypervDomainGetState(virDomainPtr domain, int *state, int *reason, unsigned int flags) @@ -1171,7 +1160,6 @@ hypervDomainGetState(virDomainPtr domain, int *state, int *reason, } - static char * hypervDomainGetXMLDesc(virDomainPtr domain, unsigned int flags) { @@ -1284,7 +1272,6 @@ hypervDomainGetXMLDesc(virDomainPtr domain, unsigned int flags) } - static int hypervConnectListDefinedDomains(virConnectPtr conn, char **const names, int maxnames) { @@ -1327,7 +1314,6 @@ hypervConnectListDefinedDomains(virConnectPtr conn, char **const names, int maxn } - static int hypervConnectNumOfDefinedDomains(virConnectPtr conn) { @@ -1354,7 +1340,6 @@ hypervConnectNumOfDefinedDomains(virConnectPtr conn) } - static int hypervDomainCreateWithFlags(virDomainPtr domain, unsigned int flags) { @@ -1383,7 +1368,6 @@ hypervDomainCreateWithFlags(virDomainPtr domain, unsigned int flags) } - static int hypervDomainCreate(virDomainPtr domain) { @@ -1391,7 +1375,6 @@ hypervDomainCreate(virDomainPtr domain) } - static int hypervDomainGetAutostart(virDomainPtr domain, int *autostart) { @@ -1549,7 +1532,6 @@ hypervConnectIsEncrypted(virConnectPtr conn) } - static int hypervConnectIsSecure(virConnectPtr conn) { @@ -1563,7 +1545,6 @@ hypervConnectIsSecure(virConnectPtr conn) } - static int hypervConnectIsAlive(virConnectPtr conn) { @@ -1580,7 +1561,6 @@ hypervConnectIsAlive(virConnectPtr conn) } - static int hypervDomainIsActive(virDomainPtr domain) { @@ -1600,7 +1580,6 @@ hypervDomainIsActive(virDomainPtr domain) } - static int hypervDomainIsPersistent(virDomainPtr domain G_GNUC_UNUSED) { @@ -1609,7 +1588,6 @@ hypervDomainIsPersistent(virDomainPtr domain G_GNUC_UNUSED) } - static int hypervDomainIsUpdated(virDomainPtr domain G_GNUC_UNUSED) { @@ -1617,7 +1595,6 @@ hypervDomainIsUpdated(virDomainPtr domain G_GNUC_UNUSED) } - static int hypervDomainManagedSave(virDomainPtr domain, unsigned int flags) { @@ -1657,7 +1634,6 @@ hypervDomainManagedSave(virDomainPtr domain, unsigned int flags) } - static int hypervDomainHasManagedSaveImage(virDomainPtr domain, unsigned int flags) { @@ -1680,7 +1656,6 @@ hypervDomainHasManagedSaveImage(virDomainPtr domain, unsigned int flags) } - static int hypervDomainManagedSaveRemove(virDomainPtr domain, unsigned int flags) { @@ -2099,7 +2074,6 @@ static virHypervisorDriver hypervHypervisorDriver = { }; - static void hypervDebugHandler(const char *message, debug_level_e level, void *user_data G_GNUC_UNUSED) diff --git a/src/hyperv/hyperv_util.c b/src/hyperv/hyperv_util.c index 56c9e8bebd..d8a6e6cf5c 100644 --- a/src/hyperv/hyperv_util.c +++ b/src/hyperv/hyperv_util.c @@ -82,7 +82,6 @@ hypervParseUri(hypervParsedUri **parsedUri, virURIPtr uri) } - void hypervFreeParsedUri(hypervParsedUri **parsedUri) { diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c index 29447b8f0f..8c30370a7b 100644 --- a/src/hyperv/hyperv_wmi.c +++ b/src/hyperv/hyperv_wmi.c @@ -85,6 +85,7 @@ hypervGetWmiClassInfo(hypervPrivate *priv, hypervWmiClassInfoListPtr list, return -1; } + int hypervGetWmiClassList(hypervPrivate *priv, hypervWmiClassInfoListPtr wmiInfo, virBufferPtr query, hypervObject **wmiClass) @@ -97,6 +98,7 @@ hypervGetWmiClassList(hypervPrivate *priv, hypervWmiClassInfoListPtr wmiInfo, return hypervEnumAndPull(priv, &wqlQuery, wmiClass); } + int hypervVerifyResponse(WsManClient *client, WsXmlDocH response, const char *detail) @@ -192,6 +194,7 @@ hypervCreateInvokeParamsList(hypervPrivate *priv, const char *method, return params; } + /* * hypervFreeInvokeParams: * @params: Params object to be freed @@ -228,6 +231,7 @@ hypervFreeInvokeParams(hypervInvokeParamsListPtr params) VIR_FREE(params); } + static inline int hypervCheckParams(hypervInvokeParamsListPtr params) { @@ -239,6 +243,7 @@ hypervCheckParams(hypervInvokeParamsListPtr params) return 0; } + /* * hypervAddSimpleParam: * @params: Params object to add to @@ -270,6 +275,7 @@ hypervAddSimpleParam(hypervInvokeParamsListPtr params, const char *name, return 0; } + /* * hypervAddEprParam: * @params: Params object to add to @@ -302,6 +308,7 @@ hypervAddEprParam(hypervInvokeParamsListPtr params, const char *name, return 0; } + /* * hypervCreateEmbeddedParam: * @priv: hypervPrivate object associated with the connection @@ -368,6 +375,7 @@ hypervSetEmbeddedProperty(virHashTablePtr table, return virHashUpdateEntry(table, name, (void*) value); } + /* * hypervAddEmbeddedParam: * @params: Params list to add to @@ -410,6 +418,7 @@ hypervAddEmbeddedParam(hypervInvokeParamsListPtr params, return 0; } + /* * hypervFreeEmbeddedParam: * @param: Pointer to embedded param to free @@ -422,10 +431,10 @@ hypervFreeEmbeddedParam(virHashTablePtr p) virHashFree(p); } + /* * Serializing parameters to XML and invoking methods */ - static int hypervGetCimTypeInfo(hypervCimTypePtr typemap, const char *name, hypervCimTypePtr *property) @@ -480,6 +489,7 @@ hypervCreateInvokeXmlDoc(hypervInvokeParamsListPtr params, WsXmlDocH *docRoot) return result; } + static int hypervSerializeSimpleParam(hypervParamPtr p, const char *resourceUri, WsXmlNodeH *methodNode) @@ -497,6 +507,7 @@ hypervSerializeSimpleParam(hypervParamPtr p, const char *resourceUri, return 0; } + static int hypervSerializeEprParam(hypervParamPtr p, hypervPrivate *priv, const char *resourceUri, WsXmlNodeH *methodNode) @@ -620,6 +631,7 @@ hypervSerializeEprParam(hypervParamPtr p, hypervPrivate *priv, return result; } + static int hypervSerializeEmbeddedParam(hypervParamPtr p, const char *resourceUri, WsXmlNodeH *methodNode) @@ -1124,6 +1136,7 @@ hypervEnumAndPull(hypervPrivate *priv, hypervWqlQueryPtr wqlQuery, return result; } + void hypervFreeObject(hypervPrivate *priv G_GNUC_UNUSED, hypervObject *object) { @@ -1236,7 +1249,6 @@ hypervReturnCodeToString(int returnCode) } - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Msvm_ComputerSystem */ @@ -1385,6 +1397,7 @@ hypervInvokeMsvmComputerSystemRequestStateChange(virDomainPtr domain, return result; } + int hypervMsvmComputerSystemEnabledStateToDomainState (Msvm_ComputerSystem *computerSystem) @@ -1422,6 +1435,7 @@ hypervMsvmComputerSystemEnabledStateToDomainState } } + bool hypervIsMsvmComputerSystemActive(Msvm_ComputerSystem *computerSystem, bool *in_transition) @@ -1461,6 +1475,7 @@ hypervIsMsvmComputerSystemActive(Msvm_ComputerSystem *computerSystem, } } + int hypervMsvmComputerSystemToDomain(virConnectPtr conn, Msvm_ComputerSystem *computerSystem, @@ -1489,6 +1504,7 @@ hypervMsvmComputerSystemToDomain(virConnectPtr conn, return *domain ? 0 : -1; } + int hypervMsvmComputerSystemFromDomain(virDomainPtr domain, Msvm_ComputerSystem **computerSystem) -- 2.26.2