We use the socket name as the tag for the virtiofs so it has to be
unique. We keep it within 36 bytes though as that's the max tag size.
# Make sure virtiofsd is allowed to create its socket in this temporary directory.
os.chown(state, uid, gid)
- sock = Path(state) / Path("sock")
+ # Make sure we can use the socket name as a unique identifier for the fs as well but make sure it's not too
+ # long as virtiofs tag names are limited to 36 bytes.
+ sock = Path(state) / f"sock-{uuid.uuid4().hex}"[:35]
virtiofsd = shutil.which("virtiofsd")
if virtiofsd is None: