Update to 4.6.0 release

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2018-08-06 14:07:24 +01:00
parent 202e7d9569
commit 782468f8e9
6 changed files with 50 additions and 945 deletions

View File

@ -1,94 +0,0 @@
From 4c76266baca407ae4981a180aed45193e50a8ade Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Thu, 5 Jul 2018 11:59:22 +0100
Subject: [PATCH 1/4] qemu: remove chardevStdioLogd param from vhostuser code
path
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The vhostuser network backend is only supported with the UNIX domain
socket chardev backend, so passing around chardevStdioLogd is not
required.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
src/qemu/qemu_command.c | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 04c5c28438..9351b9fddb 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -8195,8 +8195,7 @@ qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver,
virDomainDefPtr def,
virDomainNetDefPtr net,
virQEMUCapsPtr qemuCaps,
- unsigned int bootindex,
- bool chardevStdioLogd)
+ unsigned int bootindex)
{
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
char *chardev = NULL;
@@ -8217,7 +8216,7 @@ qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver,
cmd, cfg, def,
net->data.vhostuser,
net->info.alias, qemuCaps, false,
- chardevStdioLogd)))
+ false)))
goto cleanup;
break;
@@ -8291,8 +8290,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver,
virNetDevVPortProfileOp vmop,
bool standalone,
size_t *nnicindexes,
- int **nicindexes,
- bool chardevStdioLogd)
+ int **nicindexes)
{
int ret = -1;
char *nic = NULL, *host = NULL;
@@ -8415,8 +8413,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver,
case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
ret = qemuBuildVhostuserCommandLine(driver, logManager, secManager, cmd, def,
- net, qemuCaps, bootindex,
- chardevStdioLogd);
+ net, qemuCaps, bootindex);
goto cleanup;
break;
@@ -8600,8 +8597,7 @@ qemuBuildNetCommandLine(virQEMUDriverPtr driver,
bool standalone,
size_t *nnicindexes,
int **nicindexes,
- unsigned int *bootHostdevNet,
- bool chardevStdioLogd)
+ unsigned int *bootHostdevNet)
{
size_t i;
int last_good_net = -1;
@@ -8628,8 +8624,7 @@ qemuBuildNetCommandLine(virQEMUDriverPtr driver,
if (qemuBuildInterfaceCommandLine(driver, logManager, secManager, cmd, def, net,
qemuCaps, bootNet, vmop,
standalone, nnicindexes,
- nicindexes,
- chardevStdioLogd) < 0)
+ nicindexes) < 0)
goto error;
last_good_net = i;
@@ -10290,8 +10285,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
if (qemuBuildNetCommandLine(driver, logManager, secManager, cmd, def,
qemuCaps, vmop, standalone,
- nnicindexes, nicindexes, &bootHostdevNet,
- chardevStdioLogd) < 0)
+ nnicindexes, nicindexes, &bootHostdevNet) < 0)
goto error;
if (qemuBuildSmartcardCommandLine(logManager, secManager, cmd, cfg, def, qemuCaps,
--
2.17.1

View File

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

View File

@ -1,166 +0,0 @@
From ed5aa85f371aebb0103e712f9a103d011ab9ae43 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Wed, 4 Jul 2018 14:28:14 +0100
Subject: [PATCH 3/4] qemu: don't use chardev FD passing for vhostuser backend
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
QEMU chardevs have a bug which makes the vhostuser backend complain
about lack of support for FD passing when validating the chardev.
While this is ultimately QEMU's responsibility to fix, libvirt needs to
avoid tickling the bug.
Simply disabling chardev FD passing just for vhostuser's chardev is
the most prudent approach, avoiding need for a QEMU version number
check.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
src/qemu/qemu_command.c | 31 +++++++++++++++--------
tests/qemuxml2argvdata/net-vhostuser.args | 3 +--
tests/qemuxml2argvtest.c | 2 +-
3 files changed, 23 insertions(+), 13 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 63c7ac0f82..82d8030a33 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4939,6 +4939,7 @@ qemuOpenChrChardevUNIXSocket(const virDomainChrSourceDef *dev)
enum {
QEMU_BUILD_CHARDEV_TCP_NOWAIT = (1 << 0),
QEMU_BUILD_CHARDEV_FILE_LOGD = (1 << 1),
+ QEMU_BUILD_CHARDEV_UNIX_FD_PASS = (1 << 2),
};
/* This function outputs a -chardev command line option which describes only the
@@ -5082,7 +5083,8 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager,
break;
case VIR_DOMAIN_CHR_TYPE_UNIX:
- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV_FD_PASS)) {
+ if ((flags & QEMU_BUILD_CHARDEV_UNIX_FD_PASS) &&
+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV_FD_PASS)) {
if (qemuSecuritySetSocketLabel(secManager, (virDomainDefPtr)def) < 0)
goto cleanup;
int fd = qemuOpenChrChardevUNIXSocket(dev);
@@ -5438,7 +5440,8 @@ qemuBuildMonitorCommandLine(virLogManagerPtr logManager,
qemuDomainObjPrivatePtr priv)
{
char *chrdev;
- unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT;
+ unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT |
+ QEMU_BUILD_CHARDEV_UNIX_FD_PASS;
if (priv->chardevStdioLogd)
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
@@ -5573,7 +5576,8 @@ qemuBuildRNGBackendChrdevStr(virLogManagerPtr logManager,
char **chr,
bool chardevStdioLogd)
{
- unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT;
+ unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT |
+ QEMU_BUILD_CHARDEV_UNIX_FD_PASS;
if (chardevStdioLogd)
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
*chr = NULL;
@@ -8712,7 +8716,8 @@ qemuBuildSmartcardCommandLine(virLogManagerPtr logManager,
virBuffer opt = VIR_BUFFER_INITIALIZER;
const char *database;
const char *contAlias = NULL;
- unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT;
+ unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT |
+ QEMU_BUILD_CHARDEV_UNIX_FD_PASS;
if (chardevStdioLogd)
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
@@ -8948,7 +8953,8 @@ qemuBuildShmemCommandLine(virLogManagerPtr logManager,
virBuffer buf = VIR_BUFFER_INITIALIZER;
char *devstr = NULL;
int rc;
- unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT;
+ unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT |
+ QEMU_BUILD_CHARDEV_UNIX_FD_PASS;
if (chardevStdioLogd)
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
@@ -9108,7 +9114,8 @@ qemuBuildSerialCommandLine(virLogManagerPtr logManager,
{
size_t i;
bool havespice = false;
- unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT;
+ unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT |
+ QEMU_BUILD_CHARDEV_UNIX_FD_PASS;
if (chardevStdioLogd)
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
@@ -9171,7 +9178,8 @@ qemuBuildParallelsCommandLine(virLogManagerPtr logManager,
bool chardevStdioLogd)
{
size_t i;
- unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT;
+ unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT |
+ QEMU_BUILD_CHARDEV_UNIX_FD_PASS;
if (chardevStdioLogd)
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
@@ -9208,7 +9216,8 @@ qemuBuildChannelsCommandLine(virLogManagerPtr logManager,
bool chardevStdioLogd)
{
size_t i;
- unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT;
+ unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT |
+ QEMU_BUILD_CHARDEV_UNIX_FD_PASS;
if (chardevStdioLogd)
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
@@ -9265,7 +9274,8 @@ qemuBuildConsoleCommandLine(virLogManagerPtr logManager,
bool chardevStdioLogd)
{
size_t i;
- unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT;
+ unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT |
+ QEMU_BUILD_CHARDEV_UNIX_FD_PASS;
if (chardevStdioLogd)
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
@@ -9445,7 +9455,8 @@ qemuBuildRedirdevCommandLine(virLogManagerPtr logManager,
bool chardevStdioLogd)
{
size_t i;
- unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT;
+ unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT |
+ QEMU_BUILD_CHARDEV_UNIX_FD_PASS;
if (chardevStdioLogd)
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
diff --git a/tests/qemuxml2argvdata/net-vhostuser.args b/tests/qemuxml2argvdata/net-vhostuser.args
index fc4557a1f2..513fc535ab 100644
--- a/tests/qemuxml2argvdata/net-vhostuser.args
+++ b/tests/qemuxml2argvdata/net-vhostuser.args
@@ -14,8 +14,7 @@ QEMU_AUDIO_DRV=none \
-display none \
-no-user-config \
-nodefaults \
--chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
-server,nowait \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
-mon chardev=charmonitor,id=monitor,mode=control \
-rtc base=utc \
-no-shutdown \
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index d6911f9344..2d52f352b0 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1266,7 +1266,7 @@ mymain(void)
DO_TEST("misc-no-reboot", NONE);
DO_TEST("misc-uuid", NONE);
DO_TEST_PARSE_ERROR("vhost_queues-invalid", NONE);
- DO_TEST("net-vhostuser", NONE);
+ DO_TEST("net-vhostuser", QEMU_CAPS_CHARDEV_FD_PASS);
DO_TEST("net-vhostuser-multiq",
QEMU_CAPS_VHOSTUSER_MULTIQUEUE);
DO_TEST_FAILURE("net-vhostuser-multiq", NONE);
--
2.17.1

View File

@ -1,123 +0,0 @@
From 1dd55b2fcddecf22a046b1df069b55fdfe17af76 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Fri, 6 Jul 2018 11:00:11 +0100
Subject: [PATCH 4/4] qemu: fix UNIX socket chardevs operating in client mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When support was adding for passing a pre-opened listener socket to UNIX
chardevs, it accidentally passed the listener socket for client mode
chardevs too with predictable amounts of fail resulting.
Expand the unit test coverage to validate that we are only doing FD
passing when operating in server mode.
Reported-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
src/qemu/qemu_command.c | 3 +-
.../qemuxml2argvdata/serial-unix-chardev.args | 2 ++
.../serial-unix-chardev.x86_64-latest.args | 36 +++++++++++++++++++
.../qemuxml2argvdata/serial-unix-chardev.xml | 4 +++
tests/qemuxml2argvtest.c | 1 +
5 files changed, 45 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 82d8030a33..32eb59b6ab 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -5083,7 +5083,8 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager,
break;
case VIR_DOMAIN_CHR_TYPE_UNIX:
- if ((flags & QEMU_BUILD_CHARDEV_UNIX_FD_PASS) &&
+ if (dev->data.nix.listen &&
+ (flags & QEMU_BUILD_CHARDEV_UNIX_FD_PASS) &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV_FD_PASS)) {
if (qemuSecuritySetSocketLabel(secManager, (virDomainDefPtr)def) < 0)
goto cleanup;
diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.args b/tests/qemuxml2argvdata/serial-unix-chardev.args
index 584f4a1dd1..873d3263c6 100644
--- a/tests/qemuxml2argvdata/serial-unix-chardev.args
+++ b/tests/qemuxml2argvdata/serial-unix-chardev.args
@@ -26,4 +26,6 @@ server,nowait \
-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
-chardev socket,id=charserial0,path=/tmp/serial.sock \
-device isa-serial,chardev=charserial0,id=serial0 \
+-chardev socket,id=charserial1,path=/tmp/serial-server.sock,server,nowait \
+-device isa-serial,chardev=charserial1,id=serial1 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args
new file mode 100644
index 0000000000..ce7a7f80d7
--- /dev/null
+++ b/tests/qemuxml2argvdata/serial-unix-chardev.x86_64-latest.args
@@ -0,0 +1,36 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i686 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
+-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
+-chardev socket,id=charserial0,path=/tmp/serial.sock \
+-device isa-serial,chardev=charserial0,id=serial0 \
+-chardev socket,id=charserial1,fd=1729,server,nowait \
+-device isa-serial,chardev=charserial1,id=serial1 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/serial-unix-chardev.xml b/tests/qemuxml2argvdata/serial-unix-chardev.xml
index 04f83779ce..af513d6445 100644
--- a/tests/qemuxml2argvdata/serial-unix-chardev.xml
+++ b/tests/qemuxml2argvdata/serial-unix-chardev.xml
@@ -25,6 +25,10 @@
<source mode='connect' path='/tmp/serial.sock'/>
<target port='0'/>
</serial>
+ <serial type='unix'>
+ <source mode='bind' path='/tmp/serial-server.sock'/>
+ <target port='1'/>
+ </serial>
<console type='unix'>
<source mode='connect' path='/tmp/serial.sock'/>
<target port='0'/>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 2d52f352b0..3be5af03aa 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1335,6 +1335,7 @@ mymain(void)
QEMU_CAPS_CHARDEV_FILE_APPEND);
DO_TEST("serial-unix-chardev",
QEMU_CAPS_DEVICE_ISA_SERIAL);
+ DO_TEST_CAPS_LATEST("serial-unix-chardev");
DO_TEST("serial-tcp-chardev",
QEMU_CAPS_DEVICE_ISA_SERIAL);
DO_TEST("serial-udp-chardev",
--
2.17.1

View File

@ -3,7 +3,7 @@
# This spec file assumes you are building on a Fedora or RHEL version
# that's still supported by the vendor. It may work on other distros
# or versions, but no effort will be made to ensure that going forward.
%define min_rhel 6
%define min_rhel 7
%define min_fedora 26
%if (0%{?fedora} && 0%{?fedora} >= %{min_fedora}) || (0%{?rhel} && 0%{?rhel} >= %{min_rhel})
@ -34,10 +34,7 @@
%if 0%{?rhel}
%define with_qemu_tcg 0
%define qemu_kvm_arches x86_64
%if 0%{?rhel} >= 7
%define qemu_kvm_arches x86_64 %{power64} aarch64 s390x
%endif
%define qemu_kvm_arches x86_64 %{power64} aarch64 s390x
%endif
%ifarch %{qemu_kvm_arches}
@ -58,11 +55,7 @@
%define with_hyperv 0%{!?_without_hyperv:1}
# Then the secondary host drivers, which run inside libvirtd
%if 0%{?fedora} || 0%{?rhel} >= 7
%define with_storage_rbd 0%{!?_without_storage_rbd:1}
%else
%define with_storage_rbd 0
%endif
%define with_storage_rbd 0%{!?_without_storage_rbd:1}
%if 0%{?fedora}
%define with_storage_sheepdog 0%{!?_without_storage_sheepdog:1}
%else
@ -80,16 +73,13 @@
# A few optional bits off by default, we enable later
%define with_fuse 0%{!?_without_fuse:0}
%define with_cgconfig 0%{!?_without_cgconfig:0}
%define with_sanlock 0%{!?_without_sanlock:0}
%define with_systemd 0%{!?_without_systemd:0}
%define with_numad 0%{!?_without_numad:0}
%define with_firewalld 0%{!?_without_firewalld:0}
%define with_libssh2 0%{!?_without_libssh2:0}
%define with_wireshark 0%{!?_without_wireshark:0}
%define with_libssh 0%{!?_without_libssh:0}
%define with_bash_completion 0%{!?_without_bash_completion:0}
%define with_pm_utils 1
# Finally set the OS / architecture specific special cases
@ -117,7 +107,7 @@
# librados and librbd are built only on x86_64 on rhel
%ifnarch x86_64
%if 0%{?rhel} >= 7
%if 0%{?rhel}
%define with_storage_rbd 0
%endif
%endif
@ -147,20 +137,10 @@
%endif
%endif
# Fedora 17 / RHEL-7 are first where we use systemd. Although earlier
# Fedora has systemd, libvirt still used sysvinit there.
%if 0%{?fedora} || 0%{?rhel} >= 7
%define with_systemd 1
%define with_pm_utils 0
%endif
# Fedora 18 / RHEL-7 are first where firewalld support is enabled
%if 0%{?fedora} || 0%{?rhel} >= 7
%define with_firewalld 1
%endif
%define with_firewalld 1
# fuse is used to provide virtualized /proc for LXC
%if %{with_lxc} && 0%{?rhel} != 6
%if %{with_lxc}
%define with_fuse 0%{!?_without_fuse:1}
%endif
@ -195,10 +175,7 @@
%define with_libssh 0%{!?_without_libssh:1}
%endif
# Enable bash-completion for new enough distros
%if 0%{?fedora} || 0%{?rhel} >= 7
%define with_bash_completion 0%{!?_without_bash_completion:1}
%endif
%define with_bash_completion 0%{!?_without_bash_completion:1}
# Use Python 3 when possible, Python 2 otherwise
%if 0%{?fedora} || 0%{?rhel} > 7
@ -216,23 +193,11 @@
%endif
%endif
# Pull in cgroups config system
%if %{with_qemu} || %{with_lxc}
%define with_cgconfig 0%{!?_without_cgconfig:1}
%endif
# Force QEMU to run as non-root
%define qemu_user qemu
%define qemu_group qemu
%if 0%{?fedora} || 0%{?rhel} >= 7
%define with_systemd_macros 1
%else
%define with_systemd_macros 0
%endif
# RHEL releases provide stable tool chains and so it is safe to turn
# compiler warning into errors without being worried about frequent
# changes in reported warnings
@ -251,8 +216,8 @@
Summary: Library providing a simple virtualization API
Name: libvirt
Version: 4.5.0
Release: 3%{?dist}%{?extra_release}
Version: 4.6.0
Release: 1%{?dist}%{?extra_release}
License: LGPLv2+
URL: https://libvirt.org/
@ -260,10 +225,6 @@ URL: https://libvirt.org/
%define mainturl stable_updates/
%endif
Source: https://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.xz
Patch1: 0001-qemu-remove-chardevStdioLogd-param-from-vhostuser-co.patch
Patch2: 0002-qemu-consolidate-parameters-of-qemuBuildChrChardevSt.patch
Patch3: 0003-qemu-don-t-use-chardev-FD-passing-for-vhostuser-back.patch
Patch4: 0004-qemu-fix-UNIX-socket-chardevs-operating-in-client-mo.patch
Requires: libvirt-daemon = %{version}-%{release}
Requires: libvirt-daemon-config-network = %{version}-%{release}
@ -310,9 +271,7 @@ BuildRequires: perl-interpreter
BuildRequires: perl
%endif
BuildRequires: %{python}
%if %{with_systemd}
BuildRequires: systemd-units
%endif
%if %{with_libxl}
BuildRequires: xen-devel
%endif
@ -325,47 +284,29 @@ BuildRequires: bash-completion >= 2.0
BuildRequires: ncurses-devel
BuildRequires: gettext
BuildRequires: libtasn1-devel
%if (0%{?rhel} && 0%{?rhel} < 7)
BuildRequires: libgcrypt-devel
%endif
BuildRequires: gnutls-devel
BuildRequires: libattr-devel
# For pool-build probing for existing pools
BuildRequires: libblkid-devel >= 2.17
# for augparse, optionally used in testing
BuildRequires: augeas
%if 0%{?fedora} || 0%{?rhel} >= 7
BuildRequires: systemd-devel >= 185
%else
BuildRequires: libudev-devel >= 145
%endif
BuildRequires: libpciaccess-devel >= 0.10.9
BuildRequires: yajl-devel
BuildRequires: jansson-devel
%if %{with_sanlock}
BuildRequires: sanlock-devel >= 2.4
%endif
BuildRequires: libpcap-devel
%if 0%{?rhel} && 0%{?rhel} < 7
BuildRequires: libnl-devel
%else
BuildRequires: libnl3-devel
%endif
BuildRequires: avahi-devel
BuildRequires: libselinux-devel
BuildRequires: dnsmasq >= 2.41
BuildRequires: iptables
%if 0%{?rhel} && 0%{?rhel} < 7
BuildRequires: iptables-ipv6
%endif
BuildRequires: radvd
BuildRequires: ebtables
BuildRequires: module-init-tools
BuildRequires: cyrus-sasl-devel
%if 0%{?fedora} || 0%{?rhel} >= 7
BuildRequires: polkit >= 0.112
%else
BuildRequires: polkit >= 0.93
%endif
# For mount/umount in FS driver
BuildRequires: util-linux
%if %{with_qemu}
@ -383,12 +324,8 @@ BuildRequires: parted-devel
# For Multipath support
BuildRequires: device-mapper-devel
%if %{with_storage_rbd}
%if 0%{?fedora} || 0%{?rhel} >= 7
BuildRequires: librados2-devel
BuildRequires: librbd1-devel
%else
BuildRequires: ceph-devel
%endif
%endif
%if %{with_storage_gluster}
BuildRequires: glusterfs-api-devel >= 3.4.1
@ -415,11 +352,7 @@ BuildRequires: fuse-devel >= 2.8.6
BuildRequires: libssh2-devel >= 1.3.0
%endif
%if 0%{?fedora} || 0%{?rhel} >= 7
BuildRequires: netcf-devel >= 0.2.2
%else
BuildRequires: netcf-devel >= 0.1.8
%endif
%if %{with_esx}
BuildRequires: libcurl-devel
%endif
@ -495,25 +428,16 @@ Requires: iproute-tc
%endif
Requires: avahi-libs
%if 0%{?fedora} || 0%{?rhel} >= 7
Requires: polkit >= 0.112
%else
Requires: polkit >= 0.93
%endif
%if %{with_cgconfig}
Requires: libcgroup
%endif
%ifarch %{ix86} x86_64 ia64
# For virConnectGetSysinfo
Requires: dmidecode
%endif
# For service management
%if %{with_systemd}
Requires(post): systemd-units
Requires(post): systemd-sysv
Requires(preun): systemd-units
Requires(postun): systemd-units
%endif
%if %{with_numad}
Requires: numad
%endif
@ -548,12 +472,10 @@ Network filter configuration files for cleaning guest traffic
%package daemon-driver-network
Summary: Network driver plugin for the libvirtd daemon
Requires: libvirt-daemon = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
Requires: dnsmasq >= 2.41
Requires: radvd
Requires: iptables
%if 0%{?rhel} && 0%{?rhel} < 7
Requires: iptables-ipv6
%endif
%description daemon-driver-network
The network driver plugin for the libvirtd daemon, providing
@ -564,10 +486,8 @@ bridge capabilities.
%package daemon-driver-nwfilter
Summary: Nwfilter driver plugin for the libvirtd daemon
Requires: libvirt-daemon = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
Requires: iptables
%if 0%{?rhel} && 0%{?rhel} < 7
Requires: iptables-ipv6
%endif
Requires: ebtables
%description daemon-driver-nwfilter
@ -579,12 +499,9 @@ iptables and ip6tables capabilities
%package daemon-driver-nodedev
Summary: Nodedev driver plugin for the libvirtd daemon
Requires: libvirt-daemon = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
# needed for device enumeration
%if 0%{?fedora} || 0%{?rhel} >= 7
Requires: systemd >= 185
%else
Requires: udev >= 145
%endif
%description daemon-driver-nodedev
The nodedev driver plugin for the libvirtd daemon, providing
@ -595,9 +512,8 @@ capabilities.
%package daemon-driver-interface
Summary: Interface driver plugin for the libvirtd daemon
Requires: libvirt-daemon = %{version}-%{release}
%if (0%{?fedora} || 0%{?rhel} >= 7)
Requires: libvirt-libs = %{version}-%{release}
Requires: netcf-libs >= 0.2.2
%endif
%description daemon-driver-interface
The interface driver plugin for the libvirtd daemon, providing
@ -608,6 +524,7 @@ netcf library
%package daemon-driver-secret
Summary: Secret driver plugin for the libvirtd daemon
Requires: libvirt-daemon = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
%description daemon-driver-secret
The secret driver plugin for the libvirtd daemon, providing
@ -616,6 +533,7 @@ an implementation of the secret key APIs.
%package daemon-driver-storage-core
Summary: Storage driver plugin including base backends for the libvirtd daemon
Requires: libvirt-daemon = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
Requires: nfs-utils
# For mkfs
Requires: util-linux
@ -632,6 +550,7 @@ iSCSI, and multipath storage.
%package daemon-driver-storage-logical
Summary: Storage driver plugin for lvm volumes
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
Requires: lvm2
%description daemon-driver-storage-logical
@ -642,6 +561,7 @@ volumes using lvm.
%package daemon-driver-storage-disk
Summary: Storage driver plugin for disk
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
Requires: parted
Requires: device-mapper
@ -653,6 +573,7 @@ volumes using the host disks.
%package daemon-driver-storage-scsi
Summary: Storage driver plugin for local scsi devices
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
%description daemon-driver-storage-scsi
The storage driver backend adding implementation of the storage APIs for scsi
@ -662,6 +583,7 @@ host devices.
%package daemon-driver-storage-iscsi
Summary: Storage driver plugin for iscsi
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
Requires: iscsi-initiator-utils
%description daemon-driver-storage-iscsi
@ -672,6 +594,7 @@ volumes using the host iscsi stack.
%package daemon-driver-storage-mpath
Summary: Storage driver plugin for multipath volumes
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
Requires: device-mapper
%description daemon-driver-storage-mpath
@ -683,6 +606,7 @@ multipath storage using device mapper.
%package daemon-driver-storage-gluster
Summary: Storage driver plugin for gluster
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
%if 0%{?fedora}
Requires: glusterfs-client >= 2.0.1
%endif
@ -700,6 +624,7 @@ volumes using libgfapi.
%package daemon-driver-storage-rbd
Summary: Storage driver plugin for rbd
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
%description daemon-driver-storage-rbd
The storage driver backend adding implementation of the storage APIs for rbd
@ -711,6 +636,7 @@ volumes using the ceph protocol.
%package daemon-driver-storage-sheepdog
Summary: Storage driver plugin for sheepdog
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
Requires: sheepdog
%description daemon-driver-storage-sheepdog
@ -723,6 +649,7 @@ sheepdog volumes using.
%package daemon-driver-storage-zfs
Summary: Storage driver plugin for ZFS
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
# Support any conforming implementation of zfs
Requires: /sbin/zfs
Requires: /sbin/zpool
@ -764,6 +691,7 @@ parted and more.
%package daemon-driver-qemu
Summary: QEMU driver plugin for the libvirtd daemon
Requires: libvirt-daemon = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
# There really is a hard cross-driver dependency here
Requires: libvirt-daemon-driver-network = %{version}-%{release}
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
@ -788,6 +716,7 @@ QEMU
%package daemon-driver-lxc
Summary: LXC driver plugin for the libvirtd daemon
Requires: libvirt-daemon = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
# There really is a hard cross-driver dependency here
Requires: libvirt-daemon-driver-network = %{version}-%{release}
%if 0%{?fedora} || 0%{?rhel} > 7
@ -805,6 +734,7 @@ the Linux kernel
%package daemon-driver-uml
Summary: Uml driver plugin for the libvirtd daemon
Requires: libvirt-daemon = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
%description daemon-driver-uml
The UML driver plugin for the libvirtd daemon, providing
@ -817,6 +747,7 @@ User Mode Linux
%package daemon-driver-vbox
Summary: VirtualBox driver plugin for the libvirtd daemon
Requires: libvirt-daemon = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
%description daemon-driver-vbox
The vbox driver plugin for the libvirtd daemon, providing
@ -829,6 +760,7 @@ VirtualBox
%package daemon-driver-libxl
Summary: Libxl driver plugin for the libvirtd daemon
Requires: libvirt-daemon = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
Obsoletes: libvirt-daemon-driver-xen < 4.3.0
%description daemon-driver-libxl
@ -966,10 +898,8 @@ Requires: ncurses
Requires: gettext
# Needed by virt-pki-validate script.
Requires: gnutls-utils
%if %{with_pm_utils}
# Needed for probing the power management features of the host.
Requires: pm-utils
%endif
# We dlopen(libjansson.so.4), so need an explicit dep
Requires: jansson
%if %{with_bash_completion}
Requires: %{name}-bash-completion = %{version}-%{release}
%endif
@ -1229,29 +1159,13 @@ exit 1
%define arg_wireshark --without-wireshark-dissector
%endif
%if %{with_pm_utils}
%define arg_pm_utils --with-pm-utils
%else
%define arg_pm_utils --without-pm-utils
%endif
%define when %(date +"%%F-%%T")
%define where %(hostname)
%define who %{?packager}%{!?packager:Unknown}
%define arg_packager --with-packager="%{who}, %{when}, %{where}"
%define arg_packager_version --with-packager-version="%{release}"
%if %{with_systemd}
%define arg_init_script --with-init-script=systemd
%else
%define arg_init_script --with-init-script=redhat
%endif
%if 0%{?fedora} || 0%{?rhel} >= 7
%define arg_selinux_mount --with-selinux-mount="/sys/fs/selinux"
%else
%define arg_selinux_mount --with-selinux-mount="/selinux"
%endif
%define arg_selinux_mount --with-selinux-mount="/sys/fs/selinux"
%if 0%{?fedora}
# Nightly firmware repo x86/OVMF
@ -1314,7 +1228,7 @@ rm -f po/stamp-po
--without-apparmor \
--without-hal \
--with-udev \
--with-yajl \
--with-jansson \
%{?arg_sanlock} \
--with-libpcap \
--with-macvtap \
@ -1323,7 +1237,7 @@ rm -f po/stamp-po
--with-driver-modules \
%{?arg_firewalld} \
%{?arg_wireshark} \
%{?arg_pm_utils} \
--without-pm-utils \
--with-nss-plugin \
%{arg_packager} \
%{arg_packager_version} \
@ -1333,7 +1247,7 @@ rm -f po/stamp-po
%{?arg_loader_nvram} \
%{?enable_werror} \
--enable-expensive-tests \
%{arg_init_script} \
--with-init-script=systemd \
%{?arg_login_shell}
make %{?_smp_mflags} V=1
gzip -9 ChangeLog
@ -1457,93 +1371,25 @@ exit 0
%post daemon
%if %{with_systemd}
%if %{with_systemd_macros}
%systemd_post virtlockd.socket virtlockd-admin.socket
%systemd_post virtlogd.socket virtlogd-admin.socket
%systemd_post libvirtd.service
%else
if [ $1 -eq 1 ] ; then
# Initial installation
/bin/systemctl enable \
virtlockd.socket \
virtlockd-admin.socket \
virtlogd.socket \
virtlogd-admin.socket \
libvirtd.service >/dev/null 2>&1 || :
fi
%endif
%else
%if %{with_cgconfig}
# Starting with Fedora 16/RHEL-7, systemd automounts all cgroups,
# and cgconfig is no longer a necessary service.
%if 0%{?rhel} && 0%{?rhel} < 7
if [ "$1" -eq "1" ]; then
/sbin/chkconfig cgconfig on
fi
%endif
%endif
/sbin/chkconfig --add libvirtd
/sbin/chkconfig --add virtlogd
/sbin/chkconfig --add virtlockd
%endif
%systemd_post virtlockd.socket virtlockd-admin.socket
%systemd_post virtlogd.socket virtlogd-admin.socket
%systemd_post libvirtd.service
# request daemon restart in posttrans
mkdir -p %{_localstatedir}/lib/rpm-state/libvirt || :
touch %{_localstatedir}/lib/rpm-state/libvirt/restart || :
%preun daemon
%if %{with_systemd}
%if %{with_systemd_macros}
%systemd_preun libvirtd.service
%systemd_preun virtlogd.socket virtlogd-admin.socket virtlogd.service
%systemd_preun virtlockd.socket virtlockd-admin.socket virtlockd.service
%else
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
/bin/systemctl --no-reload disable \
libvirtd.service \
virtlogd.socket \
virtlogd-admin.socket \
virtlogd.service \
virtlockd.socket \
virtlockd-admin.socket \
virtlockd.service > /dev/null 2>&1 || :
/bin/systemctl stop \
libvirtd.service \
virtlogd.socket \
virtlogd-admin.socket \
virtlogd.service \
virtlockd.socket \
virtlockd-admin.socket \
virtlockd.service > /dev/null 2>&1 || :
fi
%endif
%else
if [ $1 = 0 ]; then
/sbin/service libvirtd stop 1>/dev/null 2>&1
/sbin/chkconfig --del libvirtd
/sbin/service virtlogd stop 1>/dev/null 2>&1
/sbin/chkconfig --del virtlogd
/sbin/service virtlockd stop 1>/dev/null 2>&1
/sbin/chkconfig --del virtlockd
fi
%endif
%systemd_preun libvirtd.service
%systemd_preun virtlogd.socket virtlogd-admin.socket virtlogd.service
%systemd_preun virtlockd.socket virtlockd-admin.socket virtlockd.service
%postun daemon
%if %{with_systemd}
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
/bin/systemctl reload-or-try-restart virtlockd.service >/dev/null 2>&1 || :
/bin/systemctl reload-or-try-restart virtlogd.service >/dev/null 2>&1 || :
fi
%else
if [ $1 -ge 1 ]; then
/sbin/service virtlockd reload > /dev/null 2>&1 || :
/sbin/service virtlogd reload > /dev/null 2>&1 || :
fi
%endif
# In upgrade scenario we must explicitly enable virtlockd/virtlogd
# sockets, if libvirtd is already enabled and start them if
@ -1551,28 +1397,15 @@ fi
# guests
%triggerpostun daemon -- libvirt-daemon < 1.3.0
if [ $1 -ge 1 ] ; then
%if %{with_systemd}
/bin/systemctl is-enabled libvirtd.service 1>/dev/null 2>&1 &&
/bin/systemctl enable virtlogd.socket virtlogd-admin.socket || :
/bin/systemctl is-active libvirtd.service 1>/dev/null 2>&1 &&
/bin/systemctl start virtlogd.socket virtlogd-admin.socket || :
%else
/sbin/chkconfig libvirtd 1>/dev/null 2>&1 &&
/sbin/chkconfig virtlogd on || :
/sbin/service libvirtd status 1>/dev/null 2>&1 &&
/sbin/service virtlogd start || :
/sbin/service virtlockd reload > /dev/null 2>&1 || :
/sbin/service virtlogd reload > /dev/null 2>&1 || :
%endif
fi
%posttrans daemon
if [ -f %{_localstatedir}/lib/rpm-state/libvirt/restart ]; then
%if %{with_systemd}
/bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
%else
/sbin/service libvirtd condrestart > /dev/null 2>&1 || :
%endif
fi
rm -rf %{_localstatedir}/lib/rpm-state/libvirt || :
@ -1620,11 +1453,7 @@ fi
%posttrans daemon-config-network
if [ -f %{_localstatedir}/lib/rpm-state/libvirt/restart ]; then
%if %{with_systemd}
/bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
%else
/sbin/service libvirtd condrestart > /dev/null 2>&1 || :
%endif
fi
rm -rf %{_localstatedir}/lib/rpm-state/libvirt || :
@ -1636,16 +1465,11 @@ touch %{_localstatedir}/lib/rpm-state/libvirt/restart || :
%posttrans daemon-config-nwfilter
if [ -f %{_localstatedir}/lib/rpm-state/libvirt/restart ]; then
%if %{with_systemd}
/bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
%else
/sbin/service libvirtd condrestart > /dev/null 2>&1 || :
%endif
fi
rm -rf %{_localstatedir}/lib/rpm-state/libvirt || :
%if %{with_systemd}
%triggerun -- libvirt < 0.9.4
%{_bindir}/systemd-sysv-convert --save libvirtd >/dev/null 2>&1 ||:
@ -1655,7 +1479,6 @@ rm -rf %{_localstatedir}/lib/rpm-state/libvirt || :
# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del libvirtd >/dev/null 2>&1 || :
/bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
%endif
%if %{with_qemu}
%pre daemon-driver-qemu
@ -1676,35 +1499,18 @@ exit 0
%preun client
%if %{with_systemd}
%if %{with_systemd_macros}
%systemd_preun libvirt-guests.service
%endif
%else
if [ $1 = 0 ]; then
/sbin/chkconfig --del libvirt-guests
rm -f /var/lib/libvirt/libvirt-guests
fi
%endif
%systemd_preun libvirt-guests.service
%post client
/sbin/ldconfig
%if %{with_systemd}
%if %{with_systemd_macros}
%systemd_post libvirt-guests.service
%endif
%else
/sbin/chkconfig --add libvirt-guests
%endif
%systemd_post libvirt-guests.service
%postun client
/sbin/ldconfig
%if %{with_systemd}
%if %{with_systemd_macros}
%systemd_postun libvirt-guests.service
%endif
%systemd_postun libvirt-guests.service
%triggerun client -- libvirt < 0.9.4
%{_bindir}/systemd-sysv-convert --save libvirt-guests >/dev/null 2>&1 ||:
@ -1713,7 +1519,6 @@ fi
# Run this because the SysV package being removed won't do them
/sbin/chkconfig --del libvirt-guests >/dev/null 2>&1 || :
%endif
%if %{with_sanlock}
%post lock-sanlock
@ -1757,7 +1562,6 @@ exit 0
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/
%if %{with_systemd}
%{_unitdir}/libvirtd.service
%{_unitdir}/virt-guest-shutdown.target
%{_unitdir}/virtlogd.service
@ -1766,11 +1570,6 @@ exit 0
%{_unitdir}/virtlockd.service
%{_unitdir}/virtlockd.socket
%{_unitdir}/virtlockd-admin.socket
%else
%{_sysconfdir}/rc.d/init.d/libvirtd
%{_sysconfdir}/rc.d/init.d/virtlogd
%{_sysconfdir}/rc.d/init.d/virtlockd
%endif
%config(noreplace) %{_sysconfdir}/sysconfig/libvirtd
%config(noreplace) %{_sysconfdir}/sysconfig/virtlogd
%config(noreplace) %{_sysconfdir}/sysconfig/virtlockd
@ -2022,17 +1821,11 @@ exit 0
%endif
%if %{with_systemd}
%{_unitdir}/libvirt-guests.service
%else
%{_sysconfdir}/rc.d/init.d/libvirt-guests
%endif
%config(noreplace) %{_sysconfdir}/sysconfig/libvirt-guests
%attr(0755, root, root) %{_libexecdir}/libvirt-guests.sh
%files libs -f %{name}.lang
# RHEL6 doesn't have 'license' macro
%{!?_licensedir:%global license %%doc}
%license COPYING COPYING.LESSER
%config(noreplace) %{_sysconfdir}/libvirt/libvirt.conf
%config(noreplace) %{_sysconfdir}/libvirt/libvirt-admin.conf
@ -2133,6 +1926,9 @@ exit 0
%changelog
* Mon Aug 6 2018 Daniel P. Berrangé <berrange@redhat.com> - 4.6.0-1
- Update to 4.6.0 release
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.5.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (libvirt-4.5.0.tar.xz) = 26710c7e5219f007524e9f93a642e55e4e8ea197afa6b2ca6a4b67b7028313f4b0d82924ee9a1e91ff688a4d2b53f89f3655fbeef0fa99a34f8418f37d787984
SHA512 (libvirt-4.6.0.tar.xz) = beae0f1cafa73b9495d877979547bbc9b7ca2a7c3b213c5da92e6302b570d42df9d639f50380dbc0cebd6af983924dc27b1c81139c81dee0897f39a6a5158968