qemu/hw
Changpeng Liu 42824b4d16 virtio-blk: set correct config size for the host driver
Commit caa1ee43 "vhost-user-blk: add discard/write zeroes features
support" added fields to struct virtio_blk_config. This changes
the size of the config space and breaks migration from QEMU 3.1
and older:

qemu-system-ppc64: get_pci_config_device: Bad config data: i=0x10 read: 41 device: 1 cmask: ff wmask: 80 w1cmask:0
qemu-system-ppc64: Failed to load PCIDevice:config
qemu-system-ppc64: Failed to load virtio-blk:virtio
qemu-system-ppc64: error while loading state for instance 0x0 of device 'pci@800000020000000:01.0/virtio-blk'
qemu-system-ppc64: load of migration failed: Invalid argument

Since virtio-blk doesn't support the "discard" and "write zeroes"
features, it shouldn't even expose the associated fields in the
config space actually. Just include all fields up to num_queues to
match QEMU 3.1 and older.

Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 1550022537-27565-1-git-send-email-changpeng.liu@intel.com
Message-Id: <1550022537-27565-1-git-send-email-changpeng.liu@intel.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-02-13 16:18:17 +08:00
..
9pfs xen: re-name XenDevice to XenLegacyDevice... 2019-01-14 13:45:40 +00:00
acpi uuid: Make qemu_uuid_bswap() take and return a QemuUUID 2019-02-01 13:46:45 +01:00
adc
alpha hw/alpha/Makefile.objs: Create CONFIG_* for alpha 2019-02-05 16:50:20 +01:00
arm * cpu-exec fixes (Emilio, Laurent) 2019-02-05 19:39:22 +00:00
audio audio: fix pc speaker init 2019-01-24 13:10:19 +01:00
block virtio-blk: set correct config size for the host driver 2019-02-13 16:18:17 +08:00
bt
char hw/char/stm32f2xx_usart: Do not update data register when device is disabled 2019-01-21 10:23:10 +00:00
core hw/core/loader.c: Read as long as possible in load_image_size() 2019-02-05 16:50:18 +01:00
cpu hw/cpu/cluster: Mark the cpu-cluster device with user_creatable = false 2019-02-06 15:55:56 +01:00
cris hw/cris/Makefile.objs: Create CONFIG_* for cris 2019-02-05 16:50:20 +01:00
display hw/display/milkymist-tmu2: Move inlined code from header to source 2019-02-01 11:58:50 +01:00
dma
gpio trace: enforce that every trace-events file has a final newline 2019-01-24 14:16:56 +00:00
hppa hw/hppa/Makefile.objs: Create CONFIG_* for hppa 2019-02-05 16:50:20 +01:00
hyperv
i2c hw/i2c/Makefile.objs: Create new CONFIG_* variables for EEPROM and ACPI controller 2019-02-05 16:50:21 +01:00
i386 * cpu-exec fixes (Emilio, Laurent) 2019-02-05 19:39:22 +00:00
ide ide: split ioport registration to a separate file 2019-02-05 16:50:19 +01:00
input hw/input/tsc210x: Fix building with no verbosity 2019-02-06 15:57:06 +01:00
intc spapr: move the interrupt presenters under machine_data 2019-02-04 18:44:18 +11:00
ipack
ipmi
isa
lm32 hw/lm32/Makefile.objs: Conditionally build lm32 and milkmyst 2019-02-05 16:50:20 +01:00
m68k hw/m68k/Makefile.objs: Conditionally build boards 2019-02-05 16:50:19 +01:00
mem
microblaze hw/microblaze/Makefile.objs: Create configs for petalogix and xilinx boards 2019-02-05 16:50:19 +01:00
mips hw/mips/Makefile.objs: Create CONFIG_* for r4k, malta, mipssim boards 2019-02-05 16:50:19 +01:00
misc hw/misc/armsse-cpuid: Implement SSE-200 CPU_IDENTITY register block 2019-02-01 14:55:43 +00:00
moxie hw/moxie/Makefile.objs: Conditionally build moxie 2019-02-05 16:50:20 +01:00
net hw/pci-host/Makefile.objs: make CONFIGS clear for PCI EXPRESS 2019-02-05 16:50:19 +01:00
nios2 hw/nios2/Makefile.objs: Conditionally build nios2 2019-02-05 16:50:20 +01:00
nvram fw_cfg: fix the life cycle and the name of "qemu_extra_params_fw" 2019-02-05 10:58:33 -05:00
openrisc hw/openrisc/Makefile.objs: Create CONFIG_* for openrisc 2019-02-05 16:50:21 +01:00
pci pci/msi: export msi_is_masked() 2019-02-05 10:58:33 -05:00
pci-bridge
pci-host build: actually use CONFIG_PAM 2019-02-05 16:50:19 +01:00
pcmcia
ppc hw/ppc/Makefile.objs: Build all boards conditinally with CONFIG_* 2019-02-05 16:50:20 +01:00
rdma hw/rdma: modify struct initialization 2019-01-19 11:01:33 +02:00
riscv hw/riscv/Makefile.objs: Create CONFIG_* for riscv boards 2019-02-05 16:50:20 +01:00
s390x * cpu-exec fixes (Emilio, Laurent) 2019-02-05 19:39:22 +00:00
scsi scsi-generic: Convert from DPRINTF() macro to trace events 2019-02-05 16:50:21 +01:00
sd hw: sd: set category of the sd memory card 2019-01-30 10:24:20 +01:00
sh4 * cpu-exec fixes (Emilio, Laurent) 2019-02-05 19:39:22 +00:00
smbios
sparc qemu-sparc queue 2019-02-07 16:49:30 +00:00
sparc64 qemu-sparc queue 2019-02-07 16:49:30 +00:00
ssi aspeed/smc: snoop SPI transfers to fake dummy cycles 2019-01-29 11:46:05 +00:00
timer
tpm tpm: clear RAM when "memory overwrite" requested 2019-01-17 21:10:57 -05:00
tricore hw/tricore/Makefile.objs: Create CONFIG_* for tricore 2019-02-05 16:50:21 +01:00
unicore32 hw/unicore32/puv3: Drop useless inclusion of "hw/i386/pc.h" 2019-02-06 15:54:12 +01:00
usb usb-mtp: replace the homebrew write with qemu_write_full 2019-01-30 06:47:52 +01:00
vfio hw/vfio/Makefile.objs: Create new CONFIG_* variables for VFIO core and PCI 2019-02-05 16:50:21 +01:00
virtio hw/virtio: Use CONFIG_VIRTIO_PCI switch instead of CONFIG_PCI 2019-02-05 10:58:33 -05:00
watchdog
xen xen: fix xen-bus state model to allow frontend re-connection 2019-02-04 11:04:49 +00:00
xenpv xen: Replace few mentions of xend by libxl 2019-01-14 13:45:40 +00:00
xtensa hw/xtensa/Makefile.objs: Build xtensa_sim and xtensa_fpga conditionally 2019-02-05 16:50:20 +01:00
Makefile.objs hw/vfio/Makefile.objs: Create new CONFIG_* variables for VFIO core and PCI 2019-02-05 16:50:21 +01:00