/* Check and display whether the domain is persistent or not */
persistent = virDomainIsPersistent(dom);
- vshDebug(ctl, VSH_ERR_DEBUG, "Domain persistent flag value: %d\n",
+ vshDebug(ctl, VSH_ERR_DEBUG, "Domain persistent flag value: %d",
persistent);
if (persistent < 0)
vshPrint(ctl, "%-15s %s\n", _("Persistent:"), _("unknown"));
struct virshWatchData *data = opaque;
/* suspend the domain when migration timeouts. */
- vshDebug(data->ctl, VSH_ERR_DEBUG, "watchJob: timeout\n");
+ vshDebug(data->ctl, VSH_ERR_DEBUG, "watchJob: timeout");
if (data->timeout_func)
(data->timeout_func)(data->ctl, data->dom, data->opaque);
virshWatchSetTimeout(struct virshWatchData *data)
{
vshDebug(data->ctl, VSH_ERR_DEBUG,
- "watchJob: setting timeout of %d secs\n", data->timeout_secs);
+ "watchJob: setting timeout of %d secs", data->timeout_secs);
data->timeout_src = g_timeout_source_new_seconds(data->timeout_secs);
g_source_set_callback(data->timeout_src,
pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask);
#endif /* !WIN32 */
vshDebug(data->ctl, VSH_ERR_DEBUG, "%s",
- "watchJob: progress update\n");
+ "watchJob: progress update");
ret = virDomainGetJobInfo(data->dom, &jobinfo);
#ifndef WIN32
pthread_sigmask(SIG_SETMASK, &oldsigmask, NULL);
vshTTYDisableInterrupt(data->ctl);
data->jobStarted = true;
vshDebug(data->ctl, VSH_ERR_DEBUG,
- "watchJob: job started\n");
+ "watchJob: job started");
}
if (data->jobStarted) {
virshWatchSetTimeout(data);
} else if (!data->verbose) {
vshDebug(data->ctl, VSH_ERR_DEBUG,
- "watchJob: disabling callback\n");
+ "watchJob: disabling callback");
return G_SOURCE_REMOVE;
}
}
gsize nread = 0;
vshDebug(data->ctl, VSH_ERR_DEBUG,
- "watchJob: stdin data %d\n", condition);
+ "watchJob: stdin data %d", condition);
if (condition & G_IO_IN) {
g_io_channel_read_chars(data->stdin_ioc,
&retchar,
NULL);
vshDebug(data->ctl, VSH_ERR_DEBUG,
- "watchJob: got %zu characters\n", nread);
+ "watchJob: got %zu characters", nread);
if (nread == 1 &&
vshTTYIsInterruptCharacter(data->ctl, retchar)) {
virDomainAbortJob(data->dom);
/* don't poll on STDIN if we are not using a terminal */
if (vshTTYAvailable(ctl)) {
vshDebug(ctl, VSH_ERR_DEBUG, "%s",
- "watchJob: on TTY, enabling Ctrl-c processing\n");
+ "watchJob: on TTY, enabling Ctrl-c processing");
#ifdef WIN32
data.stdin_ioc = g_io_channel_win32_new_fd(STDIN_FILENO);
#else
g_main_loop_run(eventLoop);
vshDebug(ctl, VSH_ERR_DEBUG,
- "watchJob: job done, status %d\n", *job_err);
+ "watchJob: job done, status %d", *job_err);
if (*job_err == 0 && verbose) /* print [100 %] */
virshPrintJobProgress(label, 0, 1);
_("Optional flags or --rawstats are not supported by the daemon"));
goto cleanup;
}
- vshDebug(ctl, VSH_ERR_DEBUG, "detailed statistics not supported\n");
+ vshDebug(ctl, VSH_ERR_DEBUG, "detailed statistics not supported");
vshResetLibvirtError();
rc = virDomainGetJobInfo(dom, &info);
}
case VIRSH_MIGRATE_TIMEOUT_DEFAULT: /* unreachable */
case VIRSH_MIGRATE_TIMEOUT_SUSPEND:
vshDebug(ctl, VSH_ERR_DEBUG,
- "migration timed out; suspending domain\n");
+ "migration timed out; suspending domain");
if (virDomainSuspend(dom) < 0)
- vshDebug(ctl, VSH_ERR_INFO, "suspending domain failed\n");
+ vshDebug(ctl, VSH_ERR_INFO, "suspending domain failed");
break;
case VIRSH_MIGRATE_TIMEOUT_POSTCOPY:
vshDebug(ctl, VSH_ERR_DEBUG,
- "migration timed out; switching to post-copy\n");
+ "migration timed out; switching to post-copy");
if (virDomainMigrateStartPostCopy(dom, 0) < 0)
- vshDebug(ctl, VSH_ERR_INFO, "switching to post-copy failed\n");
+ vshDebug(ctl, VSH_ERR_INFO, "switching to post-copy failed");
break;
}
}
if (iteration == 2) {
vshDebug(ctl, VSH_ERR_DEBUG,
- "iteration %d finished; switching to post-copy\n",
+ "iteration %d finished; switching to post-copy",
iteration - 1);
if (virDomainMigrateStartPostCopy(dom, 0) < 0)
- vshDebug(ctl, VSH_ERR_INFO, "switching to post-copy failed\n");
+ vshDebug(ctl, VSH_ERR_INFO, "switching to post-copy failed");
}
}
if (vshCommandOptString(ctl, cmd, optname, &n) < 0)
return NULL;
- vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s\n",
+ vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s",
cmd->def->name, optname, n);
if (name)
/* try it by NAME */
if (!is_mac && (flags & VIRSH_BYNAME)) {
- vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as interface NAME\n",
+ vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as interface NAME",
cmd->def->name, optname);
iface = virInterfaceLookupByName(priv->conn, n);
/* try it by MAC */
} else if (is_mac && (flags & VIRSH_BYMAC)) {
- vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as interface MAC\n",
+ vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as interface MAC",
cmd->def->name, optname);
iface = virInterfaceLookupByMACString(priv->conn, n);
}
if (vshCommandOptString(ctl, cmd, optname, &n) < 0)
return NULL;
- vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s\n",
+ vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s",
cmd->def->name, optname, n);
if (name)
/* try it by UUID */
if ((flags & VIRSH_BYUUID) && strlen(n) == VIR_UUID_STRING_BUFLEN-1) {
- vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as network UUID\n",
+ vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as network UUID",
cmd->def->name, optname);
network = virNetworkLookupByUUIDString(priv->conn, n);
}
/* try it by NAME */
if (!network && (flags & VIRSH_BYNAME)) {
- vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as network NAME\n",
+ vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as network NAME",
cmd->def->name, optname);
network = virNetworkLookupByName(priv->conn, n);
}
if (vshCommandOptString(ctl, cmd, optname, &n) < 0)
return NULL;
- vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s\n",
+ vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s",
cmd->def->name, optname, n);
if (name)
*name = n;
- vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as network UUID\n",
+ vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as network UUID",
cmd->def->name, optname);
port = virNetworkPortLookupByUUIDString(net, n);
if (vshCommandOptString(ctl, cmd, optname, &n) < 0)
return NULL;
- vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s\n",
+ vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s",
cmd->def->name, optname, n);
if (name)
/* try it by UUID */
if ((flags & VIRSH_BYUUID) && strlen(n) == VIR_UUID_STRING_BUFLEN-1) {
- vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as nwfilter UUID\n",
+ vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as nwfilter UUID",
cmd->def->name, optname);
nwfilter = virNWFilterLookupByUUIDString(priv->conn, n);
}
/* try it by NAME */
if (!nwfilter && (flags & VIRSH_BYNAME)) {
- vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as nwfilter NAME\n",
+ vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as nwfilter NAME",
cmd->def->name, optname);
nwfilter = virNWFilterLookupByName(priv->conn, n);
}
if (vshCommandOptString(ctl, cmd, optname, &n) < 0)
return NULL;
- vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s\n",
+ vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s",
cmd->def->name, optname, n);
if (name)
*name = n;
- vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as nwfilter binding port dev\n",
+ vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as nwfilter binding port dev",
cmd->def->name, optname);
binding = virNWFilterBindingLookupByPortDev(priv->conn, n);
if (cmd->skipChecks && !n)
return NULL;
- vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s\n",
+ vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s",
cmd->def->name, optname, n);
if (name)
/* try it by UUID */
if ((flags & VIRSH_BYUUID) && strlen(n) == VIR_UUID_STRING_BUFLEN-1) {
- vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as pool UUID\n",
+ vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as pool UUID",
cmd->def->name, optname);
pool = virStoragePoolLookupByUUIDString(priv->conn, n);
}
/* try it by NAME */
if (!pool && (flags & VIRSH_BYNAME)) {
- vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as pool NAME\n",
+ vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as pool NAME",
cmd->def->name, optname);
pool = virStoragePoolLookupByName(priv->conn, n);
}
/* Retrieve the persistence status of the pool */
if (details) {
persistent = virStoragePoolIsPersistent(list->pools[i]);
- vshDebug(ctl, VSH_ERR_DEBUG, "Persistent flag value: %d\n",
+ vshDebug(ctl, VSH_ERR_DEBUG, "Persistent flag value: %d",
persistent);
if (persistent < 0)
poolInfoTexts[i].persistent = g_strdup(_("unknown"));
/* Check and display whether the pool is persistent or not */
persistent = virStoragePoolIsPersistent(pool);
- vshDebug(ctl, VSH_ERR_DEBUG, "Pool persistent flag value: %d\n",
+ vshDebug(ctl, VSH_ERR_DEBUG, "Pool persistent flag value: %d",
persistent);
if (persistent < 0)
vshPrint(ctl, "%-15s %s\n", _("Persistent:"), _("unknown"));
return NULL;
vshDebug(ctl, VSH_ERR_DEBUG,
- "%s: found option <%s>: %s\n", cmd->def->name, optname, n);
+ "%s: found option <%s>: %s", cmd->def->name, optname, n);
if (name != NULL)
*name = n;
/* try it by ID */
if (flags & VIRSH_BYID) {
if (virStrToLong_i(name, NULL, 10, &id) == 0 && id >= 0) {
- vshDebug(ctl, VSH_ERR_DEBUG, "%s: <domain> looks like ID\n",
+ vshDebug(ctl, VSH_ERR_DEBUG, "%s: <domain> looks like ID",
cmdname);
dom = virDomainLookupByID(priv->conn, id);
}
/* try it by UUID */
if (!dom && (flags & VIRSH_BYUUID) &&
strlen(name) == VIR_UUID_STRING_BUFLEN-1) {
- vshDebug(ctl, VSH_ERR_DEBUG, "%s: <domain> trying as domain UUID\n",
+ vshDebug(ctl, VSH_ERR_DEBUG, "%s: <domain> trying as domain UUID",
cmdname);
dom = virDomainLookupByUUIDString(priv->conn, name);
}
/* try it by NAME */
if (!dom && (flags & VIRSH_BYNAME)) {
- vshDebug(ctl, VSH_ERR_DEBUG, "%s: <domain> trying as domain NAME\n",
+ vshDebug(ctl, VSH_ERR_DEBUG, "%s: <domain> trying as domain NAME",
cmdname);
dom = virDomainLookupByName(priv->conn, name);
}
if (vshCommandOptString(ctl, cmd, optname, &n) < 0)
return NULL;
- vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s\n",
+ vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s",
cmd->def->name, optname, n);
if (name)
}
}
- vshDebug(ctl, VSH_ERR_DEBUG, "%s: found option <%s>: %s\n",
+ vshDebug(ctl, VSH_ERR_DEBUG, "%s: found option <%s>: %s",
cmd->def->name, optname, n);
if (name)
/* try it by name */
if (pool && (flags & VIRSH_BYNAME)) {
- vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as vol name\n",
+ vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as vol name",
cmd->def->name, optname);
vol = virStorageVolLookupByName(pool, n);
}
/* try it by key */
if (!vol && (flags & VIRSH_BYUUID)) {
- vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as vol key\n",
+ vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as vol key",
cmd->def->name, optname);
vol = virStorageVolLookupByKey(priv->conn, n);
}
/* try it by path */
if (!vol && (flags & VIRSH_BYUUID)) {
- vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as vol path\n",
+ vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as vol path",
cmd->def->name, optname);
vol = virStorageVolLookupByPath(priv->conn, n);
}
/* Lookup snapshot backing volume. Try the backing-vol
* parameter as a name */
vshDebug(ctl, VSH_ERR_DEBUG,
- "%s: Look up backing store volume '%s' as name\n",
+ "%s: Look up backing store volume '%s' as name",
cmd->def->name, snapshotStrVol);
snapVol = virStorageVolLookupByName(pool, snapshotStrVol);
if (snapVol)
vshDebug(ctl, VSH_ERR_DEBUG,
- "%s: Backing store volume found using '%s' as name\n",
+ "%s: Backing store volume found using '%s' as name",
cmd->def->name, snapshotStrVol);
if (snapVol == NULL) {
/* Snapshot backing volume not found by name. Try the
* backing-vol parameter as a key */
vshDebug(ctl, VSH_ERR_DEBUG,
- "%s: Look up backing store volume '%s' as key\n",
+ "%s: Look up backing store volume '%s' as key",
cmd->def->name, snapshotStrVol);
snapVol = virStorageVolLookupByKey(priv->conn, snapshotStrVol);
if (snapVol)
vshDebug(ctl, VSH_ERR_DEBUG,
- "%s: Backing store volume found using '%s' as key\n",
+ "%s: Backing store volume found using '%s' as key",
cmd->def->name, snapshotStrVol);
}
if (snapVol == NULL) {
/* Snapshot backing volume not found by key. Try the
* backing-vol parameter as a path */
vshDebug(ctl, VSH_ERR_DEBUG,
- "%s: Look up backing store volume '%s' as path\n",
+ "%s: Look up backing store volume '%s' as path",
cmd->def->name, snapshotStrVol);
snapVol = virStorageVolLookupByPath(priv->conn, snapshotStrVol);
if (snapVol)
vshDebug(ctl, VSH_ERR_DEBUG,
- "%s: Backing store volume found using '%s' as path\n",
+ "%s: Backing store volume found using '%s' as path",
cmd->def->name, snapshotStrVol);
}
if (snapVol == NULL) {
goto cleanup;
}
vshDebug(ctl, VSH_ERR_INFO, "%s",
- _("Failed to setup keepalive on connection\n"));
+ _("Failed to setup keepalive on connection"));
vshResetLibvirtError();
}
/* parse command */
ctl->imode = false;
if (argc - optind == 1) {
- vshDebug(ctl, VSH_ERR_INFO, "commands: \"%s\"\n", argv[optind]);
+ vshDebug(ctl, VSH_ERR_INFO, "commands: \"%s\"", argv[optind]);
return vshCommandStringParse(ctl, argv[optind], NULL);
} else {
return vshCommandArgvParse(ctl, argc - optind, argv + optind);
/* parse command */
ctl->imode = false;
if (argc - optind == 1) {
- vshDebug(ctl, VSH_ERR_INFO, "commands: \"%s\"\n", argv[optind]);
+ vshDebug(ctl, VSH_ERR_INFO, "commands: \"%s\"", argv[optind]);
return vshCommandStringParse(ctl, argv[optind], NULL);
} else {
return vshCommandArgvParse(ctl, argc - optind, argv + optind);
case VSH_OT_BOOL:
/* nothing to do */
if (report) {
- vshDebug(ctl, VSH_ERR_INFO, "%s: %s(bool)\n",
+ vshDebug(ctl, VSH_ERR_INFO, "%s: %s(bool)",
cmd->def->name, opt->def->name);
}
break;
case VSH_OT_STRING:
case VSH_OT_INT:
if (report) {
- vshDebug(ctl, VSH_ERR_INFO, "%s: %s(optdata): %s\n",
+ vshDebug(ctl, VSH_ERR_INFO, "%s: %s(optdata): %s",
cmd->def->name, opt->def->name, NULLSTR(val));
}
case VSH_OT_ARGV:
if (report) {
- vshDebug(ctl, VSH_ERR_INFO, "%s: %s(argv: %zu): %s\n",
+ vshDebug(ctl, VSH_ERR_INFO, "%s: %s(argv: %zu): %s",
cmd->def->name, opt->def->name, opt->nargv, NULLSTR(val));
}
vshOutputLogFile(ctl, level, str);
- fputs(str, stdout);
+ fprintf(stderr, "%s\n", str);
fflush(stdout);
}