mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
lib: Put some variable declarations on individual lines
In short, virXXXPtr type is going away. With big bang. And to help us rewrite the code with a sed script, it's better if each variable is declared on its own line. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
a1d058a1db
commit
9d3cd0c1d4
@ -917,7 +917,10 @@ virBhyveProcessBuildGrubbhyveCmd(virDomainDefPtr def,
|
|||||||
const char *devmap_file,
|
const char *devmap_file,
|
||||||
char **devicesmap_out)
|
char **devicesmap_out)
|
||||||
{
|
{
|
||||||
virDomainDiskDefPtr hdd, cd, userdef, diskdef;
|
virDomainDiskDefPtr hdd;
|
||||||
|
virDomainDiskDefPtr cd;
|
||||||
|
virDomainDiskDefPtr userdef;
|
||||||
|
virDomainDiskDefPtr diskdef;
|
||||||
virCommandPtr cmd;
|
virCommandPtr cmd;
|
||||||
unsigned int best_idx = UINT_MAX;
|
unsigned int best_idx = UINT_MAX;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
@ -681,7 +681,8 @@ bhyveConnectDomainXMLToNative(virConnectPtr conn,
|
|||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
bhyveConnPtr privconn = conn->privateData;
|
bhyveConnPtr privconn = conn->privateData;
|
||||||
virDomainDefPtr def = NULL;
|
virDomainDefPtr def = NULL;
|
||||||
virCommandPtr cmd = NULL, loadcmd = NULL;
|
virCommandPtr cmd = NULL;
|
||||||
|
virCommandPtr loadcmd = NULL;
|
||||||
char *ret = NULL;
|
char *ret = NULL;
|
||||||
|
|
||||||
virCheckFlags(0, NULL);
|
virCheckFlags(0, NULL);
|
||||||
|
@ -2082,7 +2082,8 @@ int
|
|||||||
virDomainUSBAddressSetAddHub(virDomainUSBAddressSetPtr addrs,
|
virDomainUSBAddressSetAddHub(virDomainUSBAddressSetPtr addrs,
|
||||||
virDomainHubDefPtr hub)
|
virDomainHubDefPtr hub)
|
||||||
{
|
{
|
||||||
virDomainUSBAddressHubPtr targetHub = NULL, newHub = NULL;
|
virDomainUSBAddressHubPtr targetHub = NULL;
|
||||||
|
virDomainUSBAddressHubPtr newHub = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
int targetPort;
|
int targetPort;
|
||||||
g_autofree char *portStr = NULL;
|
g_autofree char *portStr = NULL;
|
||||||
|
@ -17621,7 +17621,8 @@ virDomainChrDefPtr
|
|||||||
virDomainChrRemove(virDomainDefPtr vmdef,
|
virDomainChrRemove(virDomainDefPtr vmdef,
|
||||||
virDomainChrDefPtr chr)
|
virDomainChrDefPtr chr)
|
||||||
{
|
{
|
||||||
virDomainChrDefPtr ret = NULL, **arrPtr = NULL;
|
virDomainChrDefPtr ret = NULL;
|
||||||
|
virDomainChrDefPtr **arrPtr = NULL;
|
||||||
size_t i, *cntPtr = NULL;
|
size_t i, *cntPtr = NULL;
|
||||||
|
|
||||||
if (virDomainChrGetDomainPtrsInternal(vmdef, chr->deviceType,
|
if (virDomainChrGetDomainPtrsInternal(vmdef, chr->deviceType,
|
||||||
|
@ -780,7 +780,8 @@ virDomainNumaDefNodeDistanceParseXML(virDomainNumaPtr def,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < sibling; i++) {
|
for (i = 0; i < sibling; i++) {
|
||||||
virDomainNumaDistancePtr ldist, rdist;
|
virDomainNumaDistancePtr ldist;
|
||||||
|
virDomainNumaDistancePtr rdist;
|
||||||
unsigned int sibling_id, sibling_value;
|
unsigned int sibling_id, sibling_value;
|
||||||
|
|
||||||
/* siblings are in order of parsing or explicitly numbered */
|
/* siblings are in order of parsing or explicitly numbered */
|
||||||
|
@ -402,7 +402,8 @@ virNWFilterVarCombIterEntryAreUniqueEntries(virNWFilterVarCombIterEntryPtr cie,
|
|||||||
GHashTable *hash)
|
GHashTable *hash)
|
||||||
{
|
{
|
||||||
size_t i, j;
|
size_t i, j;
|
||||||
virNWFilterVarValuePtr varValue, tmp;
|
virNWFilterVarValuePtr varValue;
|
||||||
|
virNWFilterVarValuePtr tmp;
|
||||||
const char *value;
|
const char *value;
|
||||||
|
|
||||||
varValue = virHashLookup(hash, cie->varNames[0]);
|
varValue = virHashLookup(hash, cie->varNames[0]);
|
||||||
|
@ -1254,7 +1254,8 @@ virNetworkObjUpdate(virNetworkObjPtr obj,
|
|||||||
unsigned int flags) /* virNetworkUpdateFlags */
|
unsigned int flags) /* virNetworkUpdateFlags */
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
virNetworkDefPtr livedef = NULL, configdef = NULL;
|
virNetworkDefPtr livedef = NULL;
|
||||||
|
virNetworkDefPtr configdef = NULL;
|
||||||
|
|
||||||
/* normalize config data, and check for common invalid requests. */
|
/* normalize config data, and check for common invalid requests. */
|
||||||
if (virNetworkObjConfigChangeSetup(obj, xmlopt, flags) < 0)
|
if (virNetworkObjConfigChangeSetup(obj, xmlopt, flags) < 0)
|
||||||
|
@ -128,7 +128,8 @@ virDomainDriverMergeBlkioDevice(virBlkioDevicePtr *dest_array,
|
|||||||
const char *type)
|
const char *type)
|
||||||
{
|
{
|
||||||
size_t i, j;
|
size_t i, j;
|
||||||
virBlkioDevicePtr dest, src;
|
virBlkioDevicePtr dest;
|
||||||
|
virBlkioDevicePtr src;
|
||||||
|
|
||||||
for (i = 0; i < src_size; i++) {
|
for (i = 0; i < src_size; i++) {
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
@ -832,7 +832,8 @@ virHostdevPreparePCIDevicesImpl(virHostdevManagerPtr mgr,
|
|||||||
|
|
||||||
/* Step 6: Set driver and domain information */
|
/* Step 6: Set driver and domain information */
|
||||||
for (i = 0; i < virPCIDeviceListCount(pcidevs); i++) {
|
for (i = 0; i < virPCIDeviceListCount(pcidevs); i++) {
|
||||||
virPCIDevicePtr pci, actual;
|
virPCIDevicePtr pci;
|
||||||
|
virPCIDevicePtr actual;
|
||||||
|
|
||||||
/* We need to look up the actual device and set the information
|
/* We need to look up the actual device and set the information
|
||||||
* there because 'pci' only contain address information and will
|
* there because 'pci' only contain address information and will
|
||||||
|
@ -3961,9 +3961,12 @@ libxlDomainDetachDeviceLive(libxlDriverPrivatePtr driver,
|
|||||||
static int
|
static int
|
||||||
libxlDomainDetachDeviceConfig(virDomainDefPtr vmdef, virDomainDeviceDefPtr dev)
|
libxlDomainDetachDeviceConfig(virDomainDefPtr vmdef, virDomainDeviceDefPtr dev)
|
||||||
{
|
{
|
||||||
virDomainDiskDefPtr disk, detach;
|
virDomainDiskDefPtr disk;
|
||||||
virDomainHostdevDefPtr hostdev, det_hostdev;
|
virDomainDiskDefPtr detach;
|
||||||
virDomainControllerDefPtr cont, det_cont;
|
virDomainHostdevDefPtr hostdev;
|
||||||
|
virDomainHostdevDefPtr det_hostdev;
|
||||||
|
virDomainControllerDefPtr cont;
|
||||||
|
virDomainControllerDefPtr det_cont;
|
||||||
virDomainNetDefPtr net;
|
virDomainNetDefPtr net;
|
||||||
int idx;
|
int idx;
|
||||||
|
|
||||||
|
@ -1559,7 +1559,8 @@ static int
|
|||||||
xenFormatSerial(virConfValuePtr list, virDomainChrDefPtr serial)
|
xenFormatSerial(virConfValuePtr list, virDomainChrDefPtr serial)
|
||||||
{
|
{
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
virConfValuePtr val, tmp;
|
virConfValuePtr val;
|
||||||
|
virConfValuePtr tmp;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (serial) {
|
if (serial) {
|
||||||
@ -1614,7 +1615,8 @@ xenFormatNet(virConnectPtr conn,
|
|||||||
const char *vif_typename)
|
const char *vif_typename)
|
||||||
{
|
{
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
virConfValuePtr val, tmp;
|
virConfValuePtr val;
|
||||||
|
virConfValuePtr tmp;
|
||||||
char macaddr[VIR_MAC_STRING_BUFLEN];
|
char macaddr[VIR_MAC_STRING_BUFLEN];
|
||||||
|
|
||||||
virBufferAsprintf(&buf, "mac=%s", virMacAddrFormat(&net->mac, macaddr));
|
virBufferAsprintf(&buf, "mac=%s", virMacAddrFormat(&net->mac, macaddr));
|
||||||
@ -1768,7 +1770,8 @@ xenFormatPCI(virConfPtr conf, virDomainDefPtr def)
|
|||||||
for (i = 0; i < def->nhostdevs; i++) {
|
for (i = 0; i < def->nhostdevs; i++) {
|
||||||
if (def->hostdevs[i]->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
|
if (def->hostdevs[i]->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
|
||||||
def->hostdevs[i]->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI) {
|
def->hostdevs[i]->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI) {
|
||||||
virConfValuePtr val, tmp;
|
virConfValuePtr val;
|
||||||
|
virConfValuePtr tmp;
|
||||||
char *buf;
|
char *buf;
|
||||||
const char *permissive_str = NULL;
|
const char *permissive_str = NULL;
|
||||||
|
|
||||||
@ -2242,7 +2245,8 @@ xenFormatVfb(virConfPtr conf, virDomainDefPtr def)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
virConfValuePtr vfb, disp;
|
virConfValuePtr vfb;
|
||||||
|
virConfValuePtr disp;
|
||||||
char *vfbstr = NULL;
|
char *vfbstr = NULL;
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
|
@ -1395,7 +1395,8 @@ static int
|
|||||||
xenFormatXLVnode(virConfValuePtr list,
|
xenFormatXLVnode(virConfValuePtr list,
|
||||||
virBufferPtr buf)
|
virBufferPtr buf)
|
||||||
{
|
{
|
||||||
virConfValuePtr numaPnode, tmp;
|
virConfValuePtr numaPnode;
|
||||||
|
virConfValuePtr tmp;
|
||||||
|
|
||||||
numaPnode = g_new0(virConfValue, 1);
|
numaPnode = g_new0(virConfValue, 1);
|
||||||
|
|
||||||
@ -1423,7 +1424,8 @@ xenFormatXLVnuma(virConfValuePtr list,
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
size_t i;
|
size_t i;
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
virConfValuePtr numaVnode, tmp;
|
virConfValuePtr numaVnode;
|
||||||
|
virConfValuePtr tmp;
|
||||||
virBitmapPtr cpumask = virDomainNumaGetNodeCpumask(numa, node);
|
virBitmapPtr cpumask = virDomainNumaGetNodeCpumask(numa, node);
|
||||||
size_t nodeSize = virDomainNumaGetNodeMemorySize(numa, node) / 1024;
|
size_t nodeSize = virDomainNumaGetNodeMemorySize(numa, node) / 1024;
|
||||||
g_autofree char *nodeVcpus = NULL;
|
g_autofree char *nodeVcpus = NULL;
|
||||||
@ -1638,7 +1640,8 @@ static int
|
|||||||
xenFormatXLDisk(virConfValuePtr list, virDomainDiskDefPtr disk)
|
xenFormatXLDisk(virConfValuePtr list, virDomainDiskDefPtr disk)
|
||||||
{
|
{
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
virConfValuePtr val, tmp;
|
virConfValuePtr val;
|
||||||
|
virConfValuePtr tmp;
|
||||||
int format = virDomainDiskGetFormat(disk);
|
int format = virDomainDiskGetFormat(disk);
|
||||||
const char *driver = virDomainDiskGetDriver(disk);
|
const char *driver = virDomainDiskGetDriver(disk);
|
||||||
g_autofree char *target = NULL;
|
g_autofree char *target = NULL;
|
||||||
@ -1858,7 +1861,8 @@ xenFormatXLInputDevs(virConfPtr conf, virDomainDefPtr def)
|
|||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
const char *devtype;
|
const char *devtype;
|
||||||
virConfValuePtr usbdevices = NULL, lastdev;
|
virConfValuePtr usbdevices = NULL;
|
||||||
|
virConfValuePtr lastdev;
|
||||||
|
|
||||||
if (def->os.type == VIR_DOMAIN_OSTYPE_HVM) {
|
if (def->os.type == VIR_DOMAIN_OSTYPE_HVM) {
|
||||||
usbdevices = g_new0(virConfValue, 1);
|
usbdevices = g_new0(virConfValue, 1);
|
||||||
@ -1941,7 +1945,8 @@ xenFormatXLUSBController(virConfPtr conf,
|
|||||||
|
|
||||||
for (i = 0; i < def->ncontrollers; i++) {
|
for (i = 0; i < def->ncontrollers; i++) {
|
||||||
if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_USB) {
|
if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_USB) {
|
||||||
virConfValuePtr val, tmp;
|
virConfValuePtr val;
|
||||||
|
virConfValuePtr tmp;
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if (def->controllers[i]->model != -1) {
|
if (def->controllers[i]->model != -1) {
|
||||||
@ -2019,7 +2024,8 @@ xenFormatXLUSB(virConfPtr conf,
|
|||||||
for (i = 0; i < def->nhostdevs; i++) {
|
for (i = 0; i < def->nhostdevs; i++) {
|
||||||
if (def->hostdevs[i]->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
|
if (def->hostdevs[i]->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
|
||||||
def->hostdevs[i]->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB) {
|
def->hostdevs[i]->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB) {
|
||||||
virConfValuePtr val, tmp;
|
virConfValuePtr val;
|
||||||
|
virConfValuePtr tmp;
|
||||||
char *buf;
|
char *buf;
|
||||||
|
|
||||||
buf = g_strdup_printf("hostbus=%x,hostaddr=%x",
|
buf = g_strdup_printf("hostbus=%x,hostaddr=%x",
|
||||||
@ -2055,7 +2061,8 @@ xenFormatXLChannel(virConfValuePtr list, virDomainChrDefPtr channel)
|
|||||||
{
|
{
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
int sourceType = channel->source->type;
|
int sourceType = channel->source->type;
|
||||||
virConfValuePtr val, tmp;
|
virConfValuePtr val;
|
||||||
|
virConfValuePtr tmp;
|
||||||
|
|
||||||
/* connection */
|
/* connection */
|
||||||
virBufferAddLit(&buf, "connection=");
|
virBufferAddLit(&buf, "connection=");
|
||||||
@ -2145,7 +2152,8 @@ xenFormatXLDomainNamespaceData(virConfPtr conf, virDomainDefPtr def)
|
|||||||
args->list = NULL;
|
args->list = NULL;
|
||||||
|
|
||||||
for (i = 0; i < nsdata->num_args; i++) {
|
for (i = 0; i < nsdata->num_args; i++) {
|
||||||
virConfValuePtr val, tmp;
|
virConfValuePtr val;
|
||||||
|
virConfValuePtr tmp;
|
||||||
|
|
||||||
val = g_new0(virConfValue, 1);
|
val = g_new0(virConfValue, 1);
|
||||||
|
|
||||||
|
@ -275,7 +275,8 @@ xenFormatXMDisk(virConfValuePtr list,
|
|||||||
virDomainDiskDefPtr disk)
|
virDomainDiskDefPtr disk)
|
||||||
{
|
{
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
virConfValuePtr val, tmp;
|
virConfValuePtr val;
|
||||||
|
virConfValuePtr tmp;
|
||||||
const char *src = virDomainDiskGetSource(disk);
|
const char *src = virDomainDiskGetSource(disk);
|
||||||
int format = virDomainDiskGetFormat(disk);
|
int format = virDomainDiskGetFormat(disk);
|
||||||
const char *driver = virDomainDiskGetDriver(disk);
|
const char *driver = virDomainDiskGetDriver(disk);
|
||||||
|
@ -735,7 +735,8 @@ static int virLXCControllerSetupLoopDevices(virLXCControllerPtr ctrl)
|
|||||||
static int virLXCControllerSetupCpuAffinity(virLXCControllerPtr ctrl)
|
static int virLXCControllerSetupCpuAffinity(virLXCControllerPtr ctrl)
|
||||||
{
|
{
|
||||||
int hostcpus, maxcpu = CPU_SETSIZE;
|
int hostcpus, maxcpu = CPU_SETSIZE;
|
||||||
virBitmapPtr cpumap, cpumapToSet;
|
virBitmapPtr cpumap;
|
||||||
|
virBitmapPtr cpumapToSet;
|
||||||
|
|
||||||
VIR_DEBUG("Setting CPU affinity");
|
VIR_DEBUG("Setting CPU affinity");
|
||||||
|
|
||||||
|
@ -3129,9 +3129,11 @@ lxcDomainDetachDeviceConfig(virDomainDefPtr vmdef,
|
|||||||
virDomainDeviceDefPtr dev)
|
virDomainDeviceDefPtr dev)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
virDomainDiskDefPtr disk, det_disk;
|
virDomainDiskDefPtr disk;
|
||||||
|
virDomainDiskDefPtr det_disk;
|
||||||
virDomainNetDefPtr net;
|
virDomainNetDefPtr net;
|
||||||
virDomainHostdevDefPtr hostdev, det_hostdev;
|
virDomainHostdevDefPtr hostdev;
|
||||||
|
virDomainHostdevDefPtr det_hostdev;
|
||||||
int idx;
|
int idx;
|
||||||
|
|
||||||
switch (dev->type) {
|
switch (dev->type) {
|
||||||
@ -4294,7 +4296,8 @@ static int lxcDomainAttachDeviceFlags(virDomainPtr dom,
|
|||||||
virLXCDriverPtr driver = dom->conn->privateData;
|
virLXCDriverPtr driver = dom->conn->privateData;
|
||||||
virDomainObjPtr vm = NULL;
|
virDomainObjPtr vm = NULL;
|
||||||
virDomainDefPtr vmdef = NULL;
|
virDomainDefPtr vmdef = NULL;
|
||||||
virDomainDeviceDefPtr dev = NULL, dev_copy = NULL;
|
virDomainDeviceDefPtr dev = NULL;
|
||||||
|
virDomainDeviceDefPtr dev_copy = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver);
|
virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver);
|
||||||
|
|
||||||
@ -4468,7 +4471,8 @@ static int lxcDomainDetachDeviceFlags(virDomainPtr dom,
|
|||||||
virCapsPtr caps = NULL;
|
virCapsPtr caps = NULL;
|
||||||
virDomainObjPtr vm = NULL;
|
virDomainObjPtr vm = NULL;
|
||||||
virDomainDefPtr vmdef = NULL;
|
virDomainDefPtr vmdef = NULL;
|
||||||
virDomainDeviceDefPtr dev = NULL, dev_copy = NULL;
|
virDomainDeviceDefPtr dev = NULL;
|
||||||
|
virDomainDeviceDefPtr dev_copy = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver);
|
virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver);
|
||||||
|
|
||||||
|
@ -1065,7 +1065,10 @@ networkDnsmasqConfContents(virNetworkObjPtr obj,
|
|||||||
size_t i;
|
size_t i;
|
||||||
virNetworkDNSDefPtr dns = &def->dns;
|
virNetworkDNSDefPtr dns = &def->dns;
|
||||||
bool wantDNS = dns->enable != VIR_TRISTATE_BOOL_NO;
|
bool wantDNS = dns->enable != VIR_TRISTATE_BOOL_NO;
|
||||||
virNetworkIPDefPtr tmpipdef, ipdef, ipv4def, ipv6def;
|
virNetworkIPDefPtr tmpipdef;
|
||||||
|
virNetworkIPDefPtr ipdef;
|
||||||
|
virNetworkIPDefPtr ipv4def;
|
||||||
|
virNetworkIPDefPtr ipv6def;
|
||||||
bool ipv6SLAAC;
|
bool ipv6SLAAC;
|
||||||
|
|
||||||
*configstr = NULL;
|
*configstr = NULL;
|
||||||
@ -1682,7 +1685,9 @@ networkRefreshDhcpDaemon(virNetworkDriverStatePtr driver,
|
|||||||
virNetworkDefPtr def = virNetworkObjGetDef(obj);
|
virNetworkDefPtr def = virNetworkObjGetDef(obj);
|
||||||
size_t i;
|
size_t i;
|
||||||
pid_t dnsmasqPid;
|
pid_t dnsmasqPid;
|
||||||
virNetworkIPDefPtr ipdef, ipv4def, ipv6def;
|
virNetworkIPDefPtr ipdef;
|
||||||
|
virNetworkIPDefPtr ipv4def;
|
||||||
|
virNetworkIPDefPtr ipv6def;
|
||||||
g_autoptr(dnsmasqContext) dctx = NULL;
|
g_autoptr(dnsmasqContext) dctx = NULL;
|
||||||
|
|
||||||
/* if no IP addresses specified, nothing to do */
|
/* if no IP addresses specified, nothing to do */
|
||||||
|
@ -3199,7 +3199,8 @@ iptablesRuleInstCommand(virFirewallPtr fw,
|
|||||||
const char *ifname,
|
const char *ifname,
|
||||||
virNWFilterRuleInstPtr rule)
|
virNWFilterRuleInstPtr rule)
|
||||||
{
|
{
|
||||||
virNWFilterVarCombIterPtr vciter, tmp;
|
virNWFilterVarCombIterPtr vciter;
|
||||||
|
virNWFilterVarCombIterPtr tmp;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
/* rule->vars holds all the variables names that this rule will access.
|
/* rule->vars holds all the variables names that this rule will access.
|
||||||
@ -3234,7 +3235,8 @@ ebtablesRuleInstCommand(virFirewallPtr fw,
|
|||||||
const char *ifname,
|
const char *ifname,
|
||||||
virNWFilterRuleInstPtr rule)
|
virNWFilterRuleInstPtr rule)
|
||||||
{
|
{
|
||||||
virNWFilterVarCombIterPtr vciter, tmp;
|
virNWFilterVarCombIterPtr vciter;
|
||||||
|
virNWFilterVarCombIterPtr tmp;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
/* rule->vars holds all the variables names that this rule will access.
|
/* rule->vars holds all the variables names that this rule will access.
|
||||||
|
@ -1817,7 +1817,8 @@ openvzUpdateDevice(virDomainDefPtr vmdef,
|
|||||||
virDomainDeviceDefPtr dev,
|
virDomainDeviceDefPtr dev,
|
||||||
bool persist)
|
bool persist)
|
||||||
{
|
{
|
||||||
virDomainFSDefPtr fs, cur;
|
virDomainFSDefPtr fs;
|
||||||
|
virDomainFSDefPtr cur;
|
||||||
int pos;
|
int pos;
|
||||||
|
|
||||||
if (dev->type == VIR_DOMAIN_DEVICE_FS) {
|
if (dev->type == VIR_DOMAIN_DEVICE_FS) {
|
||||||
|
@ -1255,7 +1255,8 @@ int qemuAgentFSFreeze(qemuAgentPtr agent, const char **mountpoints,
|
|||||||
unsigned int nmountpoints)
|
unsigned int nmountpoints)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
virJSONValuePtr cmd, arg = NULL;
|
virJSONValuePtr cmd;
|
||||||
|
virJSONValuePtr arg = NULL;
|
||||||
virJSONValuePtr reply = NULL;
|
virJSONValuePtr reply = NULL;
|
||||||
|
|
||||||
if (mountpoints && nmountpoints) {
|
if (mountpoints && nmountpoints) {
|
||||||
|
@ -6172,7 +6172,8 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver,
|
|||||||
if ((flags & VIR_DOMAIN_XML_MIGRATABLE)) {
|
if ((flags & VIR_DOMAIN_XML_MIGRATABLE)) {
|
||||||
size_t i;
|
size_t i;
|
||||||
int toremove = 0;
|
int toremove = 0;
|
||||||
virDomainControllerDefPtr usb = NULL, pci = NULL;
|
virDomainControllerDefPtr usb = NULL;
|
||||||
|
virDomainControllerDefPtr pci = NULL;
|
||||||
|
|
||||||
/* If only the default USB controller is present, we can remove it
|
/* If only the default USB controller is present, we can remove it
|
||||||
* and make the XML compatible with older versions of libvirt which
|
* and make the XML compatible with older versions of libvirt which
|
||||||
|
@ -7431,12 +7431,16 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef,
|
|||||||
unsigned int parse_flags,
|
unsigned int parse_flags,
|
||||||
virDomainXMLOptionPtr xmlopt)
|
virDomainXMLOptionPtr xmlopt)
|
||||||
{
|
{
|
||||||
virDomainDiskDefPtr disk, det_disk;
|
virDomainDiskDefPtr disk;
|
||||||
|
virDomainDiskDefPtr det_disk;
|
||||||
virDomainNetDefPtr net;
|
virDomainNetDefPtr net;
|
||||||
virDomainSoundDefPtr sound;
|
virDomainSoundDefPtr sound;
|
||||||
virDomainHostdevDefPtr hostdev, det_hostdev;
|
virDomainHostdevDefPtr hostdev;
|
||||||
virDomainLeaseDefPtr lease, det_lease;
|
virDomainHostdevDefPtr det_hostdev;
|
||||||
virDomainControllerDefPtr cont, det_cont;
|
virDomainLeaseDefPtr lease;
|
||||||
|
virDomainLeaseDefPtr det_lease;
|
||||||
|
virDomainControllerDefPtr cont;
|
||||||
|
virDomainControllerDefPtr det_cont;
|
||||||
virDomainChrDefPtr chr;
|
virDomainChrDefPtr chr;
|
||||||
virDomainFSDefPtr fs;
|
virDomainFSDefPtr fs;
|
||||||
virDomainMemoryDefPtr mem;
|
virDomainMemoryDefPtr mem;
|
||||||
@ -10240,7 +10244,8 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
|
|||||||
virDomainDefPtr def;
|
virDomainDefPtr def;
|
||||||
virDomainDefPtr persistentDef;
|
virDomainDefPtr persistentDef;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
virDomainNetDefPtr net = NULL, persistentNet = NULL;
|
virDomainNetDefPtr net = NULL;
|
||||||
|
virDomainNetDefPtr persistentNet = NULL;
|
||||||
g_autoptr(virNetDevBandwidth) bandwidth = NULL;
|
g_autoptr(virNetDevBandwidth) bandwidth = NULL;
|
||||||
g_autoptr(virNetDevBandwidth) newBandwidth = NULL;
|
g_autoptr(virNetDevBandwidth) newBandwidth = NULL;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = NULL;
|
g_autoptr(virQEMUDriverConfig) cfg = NULL;
|
||||||
|
@ -4006,7 +4006,8 @@ static int
|
|||||||
qemuMonitorJSONQueryFdsetsParse(virJSONValuePtr msg,
|
qemuMonitorJSONQueryFdsetsParse(virJSONValuePtr msg,
|
||||||
qemuMonitorFdsetsPtr *fdsets)
|
qemuMonitorFdsetsPtr *fdsets)
|
||||||
{
|
{
|
||||||
virJSONValuePtr returnArray, entry;
|
virJSONValuePtr returnArray;
|
||||||
|
virJSONValuePtr entry;
|
||||||
size_t i;
|
size_t i;
|
||||||
g_autoptr(qemuMonitorFdsets) sets = g_new0(qemuMonitorFdsets, 1);
|
g_autoptr(qemuMonitorFdsets) sets = g_new0(qemuMonitorFdsets, 1);
|
||||||
int ninfo;
|
int ninfo;
|
||||||
@ -4213,7 +4214,10 @@ qemuMonitorJSONQueryRxFilterParse(virJSONValuePtr msg,
|
|||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
const char *tmp;
|
const char *tmp;
|
||||||
virJSONValuePtr returnArray, entry, table, element;
|
virJSONValuePtr returnArray;
|
||||||
|
virJSONValuePtr entry;
|
||||||
|
virJSONValuePtr table;
|
||||||
|
virJSONValuePtr element;
|
||||||
size_t nTable;
|
size_t nTable;
|
||||||
size_t i;
|
size_t i;
|
||||||
virNetDevRxFilterPtr fil = virNetDevRxFilterNew();
|
virNetDevRxFilterPtr fil = virNetDevRxFilterNew();
|
||||||
@ -5015,7 +5019,8 @@ int qemuMonitorJSONScreendump(qemuMonitorPtr mon,
|
|||||||
const char *file)
|
const char *file)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
virJSONValuePtr cmd, reply = NULL;
|
virJSONValuePtr cmd;
|
||||||
|
virJSONValuePtr reply = NULL;
|
||||||
|
|
||||||
cmd = qemuMonitorJSONMakeCommand("screendump",
|
cmd = qemuMonitorJSONMakeCommand("screendump",
|
||||||
"s:filename", file,
|
"s:filename", file,
|
||||||
@ -5386,7 +5391,8 @@ int qemuMonitorJSONOpenGraphics(qemuMonitorPtr mon,
|
|||||||
bool skipauth)
|
bool skipauth)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
virJSONValuePtr cmd, reply = NULL;
|
virJSONValuePtr cmd;
|
||||||
|
virJSONValuePtr reply = NULL;
|
||||||
|
|
||||||
cmd = qemuMonitorJSONMakeCommand("add_client",
|
cmd = qemuMonitorJSONMakeCommand("add_client",
|
||||||
"s:protocol", protocol,
|
"s:protocol", protocol,
|
||||||
|
@ -263,7 +263,8 @@ int virNetServerClientAddFilter(virNetServerClientPtr client,
|
|||||||
void virNetServerClientRemoveFilter(virNetServerClientPtr client,
|
void virNetServerClientRemoveFilter(virNetServerClientPtr client,
|
||||||
int filterID)
|
int filterID)
|
||||||
{
|
{
|
||||||
virNetServerClientFilterPtr tmp, prev;
|
virNetServerClientFilterPtr tmp;
|
||||||
|
virNetServerClientFilterPtr prev;
|
||||||
|
|
||||||
virObjectLock(client);
|
virObjectLock(client);
|
||||||
|
|
||||||
|
@ -90,7 +90,8 @@ static int
|
|||||||
virSecurityStackClose(virSecurityManagerPtr mgr)
|
virSecurityStackClose(virSecurityManagerPtr mgr)
|
||||||
{
|
{
|
||||||
virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr);
|
virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr);
|
||||||
virSecurityStackItemPtr next, item = priv->itemsHead;
|
virSecurityStackItemPtr item = priv->itemsHead;
|
||||||
|
virSecurityStackItemPtr next;
|
||||||
|
|
||||||
while (item) {
|
while (item) {
|
||||||
next = item->next;
|
next = item->next;
|
||||||
|
@ -7338,7 +7338,8 @@ testNodeDeviceMockCreateVport(testDriverPtr driver,
|
|||||||
{
|
{
|
||||||
virNodeDeviceDefPtr def = NULL;
|
virNodeDeviceDefPtr def = NULL;
|
||||||
virNodeDevCapsDefPtr caps;
|
virNodeDevCapsDefPtr caps;
|
||||||
virNodeDeviceObjPtr obj = NULL, objcopy = NULL;
|
virNodeDeviceObjPtr obj = NULL;
|
||||||
|
virNodeDeviceObjPtr objcopy = NULL;
|
||||||
virNodeDeviceDefPtr objdef;
|
virNodeDeviceDefPtr objdef;
|
||||||
virObjectEventPtr event = NULL;
|
virObjectEventPtr event = NULL;
|
||||||
g_autofree char *xml = NULL;
|
g_autofree char *xml = NULL;
|
||||||
|
@ -207,7 +207,8 @@ virConfCreate(const char *filename, unsigned int flags)
|
|||||||
static virConfEntryPtr
|
static virConfEntryPtr
|
||||||
virConfAddEntry(virConfPtr conf, char *name, virConfValuePtr value, char *comm)
|
virConfAddEntry(virConfPtr conf, char *name, virConfValuePtr value, char *comm)
|
||||||
{
|
{
|
||||||
virConfEntryPtr ret, prev;
|
virConfEntryPtr ret;
|
||||||
|
virConfEntryPtr prev;
|
||||||
|
|
||||||
if (conf == NULL)
|
if (conf == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -441,7 +442,10 @@ virConfParseString(virConfParserCtxtPtr ctxt)
|
|||||||
static virConfValuePtr
|
static virConfValuePtr
|
||||||
virConfParseValue(virConfParserCtxtPtr ctxt)
|
virConfParseValue(virConfParserCtxtPtr ctxt)
|
||||||
{
|
{
|
||||||
virConfValuePtr ret, lst = NULL, tmp, prev;
|
virConfValuePtr ret;
|
||||||
|
virConfValuePtr lst = NULL;
|
||||||
|
virConfValuePtr tmp;
|
||||||
|
virConfValuePtr prev;
|
||||||
virConfType type = VIR_CONF_NONE;
|
virConfType type = VIR_CONF_NONE;
|
||||||
char *str = NULL;
|
char *str = NULL;
|
||||||
long long l = 0;
|
long long l = 0;
|
||||||
@ -1332,7 +1336,8 @@ virConfSetValue(virConfPtr conf,
|
|||||||
const char *setting,
|
const char *setting,
|
||||||
virConfValuePtr value)
|
virConfValuePtr value)
|
||||||
{
|
{
|
||||||
virConfEntryPtr cur, prev = NULL;
|
virConfEntryPtr cur;
|
||||||
|
virConfEntryPtr prev = NULL;
|
||||||
|
|
||||||
if (value && value->type == VIR_CONF_STRING && value->str == NULL) {
|
if (value && value->type == VIR_CONF_STRING && value->str == NULL) {
|
||||||
virConfFreeValue(value);
|
virConfFreeValue(value);
|
||||||
|
@ -193,7 +193,8 @@ virNetDevBandwidthSet(const char *ifname,
|
|||||||
bool swapped)
|
bool swapped)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
virNetDevBandwidthRatePtr rx = NULL, tx = NULL; /* From domain POV */
|
virNetDevBandwidthRatePtr rx = NULL; /* From domain POV */
|
||||||
|
virNetDevBandwidthRatePtr tx = NULL; /* From domain POV */
|
||||||
virCommandPtr cmd = NULL;
|
virCommandPtr cmd = NULL;
|
||||||
char *average = NULL;
|
char *average = NULL;
|
||||||
char *peak = NULL;
|
char *peak = NULL;
|
||||||
|
@ -33,7 +33,8 @@ struct _virNetDevBandwidthRate {
|
|||||||
typedef struct _virNetDevBandwidth virNetDevBandwidth;
|
typedef struct _virNetDevBandwidth virNetDevBandwidth;
|
||||||
typedef virNetDevBandwidth *virNetDevBandwidthPtr;
|
typedef virNetDevBandwidth *virNetDevBandwidthPtr;
|
||||||
struct _virNetDevBandwidth {
|
struct _virNetDevBandwidth {
|
||||||
virNetDevBandwidthRatePtr in, out;
|
virNetDevBandwidthRatePtr in;
|
||||||
|
virNetDevBandwidthRatePtr out;
|
||||||
};
|
};
|
||||||
|
|
||||||
void virNetDevBandwidthFree(virNetDevBandwidthPtr def);
|
void virNetDevBandwidthFree(virNetDevBandwidthPtr def);
|
||||||
|
@ -408,7 +408,8 @@ vzConnectOpen(virConnectPtr conn,
|
|||||||
static int
|
static int
|
||||||
vzConnectClose(virConnectPtr conn)
|
vzConnectClose(virConnectPtr conn)
|
||||||
{
|
{
|
||||||
vzConnPtr curr, *prev = &vz_conn_list;
|
vzConnPtr curr;
|
||||||
|
vzConnPtr *prev = &vz_conn_list;
|
||||||
vzConnPtr privconn = conn->privateData;
|
vzConnPtr privconn = conn->privateData;
|
||||||
|
|
||||||
if (!privconn)
|
if (!privconn)
|
||||||
|
@ -889,7 +889,8 @@ prlsdkParseNetAddress(char *addr)
|
|||||||
char *maskstr = NULL;
|
char *maskstr = NULL;
|
||||||
int nbits;
|
int nbits;
|
||||||
virSocketAddr mask;
|
virSocketAddr mask;
|
||||||
virNetDevIPAddrPtr ip = NULL, ret = NULL;
|
virNetDevIPAddrPtr ip = NULL;
|
||||||
|
virNetDevIPAddrPtr ret = NULL;
|
||||||
|
|
||||||
if (!(maskstr = strchr(addr, '/')))
|
if (!(maskstr = strchr(addr, '/')))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -3141,12 +3142,14 @@ static int prlsdkConfigureGateways(PRL_HANDLE sdknet, virDomainNetDefPtr net)
|
|||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
size_t i;
|
size_t i;
|
||||||
virNetDevIPRoutePtr route4 = NULL, route6 = NULL;
|
virNetDevIPRoutePtr route4 = NULL;
|
||||||
|
virNetDevIPRoutePtr route6 = NULL;
|
||||||
char *gw4 = NULL, *gw6 = NULL;
|
char *gw4 = NULL, *gw6 = NULL;
|
||||||
PRL_RESULT pret;
|
PRL_RESULT pret;
|
||||||
|
|
||||||
for (i = 0; i < net->guestIP.nroutes; i++) {
|
for (i = 0; i < net->guestIP.nroutes; i++) {
|
||||||
virSocketAddrPtr addrdst, gateway;
|
virSocketAddrPtr addrdst;
|
||||||
|
virSocketAddrPtr gateway;
|
||||||
virSocketAddr zero;
|
virSocketAddr zero;
|
||||||
|
|
||||||
addrdst = virNetDevIPRouteGetAddress(net->guestIP.routes[i]);
|
addrdst = virNetDevIPRouteGetAddress(net->guestIP.routes[i]);
|
||||||
|
@ -84,9 +84,12 @@ static virNetServerPtr
|
|||||||
testCreateServer(const char *server_name, const char *host, int family)
|
testCreateServer(const char *server_name, const char *host, int family)
|
||||||
{
|
{
|
||||||
virNetServerPtr srv = NULL;
|
virNetServerPtr srv = NULL;
|
||||||
virNetServerServicePtr svc1 = NULL, svc2 = NULL;
|
virNetServerServicePtr svc1 = NULL;
|
||||||
virNetServerClientPtr cln1 = NULL, cln2 = NULL;
|
virNetServerServicePtr svc2 = NULL;
|
||||||
virNetSocketPtr sk1 = NULL, sk2 = NULL;
|
virNetServerClientPtr cln1 = NULL;
|
||||||
|
virNetServerClientPtr cln2 = NULL;
|
||||||
|
virNetSocketPtr sk1 = NULL;
|
||||||
|
virNetSocketPtr sk2 = NULL;
|
||||||
int fdclient[2];
|
int fdclient[2];
|
||||||
|
|
||||||
if (socketpair(PF_UNIX, SOCK_STREAM, 0, fdclient) < 0) {
|
if (socketpair(PF_UNIX, SOCK_STREAM, 0, fdclient) < 0) {
|
||||||
@ -269,7 +272,8 @@ static int testExecRestart(const void *opaque)
|
|||||||
const struct testExecRestartData *data = opaque;
|
const struct testExecRestartData *data = opaque;
|
||||||
char *infile = NULL, *outfile = NULL;
|
char *infile = NULL, *outfile = NULL;
|
||||||
char *injsonstr = NULL, *outjsonstr = NULL;
|
char *injsonstr = NULL, *outjsonstr = NULL;
|
||||||
virJSONValuePtr injson = NULL, outjson = NULL;
|
virJSONValuePtr injson = NULL;
|
||||||
|
virJSONValuePtr outjson = NULL;
|
||||||
int fdclient[2] = { -1, -1 }, fdserver[2] = { -1, -1 };
|
int fdclient[2] = { -1, -1 }, fdserver[2] = { -1, -1 };
|
||||||
|
|
||||||
if (socketpair(PF_UNIX, SOCK_STREAM, 0, fdclient) < 0) {
|
if (socketpair(PF_UNIX, SOCK_STREAM, 0, fdclient) < 0) {
|
||||||
|
@ -93,7 +93,8 @@ testVirPCIDeviceDetach(const void *opaque G_GNUC_UNUSED)
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
virPCIDevicePtr dev[] = {NULL, NULL, NULL};
|
virPCIDevicePtr dev[] = {NULL, NULL, NULL};
|
||||||
size_t i, nDev = G_N_ELEMENTS(dev);
|
size_t i, nDev = G_N_ELEMENTS(dev);
|
||||||
virPCIDeviceListPtr activeDevs = NULL, inactiveDevs = NULL;
|
virPCIDeviceListPtr activeDevs = NULL;
|
||||||
|
virPCIDeviceListPtr inactiveDevs = NULL;
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
if (!(activeDevs = virPCIDeviceListNew()) ||
|
if (!(activeDevs = virPCIDeviceListNew()) ||
|
||||||
@ -136,7 +137,8 @@ testVirPCIDeviceReset(const void *opaque G_GNUC_UNUSED)
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
virPCIDevicePtr dev[] = {NULL, NULL, NULL};
|
virPCIDevicePtr dev[] = {NULL, NULL, NULL};
|
||||||
size_t i, nDev = G_N_ELEMENTS(dev);
|
size_t i, nDev = G_N_ELEMENTS(dev);
|
||||||
virPCIDeviceListPtr activeDevs = NULL, inactiveDevs = NULL;
|
virPCIDeviceListPtr activeDevs = NULL;
|
||||||
|
virPCIDeviceListPtr inactiveDevs = NULL;
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
if (!(activeDevs = virPCIDeviceListNew()) ||
|
if (!(activeDevs = virPCIDeviceListNew()) ||
|
||||||
@ -173,7 +175,8 @@ testVirPCIDeviceReattach(const void *opaque G_GNUC_UNUSED)
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
virPCIDevicePtr dev[] = {NULL, NULL, NULL};
|
virPCIDevicePtr dev[] = {NULL, NULL, NULL};
|
||||||
size_t i, nDev = G_N_ELEMENTS(dev);
|
size_t i, nDev = G_N_ELEMENTS(dev);
|
||||||
virPCIDeviceListPtr activeDevs = NULL, inactiveDevs = NULL;
|
virPCIDeviceListPtr activeDevs = NULL;
|
||||||
|
virPCIDeviceListPtr inactiveDevs = NULL;
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
if (!(activeDevs = virPCIDeviceListNew()) ||
|
if (!(activeDevs = virPCIDeviceListNew()) ||
|
||||||
|
Loading…
Reference in New Issue
Block a user