[Virtio-fs] Can libvirt parse virtiofsd -o writeback?

Harry G. Coin hgcoin at gmail.com
Fri Sep 18 19:06:11 UTC 2020


On 9/18/20 1:55 PM, Dr. David Alan Gilbert wrote:
> * Harry G. Coin (hgcoin at gmail.com) wrote:
>> Is there any libvirt xml parser rev that knows about how to set
>> virtiofsd -o writeback?
> I don't think so ; the docs say:
> https://libvirt.org/formatdomain.html#filesystems
> says:
>
>  binary
>
>     The optional binary element can tune the options for virtiofsd. All
>     of the following attributes and elements are optional. The attribute
>     path can be used to override the path to the daemon. Attribute xattr
>     enables the use of filesystem extended attributes. Caching can be
>     tuned via the cache element, possible mode values being none and
>     always. Locking can be controlled via the lock element - attributes
>     posix and flock both accepting values on or off. ( Since 6.2.0 )
>
>
> Hmm, I've never tried the -o writeback; have you found it beneficial?
>
> Dave

Jury is still out.  Writeback without dax (which is unavailable outside
the high-interest bubble) subjectively seems to help a bit.  I have
managed to get a kernel boot going with generic environments, calls for
some hacking of initramfs, and most of the instructions about kernel
command line content is wrong on the info page.

Here's how folks can try writeback without having to cook up a dev
environment:

The paths below are for debian/ubuntu style distos, the rhel/centos
paths differ a bit.   I don't have the SELinux equivalent to the
apparmor glue.

Libvirt xml:

...

<filesystem type="mount" accessmode="passthrough">
  <driver type="virtiofs" queue="1024"/>
  <binary path="/usr/local/sbin/custom_virtiofsd" xattr="on">
    <lock posix="off" flock="on"/>
  </binary>

cat >  /usr/local/sbin/custom_virtiofsd
#!/bin/bash
#Provide a way to add arguments libvirt doesn't know about.
set -o allexport
/usr/lib/qemu/virtiofsd $@ -o writeback

and

cat > /etc/apparmor.d/local/usr.sbin.libvirtd
/usr/local/sbin/custom_virtiofsd rux,


>
>> Thanks
>>
>> Harry Coin
>>
>>
>> _______________________________________________
>> Virtio-fs mailing list
>> Virtio-fs at redhat.com
>> https://www.redhat.com/mailman/listinfo/virtio-fs





More information about the Virtio-fs mailing list