mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 18:05:20 +00:00
maint: fix comma style issues: util
Most of our code base uses space after comma but not before; fix the remaining uses before adding a syntax check. * src/util/vircommand.c: Consistently use commas. * src/util/virlog.c: Likewise. * src/util/virnetdevbandwidth.c: Likewise. * src/util/virnetdevmacvlan.c: Likewise. * src/util/virnetdevvportprofile.c: Likewise. * src/util/virnetlink.c: Likewise. * src/util/virpci.c: Likewise. * src/util/virsysinfo.c: Likewise. * src/util/virusb.c: Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
57682aea36
commit
c7c84fa54a
@ -399,8 +399,8 @@ virExec(virCommandPtr cmd)
|
|||||||
{
|
{
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
int null = -1, fd, openmax;
|
int null = -1, fd, openmax;
|
||||||
int pipeout[2] = {-1,-1};
|
int pipeout[2] = {-1, -1};
|
||||||
int pipeerr[2] = {-1,-1};
|
int pipeerr[2] = {-1, -1};
|
||||||
int childin = cmd->infd;
|
int childin = cmd->infd;
|
||||||
int childout = -1;
|
int childout = -1;
|
||||||
int childerr = -1;
|
int childerr = -1;
|
||||||
|
@ -1183,7 +1183,7 @@ virLogOutputToJournald(virLogSource source,
|
|||||||
state.bufs = iov_bufs;
|
state.bufs = iov_bufs;
|
||||||
state.bufs_end = iov_bufs + ARRAY_CARDINALITY(iov_bufs);
|
state.bufs_end = iov_bufs + ARRAY_CARDINALITY(iov_bufs);
|
||||||
|
|
||||||
journalAddString(&state ,"MESSAGE", rawstr);
|
journalAddString(&state, "MESSAGE", rawstr);
|
||||||
journalAddInt(&state, "PRIORITY", priority);
|
journalAddInt(&state, "PRIORITY", priority);
|
||||||
journalAddString(&state, "LIBVIRT_SOURCE",
|
journalAddString(&state, "LIBVIRT_SOURCE",
|
||||||
virLogSourceTypeToString(source));
|
virLogSourceTypeToString(source));
|
||||||
|
@ -167,7 +167,7 @@ virNetDevBandwidthSet(const char *ifname,
|
|||||||
}
|
}
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
cmd = virCommandNew(TC);
|
cmd = virCommandNew(TC);
|
||||||
virCommandAddArgList(cmd,"class", "add", "dev", ifname, "parent",
|
virCommandAddArgList(cmd, "class", "add", "dev", ifname, "parent",
|
||||||
hierarchical_class ? "1:1" : "1:", "classid",
|
hierarchical_class ? "1:1" : "1:", "classid",
|
||||||
hierarchical_class ? "1:2" : "1:1", "htb",
|
hierarchical_class ? "1:2" : "1:1", "htb",
|
||||||
"rate", average, NULL);
|
"rate", average, NULL);
|
||||||
@ -192,7 +192,7 @@ virNetDevBandwidthSet(const char *ifname,
|
|||||||
|
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
cmd = virCommandNew(TC);
|
cmd = virCommandNew(TC);
|
||||||
virCommandAddArgList(cmd,"filter", "add", "dev", ifname, "parent",
|
virCommandAddArgList(cmd, "filter", "add", "dev", ifname, "parent",
|
||||||
"1:0", "protocol", "ip", "handle", "1", "fw",
|
"1:0", "protocol", "ip", "handle", "1", "fw",
|
||||||
"flowid", "1", NULL);
|
"flowid", "1", NULL);
|
||||||
|
|
||||||
|
@ -332,7 +332,7 @@ int virNetDevMacVLanTapOpen(const char *ifname,
|
|||||||
|
|
||||||
if (fscanf(file, "%d", &ifindex) != 1) {
|
if (fscanf(file, "%d", &ifindex) != 1) {
|
||||||
virReportSystemError(errno,
|
virReportSystemError(errno,
|
||||||
"%s",_("cannot determine macvtap's tap device "
|
"%s", _("cannot determine macvtap's tap device "
|
||||||
"interface index"));
|
"interface index"));
|
||||||
VIR_FORCE_FCLOSE(file);
|
VIR_FORCE_FCLOSE(file);
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -841,7 +841,7 @@ virNetDevVPortProfileOpCommon(const char *ifname, int ifindex,
|
|||||||
int rc;
|
int rc;
|
||||||
int src_pid = 0;
|
int src_pid = 0;
|
||||||
uint32_t dst_pid = 0;
|
uint32_t dst_pid = 0;
|
||||||
struct nlattr *tb[IFLA_MAX + 1] = { NULL , };
|
struct nlattr *tb[IFLA_MAX + 1] = { NULL, };
|
||||||
int repeats = STATUS_POLL_TIMEOUT_USEC / STATUS_POLL_INTERVL_USEC;
|
int repeats = STATUS_POLL_TIMEOUT_USEC / STATUS_POLL_INTERVL_USEC;
|
||||||
uint16_t status = 0;
|
uint16_t status = 0;
|
||||||
bool is8021Qbg = (profileId == NULL);
|
bool is8021Qbg = (profileId == NULL);
|
||||||
|
@ -660,7 +660,7 @@ addentry:
|
|||||||
virMacAddrSet(&srv->handles[r].macaddr, macaddr);
|
virMacAddrSet(&srv->handles[r].macaddr, macaddr);
|
||||||
else
|
else
|
||||||
virMacAddrSetRaw(&srv->handles[r].macaddr,
|
virMacAddrSetRaw(&srv->handles[r].macaddr,
|
||||||
(unsigned char[VIR_MAC_BUFLEN]){0,0,0,0,0,0});
|
(unsigned char[VIR_MAC_BUFLEN]){0, 0, 0, 0, 0, 0});
|
||||||
|
|
||||||
VIR_DEBUG("added client to loop slot: %d. with macaddr ptr=%p", r, macaddr);
|
VIR_DEBUG("added client to loop slot: %d. with macaddr ptr=%p", r, macaddr);
|
||||||
|
|
||||||
|
@ -374,7 +374,8 @@ virPCIDeviceWrite32(virPCIDevicePtr dev, int cfgfd, unsigned int pos, uint32_t v
|
|||||||
virPCIDeviceWrite(dev, cfgfd, pos, &buf[0], sizeof(buf));
|
virPCIDeviceWrite(dev, cfgfd, pos, &buf[0], sizeof(buf));
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef int (*virPCIDeviceIterPredicate)(virPCIDevicePtr , virPCIDevicePtr , void *);
|
typedef int (*virPCIDeviceIterPredicate)(virPCIDevicePtr, virPCIDevicePtr,
|
||||||
|
void *);
|
||||||
|
|
||||||
/* Iterate over available PCI devices calling @predicate
|
/* Iterate over available PCI devices calling @predicate
|
||||||
* to compare each one to @dev.
|
* to compare each one to @dev.
|
||||||
|
@ -756,7 +756,7 @@ virSysinfoParseMemory(const char *base, virSysinfoDefPtr ret)
|
|||||||
cur += 9;
|
cur += 9;
|
||||||
eol = strchr(cur, '\n');
|
eol = strchr(cur, '\n');
|
||||||
virSkipSpacesBackwards(cur, &eol);
|
virSkipSpacesBackwards(cur, &eol);
|
||||||
if (eol && VIR_STRNDUP(memory->memory_locator,cur, eol - cur) < 0)
|
if (eol && VIR_STRNDUP(memory->memory_locator, cur, eol - cur) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if ((cur = strstr(base, "Bank Locator: ")) != NULL) {
|
if ((cur = strstr(base, "Bank Locator: ")) != NULL) {
|
||||||
|
@ -216,7 +216,7 @@ virUSBDeviceFindByVendor(unsigned int vendor,
|
|||||||
virUSBDeviceListPtr list;
|
virUSBDeviceListPtr list;
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
if (!(list = virUSBDeviceSearch(vendor, product, 0 , 0,
|
if (!(list = virUSBDeviceSearch(vendor, product, 0, 0,
|
||||||
vroot,
|
vroot,
|
||||||
USB_DEVICE_FIND_BY_VENDOR)))
|
USB_DEVICE_FIND_BY_VENDOR)))
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user