]> Git Repo - qemu.git/commit
9pfs: fix wrong encoding of rdev field in Rgetattr on macOS
authorChristian Schoenebeck <[email protected]>
Fri, 29 Apr 2022 10:25:15 +0000 (12:25 +0200)
committerChristian Schoenebeck <[email protected]>
Sun, 1 May 2022 12:07:03 +0000 (14:07 +0200)
commite5c88e2264ebd0bfe35b347b8cdca1e3af784d84
tree343ac4ec0ca40c0cab19b32c0abc1c16ce1bb5f0
parent055ab89327bab83f1bd07e9de07f7628643d3d8d
9pfs: fix wrong encoding of rdev field in Rgetattr on macOS

The 'rdev' field in 9p reponse 'Rgetattr' is of type dev_t,
which is actually a system dependant type and therefore both the
size and encoding of dev_t differ between macOS and Linux.

So far we have sent 'rdev' to guest in host's dev_t format as-is,
which caused devices to appear with wrong device numbers on
guests running on macOS hosts, eventually leading to various
misbehaviours on guest in conjunction with device files.

This patch fixes this issue by converting the device number from
host's dev_t format to Linux dev_t format. As 9p request
'Tgettattr' is exclusive to protocol version 9p2000.L, it should
be fair to assume that 'rdev' field is assumed to be in Linux dev_t
format by client as well.

Signed-off-by: Christian Schoenebeck <[email protected]>
Link: https://lore.kernel.org/qemu-devel/20220421093056.5ab1e7ed@bahia/
Reviewed-by: Greg Kurz <[email protected]>
Reviewed-by: Akihiko Odaki <[email protected]>
Message-Id: <b3a430c2c382ba69a7405e04c0b090ab0d86f17e.1651228001[email protected]>
hw/9pfs/9p-util.h
hw/9pfs/9p.c
This page took 0.023337 seconds and 4 git commands to generate.