mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
maint: align whitespaces with project conventions.
This commit is contained in:
parent
b70c093ffa
commit
721949059b
@ -70,22 +70,22 @@ const char *eventToString(int event) {
|
||||
const char *ret = "";
|
||||
switch ((virDomainEventType) event) {
|
||||
case VIR_DOMAIN_EVENT_DEFINED:
|
||||
ret ="Defined";
|
||||
ret = "Defined";
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_UNDEFINED:
|
||||
ret ="Undefined";
|
||||
ret = "Undefined";
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_STARTED:
|
||||
ret ="Started";
|
||||
ret = "Started";
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_SUSPENDED:
|
||||
ret ="Suspended";
|
||||
ret = "Suspended";
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_RESUMED:
|
||||
ret ="Resumed";
|
||||
ret = "Resumed";
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_STOPPED:
|
||||
ret ="Stopped";
|
||||
ret = "Stopped";
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_SHUTDOWN:
|
||||
ret = "Shutdown";
|
||||
@ -229,16 +229,16 @@ networkEventToString(int event)
|
||||
const char *ret = "";
|
||||
switch ((virNetworkEventLifecycleType) event) {
|
||||
case VIR_NETWORK_EVENT_DEFINED:
|
||||
ret ="Defined";
|
||||
ret = "Defined";
|
||||
break;
|
||||
case VIR_NETWORK_EVENT_UNDEFINED:
|
||||
ret ="Undefined";
|
||||
ret = "Undefined";
|
||||
break;
|
||||
case VIR_NETWORK_EVENT_STARTED:
|
||||
ret ="Started";
|
||||
ret = "Started";
|
||||
break;
|
||||
case VIR_NETWORK_EVENT_STOPPED:
|
||||
ret ="Stopped";
|
||||
ret = "Stopped";
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
|
@ -161,30 +161,30 @@ virNWFilterUnlockFilterUpdates(void) {
|
||||
/*
|
||||
* attribute names for the rules XML
|
||||
*/
|
||||
static const char srcmacaddr_str[] = "srcmacaddr";
|
||||
static const char srcmacmask_str[] = "srcmacmask";
|
||||
static const char dstmacaddr_str[] = "dstmacaddr";
|
||||
static const char dstmacmask_str[] = "dstmacmask";
|
||||
static const char arpsrcmacaddr_str[]= "arpsrcmacaddr";
|
||||
static const char arpdstmacaddr_str[]= "arpdstmacaddr";
|
||||
static const char arpsrcipaddr_str[] = "arpsrcipaddr";
|
||||
static const char arpdstipaddr_str[] = "arpdstipaddr";
|
||||
static const char srcipaddr_str[] = "srcipaddr";
|
||||
static const char srcipmask_str[] = "srcipmask";
|
||||
static const char dstipaddr_str[] = "dstipaddr";
|
||||
static const char dstipmask_str[] = "dstipmask";
|
||||
static const char srcipfrom_str[] = "srcipfrom";
|
||||
static const char srcipto_str[] = "srcipto";
|
||||
static const char dstipfrom_str[] = "dstipfrom";
|
||||
static const char dstipto_str[] = "dstipto";
|
||||
static const char srcportstart_str[] = "srcportstart";
|
||||
static const char srcportend_str[] = "srcportend";
|
||||
static const char dstportstart_str[] = "dstportstart";
|
||||
static const char dstportend_str[] = "dstportend";
|
||||
static const char dscp_str[] = "dscp";
|
||||
static const char state_str[] = "state";
|
||||
static const char ipset_str[] = "ipset";
|
||||
static const char ipsetflags_str[] = "ipsetflags";
|
||||
static const char srcmacaddr_str[] = "srcmacaddr";
|
||||
static const char srcmacmask_str[] = "srcmacmask";
|
||||
static const char dstmacaddr_str[] = "dstmacaddr";
|
||||
static const char dstmacmask_str[] = "dstmacmask";
|
||||
static const char arpsrcmacaddr_str[] = "arpsrcmacaddr";
|
||||
static const char arpdstmacaddr_str[] = "arpdstmacaddr";
|
||||
static const char arpsrcipaddr_str[] = "arpsrcipaddr";
|
||||
static const char arpdstipaddr_str[] = "arpdstipaddr";
|
||||
static const char srcipaddr_str[] = "srcipaddr";
|
||||
static const char srcipmask_str[] = "srcipmask";
|
||||
static const char dstipaddr_str[] = "dstipaddr";
|
||||
static const char dstipmask_str[] = "dstipmask";
|
||||
static const char srcipfrom_str[] = "srcipfrom";
|
||||
static const char srcipto_str[] = "srcipto";
|
||||
static const char dstipfrom_str[] = "dstipfrom";
|
||||
static const char dstipto_str[] = "dstipto";
|
||||
static const char srcportstart_str[] = "srcportstart";
|
||||
static const char srcportend_str[] = "srcportend";
|
||||
static const char dstportstart_str[] = "dstportstart";
|
||||
static const char dstportend_str[] = "dstportend";
|
||||
static const char dscp_str[] = "dscp";
|
||||
static const char state_str[] = "state";
|
||||
static const char ipset_str[] = "ipset";
|
||||
static const char ipsetflags_str[] = "ipsetflags";
|
||||
|
||||
#define SRCMACADDR srcmacaddr_str
|
||||
#define SRCMACMASK srcmacmask_str
|
||||
@ -1116,8 +1116,8 @@ static const virXMLAttr2Struct macAttributes[] = {
|
||||
.name = "protocolid",
|
||||
.datatype = DATATYPE_UINT16 | DATATYPE_UINT16_HEX | DATATYPE_STRING,
|
||||
.dataIdx = offsetof(virNWFilterRuleDef, p.ethHdrFilter.dataProtocolID),
|
||||
.validator= checkMacProtocolID,
|
||||
.formatter= macProtocolIDFormatter,
|
||||
.validator = checkMacProtocolID,
|
||||
.formatter = macProtocolIDFormatter,
|
||||
},
|
||||
COMMENT_PROP(ethHdrFilter),
|
||||
{
|
||||
@ -1292,8 +1292,8 @@ static const virXMLAttr2Struct arpAttributes[] = {
|
||||
.name = "opcode",
|
||||
.datatype = DATATYPE_UINT16 | DATATYPE_UINT16_HEX | DATATYPE_STRING,
|
||||
.dataIdx = offsetof(virNWFilterRuleDef, p.arpHdrFilter.dataOpcode),
|
||||
.validator= arpOpcodeValidator,
|
||||
.formatter= arpOpcodeFormatter,
|
||||
.validator = arpOpcodeValidator,
|
||||
.formatter = arpOpcodeFormatter,
|
||||
}, {
|
||||
.name = ARPSRCMACADDR,
|
||||
.datatype = DATATYPE_MACADDR,
|
||||
@ -1347,8 +1347,8 @@ static const virXMLAttr2Struct ipAttributes[] = {
|
||||
.name = "protocol",
|
||||
.datatype = DATATYPE_STRING | DATATYPE_UINT8 | DATATYPE_UINT8_HEX,
|
||||
.dataIdx = offsetof(virNWFilterRuleDef, p.ipHdrFilter.ipHdr.dataProtocolID),
|
||||
.validator= checkIPProtocolID,
|
||||
.formatter= formatIPProtocolID,
|
||||
.validator = checkIPProtocolID,
|
||||
.formatter = formatIPProtocolID,
|
||||
},
|
||||
{
|
||||
.name = SRCPORTSTART,
|
||||
@ -1409,8 +1409,8 @@ static const virXMLAttr2Struct ipv6Attributes[] = {
|
||||
.name = "protocol",
|
||||
.datatype = DATATYPE_STRING | DATATYPE_UINT8 | DATATYPE_UINT8_HEX,
|
||||
.dataIdx = offsetof(virNWFilterRuleDef, p.ipv6HdrFilter.ipHdr.dataProtocolID),
|
||||
.validator= checkIPProtocolID,
|
||||
.formatter= formatIPProtocolID,
|
||||
.validator = checkIPProtocolID,
|
||||
.formatter = formatIPProtocolID,
|
||||
},
|
||||
{
|
||||
.name = SRCPORTSTART,
|
||||
@ -2306,10 +2306,10 @@ virNWFilterRuleParse(xmlNodePtr node)
|
||||
if (VIR_ALLOC(ret) < 0)
|
||||
return NULL;
|
||||
|
||||
action = virXMLPropString(node, "action");
|
||||
direction = virXMLPropString(node, "direction");
|
||||
prio = virXMLPropString(node, "priority");
|
||||
statematch= virXMLPropString(node, "statematch");
|
||||
action = virXMLPropString(node, "action");
|
||||
direction = virXMLPropString(node, "direction");
|
||||
prio = virXMLPropString(node, "priority");
|
||||
statematch = virXMLPropString(node, "statematch");
|
||||
|
||||
if (!action) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
|
@ -4695,7 +4695,7 @@ esxVI_LookupHostInternetScsiHba(esxVI_Context *ctx,
|
||||
for (hostHostBusAdapter = hostHostBusAdapterList;
|
||||
hostHostBusAdapter;
|
||||
hostHostBusAdapter = hostHostBusAdapter->_next) {
|
||||
esxVI_HostInternetScsiHba *candidate=
|
||||
esxVI_HostInternetScsiHba *candidate =
|
||||
esxVI_HostInternetScsiHba_DynamicCast(hostHostBusAdapter);
|
||||
|
||||
if (candidate) {
|
||||
|
@ -8264,7 +8264,7 @@ virDomainBlockResize(virDomainPtr dom,
|
||||
|
||||
if (conn->driver->domainBlockResize) {
|
||||
int ret;
|
||||
ret =conn->driver->domainBlockResize(dom, disk, size, flags);
|
||||
ret = conn->driver->domainBlockResize(dom, disk, size, flags);
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
return ret;
|
||||
|
@ -557,7 +557,7 @@ learnIPAddressThread(void *arg)
|
||||
iphdr->ihl * 4 +
|
||||
sizeof(struct udphdr))) {
|
||||
VIR_WARNINGS_NO_CAST_ALIGN
|
||||
struct udphdr *udphdr= (struct udphdr *)
|
||||
struct udphdr *udphdr = (struct udphdr *)
|
||||
((char *)iphdr + iphdr->ihl * 4);
|
||||
VIR_WARNINGS_RESET
|
||||
if (ntohs(udphdr->source) == 67 &&
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* openvz_conf.c: config functions for managing OpenVZ VEs
|
||||
*
|
||||
* Copyright (C) 2010-2012 Red Hat, Inc.
|
||||
* Copyright (C) 2010-2012, 2014 Red Hat, Inc.
|
||||
* Copyright (C) 2006, 2007 Binary Karma
|
||||
* Copyright (C) 2006 Shuveb Hussain
|
||||
* Copyright (C) 2007 Anoop Joe Cyriac
|
||||
@ -937,7 +937,7 @@ static char *
|
||||
openvzLocateConfDir(void)
|
||||
{
|
||||
const char *conf_dir_list[] = {"/etc/vz/conf", "/usr/local/etc/conf", NULL};
|
||||
int i=0;
|
||||
size_t i = 0;
|
||||
char *ret = NULL;
|
||||
|
||||
while (conf_dir_list[i]) {
|
||||
|
@ -786,7 +786,7 @@ openvzGenerateContainerVethName(int veid)
|
||||
int max = 0;
|
||||
|
||||
/* get maximum interface number (actually, it is the last one) */
|
||||
for (s=strtok_r(temp, ";", &saveptr); s; s=strtok_r(NULL, ";", &saveptr)) {
|
||||
for (s = strtok_r(temp, ";", &saveptr); s; s = strtok_r(NULL, ";", &saveptr)) {
|
||||
int x;
|
||||
|
||||
if (sscanf(s, "ifname=eth%d", &x) != 1) return NULL;
|
||||
|
@ -68,7 +68,7 @@
|
||||
static unsigned const int HMC = 0;
|
||||
static unsigned const int IVM = 127;
|
||||
static unsigned const int PHYP_IFACENAME_SIZE = 24;
|
||||
static unsigned const int PHYP_MAC_SIZE= 12;
|
||||
static unsigned const int PHYP_MAC_SIZE = 12;
|
||||
|
||||
static int
|
||||
waitsocket(int socket_fd, LIBSSH2_SESSION * session)
|
||||
|
@ -1347,7 +1347,7 @@ virLogParseOutputs(const char *outputs)
|
||||
|
||||
virSkipSpaces(&cur);
|
||||
while (*cur != 0) {
|
||||
prio= virParseNumber(&cur);
|
||||
prio = virParseNumber(&cur);
|
||||
if ((prio < VIR_LOG_DEBUG) || (prio > VIR_LOG_ERROR))
|
||||
goto cleanup;
|
||||
if (*cur != ':')
|
||||
@ -1452,7 +1452,7 @@ virLogParseFilters(const char *filters)
|
||||
virSkipSpaces(&cur);
|
||||
while (*cur != 0) {
|
||||
unsigned int flags = 0;
|
||||
prio= virParseNumber(&cur);
|
||||
prio = virParseNumber(&cur);
|
||||
if ((prio < VIR_LOG_DEBUG) || (prio > VIR_LOG_ERROR))
|
||||
goto cleanup;
|
||||
if (*cur != ':')
|
||||
|
@ -425,7 +425,7 @@ virSysinfoParseProcessor(const char *base, virSysinfoDefPtr ret)
|
||||
int result = -1;
|
||||
virSysinfoProcessorDefPtr processor;
|
||||
|
||||
if (!(tmp_base=virSysinfoParseLine(base, "vendor_id", &manufacturer)))
|
||||
if (!(tmp_base = virSysinfoParseLine(base, "vendor_id", &manufacturer)))
|
||||
goto cleanup;
|
||||
|
||||
/* Find processor N: line and gather the processor manufacturer,
|
||||
|
@ -2841,7 +2841,7 @@ xenUnifiedDomainInfoListFree(xenUnifiedDomainInfoListPtr list)
|
||||
if (list == NULL)
|
||||
return;
|
||||
|
||||
for (i=0; i<list->count; i++) {
|
||||
for (i = 0; i < list->count; i++) {
|
||||
VIR_FREE(list->doms[i]->name);
|
||||
VIR_FREE(list->doms[i]);
|
||||
}
|
||||
@ -2865,7 +2865,7 @@ xenUnifiedAddDomainInfo(xenUnifiedDomainInfoListPtr list,
|
||||
int n;
|
||||
|
||||
/* check if we already have this callback on our list */
|
||||
for (n=0; n < list->count; n++) {
|
||||
for (n = 0; n < list->count; n++) {
|
||||
if (STREQ(list->doms[n]->name, name) &&
|
||||
!memcmp(list->doms[n]->uuid, uuid, VIR_UUID_BUFLEN)) {
|
||||
VIR_DEBUG("WARNING: dom already tracked");
|
||||
|
@ -616,7 +616,7 @@ static void
|
||||
xenStoreWatchListFree(xenStoreWatchListPtr list)
|
||||
{
|
||||
size_t i;
|
||||
for (i=0; i<list->count; i++) {
|
||||
for (i = 0; i < list->count; i++) {
|
||||
VIR_FREE(list->watches[i]->path);
|
||||
VIR_FREE(list->watches[i]->token);
|
||||
VIR_FREE(list->watches[i]);
|
||||
@ -648,7 +648,7 @@ xenStoreAddWatch(virConnectPtr conn,
|
||||
return -1;
|
||||
|
||||
/* check if we already have this callback on our list */
|
||||
for (n=0; n < list->count; n++) {
|
||||
for (n = 0; n < list->count; n++) {
|
||||
if (STREQ(list->watches[n]->path, path) &&
|
||||
STREQ(list->watches[n]->token, token)) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
@ -825,7 +825,7 @@ retry:
|
||||
}
|
||||
|
||||
missing = 0;
|
||||
for (i=0; i < new_domain_cnt; i++) {
|
||||
for (i = 0; i < new_domain_cnt; i++) {
|
||||
found = 0;
|
||||
for (j = 0; j < priv->activeDomainList->count; j++) {
|
||||
if (priv->activeDomainList->doms[j]->id == new_domids[i]) {
|
||||
@ -908,9 +908,9 @@ retry:
|
||||
}
|
||||
|
||||
removed = 0;
|
||||
for (j=0; j < priv->activeDomainList->count; j++) {
|
||||
for (j = 0; j < priv->activeDomainList->count; j++) {
|
||||
found = 0;
|
||||
for (i=0; i < new_domain_cnt; i++) {
|
||||
for (i = 0; i < new_domain_cnt; i++) {
|
||||
if (priv->activeDomainList->doms[j]->id == new_domids[i]) {
|
||||
found = 1;
|
||||
break;
|
||||
|
@ -582,7 +582,7 @@ xenapiDomainLookupByID(virConnectPtr conn, int id)
|
||||
xen_vm_set *result;
|
||||
xen_vm_record *record;
|
||||
unsigned char raw_uuid[VIR_UUID_BUFLEN];
|
||||
virDomainPtr domP=NULL;
|
||||
virDomainPtr domP = NULL;
|
||||
xen_session *session = ((struct _xenapiPrivate *)(conn->privateData))->session;
|
||||
|
||||
xen_session_get_this_host(session, &host, session);
|
||||
@ -722,7 +722,7 @@ xenapiDomainSuspend(virDomainPtr dom)
|
||||
{
|
||||
/* vm.pause() */
|
||||
xen_vm vm;
|
||||
xen_vm_set *vms=NULL;
|
||||
xen_vm_set *vms = NULL;
|
||||
xen_session *session = ((struct _xenapiPrivate *)(dom->conn->privateData))->session;
|
||||
if (xen_vm_get_by_name_label(session, &vms, dom->name) && vms->size > 0) {
|
||||
if (vms->size != 1) {
|
||||
@ -931,10 +931,10 @@ xenapiDomainDestroy(virDomainPtr dom)
|
||||
static char *
|
||||
xenapiDomainGetOSType(virDomainPtr dom)
|
||||
{
|
||||
xen_vm vm=NULL;
|
||||
xen_vm vm = NULL;
|
||||
xen_vm_set *vms;
|
||||
char *ostype = NULL;
|
||||
char *boot_policy=NULL;
|
||||
char *boot_policy = NULL;
|
||||
xen_session *session = ((struct _xenapiPrivate *)(dom->conn->privateData))->session;
|
||||
|
||||
if (xen_vm_get_by_name_label(session, &vms, dom->name) && vms->size > 0) {
|
||||
@ -1360,14 +1360,14 @@ xenapiDomainGetMaxVcpus(virDomainPtr dom)
|
||||
static char *
|
||||
xenapiDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
|
||||
{
|
||||
xen_vm vm=NULL;
|
||||
xen_vm vm = NULL;
|
||||
xen_vm_set *vms;
|
||||
xen_string_string_map *result=NULL;
|
||||
xen_string_string_map *result = NULL;
|
||||
xen_session *session = ((struct _xenapiPrivate *)(dom->conn->privateData))->session;
|
||||
virDomainDefPtr defPtr = NULL;
|
||||
char *boot_policy = NULL;
|
||||
unsigned long memory=0;
|
||||
int64_t dynamic_mem=0;
|
||||
unsigned long memory = 0;
|
||||
int64_t dynamic_mem = 0;
|
||||
char *val = NULL;
|
||||
struct xen_vif_set *vif_set = NULL;
|
||||
char *xml;
|
||||
@ -1700,9 +1700,9 @@ static virDomainPtr
|
||||
xenapiDomainDefineXML(virConnectPtr conn, const char *xml)
|
||||
{
|
||||
struct _xenapiPrivate *priv = conn->privateData;
|
||||
xen_vm_record *record=NULL;
|
||||
xen_vm vm=NULL;
|
||||
virDomainPtr domP=NULL;
|
||||
xen_vm_record *record = NULL;
|
||||
xen_vm vm = NULL;
|
||||
virDomainPtr domP = NULL;
|
||||
if (!priv->caps)
|
||||
return NULL;
|
||||
virDomainDefPtr defPtr = virDomainDefParseString(xml,
|
||||
|
@ -857,10 +857,10 @@ static int test21(const void *unused ATTRIBUTE_UNUSED)
|
||||
int ret = -1;
|
||||
const char *wrbuf = "Hello world\n";
|
||||
char *outbuf = NULL, *errbuf = NULL;
|
||||
const char *outbufExpected="BEGIN STDOUT\n"
|
||||
const char *outbufExpected = "BEGIN STDOUT\n"
|
||||
"Hello world\n"
|
||||
"END STDOUT\n";
|
||||
const char *errbufExpected="BEGIN STDERR\n"
|
||||
const char *errbufExpected = "BEGIN STDERR\n"
|
||||
"Hello world\n"
|
||||
"END STDERR\n";
|
||||
|
||||
|
@ -705,7 +705,7 @@ testQemuMonitorJSONAttachChardev(const void *data)
|
||||
chr = (virDomainChrSourceDef) { .type = VIR_DOMAIN_CHR_TYPE_NULL };
|
||||
CHECK("chr_null", "{\"return\": {}}");
|
||||
|
||||
chr = (virDomainChrSourceDef) { .type =VIR_DOMAIN_CHR_TYPE_VC };
|
||||
chr = (virDomainChrSourceDef) { .type = VIR_DOMAIN_CHR_TYPE_VC };
|
||||
CHECK("chr_vc", "{\"return\": {}}");
|
||||
|
||||
#define PTY_PATH "/dev/ttyS0"
|
||||
|
@ -9846,11 +9846,11 @@ cmdDetachInterface(vshControl *ctl, const vshCmd *cmd)
|
||||
{
|
||||
virDomainPtr dom = NULL;
|
||||
xmlDocPtr xml = NULL;
|
||||
xmlXPathObjectPtr obj=NULL;
|
||||
xmlXPathObjectPtr obj = NULL;
|
||||
xmlXPathContextPtr ctxt = NULL;
|
||||
xmlNodePtr cur = NULL, matchNode = NULL;
|
||||
char *detach_xml = NULL;
|
||||
const char *mac =NULL, *type = NULL;
|
||||
const char *mac = NULL, *type = NULL;
|
||||
char *doc = NULL;
|
||||
char buf[64];
|
||||
int diff_mac;
|
||||
@ -9986,7 +9986,7 @@ vshFindDisk(const char *doc,
|
||||
int type)
|
||||
{
|
||||
xmlDocPtr xml = NULL;
|
||||
xmlXPathObjectPtr obj= NULL;
|
||||
xmlXPathObjectPtr obj = NULL;
|
||||
xmlXPathContextPtr ctxt = NULL;
|
||||
xmlNodePtr cur = NULL;
|
||||
xmlNodePtr ret = NULL;
|
||||
|
@ -149,7 +149,7 @@ cmdFreecell(vshControl *ctl, const vshCmd *cmd)
|
||||
goto cleanup;
|
||||
}
|
||||
VIR_FREE(val);
|
||||
nodes_id[i]=id;
|
||||
nodes_id[i] = id;
|
||||
if (virNodeGetCellsFreeMemory(ctl->conn, &(nodes_free[i]),
|
||||
id, 1) != 1) {
|
||||
vshError(ctl, _("failed to get free memory for NUMA node "
|
||||
|
@ -117,7 +117,7 @@ cleanup:
|
||||
static char **virLoginShellGetShellArgv(virConfPtr conf)
|
||||
{
|
||||
size_t i;
|
||||
char **shargv=NULL;
|
||||
char **shargv = NULL;
|
||||
virConfValuePtr p;
|
||||
|
||||
p = virConfGetValue(conf, "shell");
|
||||
|
Loading…
Reference in New Issue
Block a user