提交 9c487f65 编写于 作者: M Martin Kletzander

Use K&R style for curly braces in src/conf/

Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
上级 7fa91525
......@@ -6193,7 +6193,8 @@ virDomainNetGenerateMAC(virDomainXMLOptionPtr xmlopt,
static virDomainFSDefPtr
virDomainFSDefParseXML(xmlNodePtr node,
xmlXPathContextPtr ctxt,
unsigned int flags) {
unsigned int flags)
{
virDomainFSDefPtr def;
xmlNodePtr cur, save_node = ctxt->node;
char *type = NULL;
......@@ -7013,7 +7014,8 @@ error:
}
static int
virDomainChrDefaultTargetType(int devtype) {
virDomainChrDefaultTargetType(int devtype)
{
switch ((enum virDomainChrDeviceType) devtype) {
case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL:
virReportError(VIR_ERR_XML_ERROR,
......@@ -7419,7 +7421,8 @@ error:
* default port.
*/
virDomainChrDefPtr
virDomainChrDefNew(void) {
virDomainChrDefNew(void)
{
virDomainChrDefPtr def = NULL;
if (VIR_ALLOC(def) < 0)
......
/*
* domain_nwfilter.c:
*
* Copyright (C) 2014 Red Hat, Inc.
* Copyright (C) 2010 IBM Corporation
*
* This library is free software; you can redistribute it and/or
......@@ -31,14 +32,16 @@
static virDomainConfNWFilterDriverPtr nwfilterDriver;
void
virDomainConfNWFilterRegister(virDomainConfNWFilterDriverPtr driver) {
virDomainConfNWFilterRegister(virDomainConfNWFilterDriverPtr driver)
{
nwfilterDriver = driver;
}
int
virDomainConfNWFilterInstantiate(virConnectPtr conn,
const unsigned char *vmuuid,
virDomainNetDefPtr net) {
virDomainNetDefPtr net)
{
if (nwfilterDriver != NULL)
return nwfilterDriver->instantiateFilter(conn, vmuuid, net);
/* driver module not available -- don't indicate failure */
......@@ -46,13 +49,15 @@ virDomainConfNWFilterInstantiate(virConnectPtr conn,
}
void
virDomainConfNWFilterTeardown(virDomainNetDefPtr net) {
virDomainConfNWFilterTeardown(virDomainNetDefPtr net)
{
if (nwfilterDriver != NULL)
nwfilterDriver->teardownFilter(net);
}
void
virDomainConfVMNWFilterTeardown(virDomainObjPtr vm) {
virDomainConfVMNWFilterTeardown(virDomainObjPtr vm)
{
size_t i;
if (nwfilterDriver != NULL) {
......
......@@ -44,7 +44,8 @@ static int
virInterfaceDefDevFormat(virBufferPtr buf, const virInterfaceDef *def);
static
void virInterfaceIpDefFree(virInterfaceIpDefPtr def) {
void virInterfaceIpDefFree(virInterfaceIpDefPtr def)
{
if (def == NULL)
return;
VIR_FREE(def->address);
......@@ -52,7 +53,8 @@ void virInterfaceIpDefFree(virInterfaceIpDefPtr def) {
}
static
void virInterfaceProtocolDefFree(virInterfaceProtocolDefPtr def) {
void virInterfaceProtocolDefFree(virInterfaceProtocolDefPtr def)
{
size_t i;
if (def == NULL)
......@@ -112,7 +114,8 @@ void virInterfaceDefFree(virInterfaceDefPtr def)
static int
virInterfaceDefParseName(virInterfaceDefPtr def,
xmlXPathContextPtr ctxt) {
xmlXPathContextPtr ctxt)
{
char *tmp;
tmp = virXPathString("string(./@name)", ctxt);
......@@ -127,7 +130,8 @@ virInterfaceDefParseName(virInterfaceDefPtr def,
static int
virInterfaceDefParseMtu(virInterfaceDefPtr def,
xmlXPathContextPtr ctxt) {
xmlXPathContextPtr ctxt)
{
unsigned long mtu;
int ret;
......@@ -144,7 +148,8 @@ virInterfaceDefParseMtu(virInterfaceDefPtr def,
static int
virInterfaceDefParseStartMode(virInterfaceDefPtr def,
xmlXPathContextPtr ctxt) {
xmlXPathContextPtr ctxt)
{
char *tmp;
tmp = virXPathString("string(./start/@mode)", ctxt);
......@@ -167,7 +172,8 @@ virInterfaceDefParseStartMode(virInterfaceDefPtr def,
}
static int
virInterfaceDefParseBondMode(xmlXPathContextPtr ctxt) {
virInterfaceDefParseBondMode(xmlXPathContextPtr ctxt)
{
char *tmp;
int ret = 0;
......@@ -198,7 +204,8 @@ virInterfaceDefParseBondMode(xmlXPathContextPtr ctxt) {
}
static int
virInterfaceDefParseBondMiiCarrier(xmlXPathContextPtr ctxt) {
virInterfaceDefParseBondMiiCarrier(xmlXPathContextPtr ctxt)
{
char *tmp;
int ret = 0;
......@@ -219,7 +226,8 @@ virInterfaceDefParseBondMiiCarrier(xmlXPathContextPtr ctxt) {
}
static int
virInterfaceDefParseBondArpValid(xmlXPathContextPtr ctxt) {
virInterfaceDefParseBondArpValid(xmlXPathContextPtr ctxt)
{
char *tmp;
int ret = 0;
......@@ -243,7 +251,8 @@ virInterfaceDefParseBondArpValid(xmlXPathContextPtr ctxt) {
static int
virInterfaceDefParseDhcp(virInterfaceProtocolDefPtr def,
xmlNodePtr dhcp, xmlXPathContextPtr ctxt) {
xmlNodePtr dhcp, xmlXPathContextPtr ctxt)
{
xmlNodePtr save;
char *tmp;
int ret = 0;
......@@ -273,7 +282,8 @@ virInterfaceDefParseDhcp(virInterfaceProtocolDefPtr def,
static int
virInterfaceDefParseIp(virInterfaceIpDefPtr def,
xmlXPathContextPtr ctxt) {
xmlXPathContextPtr ctxt)
{
int ret = 0;
char *tmp;
long l;
......@@ -296,7 +306,8 @@ virInterfaceDefParseIp(virInterfaceIpDefPtr def,
static int
virInterfaceDefParseProtoIPv4(virInterfaceProtocolDefPtr def,
xmlXPathContextPtr ctxt) {
xmlXPathContextPtr ctxt)
{
xmlNodePtr dhcp;
xmlNodePtr *ipNodes = NULL;
int nIpNodes, ret = -1;
......@@ -346,7 +357,8 @@ error:
static int
virInterfaceDefParseProtoIPv6(virInterfaceProtocolDefPtr def,
xmlXPathContextPtr ctxt) {
xmlXPathContextPtr ctxt)
{
xmlNodePtr dhcp, autoconf;
xmlNodePtr *ipNodes = NULL;
int nIpNodes, ret = -1;
......@@ -400,7 +412,8 @@ error:
static int
virInterfaceDefParseIfAdressing(virInterfaceDefPtr def,
xmlXPathContextPtr ctxt) {
xmlXPathContextPtr ctxt)
{
xmlNodePtr save;
xmlNodePtr *protoNodes = NULL;
int nProtoNodes, pp, ret = -1;
......@@ -469,7 +482,8 @@ error:
static int
virInterfaceDefParseBridge(virInterfaceDefPtr def,
xmlXPathContextPtr ctxt) {
xmlXPathContextPtr ctxt)
{
xmlNodePtr *interfaces = NULL;
xmlNodePtr bridge;
virInterfaceDefPtr itf;
......@@ -510,7 +524,8 @@ error:
static int
virInterfaceDefParseBondItfs(virInterfaceDefPtr def,
xmlXPathContextPtr ctxt) {
xmlXPathContextPtr ctxt)
{
xmlNodePtr *interfaces = NULL;
xmlNodePtr bond = ctxt->node;
virInterfaceDefPtr itf;
......@@ -556,7 +571,8 @@ error:
static int
virInterfaceDefParseBond(virInterfaceDefPtr def,
xmlXPathContextPtr ctxt) {
xmlXPathContextPtr ctxt)
{
int res;
def->data.bond.mode = virInterfaceDefParseBondMode(ctxt);
......@@ -627,7 +643,8 @@ virInterfaceDefParseBond(virInterfaceDefPtr def,
static int
virInterfaceDefParseVlan(virInterfaceDefPtr def,
xmlXPathContextPtr ctxt) {
xmlXPathContextPtr ctxt)
{
def->data.vlan.tag = virXPathString("string(./@tag)", ctxt);
if (def->data.vlan.tag == NULL) {
virReportError(VIR_ERR_XML_ERROR,
......@@ -646,7 +663,8 @@ virInterfaceDefParseVlan(virInterfaceDefPtr def,
}
static virInterfaceDefPtr
virInterfaceDefParseXML(xmlXPathContextPtr ctxt, int parentIfType) {
virInterfaceDefParseXML(xmlXPathContextPtr ctxt, int parentIfType)
{
virInterfaceDefPtr def;
int type;
char *tmp;
......
......@@ -147,17 +147,20 @@ static virRWLock updateLock;
static bool initialized = false;
void
virNWFilterReadLockFilterUpdates(void) {
virNWFilterReadLockFilterUpdates(void)
{
virRWLockRead(&updateLock);
}
void
virNWFilterWriteLockFilterUpdates(void) {
virNWFilterWriteLockFilterUpdates(void)
{
virRWLockWrite(&updateLock);
}
void
virNWFilterUnlockFilterUpdates(void) {
virNWFilterUnlockFilterUpdates(void)
{
virRWLockUnlock(&updateLock);
}
......@@ -280,7 +283,8 @@ intMapGetByString(const struct int_map *intmap, const char *str, int casecmp,
void
virNWFilterRuleDefFree(virNWFilterRuleDefPtr def) {
virNWFilterRuleDefFree(virNWFilterRuleDefPtr def)
{
size_t i;
if (!def)
return;
......@@ -299,7 +303,8 @@ virNWFilterRuleDefFree(virNWFilterRuleDefPtr def) {
static void
virNWFilterIncludeDefFree(virNWFilterIncludeDefPtr inc) {
virNWFilterIncludeDefFree(virNWFilterIncludeDefPtr inc)
{
if (!inc)
return;
virNWFilterHashTableFree(inc->params);
......@@ -309,7 +314,8 @@ virNWFilterIncludeDefFree(virNWFilterIncludeDefPtr inc) {
static void
virNWFilterEntryFree(virNWFilterEntryPtr entry) {
virNWFilterEntryFree(virNWFilterEntryPtr entry)
{
if (!entry)
return;
......@@ -320,7 +326,8 @@ virNWFilterEntryFree(virNWFilterEntryPtr entry) {
void
virNWFilterDefFree(virNWFilterDefPtr def) {
virNWFilterDefFree(virNWFilterDefPtr def)
{
size_t i;
if (!def)
return;
......@@ -2493,7 +2500,8 @@ err_exit:
}
static virNWFilterDefPtr
virNWFilterDefParseXML(xmlXPathContextPtr ctxt) {
virNWFilterDefParseXML(xmlXPathContextPtr ctxt)
{
virNWFilterDefPtr ret;
xmlNodePtr curr = ctxt->node;
char *uuid = NULL;
......@@ -2622,7 +2630,8 @@ virNWFilterDefParseXML(xmlXPathContextPtr ctxt) {
virNWFilterDefPtr
virNWFilterDefParseNode(xmlDocPtr xml,
xmlNodePtr root) {
xmlNodePtr root)
{
xmlXPathContextPtr ctxt = NULL;
virNWFilterDefPtr def = NULL;
......@@ -2650,7 +2659,8 @@ cleanup:
static virNWFilterDefPtr
virNWFilterDefParse(const char *xmlStr,
const char *filename) {
const char *filename)
{
virNWFilterDefPtr def = NULL;
xmlDocPtr xml;
......
......@@ -684,7 +684,8 @@ virNWFilterHashTableFree(virNWFilterHashTablePtr table)
virNWFilterHashTablePtr
virNWFilterHashTableCreate(int n) {
virNWFilterHashTableCreate(int n)
{
virNWFilterHashTablePtr ret;
if (VIR_ALLOC(ret) < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册