vhost-user-blk: fix blkcfg->num_queues endianness
authorStefan Hajnoczi <stefanha@redhat.com>
Tue, 23 Feb 2021 14:46:42 +0000 (14:46 +0000)
committerSoonKyu Park <sk7.park@samsung.com>
Tue, 23 Nov 2021 04:45:35 +0000 (13:45 +0900)
commit2acb431b732a026ab66fd3ffcba31feb9c335723
tree21db799e4171ab538134edc1069ea8f08a3bc82a
parent4c926899a59790bbbab7e34e491654cc0ba01859
vhost-user-blk: fix blkcfg->num_queues endianness

Git-commit: 535255b43898d2e96744057eb86f8497d4d7a461

Treat the num_queues field as virtio-endian. On big-endian hosts the
vhost-user-blk num_queues field was in the wrong endianness.

Move the blkcfg.num_queues store operation from realize to
vhost_user_blk_update_config() so feature negotiation has finished and
we know the endianness of the device. VIRTIO 1.0 devices are
little-endian, but in case someone wants to use legacy VIRTIO we support
all endianness cases.

Cc: qemu-stable@nongnu.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20210223144653.811468-2-stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Bruce Rogers <brogers@suse.com>
hw/block/vhost-user-blk.c