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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Martin Kletzander 2014-03-18 09:15:21 +01:00
parent 9c487f6505
commit b1d5f6c6cb
7 changed files with 90 additions and 44 deletions

View File

@ -1,7 +1,7 @@
/* /*
* qemu_agent.c: interaction with QEMU guest agent * qemu_agent.c: interaction with QEMU guest agent
* *
* Copyright (C) 2006-2013 Red Hat, Inc. * Copyright (C) 2006-2014 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange * Copyright (C) 2006 Daniel P. Berrange
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
@ -574,7 +574,8 @@ static void qemuAgentUpdateWatch(qemuAgentPtr mon)
static void static void
qemuAgentIO(int watch, int fd, int events, void *opaque) { qemuAgentIO(int watch, int fd, int events, void *opaque)
{
qemuAgentPtr mon = opaque; qemuAgentPtr mon = opaque;
bool error = false; bool error = false;
bool eof = false; bool eof = false;

View File

@ -1871,7 +1871,8 @@ cleanup:
} }
static bool static bool
qemuDomainSupportsPCI(virDomainDefPtr def) { qemuDomainSupportsPCI(virDomainDefPtr def)
{
if ((def->os.arch != VIR_ARCH_ARMV7L) && (def->os.arch != VIR_ARCH_AARCH64)) if ((def->os.arch != VIR_ARCH_ARMV7L) && (def->os.arch != VIR_ARCH_AARCH64))
return true; return true;
@ -11197,7 +11198,8 @@ error:
static void static void
qemuParseCommandLineBootDevs(virDomainDefPtr def, const char *str) { qemuParseCommandLineBootDevs(virDomainDefPtr def, const char *str)
{
int n, b = 0; int n, b = 0;
for (n = 0; str[n] && b < VIR_DOMAIN_BOOT_LAST; n++) { for (n = 0; str[n] && b < VIR_DOMAIN_BOOT_LAST; n++) {

View File

@ -172,9 +172,11 @@ virQEMUDriverPtr qemu_driver = NULL;
static void static void
qemuVMDriverLock(void) {} qemuVMDriverLock(void)
{}
static void static void
qemuVMDriverUnlock(void) {} qemuVMDriverUnlock(void)
{}
static int static int
qemuVMFilterRebuild(virDomainObjListIterator iter, void *data) qemuVMFilterRebuild(virDomainObjListIterator iter, void *data)
@ -879,7 +881,8 @@ static void qemuNotifyLoadDomain(virDomainObjPtr vm, int newVM, void *opaque)
* files and update its state and the networking * files and update its state and the networking
*/ */
static int static int
qemuStateReload(void) { qemuStateReload(void)
{
virQEMUDriverConfigPtr cfg = NULL; virQEMUDriverConfigPtr cfg = NULL;
virCapsPtr caps = NULL; virCapsPtr caps = NULL;
@ -910,7 +913,8 @@ cleanup:
* *
*/ */
static int static int
qemuStateStop(void) { qemuStateStop(void)
{
int ret = -1; int ret = -1;
virConnectPtr conn; virConnectPtr conn;
int numDomains = 0; int numDomains = 0;
@ -967,7 +971,8 @@ qemuStateStop(void) {
* Shutdown the QEmu daemon, it will stop all active domains and networks * Shutdown the QEmu daemon, it will stop all active domains and networks
*/ */
static int static int
qemuStateCleanup(void) { qemuStateCleanup(void)
{
if (!qemu_driver) if (!qemu_driver)
return -1; return -1;
@ -1145,7 +1150,8 @@ static int qemuConnectIsAlive(virConnectPtr conn ATTRIBUTE_UNUSED)
static int static int
kvmGetMaxVCPUs(void) { kvmGetMaxVCPUs(void)
{
int fd; int fd;
int ret; int ret;
@ -1201,7 +1207,9 @@ qemuConnectGetSysinfo(virConnectPtr conn, unsigned int flags)
return virBufferContentAndReset(&buf); return virBufferContentAndReset(&buf);
} }
static int qemuConnectGetMaxVcpus(virConnectPtr conn ATTRIBUTE_UNUSED, const char *type) { static int
qemuConnectGetMaxVcpus(virConnectPtr conn ATTRIBUTE_UNUSED, const char *type)
{
if (virConnectGetMaxVcpusEnsureACL(conn) < 0) if (virConnectGetMaxVcpusEnsureACL(conn) < 0)
return -1; return -1;
@ -1321,7 +1329,8 @@ qemuGetProcessInfo(unsigned long long *cpuTime, int *lastCpu, long *vm_rss,
static virDomainPtr qemuDomainLookupByID(virConnectPtr conn, static virDomainPtr qemuDomainLookupByID(virConnectPtr conn,
int id) { int id)
{
virQEMUDriverPtr driver = conn->privateData; virQEMUDriverPtr driver = conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
virDomainPtr dom = NULL; virDomainPtr dom = NULL;
@ -1347,7 +1356,8 @@ cleanup:
} }
static virDomainPtr qemuDomainLookupByUUID(virConnectPtr conn, static virDomainPtr qemuDomainLookupByUUID(virConnectPtr conn,
const unsigned char *uuid) { const unsigned char *uuid)
{
virQEMUDriverPtr driver = conn->privateData; virQEMUDriverPtr driver = conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
virDomainPtr dom = NULL; virDomainPtr dom = NULL;
@ -1375,7 +1385,8 @@ cleanup:
} }
static virDomainPtr qemuDomainLookupByName(virConnectPtr conn, static virDomainPtr qemuDomainLookupByName(virConnectPtr conn,
const char *name) { const char *name)
{
virQEMUDriverPtr driver = conn->privateData; virQEMUDriverPtr driver = conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
virDomainPtr dom = NULL; virDomainPtr dom = NULL;
@ -1458,7 +1469,8 @@ cleanup:
return ret; return ret;
} }
static int qemuConnectGetVersion(virConnectPtr conn, unsigned long *version) { static int qemuConnectGetVersion(virConnectPtr conn, unsigned long *version)
{
virQEMUDriverPtr driver = conn->privateData; virQEMUDriverPtr driver = conn->privateData;
int ret = -1; int ret = -1;
unsigned int qemuVersion = 0; unsigned int qemuVersion = 0;
@ -1493,7 +1505,8 @@ static char *qemuConnectGetHostname(virConnectPtr conn)
} }
static int qemuConnectListDomains(virConnectPtr conn, int *ids, int nids) { static int qemuConnectListDomains(virConnectPtr conn, int *ids, int nids)
{
virQEMUDriverPtr driver = conn->privateData; virQEMUDriverPtr driver = conn->privateData;
int n; int n;
@ -1506,7 +1519,8 @@ static int qemuConnectListDomains(virConnectPtr conn, int *ids, int nids) {
return n; return n;
} }
static int qemuConnectNumOfDomains(virConnectPtr conn) { static int qemuConnectNumOfDomains(virConnectPtr conn)
{
virQEMUDriverPtr driver = conn->privateData; virQEMUDriverPtr driver = conn->privateData;
int n; int n;
@ -1542,7 +1556,8 @@ qemuCanonicalizeMachine(virDomainDefPtr def, virQEMUCapsPtr qemuCaps)
static virDomainPtr qemuDomainCreateXML(virConnectPtr conn, static virDomainPtr qemuDomainCreateXML(virConnectPtr conn,
const char *xml, const char *xml,
unsigned int flags) { unsigned int flags)
{
virQEMUDriverPtr driver = conn->privateData; virQEMUDriverPtr driver = conn->privateData;
virDomainDefPtr def = NULL; virDomainDefPtr def = NULL;
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
@ -1648,7 +1663,8 @@ cleanup:
} }
static int qemuDomainSuspend(virDomainPtr dom) { static int qemuDomainSuspend(virDomainPtr dom)
{
virQEMUDriverPtr driver = dom->conn->privateData; virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
int ret = -1; int ret = -1;
@ -1729,7 +1745,8 @@ cleanup:
} }
static int qemuDomainResume(virDomainPtr dom) { static int qemuDomainResume(virDomainPtr dom)
{
virQEMUDriverPtr driver = dom->conn->privateData; virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
int ret = -1; int ret = -1;
@ -1793,7 +1810,8 @@ cleanup:
return ret; return ret;
} }
static int qemuDomainShutdownFlags(virDomainPtr dom, unsigned int flags) { static int qemuDomainShutdownFlags(virDomainPtr dom, unsigned int flags)
{
virQEMUDriverPtr driver = dom->conn->privateData; virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
int ret = -1; int ret = -1;
@ -2155,7 +2173,8 @@ cleanup:
} }
static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem, static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
unsigned int flags) { unsigned int flags)
{
virQEMUDriverPtr driver = dom->conn->privateData; virQEMUDriverPtr driver = dom->conn->privateData;
qemuDomainObjPrivatePtr priv; qemuDomainObjPrivatePtr priv;
virDomainObjPtr vm; virDomainObjPtr vm;
@ -2652,7 +2671,8 @@ struct _virQEMUSaveHeader {
}; };
static inline void static inline void
bswap_header(virQEMUSaveHeaderPtr hdr) { bswap_header(virQEMUSaveHeaderPtr hdr)
{
hdr->version = bswap_32(hdr->version); hdr->version = bswap_32(hdr->version);
hdr->xml_len = bswap_32(hdr->xml_len); hdr->xml_len = bswap_32(hdr->xml_len);
hdr->was_running = bswap_32(hdr->was_running); hdr->was_running = bswap_32(hdr->was_running);
@ -4248,7 +4268,8 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
unsigned int vcpu, unsigned int vcpu,
unsigned char *cpumap, unsigned char *cpumap,
int maplen, int maplen,
unsigned int flags) { unsigned int flags)
{
virQEMUDriverPtr driver = dom->conn->privateData; virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
@ -4424,7 +4445,8 @@ static int
qemuDomainPinVcpu(virDomainPtr dom, qemuDomainPinVcpu(virDomainPtr dom,
unsigned int vcpu, unsigned int vcpu,
unsigned char *cpumap, unsigned char *cpumap,
int maplen) { int maplen)
{
return qemuDomainPinVcpuFlags(dom, vcpu, cpumap, maplen, return qemuDomainPinVcpuFlags(dom, vcpu, cpumap, maplen,
VIR_DOMAIN_AFFECT_LIVE); VIR_DOMAIN_AFFECT_LIVE);
} }
@ -4434,7 +4456,8 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom,
int ncpumaps, int ncpumaps,
unsigned char *cpumaps, unsigned char *cpumaps,
int maplen, int maplen,
unsigned int flags) { unsigned int flags)
{
virQEMUDriverPtr driver = dom->conn->privateData; virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
@ -4758,7 +4781,8 @@ qemuDomainGetVcpus(virDomainPtr dom,
virVcpuInfoPtr info, virVcpuInfoPtr info,
int maxinfo, int maxinfo,
unsigned char *cpumaps, unsigned char *cpumaps,
int maplen) { int maplen)
{
virDomainObjPtr vm; virDomainObjPtr vm;
size_t i; size_t i;
int v, maxcpu, hostcpus; int v, maxcpu, hostcpus;
@ -5951,7 +5975,8 @@ cleanup:
return ret; return ret;
} }
static int qemuConnectNumOfDefinedDomains(virConnectPtr conn) { static int qemuConnectNumOfDefinedDomains(virConnectPtr conn)
{
virQEMUDriverPtr driver = conn->privateData; virQEMUDriverPtr driver = conn->privateData;
int ret = -1; int ret = -1;
@ -6099,7 +6124,8 @@ qemuDomainCreate(virDomainPtr dom)
return qemuDomainCreateWithFlags(dom, 0); return qemuDomainCreateWithFlags(dom, 0);
} }
static virDomainPtr qemuDomainDefineXML(virConnectPtr conn, const char *xml) { static virDomainPtr qemuDomainDefineXML(virConnectPtr conn, const char *xml)
{
virQEMUDriverPtr driver = conn->privateData; virQEMUDriverPtr driver = conn->privateData;
virDomainDefPtr def = NULL; virDomainDefPtr def = NULL;
virDomainDefPtr oldDef = NULL; virDomainDefPtr oldDef = NULL;
@ -7289,7 +7315,8 @@ static int qemuDomainDetachDevice(virDomainPtr dom, const char *xml)
} }
static int qemuDomainGetAutostart(virDomainPtr dom, static int qemuDomainGetAutostart(virDomainPtr dom,
int *autostart) { int *autostart)
{
virDomainObjPtr vm; virDomainObjPtr vm;
int ret = -1; int ret = -1;
@ -7309,7 +7336,8 @@ cleanup:
} }
static int qemuDomainSetAutostart(virDomainPtr dom, static int qemuDomainSetAutostart(virDomainPtr dom,
int autostart) { int autostart)
{
virQEMUDriverPtr driver = dom->conn->privateData; virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
char *configFile = NULL, *autostartLink = NULL; char *configFile = NULL, *autostartLink = NULL;
@ -11447,7 +11475,8 @@ cleanup:
static int qemuDomainGetJobInfo(virDomainPtr dom, static int qemuDomainGetJobInfo(virDomainPtr dom,
virDomainJobInfoPtr info) { virDomainJobInfoPtr info)
{
virDomainObjPtr vm; virDomainObjPtr vm;
int ret = -1; int ret = -1;
qemuDomainObjPrivatePtr priv; qemuDomainObjPrivatePtr priv;
@ -11634,7 +11663,8 @@ cleanup:
} }
static int qemuDomainAbortJob(virDomainPtr dom) { static int qemuDomainAbortJob(virDomainPtr dom)
{
virQEMUDriverPtr driver = dom->conn->privateData; virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
int ret = -1; int ret = -1;
@ -12006,7 +12036,8 @@ cleanup:
static int static int
qemuDomainSnapshotFSFreeze(virDomainObjPtr vm) { qemuDomainSnapshotFSFreeze(virDomainObjPtr vm)
{
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
int freezed; int freezed;
@ -16711,7 +16742,8 @@ static virStateDriver qemuStateDriver = {
.stateStop = qemuStateStop, .stateStop = qemuStateStop,
}; };
int qemuRegister(void) { int qemuRegister(void)
{
if (virRegisterDriver(&qemuDriver) < 0) if (virRegisterDriver(&qemuDriver) < 0)
return -1; return -1;
if (virRegisterStateDriver(&qemuStateDriver) < 0) if (virRegisterStateDriver(&qemuStateDriver) < 0)

View File

@ -4340,7 +4340,8 @@ qemuMigrationPerform(virQEMUDriverPtr driver,
} }
static int static int
qemuMigrationVPAssociatePortProfiles(virDomainDefPtr def) { qemuMigrationVPAssociatePortProfiles(virDomainDefPtr def)
{
size_t i; size_t i;
int last_good_net = -1; int last_good_net = -1;
virDomainNetDefPtr net; virDomainNetDefPtr net;

View File

@ -597,7 +597,8 @@ static void qemuMonitorUpdateWatch(qemuMonitorPtr mon)
static void static void
qemuMonitorIO(int watch, int fd, int events, void *opaque) { qemuMonitorIO(int watch, int fd, int events, void *opaque)
{
qemuMonitorPtr mon = opaque; qemuMonitorPtr mon = opaque;
bool error = false; bool error = false;
bool eof = false; bool eof = false;

View File

@ -294,7 +294,8 @@ cleanup:
static int static int
qemuMonitorJSONCommand(qemuMonitorPtr mon, qemuMonitorJSONCommand(qemuMonitorPtr mon,
virJSONValuePtr cmd, virJSONValuePtr cmd,
virJSONValuePtr *reply) { virJSONValuePtr *reply)
{
return qemuMonitorJSONCommandWithFd(mon, cmd, -1, reply); return qemuMonitorJSONCommandWithFd(mon, cmd, -1, reply);
} }

View File

@ -1,7 +1,7 @@
/* /*
* qemu_monitor_text.c: interaction with QEMU monitor console * qemu_monitor_text.c: interaction with QEMU monitor console
* *
* Copyright (C) 2006-2013 Red Hat, Inc. * Copyright (C) 2006-2014 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange * Copyright (C) 2006 Daniel P. Berrange
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
@ -364,7 +364,8 @@ qemuMonitorSendDiskPassphrase(qemuMonitorPtr mon,
int int
qemuMonitorTextStartCPUs(qemuMonitorPtr mon, qemuMonitorTextStartCPUs(qemuMonitorPtr mon,
virConnectPtr conn) { virConnectPtr conn)
{
char *reply; char *reply;
if (qemuMonitorTextCommandWithHandler(mon, "cont", if (qemuMonitorTextCommandWithHandler(mon, "cont",
@ -379,7 +380,8 @@ qemuMonitorTextStartCPUs(qemuMonitorPtr mon,
int int
qemuMonitorTextStopCPUs(qemuMonitorPtr mon) { qemuMonitorTextStopCPUs(qemuMonitorPtr mon)
{
char *info; char *info;
int ret; int ret;
@ -434,7 +436,8 @@ cleanup:
} }
int qemuMonitorTextSystemPowerdown(qemuMonitorPtr mon) { int qemuMonitorTextSystemPowerdown(qemuMonitorPtr mon)
{
char *info; char *info;
int ret; int ret;
@ -444,7 +447,11 @@ int qemuMonitorTextSystemPowerdown(qemuMonitorPtr mon) {
return ret; return ret;
} }
int qemuMonitorTextSetLink(qemuMonitorPtr mon, const char *name, enum virDomainNetInterfaceLinkState state) { int
qemuMonitorTextSetLink(qemuMonitorPtr mon,
const char *name,
enum virDomainNetInterfaceLinkState state)
{
char *info = NULL; char *info = NULL;
char *cmd = NULL; char *cmd = NULL;
const char *st_str = NULL; const char *st_str = NULL;
@ -486,7 +493,8 @@ error:
return -1; return -1;
} }
int qemuMonitorTextSystemReset(qemuMonitorPtr mon) { int qemuMonitorTextSystemReset(qemuMonitorPtr mon)
{
char *info; char *info;
int ret; int ret;