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:
Michal Privoznik 2021-03-11 15:37:07 +01:00
parent a1d058a1db
commit 9d3cd0c1d4
32 changed files with 139 additions and 65 deletions

View File

@ -917,7 +917,10 @@ virBhyveProcessBuildGrubbhyveCmd(virDomainDefPtr def,
const char *devmap_file,
char **devicesmap_out)
{
virDomainDiskDefPtr hdd, cd, userdef, diskdef;
virDomainDiskDefPtr hdd;
virDomainDiskDefPtr cd;
virDomainDiskDefPtr userdef;
virDomainDiskDefPtr diskdef;
virCommandPtr cmd;
unsigned int best_idx = UINT_MAX;
size_t i;

View File

@ -681,7 +681,8 @@ bhyveConnectDomainXMLToNative(virConnectPtr conn,
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
bhyveConnPtr privconn = conn->privateData;
virDomainDefPtr def = NULL;
virCommandPtr cmd = NULL, loadcmd = NULL;
virCommandPtr cmd = NULL;
virCommandPtr loadcmd = NULL;
char *ret = NULL;
virCheckFlags(0, NULL);

View File

@ -2082,7 +2082,8 @@ int
virDomainUSBAddressSetAddHub(virDomainUSBAddressSetPtr addrs,
virDomainHubDefPtr hub)
{
virDomainUSBAddressHubPtr targetHub = NULL, newHub = NULL;
virDomainUSBAddressHubPtr targetHub = NULL;
virDomainUSBAddressHubPtr newHub = NULL;
int ret = -1;
int targetPort;
g_autofree char *portStr = NULL;

View File

@ -17621,7 +17621,8 @@ virDomainChrDefPtr
virDomainChrRemove(virDomainDefPtr vmdef,
virDomainChrDefPtr chr)
{
virDomainChrDefPtr ret = NULL, **arrPtr = NULL;
virDomainChrDefPtr ret = NULL;
virDomainChrDefPtr **arrPtr = NULL;
size_t i, *cntPtr = NULL;
if (virDomainChrGetDomainPtrsInternal(vmdef, chr->deviceType,

View File

@ -780,7 +780,8 @@ virDomainNumaDefNodeDistanceParseXML(virDomainNumaPtr def,
}
for (i = 0; i < sibling; i++) {
virDomainNumaDistancePtr ldist, rdist;
virDomainNumaDistancePtr ldist;
virDomainNumaDistancePtr rdist;
unsigned int sibling_id, sibling_value;
/* siblings are in order of parsing or explicitly numbered */

View File

@ -402,7 +402,8 @@ virNWFilterVarCombIterEntryAreUniqueEntries(virNWFilterVarCombIterEntryPtr cie,
GHashTable *hash)
{
size_t i, j;
virNWFilterVarValuePtr varValue, tmp;
virNWFilterVarValuePtr varValue;
virNWFilterVarValuePtr tmp;
const char *value;
varValue = virHashLookup(hash, cie->varNames[0]);

View File

@ -1254,7 +1254,8 @@ virNetworkObjUpdate(virNetworkObjPtr obj,
unsigned int flags) /* virNetworkUpdateFlags */
{
int ret = -1;
virNetworkDefPtr livedef = NULL, configdef = NULL;
virNetworkDefPtr livedef = NULL;
virNetworkDefPtr configdef = NULL;
/* normalize config data, and check for common invalid requests. */
if (virNetworkObjConfigChangeSetup(obj, xmlopt, flags) < 0)

View File

@ -128,7 +128,8 @@ virDomainDriverMergeBlkioDevice(virBlkioDevicePtr *dest_array,
const char *type)
{
size_t i, j;
virBlkioDevicePtr dest, src;
virBlkioDevicePtr dest;
virBlkioDevicePtr src;
for (i = 0; i < src_size; i++) {
bool found = false;

View File

@ -832,7 +832,8 @@ virHostdevPreparePCIDevicesImpl(virHostdevManagerPtr mgr,
/* Step 6: Set driver and domain information */
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
* there because 'pci' only contain address information and will

View File

@ -3961,9 +3961,12 @@ libxlDomainDetachDeviceLive(libxlDriverPrivatePtr driver,
static int
libxlDomainDetachDeviceConfig(virDomainDefPtr vmdef, virDomainDeviceDefPtr dev)
{
virDomainDiskDefPtr disk, detach;
virDomainHostdevDefPtr hostdev, det_hostdev;
virDomainControllerDefPtr cont, det_cont;
virDomainDiskDefPtr disk;
virDomainDiskDefPtr detach;
virDomainHostdevDefPtr hostdev;
virDomainHostdevDefPtr det_hostdev;
virDomainControllerDefPtr cont;
virDomainControllerDefPtr det_cont;
virDomainNetDefPtr net;
int idx;

View File

@ -1559,7 +1559,8 @@ static int
xenFormatSerial(virConfValuePtr list, virDomainChrDefPtr serial)
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
virConfValuePtr val, tmp;
virConfValuePtr val;
virConfValuePtr tmp;
int ret;
if (serial) {
@ -1614,7 +1615,8 @@ xenFormatNet(virConnectPtr conn,
const char *vif_typename)
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
virConfValuePtr val, tmp;
virConfValuePtr val;
virConfValuePtr tmp;
char macaddr[VIR_MAC_STRING_BUFLEN];
virBufferAsprintf(&buf, "mac=%s", virMacAddrFormat(&net->mac, macaddr));
@ -1768,7 +1770,8 @@ xenFormatPCI(virConfPtr conf, virDomainDefPtr def)
for (i = 0; i < def->nhostdevs; i++) {
if (def->hostdevs[i]->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
def->hostdevs[i]->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI) {
virConfValuePtr val, tmp;
virConfValuePtr val;
virConfValuePtr tmp;
char *buf;
const char *permissive_str = NULL;
@ -2242,7 +2245,8 @@ xenFormatVfb(virConfPtr conf, virDomainDefPtr def)
return -1;
}
} else {
virConfValuePtr vfb, disp;
virConfValuePtr vfb;
virConfValuePtr disp;
char *vfbstr = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;

View File

@ -1395,7 +1395,8 @@ static int
xenFormatXLVnode(virConfValuePtr list,
virBufferPtr buf)
{
virConfValuePtr numaPnode, tmp;
virConfValuePtr numaPnode;
virConfValuePtr tmp;
numaPnode = g_new0(virConfValue, 1);
@ -1423,7 +1424,8 @@ xenFormatXLVnuma(virConfValuePtr list,
int ret = -1;
size_t i;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
virConfValuePtr numaVnode, tmp;
virConfValuePtr numaVnode;
virConfValuePtr tmp;
virBitmapPtr cpumask = virDomainNumaGetNodeCpumask(numa, node);
size_t nodeSize = virDomainNumaGetNodeMemorySize(numa, node) / 1024;
g_autofree char *nodeVcpus = NULL;
@ -1638,7 +1640,8 @@ static int
xenFormatXLDisk(virConfValuePtr list, virDomainDiskDefPtr disk)
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
virConfValuePtr val, tmp;
virConfValuePtr val;
virConfValuePtr tmp;
int format = virDomainDiskGetFormat(disk);
const char *driver = virDomainDiskGetDriver(disk);
g_autofree char *target = NULL;
@ -1858,7 +1861,8 @@ xenFormatXLInputDevs(virConfPtr conf, virDomainDefPtr def)
{
size_t i;
const char *devtype;
virConfValuePtr usbdevices = NULL, lastdev;
virConfValuePtr usbdevices = NULL;
virConfValuePtr lastdev;
if (def->os.type == VIR_DOMAIN_OSTYPE_HVM) {
usbdevices = g_new0(virConfValue, 1);
@ -1941,7 +1945,8 @@ xenFormatXLUSBController(virConfPtr conf,
for (i = 0; i < def->ncontrollers; i++) {
if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_USB) {
virConfValuePtr val, tmp;
virConfValuePtr val;
virConfValuePtr tmp;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
if (def->controllers[i]->model != -1) {
@ -2019,7 +2024,8 @@ xenFormatXLUSB(virConfPtr conf,
for (i = 0; i < def->nhostdevs; i++) {
if (def->hostdevs[i]->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
def->hostdevs[i]->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB) {
virConfValuePtr val, tmp;
virConfValuePtr val;
virConfValuePtr tmp;
char *buf;
buf = g_strdup_printf("hostbus=%x,hostaddr=%x",
@ -2055,7 +2061,8 @@ xenFormatXLChannel(virConfValuePtr list, virDomainChrDefPtr channel)
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
int sourceType = channel->source->type;
virConfValuePtr val, tmp;
virConfValuePtr val;
virConfValuePtr tmp;
/* connection */
virBufferAddLit(&buf, "connection=");
@ -2145,7 +2152,8 @@ xenFormatXLDomainNamespaceData(virConfPtr conf, virDomainDefPtr def)
args->list = NULL;
for (i = 0; i < nsdata->num_args; i++) {
virConfValuePtr val, tmp;
virConfValuePtr val;
virConfValuePtr tmp;
val = g_new0(virConfValue, 1);

View File

@ -275,7 +275,8 @@ xenFormatXMDisk(virConfValuePtr list,
virDomainDiskDefPtr disk)
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
virConfValuePtr val, tmp;
virConfValuePtr val;
virConfValuePtr tmp;
const char *src = virDomainDiskGetSource(disk);
int format = virDomainDiskGetFormat(disk);
const char *driver = virDomainDiskGetDriver(disk);

View File

@ -735,7 +735,8 @@ static int virLXCControllerSetupLoopDevices(virLXCControllerPtr ctrl)
static int virLXCControllerSetupCpuAffinity(virLXCControllerPtr ctrl)
{
int hostcpus, maxcpu = CPU_SETSIZE;
virBitmapPtr cpumap, cpumapToSet;
virBitmapPtr cpumap;
virBitmapPtr cpumapToSet;
VIR_DEBUG("Setting CPU affinity");

View File

@ -3129,9 +3129,11 @@ lxcDomainDetachDeviceConfig(virDomainDefPtr vmdef,
virDomainDeviceDefPtr dev)
{
int ret = -1;
virDomainDiskDefPtr disk, det_disk;
virDomainDiskDefPtr disk;
virDomainDiskDefPtr det_disk;
virDomainNetDefPtr net;
virDomainHostdevDefPtr hostdev, det_hostdev;
virDomainHostdevDefPtr hostdev;
virDomainHostdevDefPtr det_hostdev;
int idx;
switch (dev->type) {
@ -4294,7 +4296,8 @@ static int lxcDomainAttachDeviceFlags(virDomainPtr dom,
virLXCDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm = NULL;
virDomainDefPtr vmdef = NULL;
virDomainDeviceDefPtr dev = NULL, dev_copy = NULL;
virDomainDeviceDefPtr dev = NULL;
virDomainDeviceDefPtr dev_copy = NULL;
int ret = -1;
virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver);
@ -4468,7 +4471,8 @@ static int lxcDomainDetachDeviceFlags(virDomainPtr dom,
virCapsPtr caps = NULL;
virDomainObjPtr vm = NULL;
virDomainDefPtr vmdef = NULL;
virDomainDeviceDefPtr dev = NULL, dev_copy = NULL;
virDomainDeviceDefPtr dev = NULL;
virDomainDeviceDefPtr dev_copy = NULL;
int ret = -1;
virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver);

View File

@ -1065,7 +1065,10 @@ networkDnsmasqConfContents(virNetworkObjPtr obj,
size_t i;
virNetworkDNSDefPtr dns = &def->dns;
bool wantDNS = dns->enable != VIR_TRISTATE_BOOL_NO;
virNetworkIPDefPtr tmpipdef, ipdef, ipv4def, ipv6def;
virNetworkIPDefPtr tmpipdef;
virNetworkIPDefPtr ipdef;
virNetworkIPDefPtr ipv4def;
virNetworkIPDefPtr ipv6def;
bool ipv6SLAAC;
*configstr = NULL;
@ -1682,7 +1685,9 @@ networkRefreshDhcpDaemon(virNetworkDriverStatePtr driver,
virNetworkDefPtr def = virNetworkObjGetDef(obj);
size_t i;
pid_t dnsmasqPid;
virNetworkIPDefPtr ipdef, ipv4def, ipv6def;
virNetworkIPDefPtr ipdef;
virNetworkIPDefPtr ipv4def;
virNetworkIPDefPtr ipv6def;
g_autoptr(dnsmasqContext) dctx = NULL;
/* if no IP addresses specified, nothing to do */

View File

@ -3199,7 +3199,8 @@ iptablesRuleInstCommand(virFirewallPtr fw,
const char *ifname,
virNWFilterRuleInstPtr rule)
{
virNWFilterVarCombIterPtr vciter, tmp;
virNWFilterVarCombIterPtr vciter;
virNWFilterVarCombIterPtr tmp;
int ret = -1;
/* rule->vars holds all the variables names that this rule will access.
@ -3234,7 +3235,8 @@ ebtablesRuleInstCommand(virFirewallPtr fw,
const char *ifname,
virNWFilterRuleInstPtr rule)
{
virNWFilterVarCombIterPtr vciter, tmp;
virNWFilterVarCombIterPtr vciter;
virNWFilterVarCombIterPtr tmp;
int ret = -1;
/* rule->vars holds all the variables names that this rule will access.

View File

@ -1817,7 +1817,8 @@ openvzUpdateDevice(virDomainDefPtr vmdef,
virDomainDeviceDefPtr dev,
bool persist)
{
virDomainFSDefPtr fs, cur;
virDomainFSDefPtr fs;
virDomainFSDefPtr cur;
int pos;
if (dev->type == VIR_DOMAIN_DEVICE_FS) {

View File

@ -1255,7 +1255,8 @@ int qemuAgentFSFreeze(qemuAgentPtr agent, const char **mountpoints,
unsigned int nmountpoints)
{
int ret = -1;
virJSONValuePtr cmd, arg = NULL;
virJSONValuePtr cmd;
virJSONValuePtr arg = NULL;
virJSONValuePtr reply = NULL;
if (mountpoints && nmountpoints) {

View File

@ -6172,7 +6172,8 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver,
if ((flags & VIR_DOMAIN_XML_MIGRATABLE)) {
size_t i;
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
* and make the XML compatible with older versions of libvirt which

View File

@ -7431,12 +7431,16 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef,
unsigned int parse_flags,
virDomainXMLOptionPtr xmlopt)
{
virDomainDiskDefPtr disk, det_disk;
virDomainDiskDefPtr disk;
virDomainDiskDefPtr det_disk;
virDomainNetDefPtr net;
virDomainSoundDefPtr sound;
virDomainHostdevDefPtr hostdev, det_hostdev;
virDomainLeaseDefPtr lease, det_lease;
virDomainControllerDefPtr cont, det_cont;
virDomainHostdevDefPtr hostdev;
virDomainHostdevDefPtr det_hostdev;
virDomainLeaseDefPtr lease;
virDomainLeaseDefPtr det_lease;
virDomainControllerDefPtr cont;
virDomainControllerDefPtr det_cont;
virDomainChrDefPtr chr;
virDomainFSDefPtr fs;
virDomainMemoryDefPtr mem;
@ -10240,7 +10244,8 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
virDomainDefPtr def;
virDomainDefPtr persistentDef;
int ret = -1;
virDomainNetDefPtr net = NULL, persistentNet = NULL;
virDomainNetDefPtr net = NULL;
virDomainNetDefPtr persistentNet = NULL;
g_autoptr(virNetDevBandwidth) bandwidth = NULL;
g_autoptr(virNetDevBandwidth) newBandwidth = NULL;
g_autoptr(virQEMUDriverConfig) cfg = NULL;

View File

@ -4006,7 +4006,8 @@ static int
qemuMonitorJSONQueryFdsetsParse(virJSONValuePtr msg,
qemuMonitorFdsetsPtr *fdsets)
{
virJSONValuePtr returnArray, entry;
virJSONValuePtr returnArray;
virJSONValuePtr entry;
size_t i;
g_autoptr(qemuMonitorFdsets) sets = g_new0(qemuMonitorFdsets, 1);
int ninfo;
@ -4213,7 +4214,10 @@ qemuMonitorJSONQueryRxFilterParse(virJSONValuePtr msg,
{
int ret = -1;
const char *tmp;
virJSONValuePtr returnArray, entry, table, element;
virJSONValuePtr returnArray;
virJSONValuePtr entry;
virJSONValuePtr table;
virJSONValuePtr element;
size_t nTable;
size_t i;
virNetDevRxFilterPtr fil = virNetDevRxFilterNew();
@ -5015,7 +5019,8 @@ int qemuMonitorJSONScreendump(qemuMonitorPtr mon,
const char *file)
{
int ret = -1;
virJSONValuePtr cmd, reply = NULL;
virJSONValuePtr cmd;
virJSONValuePtr reply = NULL;
cmd = qemuMonitorJSONMakeCommand("screendump",
"s:filename", file,
@ -5386,7 +5391,8 @@ int qemuMonitorJSONOpenGraphics(qemuMonitorPtr mon,
bool skipauth)
{
int ret = -1;
virJSONValuePtr cmd, reply = NULL;
virJSONValuePtr cmd;
virJSONValuePtr reply = NULL;
cmd = qemuMonitorJSONMakeCommand("add_client",
"s:protocol", protocol,

View File

@ -263,7 +263,8 @@ int virNetServerClientAddFilter(virNetServerClientPtr client,
void virNetServerClientRemoveFilter(virNetServerClientPtr client,
int filterID)
{
virNetServerClientFilterPtr tmp, prev;
virNetServerClientFilterPtr tmp;
virNetServerClientFilterPtr prev;
virObjectLock(client);

View File

@ -90,7 +90,8 @@ static int
virSecurityStackClose(virSecurityManagerPtr mgr)
{
virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr);
virSecurityStackItemPtr next, item = priv->itemsHead;
virSecurityStackItemPtr item = priv->itemsHead;
virSecurityStackItemPtr next;
while (item) {
next = item->next;

View File

@ -7338,7 +7338,8 @@ testNodeDeviceMockCreateVport(testDriverPtr driver,
{
virNodeDeviceDefPtr def = NULL;
virNodeDevCapsDefPtr caps;
virNodeDeviceObjPtr obj = NULL, objcopy = NULL;
virNodeDeviceObjPtr obj = NULL;
virNodeDeviceObjPtr objcopy = NULL;
virNodeDeviceDefPtr objdef;
virObjectEventPtr event = NULL;
g_autofree char *xml = NULL;

View File

@ -207,7 +207,8 @@ virConfCreate(const char *filename, unsigned int flags)
static virConfEntryPtr
virConfAddEntry(virConfPtr conf, char *name, virConfValuePtr value, char *comm)
{
virConfEntryPtr ret, prev;
virConfEntryPtr ret;
virConfEntryPtr prev;
if (conf == NULL)
return NULL;
@ -441,7 +442,10 @@ virConfParseString(virConfParserCtxtPtr ctxt)
static virConfValuePtr
virConfParseValue(virConfParserCtxtPtr ctxt)
{
virConfValuePtr ret, lst = NULL, tmp, prev;
virConfValuePtr ret;
virConfValuePtr lst = NULL;
virConfValuePtr tmp;
virConfValuePtr prev;
virConfType type = VIR_CONF_NONE;
char *str = NULL;
long long l = 0;
@ -1332,7 +1336,8 @@ virConfSetValue(virConfPtr conf,
const char *setting,
virConfValuePtr value)
{
virConfEntryPtr cur, prev = NULL;
virConfEntryPtr cur;
virConfEntryPtr prev = NULL;
if (value && value->type == VIR_CONF_STRING && value->str == NULL) {
virConfFreeValue(value);

View File

@ -193,7 +193,8 @@ virNetDevBandwidthSet(const char *ifname,
bool swapped)
{
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;
char *average = NULL;
char *peak = NULL;

View File

@ -33,7 +33,8 @@ struct _virNetDevBandwidthRate {
typedef struct _virNetDevBandwidth virNetDevBandwidth;
typedef virNetDevBandwidth *virNetDevBandwidthPtr;
struct _virNetDevBandwidth {
virNetDevBandwidthRatePtr in, out;
virNetDevBandwidthRatePtr in;
virNetDevBandwidthRatePtr out;
};
void virNetDevBandwidthFree(virNetDevBandwidthPtr def);

View File

@ -408,7 +408,8 @@ vzConnectOpen(virConnectPtr conn,
static int
vzConnectClose(virConnectPtr conn)
{
vzConnPtr curr, *prev = &vz_conn_list;
vzConnPtr curr;
vzConnPtr *prev = &vz_conn_list;
vzConnPtr privconn = conn->privateData;
if (!privconn)

View File

@ -889,7 +889,8 @@ prlsdkParseNetAddress(char *addr)
char *maskstr = NULL;
int nbits;
virSocketAddr mask;
virNetDevIPAddrPtr ip = NULL, ret = NULL;
virNetDevIPAddrPtr ip = NULL;
virNetDevIPAddrPtr ret = NULL;
if (!(maskstr = strchr(addr, '/')))
goto cleanup;
@ -3141,12 +3142,14 @@ static int prlsdkConfigureGateways(PRL_HANDLE sdknet, virDomainNetDefPtr net)
{
int ret = -1;
size_t i;
virNetDevIPRoutePtr route4 = NULL, route6 = NULL;
virNetDevIPRoutePtr route4 = NULL;
virNetDevIPRoutePtr route6 = NULL;
char *gw4 = NULL, *gw6 = NULL;
PRL_RESULT pret;
for (i = 0; i < net->guestIP.nroutes; i++) {
virSocketAddrPtr addrdst, gateway;
virSocketAddrPtr addrdst;
virSocketAddrPtr gateway;
virSocketAddr zero;
addrdst = virNetDevIPRouteGetAddress(net->guestIP.routes[i]);

View File

@ -84,9 +84,12 @@ static virNetServerPtr
testCreateServer(const char *server_name, const char *host, int family)
{
virNetServerPtr srv = NULL;
virNetServerServicePtr svc1 = NULL, svc2 = NULL;
virNetServerClientPtr cln1 = NULL, cln2 = NULL;
virNetSocketPtr sk1 = NULL, sk2 = NULL;
virNetServerServicePtr svc1 = NULL;
virNetServerServicePtr svc2 = NULL;
virNetServerClientPtr cln1 = NULL;
virNetServerClientPtr cln2 = NULL;
virNetSocketPtr sk1 = NULL;
virNetSocketPtr sk2 = NULL;
int fdclient[2];
if (socketpair(PF_UNIX, SOCK_STREAM, 0, fdclient) < 0) {
@ -269,7 +272,8 @@ static int testExecRestart(const void *opaque)
const struct testExecRestartData *data = opaque;
char *infile = NULL, *outfile = 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 };
if (socketpair(PF_UNIX, SOCK_STREAM, 0, fdclient) < 0) {

View File

@ -93,7 +93,8 @@ testVirPCIDeviceDetach(const void *opaque G_GNUC_UNUSED)
int ret = -1;
virPCIDevicePtr dev[] = {NULL, NULL, NULL};
size_t i, nDev = G_N_ELEMENTS(dev);
virPCIDeviceListPtr activeDevs = NULL, inactiveDevs = NULL;
virPCIDeviceListPtr activeDevs = NULL;
virPCIDeviceListPtr inactiveDevs = NULL;
int count;
if (!(activeDevs = virPCIDeviceListNew()) ||
@ -136,7 +137,8 @@ testVirPCIDeviceReset(const void *opaque G_GNUC_UNUSED)
int ret = -1;
virPCIDevicePtr dev[] = {NULL, NULL, NULL};
size_t i, nDev = G_N_ELEMENTS(dev);
virPCIDeviceListPtr activeDevs = NULL, inactiveDevs = NULL;
virPCIDeviceListPtr activeDevs = NULL;
virPCIDeviceListPtr inactiveDevs = NULL;
int count;
if (!(activeDevs = virPCIDeviceListNew()) ||
@ -173,7 +175,8 @@ testVirPCIDeviceReattach(const void *opaque G_GNUC_UNUSED)
int ret = -1;
virPCIDevicePtr dev[] = {NULL, NULL, NULL};
size_t i, nDev = G_N_ELEMENTS(dev);
virPCIDeviceListPtr activeDevs = NULL, inactiveDevs = NULL;
virPCIDeviceListPtr activeDevs = NULL;
virPCIDeviceListPtr inactiveDevs = NULL;
int count;
if (!(activeDevs = virPCIDeviceListNew()) ||