mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: don't use chardev FD passing for vhostuser backend
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>
This commit is contained in:
parent
0140d4c59b
commit
ed5aa85f37
@ -4939,6 +4939,7 @@ qemuOpenChrChardevUNIXSocket(const virDomainChrSourceDef *dev)
|
|||||||
enum {
|
enum {
|
||||||
QEMU_BUILD_CHARDEV_TCP_NOWAIT = (1 << 0),
|
QEMU_BUILD_CHARDEV_TCP_NOWAIT = (1 << 0),
|
||||||
QEMU_BUILD_CHARDEV_FILE_LOGD = (1 << 1),
|
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
|
/* This function outputs a -chardev command line option which describes only the
|
||||||
@ -5082,7 +5083,8 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_CHR_TYPE_UNIX:
|
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)
|
if (qemuSecuritySetSocketLabel(secManager, (virDomainDefPtr)def) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
int fd = qemuOpenChrChardevUNIXSocket(dev);
|
int fd = qemuOpenChrChardevUNIXSocket(dev);
|
||||||
@ -5438,7 +5440,8 @@ qemuBuildMonitorCommandLine(virLogManagerPtr logManager,
|
|||||||
qemuDomainObjPrivatePtr priv)
|
qemuDomainObjPrivatePtr priv)
|
||||||
{
|
{
|
||||||
char *chrdev;
|
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)
|
if (priv->chardevStdioLogd)
|
||||||
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
||||||
|
|
||||||
@ -5573,7 +5576,8 @@ qemuBuildRNGBackendChrdevStr(virLogManagerPtr logManager,
|
|||||||
char **chr,
|
char **chr,
|
||||||
bool chardevStdioLogd)
|
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)
|
if (chardevStdioLogd)
|
||||||
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
||||||
*chr = NULL;
|
*chr = NULL;
|
||||||
@ -8712,7 +8716,8 @@ qemuBuildSmartcardCommandLine(virLogManagerPtr logManager,
|
|||||||
virBuffer opt = VIR_BUFFER_INITIALIZER;
|
virBuffer opt = VIR_BUFFER_INITIALIZER;
|
||||||
const char *database;
|
const char *database;
|
||||||
const char *contAlias = NULL;
|
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)
|
if (chardevStdioLogd)
|
||||||
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
||||||
|
|
||||||
@ -8948,7 +8953,8 @@ qemuBuildShmemCommandLine(virLogManagerPtr logManager,
|
|||||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||||
char *devstr = NULL;
|
char *devstr = NULL;
|
||||||
int rc;
|
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)
|
if (chardevStdioLogd)
|
||||||
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
||||||
|
|
||||||
@ -9108,7 +9114,8 @@ qemuBuildSerialCommandLine(virLogManagerPtr logManager,
|
|||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
bool havespice = false;
|
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)
|
if (chardevStdioLogd)
|
||||||
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
||||||
|
|
||||||
@ -9171,7 +9178,8 @@ qemuBuildParallelsCommandLine(virLogManagerPtr logManager,
|
|||||||
bool chardevStdioLogd)
|
bool chardevStdioLogd)
|
||||||
{
|
{
|
||||||
size_t i;
|
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)
|
if (chardevStdioLogd)
|
||||||
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
||||||
|
|
||||||
@ -9208,7 +9216,8 @@ qemuBuildChannelsCommandLine(virLogManagerPtr logManager,
|
|||||||
bool chardevStdioLogd)
|
bool chardevStdioLogd)
|
||||||
{
|
{
|
||||||
size_t i;
|
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)
|
if (chardevStdioLogd)
|
||||||
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
||||||
|
|
||||||
@ -9265,7 +9274,8 @@ qemuBuildConsoleCommandLine(virLogManagerPtr logManager,
|
|||||||
bool chardevStdioLogd)
|
bool chardevStdioLogd)
|
||||||
{
|
{
|
||||||
size_t i;
|
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)
|
if (chardevStdioLogd)
|
||||||
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
||||||
|
|
||||||
@ -9445,7 +9455,8 @@ qemuBuildRedirdevCommandLine(virLogManagerPtr logManager,
|
|||||||
bool chardevStdioLogd)
|
bool chardevStdioLogd)
|
||||||
{
|
{
|
||||||
size_t i;
|
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)
|
if (chardevStdioLogd)
|
||||||
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD;
|
||||||
|
|
||||||
|
@ -14,8 +14,7 @@ QEMU_AUDIO_DRV=none \
|
|||||||
-display none \
|
-display none \
|
||||||
-no-user-config \
|
-no-user-config \
|
||||||
-nodefaults \
|
-nodefaults \
|
||||||
-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
|
-chardev socket,id=charmonitor,fd=1729,server,nowait \
|
||||||
server,nowait \
|
|
||||||
-mon chardev=charmonitor,id=monitor,mode=control \
|
-mon chardev=charmonitor,id=monitor,mode=control \
|
||||||
-rtc base=utc \
|
-rtc base=utc \
|
||||||
-no-shutdown \
|
-no-shutdown \
|
||||||
|
@ -1266,7 +1266,7 @@ mymain(void)
|
|||||||
DO_TEST("misc-no-reboot", NONE);
|
DO_TEST("misc-no-reboot", NONE);
|
||||||
DO_TEST("misc-uuid", NONE);
|
DO_TEST("misc-uuid", NONE);
|
||||||
DO_TEST_PARSE_ERROR("vhost_queues-invalid", 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",
|
DO_TEST("net-vhostuser-multiq",
|
||||||
QEMU_CAPS_VHOSTUSER_MULTIQUEUE);
|
QEMU_CAPS_VHOSTUSER_MULTIQUEUE);
|
||||||
DO_TEST_FAILURE("net-vhostuser-multiq", NONE);
|
DO_TEST_FAILURE("net-vhostuser-multiq", NONE);
|
||||||
|
Loading…
Reference in New Issue
Block a user