qemu: add code for handling virtiofsd

Start virtiofsd for each <filesystem> device using it.

Pre-create the socket for communication with QEMU and pass it
to virtiofsd.

Note that virtiofsd needs to run as root.

https://bugzilla.redhat.com/show_bug.cgi?id=1694166

Introduced by QEMU commit a43efa34c7d7b628cbf1ec0fe60043e5c91043ea

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Tested-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
Ján Tomko
2020-03-04 12:08:50 +01:00
parent 5c0444a38b
commit f0f986efa8
8 changed files with 376 additions and 3 deletions
+11
View File
@@ -496,6 +496,17 @@ testCompareXMLToArgv(const void *data)
}
}
for (i = 0; i < vm->def->nfss; i++) {
virDomainFSDefPtr fs = vm->def->fss[i];
char *s;
if (fs->fsdriver != VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIOFS)
continue;
s = g_strdup_printf("/tmp/lib/domain--1-guest/fs%zu.vhost-fs.sock", i);
QEMU_DOMAIN_FS_PRIVATE(fs)->vhostuser_fs_sock = s;
}
if (vm->def->vsock) {
virDomainVsockDefPtr vsock = vm->def->vsock;
qemuDomainVsockPrivatePtr vsockPriv =