From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9Gzo-0003vp-HT for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:35:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y9Gzc-0006cU-QR for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:35:43 -0500 Received: from e8.ny.us.ibm.com ([32.97.182.138]:43715) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9Gzc-0006bu-72 for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:35:32 -0500 Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 8 Jan 2015 12:35:31 -0500 From: Michael Roth Date: Thu, 8 Jan 2015 11:33:33 -0600 Message-Id: <1420738472-23267-30-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1420738472-23267-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1420738472-23267-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 29/88] vhost-scsi: use virtio_ldl_p List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org From: Paolo Bonzini This helps for cross-endian configurations. Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini (cherry picked from commit 7ce0425575745a40e94e75426607e0bec17899fa) Signed-off-by: Michael Roth --- hw/scsi/vhost-scsi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index 7146e0e..308b393 100644 --- a/hw/scsi/vhost-scsi.c +++ b/hw/scsi/vhost-scsi.c @@ -23,6 +23,7 @@ #include "hw/virtio/vhost.h" #include "hw/virtio/virtio-scsi.h" #include "hw/virtio/virtio-bus.h" +#include "hw/virtio/virtio-access.h" /* Features supported by host kernel. */ static const int kernel_feature_bits[] = { @@ -163,8 +164,8 @@ static void vhost_scsi_set_config(VirtIODevice *vdev, VirtIOSCSIConfig *scsiconf = (VirtIOSCSIConfig *)config; VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(vdev); - if ((uint32_t) ldl_p(&scsiconf->sense_size) != vs->sense_size || - (uint32_t) ldl_p(&scsiconf->cdb_size) != vs->cdb_size) { + if ((uint32_t) virtio_ldl_p(vdev, &scsiconf->sense_size) != vs->sense_size || + (uint32_t) virtio_ldl_p(vdev, &scsiconf->cdb_size) != vs->cdb_size) { error_report("vhost-scsi does not support changing the sense data and CDB sizes"); exit(1); } -- 1.9.1