qemu-e2k/hw
Christian Schoenebeck e5c88e2264 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 <qemu_oss@crudebyte.com>
Link: https://lore.kernel.org/qemu-devel/20220421093056.5ab1e7ed@bahia/
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Message-Id: <b3a430c2c382ba69a7405e04c0b090ab0d86f17e.1651228001.git.qemu_oss@crudebyte.com>
2022-05-01 14:07:03 +02:00
..
9pfs 9pfs: fix wrong encoding of rdev field in Rgetattr on macOS 2022-05-01 14:07:03 +02:00
acpi acpi: fix acpi_index migration 2022-04-06 20:03:26 +01:00
adc
alpha Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
arm hw/core: Move the ARM sysbus-fdt to core 2022-04-29 10:48:26 +10:00
audio * Fix stack-overflow due to recursive DMA in intel-hda (CVE-2021-3611) 2022-03-22 20:45:30 +00:00
avr Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
block
char hw/char: fix qcode array bounds check in ESCC impl 2022-04-26 16:12:26 +01:00
core hw/core: Move the ARM sysbus-fdt to core 2022-04-29 10:48:26 +10:00
cpu
cris
display hw/display/vmware_vga: do not discard screen updates 2022-04-22 11:47:08 +02:00
dma Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
gpio
hppa Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
hyperv hw/hyperv: remove needless qemu-common.h include 2022-04-21 16:56:55 +04:00
i2c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
i386 i386: firmware parsing and sev setup for -bios loaded firmware 2022-04-27 07:51:01 +02:00
ide
input Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
intc hw/intc: Vectored Interrupt Controller (VIC) 2022-04-26 08:17:05 -07:00
ipack
ipmi
isa
m68k hw: Add compat machines for 7.1 2022-04-20 09:36:24 +02:00
mem
microblaze Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
mips Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
misc Misc cleanups 2022-04-21 09:27:54 -07:00
net util/log: Remove qemu_log_flush 2022-04-20 10:51:11 -07:00
nios2 hw/nios2: Machine with a Vectored Interrupt Controller 2022-04-26 08:17:05 -07:00
nubus
nvme Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
nvram Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
openrisc
pci pcie: Don't try triggering a LSI when not defined 2022-04-20 18:00:30 -03:00
pci-bridge
pci-host ppc/pnv: Remove LSI on the PCIE host bridge 2022-04-20 18:00:30 -03:00
pcmcia
ppc hw/ppc: change indentation to spaces from TABs 2022-04-20 18:00:30 -03:00
rdma hw/pvrdma: Some cosmetic fixes 2022-04-26 12:25:14 +02:00
remote Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
riscv hw/riscv: Enable TPM backends 2022-04-29 10:48:48 +10:00
rtc Replace qemu_gettimeofday() with g_get_real_time() 2022-04-06 10:50:37 +02:00
rx hw/rx: rx-gdbsim DTB load address aligned of 16byte. 2022-04-21 10:06:42 -07:00
s390x hw: Add compat machines for 7.1 2022-04-20 09:36:24 +02:00
scsi Replace qemu_real_host_page variables with inlined functions 2022-04-06 10:50:38 +02:00
sd Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
sensor
sh4 Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
smbios
sparc Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
sparc64 Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
ssi hw/ssi: Add Ibex SPI device model 2022-04-22 10:35:16 +10:00
timer timer: cadence_ttc: Break out header file to allow embedding 2022-04-21 11:37:03 +01:00
tpm Replace qemu_real_host_page variables with inlined functions 2022-04-06 10:50:38 +02:00
tricore
usb Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
vfio Replace qemu_real_host_page variables with inlined functions 2022-04-06 10:50:38 +02:00
virtio vdpa: Add missing tracing to batch mapping functions 2022-04-26 12:32:47 +02:00
watchdog
xen meson: remove CONFIG_XEN_PCI_PASSTHROUGH from config-target.h 2022-04-28 08:52:22 +02:00
xenpv
xtensa Replace TARGET_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00
Kconfig
meson.build