tools: s/Nodedev/NodeDevice/

The proper name is [vir|virsh]NodeDevice* and not Nodedev.
Fortunately, there are only handful of offenders.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
Michal Privoznik 2019-07-14 11:47:34 +02:00
parent 6c62122e06
commit a0e4f6549d
4 changed files with 24 additions and 24 deletions

View File

@ -1004,7 +1004,7 @@ virshDomainInterfaceStateCompleter(vshControl *ctl,
char ** char **
virshNodedevEventNameCompleter(vshControl *ctl ATTRIBUTE_UNUSED, virshNodeDeviceEventNameCompleter(vshControl *ctl ATTRIBUTE_UNUSED,
const vshCmd *cmd ATTRIBUTE_UNUSED, const vshCmd *cmd ATTRIBUTE_UNUSED,
unsigned int flags) unsigned int flags)
{ {
@ -1018,7 +1018,7 @@ virshNodedevEventNameCompleter(vshControl *ctl ATTRIBUTE_UNUSED,
return NULL; return NULL;
for (i = 0; i < VIR_NODE_DEVICE_EVENT_ID_LAST; i++) { for (i = 0; i < VIR_NODE_DEVICE_EVENT_ID_LAST; i++) {
if (VIR_STRDUP(tmp[i], virshNodedevEventCallbacks[i].name) < 0) if (VIR_STRDUP(tmp[i], virshNodeDeviceEventCallbacks[i].name) < 0)
return NULL; return NULL;
} }
@ -1028,7 +1028,7 @@ virshNodedevEventNameCompleter(vshControl *ctl ATTRIBUTE_UNUSED,
char ** char **
virshNodedevCapabilityNameCompleter(vshControl *ctl, virshNodeDeviceCapabilityNameCompleter(vshControl *ctl,
const vshCmd *cmd, const vshCmd *cmd,
unsigned int flags) unsigned int flags)
{ {

View File

@ -106,11 +106,11 @@ char ** virshDomainInterfaceStateCompleter(vshControl *ctl,
const vshCmd *cmd, const vshCmd *cmd,
unsigned int flags); unsigned int flags);
char ** virshNodedevEventNameCompleter(vshControl *ctl, char ** virshNodeDeviceEventNameCompleter(vshControl *ctl,
const vshCmd *cmd, const vshCmd *cmd,
unsigned int flags); unsigned int flags);
char ** virshNodedevCapabilityNameCompleter(vshControl *ctl, char ** virshNodeDeviceCapabilityNameCompleter(vshControl *ctl,
const vshCmd *cmd, const vshCmd *cmd,
unsigned int flags); unsigned int flags);

View File

@ -375,7 +375,7 @@ static const vshCmdOptDef opts_node_list_devices[] = {
}, },
{.name = "cap", {.name = "cap",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.completer = virshNodedevCapabilityNameCompleter, .completer = virshNodeDeviceCapabilityNameCompleter,
.help = N_("capability names, separated by comma") .help = N_("capability names, separated by comma")
}, },
{.name = NULL} {.name = NULL}
@ -775,7 +775,7 @@ struct virshNodeDeviceEventData {
bool loop; bool loop;
bool timestamp; bool timestamp;
int count; int count;
virshNodedevEventCallback *cb; virshNodeDeviceEventCallback *cb;
}; };
typedef struct virshNodeDeviceEventData virshNodeDeviceEventData; typedef struct virshNodeDeviceEventData virshNodeDeviceEventData;
@ -841,12 +841,12 @@ vshEventGenericPrint(virConnectPtr conn ATTRIBUTE_UNUSED,
vshEventDone(data->ctl); vshEventDone(data->ctl);
} }
virshNodedevEventCallback virshNodedevEventCallbacks[] = { virshNodeDeviceEventCallback virshNodeDeviceEventCallbacks[] = {
{ "lifecycle", { "lifecycle",
VIR_NODE_DEVICE_EVENT_CALLBACK(vshEventLifecyclePrint), }, VIR_NODE_DEVICE_EVENT_CALLBACK(vshEventLifecyclePrint), },
{ "update", vshEventGenericPrint, } { "update", vshEventGenericPrint, }
}; };
verify(VIR_NODE_DEVICE_EVENT_ID_LAST == ARRAY_CARDINALITY(virshNodedevEventCallbacks)); verify(VIR_NODE_DEVICE_EVENT_ID_LAST == ARRAY_CARDINALITY(virshNodeDeviceEventCallbacks));
static const vshCmdInfo info_node_device_event[] = { static const vshCmdInfo info_node_device_event[] = {
@ -867,7 +867,7 @@ static const vshCmdOptDef opts_node_device_event[] = {
}, },
{.name = "event", {.name = "event",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.completer = virshNodedevEventNameCompleter, .completer = virshNodeDeviceEventNameCompleter,
.help = N_("which event type to wait for") .help = N_("which event type to wait for")
}, },
{.name = "loop", {.name = "loop",
@ -906,7 +906,7 @@ cmdNodeDeviceEvent(vshControl *ctl, const vshCmd *cmd)
size_t i; size_t i;
for (i = 0; i < VIR_NODE_DEVICE_EVENT_ID_LAST; i++) for (i = 0; i < VIR_NODE_DEVICE_EVENT_ID_LAST; i++)
vshPrint(ctl, "%s\n", virshNodedevEventCallbacks[i].name); vshPrint(ctl, "%s\n", virshNodeDeviceEventCallbacks[i].name);
return true; return true;
} }
@ -918,7 +918,7 @@ cmdNodeDeviceEvent(vshControl *ctl, const vshCmd *cmd)
} }
for (event = 0; event < VIR_NODE_DEVICE_EVENT_ID_LAST; event++) for (event = 0; event < VIR_NODE_DEVICE_EVENT_ID_LAST; event++)
if (STREQ(eventName, virshNodedevEventCallbacks[event].name)) if (STREQ(eventName, virshNodeDeviceEventCallbacks[event].name))
break; break;
if (event == VIR_NODE_DEVICE_EVENT_ID_LAST) { if (event == VIR_NODE_DEVICE_EVENT_ID_LAST) {
vshError(ctl, _("unknown event type %s"), eventName); vshError(ctl, _("unknown event type %s"), eventName);
@ -929,7 +929,7 @@ cmdNodeDeviceEvent(vshControl *ctl, const vshCmd *cmd)
data.loop = vshCommandOptBool(cmd, "loop"); data.loop = vshCommandOptBool(cmd, "loop");
data.timestamp = vshCommandOptBool(cmd, "timestamp"); data.timestamp = vshCommandOptBool(cmd, "timestamp");
data.count = 0; data.count = 0;
data.cb = &virshNodedevEventCallbacks[event]; data.cb = &virshNodeDeviceEventCallbacks[event];
if (vshCommandOptTimeoutToMs(ctl, cmd, &timeout) < 0) if (vshCommandOptTimeoutToMs(ctl, cmd, &timeout) < 0)
return false; return false;
if (vshCommandOptStringReq(ctl, cmd, "device", &device_value) < 0) if (vshCommandOptStringReq(ctl, cmd, "device", &device_value) < 0)

View File

@ -22,12 +22,12 @@
#include "virsh.h" #include "virsh.h"
struct virshNodedevEventCallback { struct virshNodeDeviceEventCallback {
const char *name; const char *name;
virConnectNodeDeviceEventGenericCallback cb; virConnectNodeDeviceEventGenericCallback cb;
}; };
typedef struct virshNodedevEventCallback virshNodedevEventCallback; typedef struct virshNodeDeviceEventCallback virshNodeDeviceEventCallback;
extern virshNodedevEventCallback virshNodedevEventCallbacks[]; extern virshNodeDeviceEventCallback virshNodeDeviceEventCallbacks[];
extern const vshCmdDef nodedevCmds[]; extern const vshCmdDef nodedevCmds[];