return -1;
return virCgroupSetValueStr(group,
- VIR_CGROUP_CONTROLLER_BLKIO,
- "blkio.throttle.read_iops_device",
- str);
+ VIR_CGROUP_CONTROLLER_BLKIO,
+ "blkio.throttle.read_iops_device",
+ str);
}
return -1;
return virCgroupSetValueStr(group,
- VIR_CGROUP_CONTROLLER_BLKIO,
- "blkio.throttle.write_iops_device",
- str);
+ VIR_CGROUP_CONTROLLER_BLKIO,
+ "blkio.throttle.write_iops_device",
+ str);
}
return -1;
return virCgroupSetValueStr(group,
- VIR_CGROUP_CONTROLLER_BLKIO,
- "blkio.throttle.read_bps_device",
- str);
+ VIR_CGROUP_CONTROLLER_BLKIO,
+ "blkio.throttle.read_bps_device",
+ str);
}
/**
return -1;
return virCgroupSetValueStr(group,
- VIR_CGROUP_CONTROLLER_BLKIO,
- "blkio.throttle.write_bps_device",
- str);
+ VIR_CGROUP_CONTROLLER_BLKIO,
+ "blkio.throttle.write_bps_device",
+ str);
}
return -1;
return virCgroupSetValueStr(group,
- VIR_CGROUP_CONTROLLER_BLKIO,
- "blkio.weight_device",
- str);
+ VIR_CGROUP_CONTROLLER_BLKIO,
+ "blkio.weight_device",
+ str);
}
/**
goto cleanup;
for (i = start_cpu; i < need_cpus; i++) {
- if (virTypedParameterAssign(¶ms[(i - start_cpu) * nparams +
- param_idx],
+ int idx = (i - start_cpu) * nparams + param_idx;
+ if (virTypedParameterAssign(¶ms[idx],
VIR_DOMAIN_CPU_STATS_VCPUTIME,
VIR_TYPED_PARAM_ULLONG,
sum_cpu_time[i]) < 0)
return NULL;
}
if ((CUR == '"') || (CUR == '\'') ||
- (ctxt->conf->flags & VIR_CONF_FLAG_LXC_FORMAT)) {
+ (ctxt->conf->flags & VIR_CONF_FLAG_LXC_FORMAT)) {
type = VIR_CONF_STRING;
str = virConfParseString(ctxt);
if (str == NULL)
cur = conf->entries;
while (cur != NULL) {
if (cur->name && cur->value &&
- callback(cur->name, cur->value, opaque) < 0)
+ callback(cur->name, cur->value, opaque) < 0)
return -1;
cur = cur->next;
}
ret = 0;
} else {
virReportError(VIR_ERR_DBUS_SERVICE, _("%s: %s"), member,
- localerror.message ? localerror.message : _("unknown error"));
+ localerror.message ? : _("unknown error"));
}
goto cleanup;
}
#ifndef WIN32
if (kill(pid, SIGHUP) != 0) {
virReportSystemError(errno,
- _("Failed to make dnsmasq (PID: %d) reload config files."),
- pid);
+ _("Failed to make dnsmasq (PID: %d)"
+ " reload config files."),
+ pid);
return -1;
}
#endif /* WIN32 */
"Perf", /* 65 */
"Libssh transport layer",
"Resource control",
- )
+ )
/*
return -1;
}
- virEventRegisterImpl(
- virEventPollAddHandle,
- virEventPollUpdateHandle,
- virEventPollRemoveHandle,
- virEventPollAddTimeout,
- virEventPollUpdateTimeout,
- virEventPollRemoveTimeout
- );
+ virEventRegisterImpl(virEventPollAddHandle,
+ virEventPollUpdateHandle,
+ virEventPollRemoveHandle,
+ virEventPollAddTimeout,
+ virEventPollUpdateTimeout,
+ virEventPollRemoveTimeout);
return 0;
}
}
if ((i+1) < eventLoop.timeoutsCount) {
+ size_t count = eventLoop.timeoutsCount - (i+1);
memmove(eventLoop.timeouts+i,
eventLoop.timeouts+i+1,
- sizeof(struct virEventPollTimeout)*(eventLoop.timeoutsCount
- -(i+1)));
+ sizeof(struct virEventPollTimeout)*count);
}
eventLoop.timeoutsCount--;
}
}
if ((i+1) < eventLoop.handlesCount) {
+ size_t count = eventLoop.handlesCount - (i+1);
memmove(eventLoop.handles+i,
eventLoop.handles+i+1,
- sizeof(struct virEventPollHandle)*(eventLoop.handlesCount
- -(i+1)));
+ sizeof(struct virEventPollHandle)*count);
}
eventLoop.handlesCount--;
}
unsigned int fdflags ATTRIBUTE_UNUSED)
{
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("virFileWrapperFd unsupported on this platform"));
+ _("virFileWrapperFd unsupported on this platform"));
return NULL;
}
#endif
if ((*fd = open(looppath, O_RDWR)) < 0) {
virReportSystemError(errno,
- _("Unable to open %s"), looppath);
+ _("Unable to open %s"), looppath);
VIR_FREE(looppath);
return -1;
}
if ((p = strrchr(dirpath, '/')) == NULL) {
virReportSystemError(EINVAL,
- _("Invalid relative path '%s'"), path);
+ _("Invalid relative path '%s'"), path);
return -1;
}
"host",
"2",
"3",
-);
+ );
if ((virHooksFound == -1) ||
((driver == VIR_HOOK_DRIVER_DAEMON) &&
(op == VIR_HOOK_DAEMON_OP_RELOAD ||
- op == VIR_HOOK_DAEMON_OP_SHUTDOWN)))
+ op == VIR_HOOK_DAEMON_OP_SHUTDOWN)))
virHookInitialize();
if ((virHooksFound & (1 << driver)) == 0)
if (!linkdev) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("The device at %s has no network device name"),
- sysfs_path);
+ sysfs_path);
return -1;
}
if (virHostdevNetDevice(hostdev, 0, &linkdev, &vf) < 0)
return -1;
- virtPort = virDomainNetGetActualVirtPortProfile(
- hostdev->parent.data.net);
+ virtPort = virDomainNetGetActualVirtPortProfile(hostdev->parent.data.net);
if (virtPort) {
return virHostdevNetConfigVirtPortProfile(linkdev, vf, virtPort,
- &hostdev->parent.data.net->mac,
- NULL,
- port_profile_associate);
+ &hostdev->parent.data.net->mac,
+ NULL,
+ port_profile_associate);
} else {
/* we need to try 3 different places for the config file:
* 1) ${stateDir}/${PF}_vf${vf}
} else {
virReportError(VIR_ERR_OPERATION_INVALID,
_("Unmanaged PCI device %s must be manually "
- "detached from the host"),
+ "detached from the host"),
virPCIDeviceGetName(pci));
goto reattachdevs;
}
}
VIR_DEBUG("Removing %s:%u:%u:%llu dom=%s from activeSCSIHostdevs",
- scsihostsrc->adapter, scsihostsrc->bus, scsihostsrc->target,
- scsihostsrc->unit, dom_name);
+ scsihostsrc->adapter, scsihostsrc->bus, scsihostsrc->target,
+ scsihostsrc->unit, dom_name);
virSCSIDeviceListDel(mgr->activeSCSIHostdevs, tmp,
drv_name, dom_name);
if (STREQ_NULLABLE(drv_name, usedby_drvname) &&
STREQ_NULLABLE(dom_name, usedby_domname)) {
VIR_DEBUG("Removing %s dom=%s from activeSCSIVHostHostdevs",
- hostsrc->wwpn, dom_name);
+ hostsrc->wwpn, dom_name);
virSCSIVHostDeviceListDel(mgr->activeSCSIVHostHostdevs, tmp);
}
if (flags & VIR_HOSTDEV_SP_USB) {
if (virHostdevPrepareUSBDevices(mgr, driver, def->name,
- def->hostdevs, def->nhostdevs,
- flags) < 0)
+ def->hostdevs, def->nhostdevs,
+ flags) < 0)
return -1;
}
if (ident->attrs[attr]) {
virReportError(VIR_ERR_OPERATION_DENIED, "%s",
- _("Identity attribute is already set"));
+ _("Identity attribute is already set"));
goto cleanup;
}
return -1;
return virIdentitySetAttr(ident,
- VIR_IDENTITY_ATTR_UNIX_USER_ID,
- val);
+ VIR_IDENTITY_ATTR_UNIX_USER_ID,
+ val);
}
return -1;
return virIdentitySetAttr(ident,
- VIR_IDENTITY_ATTR_UNIX_GROUP_ID,
- val);
+ VIR_IDENTITY_ATTR_UNIX_GROUP_ID,
+ val);
}
return -1;
return virIdentitySetAttr(ident,
- VIR_IDENTITY_ATTR_UNIX_PROCESS_ID,
- val);
+ VIR_IDENTITY_ATTR_UNIX_PROCESS_ID,
+ val);
}
return -1;
return virIdentitySetAttr(ident,
- VIR_IDENTITY_ATTR_UNIX_PROCESS_TIME,
- val);
+ VIR_IDENTITY_ATTR_UNIX_PROCESS_TIME,
+ val);
}
VIR_AUTOFREE(char *) error = NULL;
VIR_AUTOPTR(virCommand) cmd = virCommandNewArgList(ISCSIADM, "--mode",
- "session", NULL);
+ "session", NULL);
virCommandSetErrorBuffer(cmd, &error);
if (virCommandRunRegex(cmd,
VIR_AUTOFREE(char *) iface = NULL;
VIR_AUTOFREE(char *) iqn = NULL;
VIR_AUTOPTR(virCommand) cmd = virCommandNewArgList(ISCSIADM,
- "--mode", "iface", NULL);
+ "--mode", "iface", NULL);
*ifacename = NULL;
virISCSIRescanLUNs(const char *session)
{
VIR_AUTOPTR(virCommand) cmd = virCommandNewArgList(ISCSIADM,
- "--mode", "session",
- "-r", session,
- "-R",
- NULL);
+ "--mode", "session",
+ "-r", session,
+ "-R",
+ NULL);
return virCommandRun(cmd, NULL);
}
struct virISCSITargetList list;
size_t i;
VIR_AUTOPTR(virCommand) cmd = virCommandNewArgList(ISCSIADM,
- "--mode", "discovery",
- "--type", "sendtargets",
- "--portal", portal,
- NULL);
+ "--mode", "discovery",
+ "--type", "sendtargets",
+ "--portal", portal,
+ NULL);
if (!persist) {
virCommandAddArgList(cmd,
}
return virISCSIScanTargetsInternal(portal, ifacename,
- persist, ntargets, targets);
+ persist, ntargets, targets);
}
if (yajl_gen_string(g,
(unsigned char *)object->data.object.pairs[i].key,
strlen(object->data.object.pairs[i].key))
- != yajl_gen_status_ok)
+ != yajl_gen_status_ok)
return -1;
if (virJSONValueToStringOne(object->data.object.pairs[i].value, g) < 0)
return -1;
verify(VIR_KEYMAP_ENTRY_MAX == ARRAY_CARDINALITY(virKeyNameTable_win32));
VIR_ENUM_IMPL(virKeycodeSet, VIR_KEYCODE_SET_LAST,
- "linux",
- "xt",
- "atset1",
- "atset2",
- "atset3",
- "os_x",
- "xt_kbd",
- "usb",
- "win32",
- "qnum",
-);
+ "linux",
+ "xt",
+ "atset1",
+ "atset2",
+ "atset3",
+ "os_x",
+ "xt_kbd",
+ "usb",
+ "win32",
+ "qnum",
+ );
int virKeycodeValueFromString(virKeycodeSet codeset,
const char *keyname)
bool virKeyFileHasGroup(virKeyFilePtr conf,
- const char *groupname)
+ const char *groupname)
{
VIR_DEBUG("conf=%p groupname=%s", conf, groupname);
return virHashLookup(conf->groups, groupname) != NULL;
bool virKeyFileHasValue(virKeyFilePtr conf,
- const char *groupname,
- const char *valuename)
+ const char *groupname,
+ const char *valuename)
{
virHashTablePtr group = virHashLookup(conf->groups, groupname);
VIR_DEBUG("conf=%p groupname=%s valuename=%s", conf, groupname, valuename);
if (!virFileIsDir(directory)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Lockspace location %s exists, but is not a directory"),
- directory);
+ directory);
goto error;
}
} else {
char *initmsg = NULL;
if (virLogVersionString(&rawinitmsg, &initmsg) >= 0)
virLogOutputs[i]->f(&virLogSelf, VIR_LOG_INFO,
- __FILE__, __LINE__, __func__,
- timestamp, NULL, 0, rawinitmsg, initmsg,
- virLogOutputs[i]->data);
+ __FILE__, __LINE__, __func__,
+ timestamp, NULL, 0, rawinitmsg, initmsg,
+ virLogOutputs[i]->data);
VIR_FREE(initmsg);
if (virLogHostnameString(&hoststr, &initmsg) >= 0)
virLogOutputs[i]->f(&virLogSelf, VIR_LOG_INFO,
- __FILE__, __LINE__, __func__,
- timestamp, NULL, 0, hoststr, initmsg,
- virLogOutputs[i]->data);
+ __FILE__, __LINE__, __func__,
+ timestamp, NULL, 0, hoststr, initmsg,
+ virLogOutputs[i]->data);
VIR_FREE(hoststr);
VIR_FREE(initmsg);
virLogOutputs[i]->logInitMessage = false;
}
virLogOutputs[i]->f(source, priority,
- filename, linenr, funcname,
- timestamp, metadata, filterflags,
- str, msg, virLogOutputs[i]->data);
+ filename, linenr, funcname,
+ timestamp, metadata, filterflags,
+ str, msg, virLogOutputs[i]->data);
}
}
if (virLogNbOutputs == 0) {
static int
virNetDevSysfsDeviceFile(char **pf_sysfs_device_link, const char *ifname,
- const char *file)
+ const char *file)
{
if (virAsprintf(pf_sysfs_device_link, SYSFS_NET_DIR "%s/device/%s", ifname,
file) < 0)
break;
case VIR_MCAST_TYPE_ADDR_TOKEN:
if (virMacAddrParseHex((const char*)token,
- &mcast->macaddr) < 0) {
+ &mcast->macaddr) < 0) {
virReportSystemError(EINVAL,
_("Failed to parse MAC address from '%s'"),
buf);
}
#elif defined(HAVE_BSD_BRIDGE_MGMT)
int virNetDevBridgeRemovePort(const char *brname,
- const char *ifname)
+ const char *ifname)
{
struct ifbreq req;
VIR_WARNINGS_NO_CAST_ALIGN
rtattr_ptr = (struct rtattr *) IFA_RTA(ifaddrmsg_ptr);
for (; RTA_OK(rtattr_ptr, ifaddrmsg_len);
- rtattr_ptr = RTA_NEXT(rtattr_ptr, ifaddrmsg_len)) {
+ rtattr_ptr = RTA_NEXT(rtattr_ptr, ifaddrmsg_len)) {
VIR_WARNINGS_RESET
if (RTA_PAYLOAD(rtattr_ptr) != sizeof(struct in6_addr)) {
/* No address: ignore. */
return -1;
/* format up a broadcast address if this is IPv4 */
- if (!peerstr && ((VIR_SOCKET_ADDR_IS_FAMILY(addr, AF_INET)) &&
- ((virSocketAddrBroadcastByPrefix(addr, prefix, &broadcast) < 0) ||
- !(bcaststr = virSocketAddrFormat(&broadcast))))) {
+ if (!peerstr &&
+ ((VIR_SOCKET_ADDR_IS_FAMILY(addr, AF_INET)) &&
+ ((virSocketAddrBroadcastByPrefix(addr, prefix, &broadcast) < 0) ||
+ !(bcaststr = virSocketAddrFormat(&broadcast))))) {
return -1;
}
virCommandAddArgList(cmd, "route", "add", NULL);
virCommandAddArgFormat(cmd, "%s/%u", addrstr, prefix);
virCommandAddArgList(cmd, "via", gatewaystr, "dev", ifname,
- "proto", "static", "metric", NULL);
+ "proto", "static", "metric", NULL);
virCommandAddArgFormat(cmd, "%u", metric);
if (virCommandRun(cmd, NULL) < 0)
case RTM_GETLINK:
VIR_DEBUG(" IFINFOMSG");
VIR_DEBUG(" ifi_family = 0x%02x",
- ((struct ifinfomsg *)data)->ifi_family);
+ ((struct ifinfomsg *)data)->ifi_family);
VIR_DEBUG(" ifi_type = 0x%x",
- ((struct ifinfomsg *)data)->ifi_type);
+ ((struct ifinfomsg *)data)->ifi_type);
VIR_DEBUG(" ifi_index = %i",
- ((struct ifinfomsg *)data)->ifi_index);
+ ((struct ifinfomsg *)data)->ifi_index);
VIR_DEBUG(" ifi_flags = 0x%04x",
- ((struct ifinfomsg *)data)->ifi_flags);
+ ((struct ifinfomsg *)data)->ifi_flags);
VIR_DEBUG(" ifi_change = 0x%04x",
- ((struct ifinfomsg *)data)->ifi_change);
+ ((struct ifinfomsg *)data)->ifi_change);
}
/* DEBUG end */
/* Parse netlink message assume a setlink with vfports */
memcpy(&ifinfo, NLMSG_DATA(hdr), sizeof(ifinfo));
VIR_DEBUG("family:%#x type:%#x index:%d flags:%#x change:%#x",
- ifinfo.ifi_family, ifinfo.ifi_type, ifinfo.ifi_index,
- ifinfo.ifi_flags, ifinfo.ifi_change);
+ ifinfo.ifi_family, ifinfo.ifi_type, ifinfo.ifi_index,
+ ifinfo.ifi_flags, ifinfo.ifi_change);
if (nlmsg_parse(hdr, sizeof(ifinfo),
- (struct nlattr **)&tb, IFLA_MAX, NULL)) {
+ (struct nlattr **)&tb, IFLA_MAX, NULL)) {
VIR_DEBUG("error parsing request...");
return;
}
nla_for_each_nested(tb_vfinfo_list, tb[IFLA_VFINFO_LIST], rem) {
if (nla_type(tb_vfinfo_list) != IFLA_VF_INFO) {
VIR_DEBUG("nested parsing of"
- "IFLA_VFINFO_LIST failed.");
+ "IFLA_VFINFO_LIST failed.");
return;
}
if (nla_parse_nested(tb_vfinfo, IFLA_VF_MAX,
- tb_vfinfo_list, ifla_vf_policy)) {
+ tb_vfinfo_list, ifla_vf_policy)) {
VIR_DEBUG("nested parsing of "
- "IFLA_VF_INFO failed.");
+ "IFLA_VF_INFO failed.");
return;
}
}
continue;
}
if (nla_parse_nested(tb3, IFLA_PORT_MAX, tb_vf_ports,
- ifla_port_policy)) {
+ ifla_port_policy)) {
VIR_DEBUG("nested parsing on level 2"
" failed.");
}
}
if (tb3[IFLA_PORT_RESPONSE]) {
- VIR_DEBUG("IFLA_PORT_RESPONSE = %d", *(uint16_t *)
- RTA_DATA(tb3[IFLA_PORT_RESPONSE]));
+ VIR_DEBUG("IFLA_PORT_RESPONSE = %d",
+ *(uint16_t *) RTA_DATA(tb3[IFLA_PORT_RESPONSE]));
}
}
}
if ((virNetDevReadNetConfig(linkdev, -1, stateDir,
&adminMAC, &vlan, &MAC) == 0) &&
- (adminMAC || vlan || MAC)) {
+ (adminMAC || vlan || MAC)) {
ignore_value(virNetDevSetNetConfig(linkdev, -1,
adminMAC, vlan, MAC, !!vlan));
* Returns 0 in case of success or -1 in case of failure.
*/
int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname,
- const virMacAddr *macaddr,
- const unsigned char *vmuuid,
- virNetDevVPortProfilePtr ovsport,
- virNetDevVlanPtr virtVlan)
+ const virMacAddr *macaddr,
+ const unsigned char *vmuuid,
+ virNetDevVPortProfilePtr ovsport,
+ virNetDevVlanPtr virtVlan)
{
char macaddrstr[VIR_MAC_STRING_BUFLEN];
char ifuuidstr[VIR_UUID_STRING_BUFLEN];
if (ovsport->profileID[0] == '\0') {
virCommandAddArgList(cmd,
- "--", "set", "Interface", ifname, attachedmac_ex_id,
- "--", "set", "Interface", ifname, ifaceid_ex_id,
- "--", "set", "Interface", ifname, vmid_ex_id,
- "--", "set", "Interface", ifname,
- "external-ids:iface-status=active",
- NULL);
+ "--", "set", "Interface", ifname, attachedmac_ex_id,
+ "--", "set", "Interface", ifname, ifaceid_ex_id,
+ "--", "set", "Interface", ifname, vmid_ex_id,
+ "--", "set", "Interface", ifname,
+ "external-ids:iface-status=active",
+ NULL);
} else {
virCommandAddArgList(cmd,
- "--", "set", "Interface", ifname, attachedmac_ex_id,
- "--", "set", "Interface", ifname, ifaceid_ex_id,
- "--", "set", "Interface", ifname, vmid_ex_id,
- "--", "set", "Interface", ifname, profile_ex_id,
- "--", "set", "Interface", ifname,
- "external-ids:iface-status=active",
- NULL);
+ "--", "set", "Interface", ifname, attachedmac_ex_id,
+ "--", "set", "Interface", ifname, ifaceid_ex_id,
+ "--", "set", "Interface", ifname, vmid_ex_id,
+ "--", "set", "Interface", ifname, profile_ex_id,
+ "--", "set", "Interface", ifname,
+ "external-ids:iface-status=active",
+ NULL);
}
if (virCommandRun(cmd, NULL) < 0) {
if (err->error) {
virReportSystemError(-err->error,
- _("error during virtual port configuration of ifindex %d"),
- ifindex);
+ _("error during virtual port configuration of ifindex %d"),
+ ifindex);
goto cleanup;
}
break;
/* keep trying... */
} else {
virReportSystemError(EINVAL,
- _("error %d during port-profile setlink on "
- "interface %s (%d)"),
- status, ifname, ifindex);
+ _("error %d during port-profile setlink on "
+ "interface %s (%d)"),
+ status, ifname, ifindex);
rc = -1;
break;
}
#else /* ! WITH_VIRTUALPORT */
int virNetDevVPortProfileAssociate(const char *macvtap_ifname ATTRIBUTE_UNUSED,
- const virNetDevVPortProfile *virtPort ATTRIBUTE_UNUSED,
- const virMacAddr *macvtap_macaddr ATTRIBUTE_UNUSED,
- const char *linkdev ATTRIBUTE_UNUSED,
- int vf ATTRIBUTE_UNUSED,
- const unsigned char *vmuuid ATTRIBUTE_UNUSED,
- virNetDevVPortProfileOp vmOp ATTRIBUTE_UNUSED,
- bool setlink_only ATTRIBUTE_UNUSED)
+ const virNetDevVPortProfile *virtPort ATTRIBUTE_UNUSED,
+ const virMacAddr *macvtap_macaddr ATTRIBUTE_UNUSED,
+ const char *linkdev ATTRIBUTE_UNUSED,
+ int vf ATTRIBUTE_UNUSED,
+ const unsigned char *vmuuid ATTRIBUTE_UNUSED,
+ virNetDevVPortProfileOp vmOp ATTRIBUTE_UNUSED,
+ bool setlink_only ATTRIBUTE_UNUSED)
{
virReportSystemError(ENOSYS, "%s",
_("Virtual port profile association not supported on this platform"));
NETLINK_MSG_PUT(nl_msg, IFLA_INFO_KIND, (strlen(type) + 1), type);
if ((STREQ(type, "macvtap") || STREQ(type, "macvlan")) &&
- extra_args &&
- extra_args->macvlan_mode &&
- *extra_args->macvlan_mode > 0) {
+ extra_args &&
+ extra_args->macvlan_mode &&
+ *extra_args->macvlan_mode > 0) {
NETLINK_MSG_NEST_START(nl_msg, infodata, IFLA_INFO_DATA);
NETLINK_MSG_PUT(nl_msg, IFLA_MACVLAN_MODE,
sizeof(uint32_t), extra_args->macvlan_mode);
virNetlinkEventServerLock(srv);
VIR_DEBUG("dispatching to max %d clients, called from event watch %d",
- (int)srv->handlesCount, watch);
+ (int)srv->handlesCount, watch);
for (i = 0; i < srv->handlesCount; i++) {
if (srv->handles[i].deleted != VIR_NETLINK_HANDLE_VALID)
VIR_DEBUG("Used %zu handle slots, adding at least %d more",
srv->handlesAlloc, NETLINK_EVENT_ALLOC_EXTENT);
if (VIR_RESIZE_N(srv->handles, srv->handlesAlloc,
- srv->handlesCount, NETLINK_EVENT_ALLOC_EXTENT) < 0)
+ srv->handlesCount, NETLINK_EVENT_ALLOC_EXTENT) < 0)
goto error;
}
r = srv->handlesCount++;
obj, obj->u.s.magic); \
} else { \
VIR_WARN("Object %p (%s) is not a %s instance", \
- anyobj, obj->klass->name, #objclass); \
+ anyobj, obj->klass->name, #objclass); \
} \
} while (0)
"pciback", /* XEN */
"pci-stub", /* KVM */
"vfio-pci", /* VFIO */
-);
+ );
VIR_ENUM_IMPL(virPCIHeader, VIR_PCI_HEADER_LAST,
"endpoint",
"pci-bridge",
"cardbus-bridge",
-);
+ );
struct _virPCIDevice {
virPCIDeviceAddress address;
return 0;
if (event_attr->attrType == 0 && (type == VIR_PERF_EVENT_CMT ||
- type == VIR_PERF_EVENT_MBMT ||
- type == VIR_PERF_EVENT_MBML)) {
+ type == VIR_PERF_EVENT_MBMT ||
+ type == VIR_PERF_EVENT_MBML)) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
_("unable to enable host cpu perf event for %s"),
virPerfEventTypeToString(type));
if (nfdlist == 0) {
virReportInvalidArg(nfdlist, "%s",
- _("Expected at least one file descriptor"));
+ _("Expected at least one file descriptor"));
return -1;
}
for (i = 0; i < nfdlist; i++) {
return -1;
return virQEMUBuildCommandLineJSONRecurse(tmpkey, value, data->buf,
- data->arrayFunc, false);
+ data->arrayFunc, false);
} else {
return virQEMUBuildCommandLineJSONRecurse(key, value, data->buf,
- data->arrayFunc, false);
+ data->arrayFunc, false);
}
}
virReportError(VIR_ERR_INTERNAL_ERROR,
_("level %u cache size %llu does not match "
"expected size %llu"),
- level, i_type->size, size);
+ level, i_type->size, size);
goto error;
}
i_type->max_cache_id++;
{
char *schemata = NULL;
int rv = virFileReadValueString(&schemata,
- SYSFS_RESCTRL_PATH
- "/%s/schemata",
- groupname);
+ SYSFS_RESCTRL_PATH "/%s/schemata",
+ groupname);
*alloc = NULL;
switch (res.data.stor.ss_family) {
case AF_INET:
return memcmp(&res.data.inet4.sin_addr.s_addr, &tmp.s_addr,
- sizeof(res.data.inet4.sin_addr.s_addr)) == 0;
+ sizeof(res.data.inet4.sin_addr.s_addr)) == 0;
case AF_INET6:
return IN6_IS_ADDR_LOOPBACK(&res.data.inet6.sin6_addr);
}
/* If no cipher node, then fail */
if (!encdef->encinfo.cipher_name) {
virReportError(VIR_ERR_XML_ERROR, "%s",
- _("ivgen element found, but cipher is missing"));
+ _("ivgen element found, but cipher is missing"));
goto cleanup;
}
case QCOW2_HDR_EXTENSION_BACKING_FORMAT:
if (buf[offset+len] != '\0')
break;
- *format = virStorageFileFormatTypeFromString(
- ((const char *)buf)+offset);
+ *format = virStorageFileFormatTypeFromString(buf+offset);
if (*format <= VIR_STORAGE_FILE_NONE)
return -1;
}
/* First check file magic */
for (i = 0; i < VIR_STORAGE_FILE_LAST; i++) {
- if (virStorageFileMatchesMagic(
- fileTypeInfo[i].magicOffset,
- fileTypeInfo[i].magic,
- buf, buflen)) {
- if (!virStorageFileMatchesVersion(
- fileTypeInfo[i].versionOffset,
- fileTypeInfo[i].versionSize,
- fileTypeInfo[i].versionNumbers,
- fileTypeInfo[i].endian,
- buf, buflen)) {
+ if (virStorageFileMatchesMagic(fileTypeInfo[i].magicOffset,
+ fileTypeInfo[i].magic,
+ buf, buflen)) {
+ if (!virStorageFileMatchesVersion(fileTypeInfo[i].versionOffset,
+ fileTypeInfo[i].versionSize,
+ fileTypeInfo[i].versionNumbers,
+ fileTypeInfo[i].endian,
+ buf, buflen)) {
possibleFormat = i;
continue;
}
/* No magic, so check file extension */
for (i = 0; i < VIR_STORAGE_FILE_LAST; i++) {
- if (virStorageFileMatchesExtension(
- fileTypeInfo[i].extension, path)) {
+ if (virStorageFileMatchesExtension(fileTypeInfo[i].extension, path)) {
format = i;
goto cleanup;
}
VIR_FREE(meta->backingStoreRaw);
if (fileTypeInfo[meta->format].getBackingStore != NULL) {
int store = fileTypeInfo[meta->format].getBackingStore(&meta->backingStoreRaw,
- backingFormat,
- buf, len);
+ backingFormat,
+ buf, len);
if (store == BACKING_STORE_INVALID)
goto done;
* 06UgP5-2rhb-w3Bo-3mdR-WeoL-pytO-SAa2ky
*/
int status;
- virCommandPtr cmd = virCommandNewArgList(
- LVS,
- "--noheadings", "--unbuffered", "--nosuffix",
- "--options", "uuid", path,
- NULL
- );
+ virCommandPtr cmd = virCommandNewArgList(LVS, "--noheadings",
+ "--unbuffered", "--nosuffix",
+ "--options", "uuid", path,
+ NULL
+ );
int ret = -1;
*key = NULL;
char **key)
{
int status;
- virCommandPtr cmd = virCommandNewArgList(
- "/lib/udev/scsi_id",
- "--replace-whitespace",
- "--whitelisted",
- "--device", path,
- NULL
- );
+ virCommandPtr cmd = virCommandNewArgList("/lib/udev/scsi_id",
+ "--replace-whitespace",
+ "--whitelisted",
+ "--device", path,
+ NULL
+ );
int ret = -1;
*key = NULL;
case VIR_STORAGE_TYPE_NONE:
case VIR_STORAGE_TYPE_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("cannot retrieve physical for path '%s' type '%s'"),
- NULLSTR(src->path),
- virStorageTypeToString(actual_type));
+ _("cannot retrieve physical for path '%s' type '%s'"),
+ NULLSTR(src->path),
+ virStorageTypeToString(actual_type));
return -1;
break;
}
if (!src->drv->backend->storageFileGetUniqueIdentifier) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unique storage file identifier not implemented for "
- "storage type %s (protocol: %s)'"),
+ "storage type %s (protocol: %s)'"),
virStorageTypeToString(src->type),
virStorageNetProtocolTypeToString(src->protocol));
return NULL;
static bool
virSysinfoChassisIsEqual(virSysinfoChassisDefPtr src,
- virSysinfoChassisDefPtr dst)
+ virSysinfoChassisDefPtr dst)
{
bool identical = false;
virReportError(VIR_ERR_CONF_SYNTAX,
_("Malformed 'uri_aliases' config entry '%s', "
"aliases may only contain 'a-Z, 0-9, _, -'"),
- *aliases);
+ *aliases);
return -1;
}
base = 1000;
} else {
virReportError(VIR_ERR_INVALID_ARG,
- _("unknown suffix '%s'"), suffix);
+ _("unknown suffix '%s'"), suffix);
return -1;
}
scale = 1;
goto error;
if (!(validator->rngParser =
- xmlRelaxNGNewParserCtxt(validator->schemafile))) {
+ xmlRelaxNGNewParserCtxt(validator->schemafile))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to create RNG parser for %s"),
validator->schemafile);