From e8863b91fb98f077d4c44a11bd7ea84c5e6b29ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Wed, 16 Jun 2021 15:35:16 +0200 Subject: [PATCH] conf: require target for external virtiofsd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When adding support for externally launched virtiofsd, I was too liberal and did not require a target. But the target is required, because it's passed to the QEMU device, not to virtiofsd. https://bugzilla.redhat.com/show_bug.cgi?id=1969232 Fixes: 12967c3e1333a6e106110f449ccb1e96279b9527 Fixes: 56dcdec1ac8104f94371c210585bab91eb36395d Signed-off-by: Ján Tomko Reviewed-by: Peter Krempa --- docs/formatdomain.rst | 1 + docs/kbase/virtiofs.rst | 1 + src/conf/domain_validate.c | 4 +++- tests/qemuxml2argvdata/vhost-user-fs-sock.xml | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index da4d93a787..c6dede053f 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -3261,6 +3261,7 @@ A directory on the host that can be accessed directly from the guest. + ... diff --git a/docs/kbase/virtiofs.rst b/docs/kbase/virtiofs.rst index 8cf7567bf8..6ba7299a72 100644 --- a/docs/kbase/virtiofs.rst +++ b/docs/kbase/virtiofs.rst @@ -180,4 +180,5 @@ control and need to be set by the application running virtiofsd. + diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index bba5a85657..2124d25d16 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -2036,8 +2036,10 @@ virDomainShmemDefValidate(const virDomainShmemDef *shmem) static int virDomainFSDefValidate(const virDomainFSDef *fs) { - if (fs->dst == NULL && !fs->sock) { + if (fs->dst == NULL) { const char *source = fs->src->path; + if (!source) + source = fs->sock; virReportError(VIR_ERR_NO_TARGET, source ? "%s" : NULL, source); diff --git a/tests/qemuxml2argvdata/vhost-user-fs-sock.xml b/tests/qemuxml2argvdata/vhost-user-fs-sock.xml index aef005d3fd..e5a380c9b6 100644 --- a/tests/qemuxml2argvdata/vhost-user-fs-sock.xml +++ b/tests/qemuxml2argvdata/vhost-user-fs-sock.xml @@ -29,6 +29,7 @@ +