static bool
cmdDomIfSetLink (vshControl *ctl, const vshCmd *cmd)
{
-
virDomainPtr dom;
- const char *interface;
+ const char *iface;
const char *state;
const char *mac;
const char *desc;
bool ret = false;
unsigned int flags = 0;
int i;
-
xmlDocPtr xml = NULL;
xmlXPathContextPtr ctxt = NULL;
xmlXPathObjectPtr obj = NULL;
xmlNodePtr cur = NULL;
xmlBufferPtr xml_buf = NULL;
-
if (!vshConnectionUsability(ctl, ctl->conn))
return false;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptString(cmd, "interface", &interface) <= 0)
+ if (vshCommandOptString(cmd, "interface", &iface) <= 0)
goto cleanup;
if (vshCommandOptString(cmd, "state", &state) <= 0)
xmlStrEqual(cur->name, BAD_CAST "mac")) {
mac = virXMLPropString(cur, "address");
- if (STRCASEEQ(mac, interface)) {
+ if (STRCASEEQ(mac, iface)) {
VIR_FREE(mac);
goto hit;
}
}
}
- vshError(ctl, _("interface with address '%s' not found"), interface);
+ vshError(ctl, _("interface with address '%s' not found"), iface);
goto cleanup;
hit:
cmdDomIfGetLink (vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
- const char *interface = NULL;
+ const char *iface = NULL;
int flags = 0;
char *state = NULL;
char *mac = NULL;
bool ret = false;
int i;
-
char *desc;
xmlDocPtr xml = NULL;
xmlXPathContextPtr ctxt = NULL;
if (!(dom = vshCommandOptDomain (ctl, cmd, NULL)))
return false;
- if (vshCommandOptString (cmd, "interface", &interface) <= 0) {
+ if (vshCommandOptString (cmd, "interface", &iface) <= 0) {
virDomainFree(dom);
return false;
}
mac = virXMLPropString(cur, "address");
- if (STRCASEEQ(mac, interface)){
+ if (STRCASEEQ(mac, iface)){
VIR_FREE(mac);
goto hit;
}
}
}
- vshError(ctl, _("Interface with address '%s' not found."), interface);
+ vshError(ctl, _("Interface with address '%s' not found."), iface);
goto cleanup;
hit:
xmlStrEqual(cur->name, BAD_CAST "link")) {
state = virXMLPropString(cur, "state");
- vshPrint(ctl, "%s %s", interface, state);
+ vshPrint(ctl, "%s %s", iface, state);
VIR_FREE(state);
goto cleanup;
}
/* attribute not found */
- vshPrint(ctl, "%s default", interface);
+ vshPrint(ctl, "%s default", iface);
cleanup:
xmlXPathFreeObject(obj);