* Helper function to print vcpupin info.
*/
static bool
-virshPrintPinInfo(unsigned char *cpumap, size_t cpumaplen)
+virshPrintPinInfo(vshControl *ctl,
+ unsigned char *cpumap,
+ size_t cpumaplen)
{
char *str = NULL;
continue;
vshPrint(ctl, "%4zu: ", i);
- ret = virshPrintPinInfo(VIR_GET_CPUMAP(cpumap, cpumaplen, i),
+ ret = virshPrintPinInfo(ctl, VIR_GET_CPUMAP(cpumap, cpumaplen, i),
cpumaplen);
vshPrint(ctl, "\n");
if (!ret)
vshPrintExtra(ctl, "%s %s\n", _("emulator:"), _("CPU Affinity"));
vshPrintExtra(ctl, "----------------------------------\n");
vshPrintExtra(ctl, " *: ");
- ret = virshPrintPinInfo(cpumap, cpumaplen);
+ ret = virshPrintPinInfo(ctl, cpumap, cpumaplen);
vshPrint(ctl, "\n");
}
goto cleanup;
for (i = 0; i < niothreads; i++) {
vshPrint(ctl, " %-15u ", info[i]->iothread_id);
- ignore_value(virshPrintPinInfo(info[i]->cpumap, info[i]->cpumaplen));
+ ignore_value(virshPrintPinInfo(ctl, info[i]->cpumap, info[i]->cpumaplen));
vshPrint(ctl, "\n");
virDomainIOThreadInfoFree(info[i]);
}
goto cleanup;
if (rem)
- vshPrint("%s\n", _("Metadata removed"));
+ vshPrint(ctl, "%s\n", _("Metadata removed"));
else
- vshPrint("%s\n", _("Metadata modified"));
+ vshPrint(ctl, "%s\n", _("Metadata modified"));
} else if (edit) {
#define EDIT_GET_XML \
virshDomainGetEditMetadata(ctl, dom, uri, flags)
key, uri, flags) == 0)
#include "virsh-edit.c"
- vshPrint("%s\n", _("Metadata modified"));
+ vshPrint(ctl, "%s\n", _("Metadata modified"));
} else {
char *data;
/* get */
bool vshCommandArgvParse(vshControl *ctl, int nargs, char **argv);
int vshCommandOptTimeoutToMs(vshControl *ctl, const vshCmd *cmd, int *timeout);
+void vshPrint(vshControl *ctl, const char *format, ...)
+ ATTRIBUTE_FMT_PRINTF(2, 3);
void vshPrintExtra(vshControl *ctl, const char *format, ...)
ATTRIBUTE_FMT_PRINTF(2, 3);
bool vshInit(vshControl *ctl, const vshCmdGrp *groups, const vshCmdDef *set);
void vshDebug(vshControl *ctl, int level, const char *format, ...)
ATTRIBUTE_FMT_PRINTF(3, 4);
-/* XXX: add batch support */
-# define vshPrint(_ctl, ...) vshPrintExtra(NULL, __VA_ARGS__)
-
/* User visible sort, so we want locale-specific case comparison. */
# define vshStrcasecmp(S1, S2) strcasecmp(S1, S2)
int vshNameSorter(const void *a, const void *b);