From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49153) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1g0O-0006N5-Uk for qemu-devel@nongnu.org; Mon, 30 Jun 2014 14:08:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1g0E-0005wZ-RT for qemu-devel@nongnu.org; Mon, 30 Jun 2014 14:08:40 -0400 Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:44278) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1g0E-0005wH-L5 for qemu-devel@nongnu.org; Mon, 30 Jun 2014 14:08:30 -0400 Received: by mail-wi0-f171.google.com with SMTP id n15so6539543wiw.10 for ; Mon, 30 Jun 2014 11:08:29 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <53B1A79A.6050505@redhat.com> Date: Mon, 30 Jun 2014 20:08:26 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <20140630151704.7027.26979.stgit@bahia.local> In-Reply-To: <20140630151704.7027.26979.stgit@bahia.local> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] virtio-scsi: scsi events must be converted to target endianness List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz , "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org Il 30/06/2014 17:17, Greg Kurz ha scritto: > From: Cédric Le Goater > > Virtio SCSI Events need to be byteswapped before being pushed > when host and guest have a different endianness. Not doing so > breaks hotplug of virtio scsi disks, with the following error > message being printed in the guest console: > > virtio_scsi: Unsupport virtio scsi event 1000000 > > This issue got uncovered while testing disk hotplug with a PowerKVM > ppc64le guest. I have checked that this issue also affects a x86_64 > guest run on a ppc64 host. > > Signed-off-by: Cédric Le Goater > [ Ported from PowerKVM, > Greg Kurz ] > Signed-off-by: Greg Kurz > --- > hw/scsi/virtio-scsi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c > index 0b0a331..5568479 100644 > --- a/hw/scsi/virtio-scsi.c > +++ b/hw/scsi/virtio-scsi.c > @@ -591,8 +591,8 @@ static void virtio_scsi_push_event(VirtIOSCSI *s, SCSIDevice *dev, > > evt = &req->resp.event; > memset(evt, 0, sizeof(VirtIOSCSIEvent)); > - evt->event = event; > - evt->reason = reason; > + evt->event = virtio_tswap32(vdev, event); > + evt->reason = virtio_tswap32(vdev, reason); > if (!dev) { > assert(event == VIRTIO_SCSI_T_EVENTS_MISSED); > } else { > > > Applying to scsi-next branch, thanks.