• Stefan Hajnoczi's avatar
    virtiofs: emit uevents on filesystem events · 9086b2d9
    Stefan Hajnoczi authored
    Alyssa Ross <hi@alyssa.is> requested that virtiofs notifies userspace
    when filesytems become available. This can be used to detect when a
    filesystem with a given tag is hotplugged, for example. uevents allow
    userspace to detect changes without resorting to polling.
    
    The tag is included as a uevent property so it's easy for userspace to
    identify the filesystem in question even when the sysfs directory goes
    away during removal.
    
    Here are example uevents:
    
      # udevadm monitor -k -p
    
      KERNEL[111.113221] add      /fs/virtiofs/2 (virtiofs)
      ACTION=add
      DEVPATH=/fs/virtiofs/2
      SUBSYSTEM=virtiofs
      TAG=test
    
      KERNEL[165.527167] remove   /fs/virtiofs/2 (virtiofs)
      ACTION=remove
      DEVPATH=/fs/virtiofs/2
      SUBSYSTEM=virtiofs
      TAG=test
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: default avatarVivek Goyal <vgoyal@redhat.com>
    Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
    9086b2d9
virtio_fs.c 39.7 KB