|
Daniel P. Berrangé |
0676a0 |
From 0140d4c59b7fb26432b520bb7e85bd6834f560b0 Mon Sep 17 00:00:00 2001
|
|
Daniel P. Berrangé |
0676a0 |
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
|
|
Daniel P. Berrangé |
0676a0 |
Date: Wed, 4 Jul 2018 14:20:40 +0100
|
|
Daniel P. Berrangé |
0676a0 |
Subject: [PATCH 2/4] qemu: consolidate parameters of qemuBuildChrChardevStr
|
|
Daniel P. Berrangé |
0676a0 |
into flags
|
|
Daniel P. Berrangé |
0676a0 |
MIME-Version: 1.0
|
|
Daniel P. Berrangé |
0676a0 |
Content-Type: text/plain; charset=UTF-8
|
|
Daniel P. Berrangé |
0676a0 |
Content-Transfer-Encoding: 8bit
|
|
Daniel P. Berrangé |
0676a0 |
|
|
Daniel P. Berrangé |
0676a0 |
There are two boolean parameters passed to qemuBuildChrChardevStr,
|
|
Daniel P. Berrangé |
0676a0 |
and soon there will be a third. It will be clearer to understand
|
|
Daniel P. Berrangé |
0676a0 |
from callers' POV if we use named flags instead.
|
|
Daniel P. Berrangé |
0676a0 |
|
|
Daniel P. Berrangé |
0676a0 |
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
Daniel P. Berrangé |
0676a0 |
---
|
|
Daniel P. Berrangé |
0676a0 |
src/qemu/qemu_command.c | 94 ++++++++++++++++++++++++++---------------
|
|
Daniel P. Berrangé |
0676a0 |
1 file changed, 61 insertions(+), 33 deletions(-)
|
|
Daniel P. Berrangé |
0676a0 |
|
|
Daniel P. Berrangé |
0676a0 |
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
|
|
Daniel P. Berrangé |
0676a0 |
index 9351b9fddb..63c7ac0f82 100644
|
|
Daniel P. Berrangé |
0676a0 |
--- a/src/qemu/qemu_command.c
|
|
Daniel P. Berrangé |
0676a0 |
+++ b/src/qemu/qemu_command.c
|
|
Daniel P. Berrangé |
0676a0 |
@@ -4935,6 +4935,12 @@ qemuOpenChrChardevUNIXSocket(const virDomainChrSourceDef *dev)
|
|
Daniel P. Berrangé |
0676a0 |
return -1;
|
|
Daniel P. Berrangé |
0676a0 |
}
|
|
Daniel P. Berrangé |
0676a0 |
|
|
Daniel P. Berrangé |
0676a0 |
+
|
|
Daniel P. Berrangé |
0676a0 |
+enum {
|
|
Daniel P. Berrangé |
0676a0 |
+ QEMU_BUILD_CHARDEV_TCP_NOWAIT = (1 << 0),
|
|
Daniel P. Berrangé |
0676a0 |
+ QEMU_BUILD_CHARDEV_FILE_LOGD = (1 << 1),
|
|
Daniel P. Berrangé |
0676a0 |
+};
|
|
Daniel P. Berrangé |
0676a0 |
+
|
|
Daniel P. Berrangé |
0676a0 |
/* This function outputs a -chardev command line option which describes only the
|
|
Daniel P. Berrangé |
0676a0 |
* host side of the character device */
|
|
Daniel P. Berrangé |
0676a0 |
static char *
|
|
Daniel P. Berrangé |
0676a0 |
@@ -4946,8 +4952,7 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
const virDomainChrSourceDef *dev,
|
|
Daniel P. Berrangé |
0676a0 |
const char *alias,
|
|
Daniel P. Berrangé |
0676a0 |
virQEMUCapsPtr qemuCaps,
|
|
Daniel P. Berrangé |
0676a0 |
- bool nowait,
|
|
Daniel P. Berrangé |
0676a0 |
- bool chardevStdioLogd)
|
|
Daniel P. Berrangé |
0676a0 |
+ unsigned int flags)
|
|
Daniel P. Berrangé |
0676a0 |
{
|
|
Daniel P. Berrangé |
0676a0 |
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
|
Daniel P. Berrangé |
0676a0 |
bool telnet;
|
|
Daniel P. Berrangé |
0676a0 |
@@ -4986,7 +4991,8 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
_("append not supported in this QEMU binary"));
|
|
Daniel P. Berrangé |
0676a0 |
goto cleanup;
|
|
Daniel P. Berrangé |
0676a0 |
}
|
|
Daniel P. Berrangé |
0676a0 |
- if (qemuBuildChrChardevFileStr(chardevStdioLogd ? logManager : NULL,
|
|
Daniel P. Berrangé |
0676a0 |
+ if (qemuBuildChrChardevFileStr(flags & QEMU_BUILD_CHARDEV_FILE_LOGD ?
|
|
Daniel P. Berrangé |
0676a0 |
+ logManager : NULL,
|
|
Daniel P. Berrangé |
0676a0 |
cmd, def, &buf,
|
|
Daniel P. Berrangé |
0676a0 |
"path", dev->data.file.path,
|
|
Daniel P. Berrangé |
0676a0 |
"append", dev->data.file.append) < 0)
|
|
Daniel P. Berrangé |
0676a0 |
@@ -5032,8 +5038,11 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
dev->data.tcp.service,
|
|
Daniel P. Berrangé |
0676a0 |
telnet ? ",telnet" : "");
|
|
Daniel P. Berrangé |
0676a0 |
|
|
Daniel P. Berrangé |
0676a0 |
- if (dev->data.tcp.listen)
|
|
Daniel P. Berrangé |
0676a0 |
- virBufferAdd(&buf, nowait ? ",server,nowait" : ",server", -1);
|
|
Daniel P. Berrangé |
0676a0 |
+ if (dev->data.tcp.listen) {
|
|
Daniel P. Berrangé |
0676a0 |
+ virBufferAddLit(&buf, ",server");
|
|
Daniel P. Berrangé |
0676a0 |
+ if (flags & QEMU_BUILD_CHARDEV_TCP_NOWAIT)
|
|
Daniel P. Berrangé |
0676a0 |
+ virBufferAddLit(&buf, ",nowait");
|
|
Daniel P. Berrangé |
0676a0 |
+ }
|
|
Daniel P. Berrangé |
0676a0 |
|
|
Daniel P. Berrangé |
0676a0 |
qemuBuildChrChardevReconnectStr(&buf, &dev->data.tcp.reconnect);
|
|
Daniel P. Berrangé |
0676a0 |
|
|
Daniel P. Berrangé |
0676a0 |
@@ -5091,8 +5100,11 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
virBufferAsprintf(&buf, "socket,id=%s,path=", charAlias);
|
|
Daniel P. Berrangé |
0676a0 |
virQEMUBuildBufferEscapeComma(&buf, dev->data.nix.path);
|
|
Daniel P. Berrangé |
0676a0 |
}
|
|
Daniel P. Berrangé |
0676a0 |
- if (dev->data.nix.listen)
|
|
Daniel P. Berrangé |
0676a0 |
- virBufferAdd(&buf, nowait ? ",server,nowait" : ",server", -1);
|
|
Daniel P. Berrangé |
0676a0 |
+ if (dev->data.nix.listen) {
|
|
Daniel P. Berrangé |
0676a0 |
+ virBufferAddLit(&buf, ",server");
|
|
Daniel P. Berrangé |
0676a0 |
+ if (flags & QEMU_BUILD_CHARDEV_TCP_NOWAIT)
|
|
Daniel P. Berrangé |
0676a0 |
+ virBufferAddLit(&buf, ",nowait");
|
|
Daniel P. Berrangé |
0676a0 |
+ }
|
|
Daniel P. Berrangé |
0676a0 |
|
|
Daniel P. Berrangé |
0676a0 |
qemuBuildChrChardevReconnectStr(&buf, &dev->data.nix.reconnect);
|
|
Daniel P. Berrangé |
0676a0 |
break;
|
|
Daniel P. Berrangé |
0676a0 |
@@ -5426,6 +5438,9 @@ qemuBuildMonitorCommandLine(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
qemuDomainObjPrivatePtr priv)
|
|
Daniel P. Berrangé |
0676a0 |
{
|
|
Daniel P. Berrangé |
0676a0 |
char *chrdev;
|
|
Daniel P. Berrangé |
0676a0 |
+ unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT;
|
|
Daniel P. Berrangé |
0676a0 |
+ if (priv->chardevStdioLogd)
|
|
Daniel P. Berrangé |
0676a0 |
+ cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
|
Daniel P. Berrangé |
0676a0 |
|
|
Daniel P. Berrangé |
0676a0 |
if (!priv->monConfig)
|
|
Daniel P. Berrangé |
0676a0 |
return 0;
|
|
Daniel P. Berrangé |
0676a0 |
@@ -5433,8 +5448,7 @@ qemuBuildMonitorCommandLine(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
if (!(chrdev = qemuBuildChrChardevStr(logManager, secManager,
|
|
Daniel P. Berrangé |
0676a0 |
cmd, cfg, def,
|
|
Daniel P. Berrangé |
0676a0 |
priv->monConfig, "monitor",
|
|
Daniel P. Berrangé |
0676a0 |
- priv->qemuCaps, true,
|
|
Daniel P. Berrangé |
0676a0 |
- priv->chardevStdioLogd)))
|
|
Daniel P. Berrangé |
0676a0 |
+ priv->qemuCaps, cdevflags)))
|
|
Daniel P. Berrangé |
0676a0 |
return -1;
|
|
Daniel P. Berrangé |
0676a0 |
virCommandAddArg(cmd, "-chardev");
|
|
Daniel P. Berrangé |
0676a0 |
virCommandAddArg(cmd, chrdev);
|
|
Daniel P. Berrangé |
0676a0 |
@@ -5559,6 +5573,9 @@ qemuBuildRNGBackendChrdevStr(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
char **chr,
|
|
Daniel P. Berrangé |
0676a0 |
bool chardevStdioLogd)
|
|
Daniel P. Berrangé |
0676a0 |
{
|
|
Daniel P. Berrangé |
0676a0 |
+ unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT;
|
|
Daniel P. Berrangé |
0676a0 |
+ if (chardevStdioLogd)
|
|
Daniel P. Berrangé |
0676a0 |
+ cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
|
Daniel P. Berrangé |
0676a0 |
*chr = NULL;
|
|
Daniel P. Berrangé |
0676a0 |
|
|
Daniel P. Berrangé |
0676a0 |
switch ((virDomainRNGBackend) rng->backend) {
|
|
Daniel P. Berrangé |
0676a0 |
@@ -5571,8 +5588,8 @@ qemuBuildRNGBackendChrdevStr(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
if (!(*chr = qemuBuildChrChardevStr(logManager, secManager,
|
|
Daniel P. Berrangé |
0676a0 |
cmd, cfg, def,
|
|
Daniel P. Berrangé |
0676a0 |
rng->source.chardev,
|
|
Daniel P. Berrangé |
0676a0 |
- rng->info.alias, qemuCaps, true,
|
|
Daniel P. Berrangé |
0676a0 |
- chardevStdioLogd)))
|
|
Daniel P. Berrangé |
0676a0 |
+ rng->info.alias, qemuCaps,
|
|
Daniel P. Berrangé |
0676a0 |
+ cdevflags)))
|
|
Daniel P. Berrangé |
0676a0 |
return -1;
|
|
Daniel P. Berrangé |
0676a0 |
}
|
|
Daniel P. Berrangé |
0676a0 |
|
|
Daniel P. Berrangé |
0676a0 |
@@ -8215,8 +8232,7 @@ qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver,
|
|
Daniel P. Berrangé |
0676a0 |
if (!(chardev = qemuBuildChrChardevStr(logManager, secManager,
|
|
Daniel P. Berrangé |
0676a0 |
cmd, cfg, def,
|
|
Daniel P. Berrangé |
0676a0 |
net->data.vhostuser,
|
|
Daniel P. Berrangé |
0676a0 |
- net->info.alias, qemuCaps, false,
|
|
Daniel P. Berrangé |
0676a0 |
- false)))
|
|
Daniel P. Berrangé |
0676a0 |
+ net->info.alias, qemuCaps, 0)))
|
|
Daniel P. Berrangé |
0676a0 |
goto cleanup;
|
|
Daniel P. Berrangé |
0676a0 |
break;
|
|
Daniel P. Berrangé |
0676a0 |
|
|
Daniel P. Berrangé |
0676a0 |
@@ -8696,6 +8712,9 @@ qemuBuildSmartcardCommandLine(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
virBuffer opt = VIR_BUFFER_INITIALIZER;
|
|
Daniel P. Berrangé |
0676a0 |
const char *database;
|
|
Daniel P. Berrangé |
0676a0 |
const char *contAlias = NULL;
|
|
Daniel P. Berrangé |
0676a0 |
+ unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT;
|
|
Daniel P. Berrangé |
0676a0 |
+ if (chardevStdioLogd)
|
|
Daniel P. Berrangé |
0676a0 |
+ cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
|
Daniel P. Berrangé |
0676a0 |
|
|
Daniel P. Berrangé |
0676a0 |
if (!def->nsmartcards)
|
|
Daniel P. Berrangé |
0676a0 |
return 0;
|
|
Daniel P. Berrangé |
0676a0 |
@@ -8761,8 +8780,7 @@ qemuBuildSmartcardCommandLine(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
cmd, cfg, def,
|
|
Daniel P. Berrangé |
0676a0 |
smartcard->data.passthru,
|
|
Daniel P. Berrangé |
0676a0 |
smartcard->info.alias,
|
|
Daniel P. Berrangé |
0676a0 |
- qemuCaps, true,
|
|
Daniel P. Berrangé |
0676a0 |
- chardevStdioLogd))) {
|
|
Daniel P. Berrangé |
0676a0 |
+ qemuCaps, cdevflags))) {
|
|
Daniel P. Berrangé |
0676a0 |
virBufferFreeAndReset(&opt;;
|
|
Daniel P. Berrangé |
0676a0 |
return -1;
|
|
Daniel P. Berrangé |
0676a0 |
}
|
|
Daniel P. Berrangé |
0676a0 |
@@ -8930,6 +8948,9 @@ qemuBuildShmemCommandLine(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
|
Daniel P. Berrangé |
0676a0 |
char *devstr = NULL;
|
|
Daniel P. Berrangé |
0676a0 |
int rc;
|
|
Daniel P. Berrangé |
0676a0 |
+ unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT;
|
|
Daniel P. Berrangé |
0676a0 |
+ if (chardevStdioLogd)
|
|
Daniel P. Berrangé |
0676a0 |
+ cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
|
Daniel P. Berrangé |
0676a0 |
|
|
Daniel P. Berrangé |
0676a0 |
if (shmem->size) {
|
|
Daniel P. Berrangé |
0676a0 |
/*
|
|
Daniel P. Berrangé |
0676a0 |
@@ -8993,8 +9014,8 @@ qemuBuildShmemCommandLine(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
devstr = qemuBuildChrChardevStr(logManager, secManager,
|
|
Daniel P. Berrangé |
0676a0 |
cmd, cfg, def,
|
|
Daniel P. Berrangé |
0676a0 |
&shmem->server.chr,
|
|
Daniel P. Berrangé |
0676a0 |
- shmem->info.alias, qemuCaps, true,
|
|
Daniel P. Berrangé |
0676a0 |
- chardevStdioLogd);
|
|
Daniel P. Berrangé |
0676a0 |
+ shmem->info.alias, qemuCaps,
|
|
Daniel P. Berrangé |
0676a0 |
+ cdevflags);
|
|
Daniel P. Berrangé |
0676a0 |
if (!devstr)
|
|
Daniel P. Berrangé |
0676a0 |
return -1;
|
|
Daniel P. Berrangé |
0676a0 |
|
|
Daniel P. Berrangé |
0676a0 |
@@ -9087,6 +9108,9 @@ qemuBuildSerialCommandLine(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
{
|
|
Daniel P. Berrangé |
0676a0 |
size_t i;
|
|
Daniel P. Berrangé |
0676a0 |
bool havespice = false;
|
|
Daniel P. Berrangé |
0676a0 |
+ unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT;
|
|
Daniel P. Berrangé |
0676a0 |
+ if (chardevStdioLogd)
|
|
Daniel P. Berrangé |
0676a0 |
+ cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
|
Daniel P. Berrangé |
0676a0 |
|
|
Daniel P. Berrangé |
0676a0 |
if (def->nserials) {
|
|
Daniel P. Berrangé |
0676a0 |
for (i = 0; i < def->ngraphics && !havespice; i++) {
|
|
Daniel P. Berrangé |
0676a0 |
@@ -9106,8 +9130,7 @@ qemuBuildSerialCommandLine(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
cmd, cfg, def,
|
|
Daniel P. Berrangé |
0676a0 |
serial->source,
|
|
Daniel P. Berrangé |
0676a0 |
serial->info.alias,
|
|
Daniel P. Berrangé |
0676a0 |
- qemuCaps, true,
|
|
Daniel P. Berrangé |
0676a0 |
- chardevStdioLogd)))
|
|
Daniel P. Berrangé |
0676a0 |
+ qemuCaps, cdevflags)))
|
|
Daniel P. Berrangé |
0676a0 |
return -1;
|
|
Daniel P. Berrangé |
0676a0 |
virCommandAddArg(cmd, "-chardev");
|
|
Daniel P. Berrangé |
0676a0 |
virCommandAddArg(cmd, devstr);
|
|
Daniel P. Berrangé |
0676a0 |
@@ -9148,6 +9171,9 @@ qemuBuildParallelsCommandLine(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
bool chardevStdioLogd)
|
|
Daniel P. Berrangé |
0676a0 |
{
|
|
Daniel P. Berrangé |
0676a0 |
size_t i;
|
|
Daniel P. Berrangé |
0676a0 |
+ unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT;
|
|
Daniel P. Berrangé |
0676a0 |
+ if (chardevStdioLogd)
|
|
Daniel P. Berrangé |
0676a0 |
+ cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
|
Daniel P. Berrangé |
0676a0 |
|
|
Daniel P. Berrangé |
0676a0 |
for (i = 0; i < def->nparallels; i++) {
|
|
Daniel P. Berrangé |
0676a0 |
virDomainChrDefPtr parallel = def->parallels[i];
|
|
Daniel P. Berrangé |
0676a0 |
@@ -9157,8 +9183,7 @@ qemuBuildParallelsCommandLine(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
cmd, cfg, def,
|
|
Daniel P. Berrangé |
0676a0 |
parallel->source,
|
|
Daniel P. Berrangé |
0676a0 |
parallel->info.alias,
|
|
Daniel P. Berrangé |
0676a0 |
- qemuCaps, true,
|
|
Daniel P. Berrangé |
0676a0 |
- chardevStdioLogd)))
|
|
Daniel P. Berrangé |
0676a0 |
+ qemuCaps, cdevflags)))
|
|
Daniel P. Berrangé |
0676a0 |
return -1;
|
|
Daniel P. Berrangé |
0676a0 |
virCommandAddArg(cmd, "-chardev");
|
|
Daniel P. Berrangé |
0676a0 |
virCommandAddArg(cmd, devstr);
|
|
Daniel P. Berrangé |
0676a0 |
@@ -9183,6 +9208,9 @@ qemuBuildChannelsCommandLine(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
bool chardevStdioLogd)
|
|
Daniel P. Berrangé |
0676a0 |
{
|
|
Daniel P. Berrangé |
0676a0 |
size_t i;
|
|
Daniel P. Berrangé |
0676a0 |
+ unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT;
|
|
Daniel P. Berrangé |
0676a0 |
+ if (chardevStdioLogd)
|
|
Daniel P. Berrangé |
0676a0 |
+ cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
|
Daniel P. Berrangé |
0676a0 |
|
|
Daniel P. Berrangé |
0676a0 |
for (i = 0; i < def->nchannels; i++) {
|
|
Daniel P. Berrangé |
0676a0 |
virDomainChrDefPtr channel = def->channels[i];
|
|
Daniel P. Berrangé |
0676a0 |
@@ -9194,8 +9222,7 @@ qemuBuildChannelsCommandLine(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
cmd, cfg, def,
|
|
Daniel P. Berrangé |
0676a0 |
channel->source,
|
|
Daniel P. Berrangé |
0676a0 |
channel->info.alias,
|
|
Daniel P. Berrangé |
0676a0 |
- qemuCaps, true,
|
|
Daniel P. Berrangé |
0676a0 |
- chardevStdioLogd)))
|
|
Daniel P. Berrangé |
0676a0 |
+ qemuCaps, cdevflags)))
|
|
Daniel P. Berrangé |
0676a0 |
return -1;
|
|
Daniel P. Berrangé |
0676a0 |
virCommandAddArg(cmd, "-chardev");
|
|
Daniel P. Berrangé |
0676a0 |
virCommandAddArg(cmd, devstr);
|
|
Daniel P. Berrangé |
0676a0 |
@@ -9212,8 +9239,7 @@ qemuBuildChannelsCommandLine(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
cmd, cfg, def,
|
|
Daniel P. Berrangé |
0676a0 |
channel->source,
|
|
Daniel P. Berrangé |
0676a0 |
channel->info.alias,
|
|
Daniel P. Berrangé |
0676a0 |
- qemuCaps, true,
|
|
Daniel P. Berrangé |
0676a0 |
- chardevStdioLogd)))
|
|
Daniel P. Berrangé |
0676a0 |
+ qemuCaps, cdevflags)))
|
|
Daniel P. Berrangé |
0676a0 |
return -1;
|
|
Daniel P. Berrangé |
0676a0 |
virCommandAddArg(cmd, "-chardev");
|
|
Daniel P. Berrangé |
0676a0 |
virCommandAddArg(cmd, devstr);
|
|
Daniel P. Berrangé |
0676a0 |
@@ -9239,6 +9265,9 @@ qemuBuildConsoleCommandLine(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
bool chardevStdioLogd)
|
|
Daniel P. Berrangé |
0676a0 |
{
|
|
Daniel P. Berrangé |
0676a0 |
size_t i;
|
|
Daniel P. Berrangé |
0676a0 |
+ unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT;
|
|
Daniel P. Berrangé |
0676a0 |
+ if (chardevStdioLogd)
|
|
Daniel P. Berrangé |
0676a0 |
+ cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
|
Daniel P. Berrangé |
0676a0 |
|
|
Daniel P. Berrangé |
0676a0 |
/* Explicit console devices */
|
|
Daniel P. Berrangé |
0676a0 |
for (i = 0; i < def->nconsoles; i++) {
|
|
Daniel P. Berrangé |
0676a0 |
@@ -9257,8 +9286,7 @@ qemuBuildConsoleCommandLine(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
cmd, cfg, def,
|
|
Daniel P. Berrangé |
0676a0 |
console->source,
|
|
Daniel P. Berrangé |
0676a0 |
console->info.alias,
|
|
Daniel P. Berrangé |
0676a0 |
- qemuCaps, true,
|
|
Daniel P. Berrangé |
0676a0 |
- chardevStdioLogd)))
|
|
Daniel P. Berrangé |
0676a0 |
+ qemuCaps, cdevflags)))
|
|
Daniel P. Berrangé |
0676a0 |
return -1;
|
|
Daniel P. Berrangé |
0676a0 |
virCommandAddArg(cmd, "-chardev");
|
|
Daniel P. Berrangé |
0676a0 |
virCommandAddArg(cmd, devstr);
|
|
Daniel P. Berrangé |
0676a0 |
@@ -9279,8 +9307,7 @@ qemuBuildConsoleCommandLine(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
cmd, cfg, def,
|
|
Daniel P. Berrangé |
0676a0 |
console->source,
|
|
Daniel P. Berrangé |
0676a0 |
console->info.alias,
|
|
Daniel P. Berrangé |
0676a0 |
- qemuCaps, true,
|
|
Daniel P. Berrangé |
0676a0 |
- chardevStdioLogd)))
|
|
Daniel P. Berrangé |
0676a0 |
+ qemuCaps, cdevflags)))
|
|
Daniel P. Berrangé |
0676a0 |
return -1;
|
|
Daniel P. Berrangé |
0676a0 |
virCommandAddArg(cmd, "-chardev");
|
|
Daniel P. Berrangé |
0676a0 |
virCommandAddArg(cmd, devstr);
|
|
Daniel P. Berrangé |
0676a0 |
@@ -9295,8 +9322,7 @@ qemuBuildConsoleCommandLine(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
cmd, cfg, def,
|
|
Daniel P. Berrangé |
0676a0 |
console->source,
|
|
Daniel P. Berrangé |
0676a0 |
console->info.alias,
|
|
Daniel P. Berrangé |
0676a0 |
- qemuCaps, true,
|
|
Daniel P. Berrangé |
0676a0 |
- chardevStdioLogd)))
|
|
Daniel P. Berrangé |
0676a0 |
+ qemuCaps, cdevflags)))
|
|
Daniel P. Berrangé |
0676a0 |
return -1;
|
|
Daniel P. Berrangé |
0676a0 |
virCommandAddArg(cmd, "-chardev");
|
|
Daniel P. Berrangé |
0676a0 |
virCommandAddArg(cmd, devstr);
|
|
Daniel P. Berrangé |
0676a0 |
@@ -9419,6 +9445,9 @@ qemuBuildRedirdevCommandLine(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
bool chardevStdioLogd)
|
|
Daniel P. Berrangé |
0676a0 |
{
|
|
Daniel P. Berrangé |
0676a0 |
size_t i;
|
|
Daniel P. Berrangé |
0676a0 |
+ unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT;
|
|
Daniel P. Berrangé |
0676a0 |
+ if (chardevStdioLogd)
|
|
Daniel P. Berrangé |
0676a0 |
+ cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
|
Daniel P. Berrangé |
0676a0 |
|
|
Daniel P. Berrangé |
0676a0 |
for (i = 0; i < def->nredirdevs; i++) {
|
|
Daniel P. Berrangé |
0676a0 |
virDomainRedirdevDefPtr redirdev = def->redirdevs[i];
|
|
Daniel P. Berrangé |
0676a0 |
@@ -9428,8 +9457,7 @@ qemuBuildRedirdevCommandLine(virLogManagerPtr logManager,
|
|
Daniel P. Berrangé |
0676a0 |
cmd, cfg, def,
|
|
Daniel P. Berrangé |
0676a0 |
redirdev->source,
|
|
Daniel P. Berrangé |
0676a0 |
redirdev->info.alias,
|
|
Daniel P. Berrangé |
0676a0 |
- qemuCaps, true,
|
|
Daniel P. Berrangé |
0676a0 |
- chardevStdioLogd))) {
|
|
Daniel P. Berrangé |
0676a0 |
+ qemuCaps, cdevflags))) {
|
|
Daniel P. Berrangé |
0676a0 |
return -1;
|
|
Daniel P. Berrangé |
0676a0 |
}
|
|
Daniel P. Berrangé |
0676a0 |
|
|
Daniel P. Berrangé |
0676a0 |
--
|
|
Daniel P. Berrangé |
0676a0 |
2.17.1
|
|
Daniel P. Berrangé |
0676a0 |
|