else
usbctrl_type = VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB2;
} else {
- if (STREQLEN(type, "qusb", 4)) {
+ if (STRPREFIX(type, "qusb")) {
if (usbctrl_version == 1)
usbctrl_type = VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB1;
else
}
tmp += strlen(name);
- if (STREQLEN(tmp, "max", 3)) {
+ if (STRPREFIX(tmp, "max")) {
*riops = 0;
} else if (virStrToLong_ui(tmp, &tmp, 10, riops) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
}
tmp += strlen(name);
- if (STREQLEN(tmp, "max", 3)) {
+ if (STRPREFIX(tmp, "max")) {
*wiops = 0;
} else if (virStrToLong_ui(tmp, &tmp, 10, wiops) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
}
tmp += strlen(name);
- if (STREQLEN(tmp, "max", 3)) {
+ if (STRPREFIX(tmp, "max")) {
*rbps = 0;
} else if (virStrToLong_ull(tmp, &tmp, 10, rbps) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
}
tmp += strlen(name);
- if (STREQLEN(tmp, "max", 3)) {
+ if (STRPREFIX(tmp, "max")) {
*wbps = 0;
} else if (virStrToLong_ull(tmp, &tmp, 10, wbps) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
return -1;
}
- if (STREQLEN(str, "max", 3)) {
+ if (STRPREFIX(str, "max")) {
*cfs_quota = VIR_CGROUP_CPU_QUOTA_MAX;
return 0;
}
vshReadlineCommandGenerator(const char *text)
{
size_t grp_list_index = 0, cmd_list_index = 0;
- size_t len = strlen(text);
const char *name;
const vshCmdGrp *grp;
const vshCmdDef *cmds;
if (cmds[cmd_list_index++].flags & VSH_CMD_FLAG_ALIAS)
continue;
- if (STREQLEN(name, text, len)) {
+ if (STRPREFIX(name, text)) {
if (VIR_REALLOC_N(ret, ret_size + 2) < 0) {
g_strfreev(ret);
return NULL;