mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
src: remove blank first line in function body
Signed-off-by: Shi Lei <shi_lei@massclouds.com>
This commit is contained in:
parent
a618b06493
commit
c9ed87a610
@ -147,7 +147,6 @@ bhyveBuildNetArgStr(virConnectPtr conn,
|
||||
static int
|
||||
bhyveBuildConsoleArgStr(const virDomainDef *def, virCommandPtr cmd)
|
||||
{
|
||||
|
||||
virDomainChrDefPtr chr = NULL;
|
||||
|
||||
if (!def->nserials)
|
||||
@ -710,7 +709,6 @@ virBhyveProcessBuildCustomLoaderCmd(virDomainDefPtr def)
|
||||
static bool
|
||||
virBhyveUsableDisk(virDomainDiskDefPtr disk)
|
||||
{
|
||||
|
||||
if (virDomainDiskTranslateSourcePool(disk) < 0)
|
||||
return false;
|
||||
|
||||
@ -734,7 +732,6 @@ virBhyveUsableDisk(virDomainDiskDefPtr disk)
|
||||
static void
|
||||
virBhyveFormatGrubDevice(virBufferPtr devicemap, virDomainDiskDefPtr def)
|
||||
{
|
||||
|
||||
if (def->device == VIR_DOMAIN_DISK_DEVICE_CDROM)
|
||||
virBufferAsprintf(devicemap, "(cd) %s\n",
|
||||
virDomainDiskGetSource(def));
|
||||
|
@ -133,7 +133,6 @@ bhyveAutostartDomains(bhyveConnPtr driver)
|
||||
virCapsPtr ATTRIBUTE_NONNULL(1)
|
||||
bhyveDriverGetCapabilities(bhyveConnPtr driver)
|
||||
{
|
||||
|
||||
return virObjectRef(driver->caps);
|
||||
}
|
||||
|
||||
|
@ -177,7 +177,6 @@ bhyveMonitorOpen(virDomainObjPtr vm, bhyveConnPtr driver)
|
||||
void
|
||||
bhyveMonitorClose(bhyveMonitorPtr mon)
|
||||
{
|
||||
|
||||
if (mon == NULL)
|
||||
return;
|
||||
|
||||
|
@ -89,7 +89,6 @@ bhyveNetCleanup(virDomainObjPtr vm)
|
||||
static int
|
||||
virBhyveFormatDevMapFile(const char *vm_name, char **fn_out)
|
||||
{
|
||||
|
||||
return virAsprintf(fn_out, "%s/grub_bhyve-%s-device.map", BHYVE_STATE_DIR,
|
||||
vm_name);
|
||||
}
|
||||
|
@ -87,7 +87,6 @@ virCPUDefFreeFeatures(virCPUDefPtr def)
|
||||
void ATTRIBUTE_NONNULL(1)
|
||||
virCPUDefFreeModel(virCPUDefPtr def)
|
||||
{
|
||||
|
||||
VIR_FREE(def->model);
|
||||
VIR_FREE(def->vendor);
|
||||
VIR_FREE(def->vendor_id);
|
||||
|
@ -559,7 +559,6 @@ static void
|
||||
virDomainCapsFeatureSEVFormat(virBufferPtr buf,
|
||||
virSEVCapabilityPtr const sev)
|
||||
{
|
||||
|
||||
if (!sev) {
|
||||
virBufferAddLit(buf, "<sev supported='no'/>\n");
|
||||
} else {
|
||||
|
@ -989,7 +989,6 @@ static int
|
||||
virDomainKeyWrapCipherDefParseXML(virDomainKeyWrapDefPtr keywrap,
|
||||
xmlNodePtr node)
|
||||
{
|
||||
|
||||
char *name = NULL;
|
||||
char *state = NULL;
|
||||
int state_type;
|
||||
@ -6900,7 +6899,6 @@ static int
|
||||
virDomainHostdevSubsysUSBDefParseXML(xmlNodePtr node,
|
||||
virDomainHostdevDefPtr def)
|
||||
{
|
||||
|
||||
int ret = -1;
|
||||
bool got_product, got_vendor;
|
||||
xmlNodePtr cur;
|
||||
@ -12138,7 +12136,6 @@ virDomainChrSourceDefParseUnix(virDomainChrSourceDefPtr def,
|
||||
xmlNodePtr source,
|
||||
xmlXPathContextPtr ctxt)
|
||||
{
|
||||
|
||||
int mode;
|
||||
|
||||
if ((mode = virDomainChrSourceDefParseMode(source)) < 0)
|
||||
@ -14194,7 +14191,6 @@ virDomainWatchdogDefParseXML(virDomainXMLOptionPtr xmlopt,
|
||||
xmlNodePtr node,
|
||||
unsigned int flags)
|
||||
{
|
||||
|
||||
char *model = NULL;
|
||||
char *action = NULL;
|
||||
virDomainWatchdogDefPtr def;
|
||||
@ -16291,7 +16287,6 @@ virDomainChrTargetTypeToString(int deviceType,
|
||||
int
|
||||
virDomainHostdevInsert(virDomainDefPtr def, virDomainHostdevDefPtr hostdev)
|
||||
{
|
||||
|
||||
return VIR_APPEND_ELEMENT(def->hostdevs, def->nhostdevs, hostdev);
|
||||
}
|
||||
|
||||
@ -16630,7 +16625,6 @@ virDomainDiskByName(virDomainDefPtr def,
|
||||
int virDomainDiskInsert(virDomainDefPtr def,
|
||||
virDomainDiskDefPtr disk)
|
||||
{
|
||||
|
||||
if (VIR_REALLOC_N(def->disks, def->ndisks+1) < 0)
|
||||
return -1;
|
||||
|
||||
@ -16846,7 +16840,6 @@ virDomainNetRemove(virDomainDefPtr def, size_t i)
|
||||
int virDomainControllerInsert(virDomainDefPtr def,
|
||||
virDomainControllerDefPtr controller)
|
||||
{
|
||||
|
||||
if (VIR_REALLOC_N(def->controllers, def->ncontrollers+1) < 0)
|
||||
return -1;
|
||||
|
||||
@ -17063,7 +17056,6 @@ void virDomainLeaseInsertPreAlloced(virDomainDefPtr def,
|
||||
virDomainLeaseDefPtr
|
||||
virDomainLeaseRemoveAt(virDomainDefPtr def, size_t i)
|
||||
{
|
||||
|
||||
virDomainLeaseDefPtr lease = def->leases[i];
|
||||
|
||||
VIR_DELETE_ELEMENT(def->leases, i, def->nleases);
|
||||
@ -28656,7 +28648,6 @@ virDiskNameToBusDeviceIndex(virDomainDiskDefPtr disk,
|
||||
int *busIdx,
|
||||
int *devIdx)
|
||||
{
|
||||
|
||||
int idx = virDiskNameToIndex(disk->dst);
|
||||
if (idx < 0)
|
||||
return -1;
|
||||
@ -28687,7 +28678,6 @@ virDiskNameToBusDeviceIndex(virDomainDiskDefPtr disk,
|
||||
int
|
||||
virDomainFSInsert(virDomainDefPtr def, virDomainFSDefPtr fs)
|
||||
{
|
||||
|
||||
return VIR_APPEND_ELEMENT(def->fss, def->nfss, fs);
|
||||
}
|
||||
|
||||
|
@ -355,8 +355,6 @@ virSocketAddrRangeParseXML(const char *networkName,
|
||||
xmlNodePtr node,
|
||||
virSocketAddrRangePtr range)
|
||||
{
|
||||
|
||||
|
||||
char *start = NULL, *end = NULL;
|
||||
int ret = -1;
|
||||
|
||||
|
@ -463,7 +463,6 @@ static bool
|
||||
x86DataIsSubset(const virCPUx86Data *data,
|
||||
const virCPUx86Data *subset)
|
||||
{
|
||||
|
||||
virCPUx86DataIterator iter = virCPUx86DataIteratorInit((virCPUx86Data *)subset);
|
||||
const virCPUx86CPUID *cpuid;
|
||||
const virCPUx86CPUID *cpuidSubset;
|
||||
|
@ -63,7 +63,6 @@ static int virLockManagerNopAddResource(virLockManagerPtr lock ATTRIBUTE_UNUSED,
|
||||
virLockManagerParamPtr params ATTRIBUTE_UNUSED,
|
||||
unsigned int flags_unused ATTRIBUTE_UNUSED)
|
||||
{
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -3237,7 +3237,6 @@ static int
|
||||
networkFindUnusedBridgeName(virNetworkObjListPtr nets,
|
||||
virNetworkDefPtr def)
|
||||
{
|
||||
|
||||
int ret = -1, id = 0;
|
||||
char *newname = NULL;
|
||||
const char *templ = "virbr%d";
|
||||
|
@ -486,7 +486,6 @@ static void
|
||||
networkAddGeneralIPv6FirewallRules(virFirewallPtr fw,
|
||||
virNetworkDefPtr def)
|
||||
{
|
||||
|
||||
if (!virNetworkDefGetIPByIndex(def, AF_INET6, 0) &&
|
||||
!def->ipv6nogw) {
|
||||
return;
|
||||
|
@ -796,7 +796,6 @@ virNWFilterLearnIPAddress(virNWFilterTechDriverPtr techdriver ATTRIBUTE_UNUSED,
|
||||
int
|
||||
virNWFilterLearnInit(void)
|
||||
{
|
||||
|
||||
if (pendingLearnReq)
|
||||
return 0;
|
||||
|
||||
|
@ -3652,7 +3652,6 @@ phypDomainSetVcpus(virDomainPtr dom, unsigned int nvcpus)
|
||||
static int
|
||||
phypDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags)
|
||||
{
|
||||
|
||||
phyp_driverPtr phyp_driver = dom->conn->privateData;
|
||||
LIBSSH2_SESSION *session = phyp_driver->session;
|
||||
char *managed_system = phyp_driver->managed_system;
|
||||
|
@ -301,7 +301,6 @@ qemuAssignDeviceNetAlias(virDomainDefPtr def,
|
||||
virDomainNetDefPtr net,
|
||||
int idx)
|
||||
{
|
||||
|
||||
if (net->info.alias)
|
||||
return 0;
|
||||
|
||||
|
@ -915,7 +915,6 @@ qemuDomainFillDevicePCIConnectFlagsIterInit(virDomainDefPtr def,
|
||||
virQEMUDriverPtr driver,
|
||||
qemuDomainFillDevicePCIConnectFlagsIterData *data)
|
||||
{
|
||||
|
||||
data->driver = driver;
|
||||
|
||||
if (qemuDomainHasPCIeRoot(def)) {
|
||||
|
@ -5092,7 +5092,6 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
|
||||
int maplen,
|
||||
unsigned int flags)
|
||||
{
|
||||
|
||||
virQEMUDriverPtr driver = dom->conn->privateData;
|
||||
virDomainObjPtr vm;
|
||||
virDomainDefPtr def;
|
||||
|
@ -4121,7 +4121,6 @@ int
|
||||
qemuMonitorGetIOThreads(qemuMonitorPtr mon,
|
||||
qemuMonitorIOThreadInfoPtr **iothreads)
|
||||
{
|
||||
|
||||
VIR_DEBUG("iothreads=%p", iothreads);
|
||||
|
||||
QEMU_CHECK_MONITOR(mon);
|
||||
|
@ -1554,7 +1554,6 @@ int qemuMonitorJSONSetLink(qemuMonitorPtr mon,
|
||||
const char *name,
|
||||
virDomainNetInterfaceLinkState state)
|
||||
{
|
||||
|
||||
int ret = -1;
|
||||
virJSONValuePtr reply = NULL;
|
||||
virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("set_link",
|
||||
|
@ -5489,7 +5489,6 @@ int
|
||||
qemuProcessSetupIOThread(virDomainObjPtr vm,
|
||||
virDomainIOThreadIDDefPtr iothread)
|
||||
{
|
||||
|
||||
return qemuProcessSetupPid(vm, iothread->thread_id,
|
||||
VIR_CGROUP_THREAD_IOTHREAD,
|
||||
iothread->iothread_id,
|
||||
|
@ -216,7 +216,6 @@ virStorageBackendSheepdogDeleteVol(virStoragePoolObjPtr pool,
|
||||
virStorageVolDefPtr vol,
|
||||
unsigned int flags)
|
||||
{
|
||||
|
||||
virCheckFlags(0, -1);
|
||||
|
||||
virCommandPtr cmd = virCommandNewArgList(SHEEPDOGCLI, "vdi", "delete", vol->name, NULL);
|
||||
@ -386,7 +385,6 @@ virStorageBackendSheepdogResizeVol(virStoragePoolObjPtr pool,
|
||||
unsigned long long capacity,
|
||||
unsigned int flags)
|
||||
{
|
||||
|
||||
virCheckFlags(0, -1);
|
||||
|
||||
virCommandPtr cmd = virCommandNewArgList(SHEEPDOGCLI, "vdi", "resize", vol->name, NULL);
|
||||
@ -396,7 +394,6 @@ virStorageBackendSheepdogResizeVol(virStoragePoolObjPtr pool,
|
||||
|
||||
virCommandFree(cmd);
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -2258,7 +2258,6 @@ virStorageBackendPloopRestoreDesc(char *path)
|
||||
static void
|
||||
virStorageVolPoolRefreshThread(void *opaque)
|
||||
{
|
||||
|
||||
virStorageVolStreamInfoPtr cbdata = opaque;
|
||||
virStoragePoolObjPtr obj = NULL;
|
||||
virStoragePoolDefPtr def;
|
||||
|
@ -3174,7 +3174,6 @@ virStorageBackendBLKIDFindEmpty(const char *device,
|
||||
const char *format,
|
||||
bool writelabel)
|
||||
{
|
||||
|
||||
int ret = -1;
|
||||
int rc;
|
||||
blkid_probe probe = NULL;
|
||||
|
@ -2719,7 +2719,6 @@ static int testConnectListDefinedDomains(virConnectPtr conn,
|
||||
char **const names,
|
||||
int maxnames)
|
||||
{
|
||||
|
||||
testDriverPtr privconn = conn->privateData;
|
||||
|
||||
memset(names, 0, sizeof(*names)*maxnames);
|
||||
@ -5235,7 +5234,6 @@ testStorageVolDelete(virStorageVolPtr vol,
|
||||
static int
|
||||
testStorageVolumeTypeForPool(int pooltype)
|
||||
{
|
||||
|
||||
switch (pooltype) {
|
||||
case VIR_STORAGE_POOL_DIR:
|
||||
case VIR_STORAGE_POOL_FS:
|
||||
|
@ -885,6 +885,5 @@ dnsmasqCapsGetVersion(dnsmasqCapsPtr caps)
|
||||
bool
|
||||
dnsmasqCapsGet(dnsmasqCapsPtr caps, dnsmasqCapsFlags flag)
|
||||
{
|
||||
|
||||
return caps && virBitmapIsBitSet(caps->flags, flag);
|
||||
}
|
||||
|
@ -2819,7 +2819,6 @@ virFileAccessibleAs(const char *path,
|
||||
uid_t uid ATTRIBUTE_UNUSED,
|
||||
gid_t gid ATTRIBUTE_UNUSED)
|
||||
{
|
||||
|
||||
VIR_WARN("Ignoring uid/gid due to WIN32");
|
||||
|
||||
return access(path, mode);
|
||||
|
@ -665,7 +665,6 @@ int
|
||||
virNetDevSetOnline(const char *ifname,
|
||||
bool online)
|
||||
{
|
||||
|
||||
return virNetDevSetIFFlag(ifname, VIR_IFF_UP, online);
|
||||
}
|
||||
|
||||
@ -1073,7 +1072,6 @@ int
|
||||
virNetDevSysfsFile(char **pf_sysfs_device_link, const char *ifname,
|
||||
const char *file)
|
||||
{
|
||||
|
||||
if (virAsprintf(pf_sysfs_device_link, SYSFS_NET_DIR "%s/%s", ifname, file) < 0)
|
||||
return -1;
|
||||
return 0;
|
||||
@ -1083,7 +1081,6 @@ static int
|
||||
virNetDevSysfsDeviceFile(char **pf_sysfs_device_link, const char *ifname,
|
||||
const char *file)
|
||||
{
|
||||
|
||||
if (virAsprintf(pf_sysfs_device_link, SYSFS_NET_DIR "%s/device/%s", ifname,
|
||||
file) < 0)
|
||||
return -1;
|
||||
|
@ -83,7 +83,6 @@ virBitmapPtr macvlanIDs = NULL;
|
||||
static int
|
||||
virNetDevMacVLanOnceInit(void)
|
||||
{
|
||||
|
||||
if (!macvtapIDs &&
|
||||
!(macvtapIDs = virBitmapNew(MACVLAN_MAX_ID + 1)))
|
||||
return -1;
|
||||
|
@ -4753,7 +4753,6 @@ virStorageFileReportBrokenChain(int errcode,
|
||||
virStorageSourcePtr src,
|
||||
virStorageSourcePtr parent)
|
||||
{
|
||||
|
||||
if (src->drv) {
|
||||
unsigned int access_user = src->drv->uid;
|
||||
unsigned int access_group = src->drv->gid;
|
||||
|
@ -1724,7 +1724,6 @@ virGetDeviceID(const char *path ATTRIBUTE_UNUSED,
|
||||
int *maj ATTRIBUTE_UNUSED,
|
||||
int *min ATTRIBUTE_UNUSED)
|
||||
{
|
||||
|
||||
return -ENOSYS;
|
||||
}
|
||||
#endif
|
||||
|
@ -44,7 +44,6 @@ static vboxUniformedAPI gVBoxAPI;
|
||||
|
||||
static int vboxConnectNumOfStoragePools(virConnectPtr conn ATTRIBUTE_UNUSED)
|
||||
{
|
||||
|
||||
/** Currently only one pool supported, the default one
|
||||
* given by ISystemProperties::defaultHardDiskFolder()
|
||||
*/
|
||||
|
@ -183,7 +183,6 @@ vzGetDriverConnection(void)
|
||||
void
|
||||
vzDestroyDriverConnection(void)
|
||||
{
|
||||
|
||||
vzDriverPtr driver;
|
||||
vzConnPtr privconn_list;
|
||||
|
||||
|
@ -4126,7 +4126,6 @@ prlsdkCreateVm(vzDriverPtr driver, virDomainDefPtr def)
|
||||
static int
|
||||
virStorageTranslatePoolLocal(virConnectPtr conn, virStorageSourcePtr src)
|
||||
{
|
||||
|
||||
virStoragePoolPtr pool = NULL;
|
||||
virStorageVolPtr vol = NULL;
|
||||
virStorageVolInfo info;
|
||||
|
@ -447,7 +447,6 @@ xenapiNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info)
|
||||
static char *
|
||||
xenapiConnectGetCapabilities(virConnectPtr conn)
|
||||
{
|
||||
|
||||
virCapsPtr caps = ((struct _xenapiPrivate *)(conn->privateData))->caps;
|
||||
if (caps)
|
||||
return virCapabilitiesFormatXML(caps);
|
||||
@ -1241,7 +1240,6 @@ xenapiDomainGetVcpus(virDomainPtr dom,
|
||||
virVcpuInfoPtr info, int maxinfo,
|
||||
unsigned char *cpumaps, int maplen)
|
||||
{
|
||||
|
||||
xen_vm_set *vms = NULL;
|
||||
xen_vm vm = NULL;
|
||||
xen_string_string_map *vcpu_params = NULL;
|
||||
|
@ -1346,7 +1346,6 @@ xenFormatNet(virConnectPtr conn,
|
||||
static int
|
||||
xenFormatPCI(virConfPtr conf, virDomainDefPtr def)
|
||||
{
|
||||
|
||||
virConfValuePtr pciVal = NULL;
|
||||
int hasPCI = 0;
|
||||
size_t i;
|
||||
|
Loading…
x
Reference in New Issue
Block a user