qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

virtiofsd: Parse flag FUSE_WRITE_KILL_PRIV

Caller can set FUSE_WRITE_KILL_PRIV in write_flags. Parse it and pass it
to the filesystem.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Reviewed-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Reviewed-by: Sergio Lopez <slp@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

authored by

Vivek Goyal and committed by
Dr. David Alan Gilbert
f779bc52 4f8bde99

+8 -2
+5 -1
tools/virtiofsd/fuse_common.h
··· 93 93 */ 94 94 unsigned int cache_readdir:1; 95 95 96 + /* Indicates that suid/sgid bits should be removed upon write */ 97 + unsigned int kill_priv:1; 98 + 99 + 96 100 /** Padding. Reserved for future use*/ 97 - unsigned int padding:25; 101 + unsigned int padding:24; 98 102 unsigned int padding2:32; 99 103 100 104 /*
+3 -1
tools/virtiofsd/fuse_lowlevel.c
··· 1142 1142 memset(&fi, 0, sizeof(fi)); 1143 1143 fi.fh = arg->fh; 1144 1144 fi.writepage = (arg->write_flags & FUSE_WRITE_CACHE) != 0; 1145 + fi.kill_priv = !!(arg->write_flags & FUSE_WRITE_KILL_PRIV); 1145 1146 1146 1147 fi.lock_owner = arg->lock_owner; 1147 1148 fi.flags = arg->flags; ··· 1177 1178 fi.lock_owner = arg->lock_owner; 1178 1179 fi.flags = arg->flags; 1179 1180 fi.fh = arg->fh; 1180 - fi.writepage = arg->write_flags & FUSE_WRITE_CACHE; 1181 + fi.writepage = !!(arg->write_flags & FUSE_WRITE_CACHE); 1182 + fi.kill_priv = !!(arg->write_flags & FUSE_WRITE_KILL_PRIV); 1181 1183 1182 1184 if (ibufv->count == 1) { 1183 1185 assert(!(tmpbufv.buf[0].flags & FUSE_BUF_IS_FD));